A NoSQL–SQL Hybrid Organization and Management Approach for Real-Time Geospatial Data: A Case Study of Public Security Video Surveillance
Abstract
:1. Introduction
2. NoSQL–SQL Hybrid Organization and Management Approach for Real-Time Geospatial Data
2.1. NoSQL–SQL DBMS Hybrid Storage Architecture
- (1)
- The MMDB is the structure for access. It supports real-time writing and query of the latest input data and synchronizes historical data into the DFS in batches after preprocessing.
- (2)
- The RDB is the secondary part. It stores structured on-the-fly analysis results and change information extracted from input data, uses a trigger mechanism to detect abnormal events in real-time, and instantaneously delivers events to correlative geographic objects and modules by the “subscribe/publish” message mechanism for dynamic geo-processing.
- (3)
- The DFS is the main part. It stores the incremental large volume historical geospatial data with even distribution and a scalable storage environment.
2.1.1. MMDB for Real-Time Access
2.1.2. DFS for Incremental Historical Data
2.1.3. RDB for On-The-Fly Extracted Data
- (a)
- The interest value is the most significant information of the geospatial data in the form of number and characters. For instance, we usually pay attention to some key information that lies in the sensor data rather the sensor data itself, such as the position of a person in the surveillance video who breaks into the enclosed alert area.
- (b)
- The abnormal change value is the specific interest value out of range. This change information often includes the “blasting fuse” to drive the evolution process of geographic environment and what the people care about the most. For example, the value of interest may record the state of a car, but only when the car is speeding, stopped for a long period of time, or moving away from a predefined route, the abnormal change value can trigger the traffic GIS platform to implement emergency disposal.
- (c)
- The digest value is a uniform way to briefly describe the multi-media data like videos, images, audios and signals which is beneficial for de-duplicating and retrieving [19]. For example, if two video frames are the same, the digest values generated by Message Digest 5 Algorithm (MD5) will be the same. Therefore, when retrieving a video stream we just need to compare the digest values and ignore those duplicated video frames, which can greatly reduce scheduling pressure.
2.2. Multi-Granularity Organization Method
- (a)
- The geographic object represents the monitoring entity, like person, vehicle, area or virtual object. For example, the GPS data at a given time reflect the position of a taxi; the monitoring video frame displays the public security situation of a community. The geographic object can be instantiated by the structure of object ID, name, type, lifetime, and description.
- (b)
- The geographic event represents the abnormal state change of a geographic object at a certain moment. For example, if car “A” drives over the speed limit at time “t1”; we can create the event “OverSpeed” visualized by the trajectory point with speed parameter at time “t1” for object “A”. A geographic event can be instantiated by the structure of event ID, name, type, timestamp, object ID and a pointer to the abnormal changed input data.
- (c)
- The geographic process represents the activity of a geographic object triggered by event, materialized by clustering the data sequence during one or several time periods around the same theme. For example, the trajectory of a taxi can be divided into several process segments described with the semantics “move” and “stop”; the flood sensor data stream can be segmented into at least three process categories “below normal level”, “normal level” and “surpass normal level”. The geographic process can be instantiated by the structure of process ID, name, type, time period, object ID, event ID and a pointer to the data segment.
2.3. Unified Scheduling by Uniform ID Structure Design
3. Case Study of Real-Time GeoVideo Data in Hybrid NoSQL–SQL DBMS
3.1. Dataflow in Hybrid Databases
3.2. Structure and Algorithm of Interoperability
3.2.1. Change Detection and Event Trigger
Algorithm 1: Trigger_SafeDistance (Tuple DistanceValue) |
1. create trigger Trigger_Safe_Distance 2. after insert on Table Safe_Distance 3. foreach new row 4. begin 5. if newTuple.distance < safe_distance_level1 then 6. insert into Event_Safe_Distance values(event_type1, newTuple.attributes) 7. elseif newTuple.distance < safe_distance_level2 then 8. insert into Event_Safe_Distance values(event_type2, newTuple. attributes) 9. elseif newTuple.distance < safe_distance_level3 then 10. insert into Event_Safe_Distance values(event_type3, newTuple. attributes) 11. else 12. insert into Event_Safe_Distance values(event_type4, newTuple. attributes) 13. end if-then 14. end-begin 15. end-foreach |
3.2.2. Event Subscribing and Publishing
Algorithm 2: Trigger_DispatchEvent (Tuple SafeDistanceEvent) |
1. create trigger Dispatch_Event 2. after insert on Table Event_Safe_Distance 3. foreach new row 4. begin 5. set @ret=gman_do_background (GearmanWorker ‘SyncAndDispatchEvent’, 6. json_object(newTupleInMySQL.attributes as newKeyValuePairInRedis.attributes)) 7. end-begin 8. end-foreach |
Algorithm 3: GearmanWorker_SyncAndDispatchEvent (Tuple SafeDistanceEvent) |
1. $worker = new GearmanWorker() 2. $worker->addFunction(‘SyncAndDispatchEvent’) 3. $redis = new Redis() 4. $redis->connect(ip, port) 5. while($worker->work()) 6. begin 7. function SyncAndDispatchEvent (Tuple $job) 8. global $redis 9. $workString = $job->workload() 10. $work = json_decode($workString) 11. $redis->hmset(key: “attributeName”, value: $work->attribute) 12. $redis->publish(channel: $work->event_type, $work->eid) 13. end-function 14. end-begin |
4. Experimental Study
4.1. Experimental Setting
4.2. Experimental Results
4.2.1. Real-Time Accessing
4.2.2. Event Detection and Dispatch
4.2.3. Historical Data Distribution
5. Conclusions
Acknowledgments
Author Contributions
Conflicts of Interest
References
- Kwan, M.P.; Lee, J. Emergency response after 9/11: The potential of real-time 3D GIS for quick emergency response in micro-spatial environments. Comput. Environ. Urban 2005, 29, 93–113. [Google Scholar] [CrossRef]
- Zerger, A.; Smith, D.I. Impediments to using GIS for real-time disaster decision support. Comput. Environ. Urban 2003, 27, 123–141. [Google Scholar] [CrossRef]
- Zhang, F.; Zheng, Y.; Xu, D.; Du, Z.; Wang, Y.; Liu, R.; Ye, X. Real-time spatial queries for moving objects using storm topology. ISPRS Int. J. Geo-Inf. 2016, 5. [Google Scholar] [CrossRef]
- Looking Forward: Five Thoughts on the Future of GIS. Available online: http://www.esri.com/news/arcwatch/0211/future-of-gis.html (accessed on 7 August 2016).
- Xu, W.; Zhu, Q.; Zhang, Y.; Ding, Y.; Hu, M. Real-Time GIS and its application in indoor fire disaster. ISPRS Arch. 2013, XL-2/W2, 121–127. [Google Scholar] [CrossRef]
- Pelekis, N.; Theodoulidis, B.; Kopanakis, I.; Theodoridis, Y. Literature review of spatio-temporal database models. Knowl. Eng. Rev. 2004, 19, 235–274. [Google Scholar] [CrossRef]
- Breunig, M.; Türker, C.; Böhlen, M.H.; Dieker, S.; Güting, R.H.; Jensen, C.S.; Relly, L.; Rigaux, P.; Schek, H.J.; Scholl, M. Architectures and implementations of spatio-temporal database management systems. In Spatio-Temporal Databases: The CHOROCHRONOS Approach, 1st ed.; Frank, A.U., Sellis, T., Koubarakis, M., Eds.; Springer: Berlin, Germany, 2003; pp. 264–314. [Google Scholar]
- Shvachko, K.; Kuang, H.; Radia, S.; Chansler, R. The hadoop distributed file system. In Proceedings of the 2010 IEEE 26th Symposium on Mass Storage Systems and Technologies, Washington, DC, USA, 3–7 May 2010.
- Abadi, D.J.; Ahmad, Y.; Balazinska, M.; Çetintemel, U.; Cherniack, M.; Hwang, J.H.; Lindner, W.; Maskey, A.S.; Rasin, A.; Ryvkina, E.; et al. The design of the borealis stream processing engine. In Proceedings of the 2005 CIDR Conference, Asilomar, CA, USA, 4–7 January 2005.
- Arasu, A.; Babu, S.; Widom, J. The CQL continuous query language: Semantic foundations and query execution. VLDB J. 2006, 15, 121–142. [Google Scholar] [CrossRef]
- Gyllstrom, D.; Wu, E.; Chae, H.J.; Diao, Y.; Stahlberg, P.; Anderson, G. SASE: Complex event processing over streams. In Proceedings of the 3rd Biennial Conference on Innovative Data Systems Research, Asilomar, CA, USA, 7–10 January 2007.
- Demers, A.J.; Gehrke, J.; Panda, B.; Riedewald, M.; Sharma, V.; White, W.M. Cayuga: A general purpose event monitoring system. In Proceedings of the 3rd Biennial Conference on Innovative Data Systems Research, Asilomar, CA, USA, 7–10 January 2007.
- Gedik, B.; Andrade, H.; Wu, K.L.; Yu, P.S.; Doo, M. SPADE: The system s declarative stream processing engine. In Proceedings of the 2008 ACM SIGMOD International Conference on Management of Data, Vancouver, BC, Canada, 9–12 June 2008.
- Hao, X.; Jin, P.; Yue, L. Efficient storage of multi-sensor object-tracking data. IEEE Trans. Parall. Distr. 2015, 27, 2881–2894. [Google Scholar] [CrossRef]
- Kang, Y.; Park, I.; Rhee, J.; Lee, Y. MongoDB-based repository design for IoT-generated RFID/Sensor big data. IEEE Sens J. 2015, 16, 485–497. [Google Scholar] [CrossRef]
- Sipke, V.D.V.J.; Bram, V.D.W.; Meijer, R.J. Sensor data storage performance: SQL or NoSQL, physical or virtual. In Proceedings of the 2012 IEEE Fifth International Conference on Cloud Computing, Honolulu, HI, USA, 24–29 June 2012.
- Kim, C.H.; Park, K.W.; Choi, Y.L. Web service performance improvement with the Redis. J. Korea Inst. Inf. Commun. Eng. 2015, 19, 2064–2072. [Google Scholar] [CrossRef]
- Jiang, L.; Xu, L.D.; Cai, H.; Jiang, Z. An IoT-Oriented data storage framework in cloud computing platform. IEEE Trans. Ind. Inform. 2014, 10, 1443–1451. [Google Scholar] [CrossRef]
- Li, T.; Liu, Y.; Tian, Y.; Shen, S.; Mao, W. A storage solution for massive IoT data based on NoSQL. In Proceedings of the 2012 IEEE International Conference on Green Computing and Communications, Besancon, France, 20–23 November 2012.
- Gong, J.; Li, X.; Wu, H. Spatio-temporal data model for Real-Time GIS. AGCS 2014, 43, 226–232. [Google Scholar]
- Li, X.; Yang, J.; Guan, X.; Wu, H. An event-driven spatiotemporal data model (e-st) supporting dynamic expression and simulation of geographic processes. Trans. GIS 2014, 18, 76–96. [Google Scholar] [CrossRef]
- Lu, Y.; Shahabi, C.; Kim, S.H. Efficient indexing and retrieval of large-scale geo-tagged video databases. Geoinformatica 2016, 20, 829–857. [Google Scholar] [CrossRef]
- Milosavljević, A.; Rančić, D.; Dimitrijević, A.; Predić, B.; Mihajlović, V. Integration of GIS and video surveillance. Int. J. Geogr. Inf. Sci. 2016, 30, 2089–2107. [Google Scholar] [CrossRef]
- Lewis, P.; Fotheringham, S.; Winstanley, A. Spatial video and GIS. Int. J. Geogr. Inf. Sci. 2011, 25, 697–716. [Google Scholar] [CrossRef]
- Al-Dohuki, S.; Kamw, F.; Zhao, Y.; Ma, C.; Wu, Y.; Yang, J.; Ye, X.; Wang, F.; Li, X.; Chen, W. SemanticTraj: A New Approach to Interacting with Massive Taxi Trajectories. IEEE Trans. Vis. Comput. Graph. 2017, 23, 11–20. [Google Scholar] [CrossRef] [PubMed]
- Huang, X.; Zhao, Y.; Yang, J.; Zhang, C.; Ma, C.; Ye, X. TrajGraph: A Graph-Based Visual Analytics Approach to Studying Urban Network Centralities Using Taxi Trajectory Data. IEEE Trans. Vis. Comput. Graph. 2016, 22, 160–169. [Google Scholar] [CrossRef] [PubMed]
- Ye, X.; Huang, Q.; Li, W. Integrating Big Social Data, Computing, and Modeling for Spatial Social Science. Cartogr. Geogr. Inf. Sci. 2016. [Google Scholar] [CrossRef]
Element | Type | Description |
---|---|---|
_id | RowID | Auto-adding identity of change element |
exhibit_id | int | Unique identity of exhibit in museum |
visitor_id | int | Unique identity of visitor in museum |
distance | float | Distance between visitor and exhibit |
camera_id | int | Unique identity of camera that captures the scene |
Element | Type | Description |
---|---|---|
eid | string | Unique identity of event |
event_type | int | Type of event |
exhibit_id | int | Identity of exhibit related to this event |
visitor_id | int | Identity of visitor related to this event |
distance | float | The distance between visitor and exhibit |
camera_id | int | Unique identity of camera that captures the scene |
© 2017 by the authors; licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC-BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Wu, C.; Zhu, Q.; Zhang, Y.; Du, Z.; Ye, X.; Qin, H.; Zhou, Y. A NoSQL–SQL Hybrid Organization and Management Approach for Real-Time Geospatial Data: A Case Study of Public Security Video Surveillance. ISPRS Int. J. Geo-Inf. 2017, 6, 21. https://doi.org/10.3390/ijgi6010021
Wu C, Zhu Q, Zhang Y, Du Z, Ye X, Qin H, Zhou Y. A NoSQL–SQL Hybrid Organization and Management Approach for Real-Time Geospatial Data: A Case Study of Public Security Video Surveillance. ISPRS International Journal of Geo-Information. 2017; 6(1):21. https://doi.org/10.3390/ijgi6010021
Chicago/Turabian StyleWu, Chen, Qing Zhu, Yeting Zhang, Zhiqiang Du, Xinyue Ye, Han Qin, and Yan Zhou. 2017. "A NoSQL–SQL Hybrid Organization and Management Approach for Real-Time Geospatial Data: A Case Study of Public Security Video Surveillance" ISPRS International Journal of Geo-Information 6, no. 1: 21. https://doi.org/10.3390/ijgi6010021
APA StyleWu, C., Zhu, Q., Zhang, Y., Du, Z., Ye, X., Qin, H., & Zhou, Y. (2017). A NoSQL–SQL Hybrid Organization and Management Approach for Real-Time Geospatial Data: A Case Study of Public Security Video Surveillance. ISPRS International Journal of Geo-Information, 6(1), 21. https://doi.org/10.3390/ijgi6010021