Moving Objects Databases (MOD) focus on modeling and querying the movements of moving entities, such as people, vehicles and vessels. With the development of positioning technologies, such as Global Positioning System (GPS) and Radio-Frequency Identification (RFID), it has been extensively studied [1
] in recent years due to the wide application, such as online Location-Based Services (LBSs), Location-Based Social Networks (LBSNs), intelligent surveillance systems based on sensor networks [5
], video surveillance systems [9
] and vehicular ad hoc networks [12
]. In the real world, more moving objects, such as pedestrians, cars and buses, are inclined to move along with underlying transportation networks other than geographical free space. Hence, the topic of modeling moving objects in networks has received an increasing amount of attention in the literature [14
Although there has been much work on modeling moving objects in networks, such as State-Based Dynamic Transportation Network (SBDTN) [20
], MODTN [21
], Graph of Cellular Automata (GCA) [22
] and Moving Objects in Networks (MONET) [23
], the approaches only address the issue of representing networks and trajectories and ignore the semantic information, such as traffic states, traffic restrictions and social relationships between moving objects. In addition, how to balance the granularity of modeling networks and the cost of location updates is still also a challenge in the field of MOD and Geographical Information Systems (GIS) [14
]. That is because fine-grained network-constrained models represent the segment as the basic unit. However, this could lead to more cost of location updates and index maintenance, owing to the fact that frequently changing segments of a moving object motivates massive location update requests and causes index structures to be invalidated. In contrast, coarse-grained network-constrained models represent the route as the basic unit. Although it could help to reduce the cost of location updates, because the traffic state is closely related to segments, it cannot adapt well to some real-world applications that require good real-time performance, especially for vehicle navigation systems and carpool services [26
Additionally, existing network-constrained data models are hard to define as spatial-temporal integrated approaches [2
], due to the lack of the unified and effective management of trajectories, underlying networks and semantic information. Some brute-force approaches store these types of unstructured datasets into multiple tables. However, many complex queries supporting three kinds of conditions, spatial, temporal and semantic information, must rely on time-consuming table join operations. Hence, this requires the development of a novel spatial-temporal integrated data model for moving objects in networks that has the capability of flexible controls for location updates simultaneously.
In this paper, we propose a hierarchical graph model for moving objects in networks called the Geo-Social-Moving data model for moving objects in Networks (GSMNet), which contains four graph structures: RouteGraph, SegmentGraph, ObjectGraph and MoveGraph. To control the cost of location updates, the underlying network is represented as two separate graph structures, RouteGraph and SegmentGraph, at the different levels of granularity. It is different from traditional modeling approaches that represent a transportation network as a directed graph. Routes and segments are represented as two kinds of graph nodes, and spatial relationships such as and connect these graph nodes. One-to-many relationships from route nodes to segment nodes are created to model the topological relationships. Traffic restrictions are represented as edges between segments or route graph nodes. Furthermore, ObjectGraph represents the social relationships between moving objects; MoveGraph aggregates all of the location points in the current segment as one trajectory unit and represents it as a graph node.
The work reported in this paper is a step toward enhancing integrated spatial-temporal data modeling for moving objects in networks by involving hierarchical graph structures to represent trajectories, networks and semantic information. This is also an attempt to balance the trade-off between the flexible control of the granularity of modeling networks and the cost of location updates.
The contributions of this paper lie in the following aspects:
A hierarchical GSMNet model for moving objects in networks is proposed that represents moving objects’ trajectories, underlying networks and semantic information, including social relationships and traffic, in an integrated manner. It provides an effective and unified means to handle these unstructured data.
Based on the GSMNet model, a large set of data types and corresponding operators is provided, and we give the formal definitions of data types together with the operation signatures and semantics. Seventeen benchmark queries from BerlinMOD are rewritten in formal SQL-like notation.
Extensive experiments with simulated trajectories generated by BerlinMOD are conducted to evaluate the efficiency and performance. The results demonstrate that our proposed GSMNet model has strong potential to reduce time-consuming table join operations and has the capability to represent the semantic information.
The remainder of this paper is organized as follows. Section 2
summarizes related works. Section 3
elaborates on our proposed GSMNet model corresponding to a set of data types. Section 4
provides the formal definition of the operators. Section 5
illustrates the benchmark queries from BerlinMOD. Section 6
conducts the experiments. Finally, Section 7
concludes the paper and recommends future work.
5. Benchmark Queries
In this section, we perform a set of interesting benchmark queries that were written in common natural language to test the performance and efficiency of our proposed GSMNet model. The benchmark queries should not only demonstrate the strengths, but also the weaknesses of the data model; we employ a recognized benchmark BerlinMOD [24
] that builds on Secondo database management system (DBMS)to compare the performance of different spatio-temporal database management systems. It identifies 96 query types according to five query properties: object identity, dimension, query interval, condition type and aggregation. However, not all of the query types are interesting for benchmark queries. Seventeen carefully selected benchmark queries are presented according to systematic analysis and combinations, as shown in Table 2
. We formulate these queries in formal SQL-like notation based on the proposed data types and operators in the GSMNet model.
First, we introduce many common database objects in BerlinMOD to better understand the meaning and semantics of these queries. QueryPoints
represent the query points and are defined as
is the identification for this relation,
denotes the query coordinates and
is the data type provided by Secondo [14
are defined as
is a key and
are regular regions. QueryInstants
are defined as
, and QueryPeriods
are defined as
denote the license plate numbers that are sampled from all vehicles and are represented as
. BerlinMOD adopts two types of data model: the Object-Based Approach (OBA) and the Trip-Based Approach (TBA). For the OBA, the entire trajectory is kept together. For the TBA, the entire trajectory is divided into a sequence of trips.
For simplicity, we only provide our implementation based on the proposed GSMNet model, as follows. For the formulation of queries in BerlinMOD, refer to the literature [24
Query 1: What are the models of vehicles with license plate numbers from QueryLicences ?
This query mainly tests the performance on standard data types , standard operators and and the standard index on licence. Compared with TBA and OBA approaches, this query only traverses the ObjectGraph in the GSMNet model to produce the query answer. The strategy that aggregates all moving objects into a single subgraph structure could efficiently avoid performance degradation because of the increase of the the trajectories’ data scale. This is important for significantly improving query performance.
Query 2: How many vehicles exist that are ‘passenger’ cars?
This query also tests the standard data types , operators and the aggregation operators . High query performance also benefits from the hierarchical graph design in the GSMNet model, and the index on the attribute Type field could make it perform better.
Query 3: Where have the vehicles with licenses from QueryLicences1 been at each of the instants from QueryInstants1?
This query needs to retrieve a specific position of the moving objects at query instants. First, the GSMNet model adopts the operator to locate all objects that satisfy the query condition QueryLicences1. This step benefits from the index on the licence field. Then, the operator retrieves the corresponding trajectories of the query objects. The time operator intercepts it at a query instant. Finally, the road segment nodes are retrieved by the operator .
Query 4: Which license plate numbers belong to vehicles that have passed the points from QueryPoints?
This query mainly tests the performance of the spatial index on the trajectories. The operator traverses MoveGraph to find the trajectory unit that pass the QueryPoints.
Query 5: What is the minimum distance between places, where a vehicle with a license from QueryLicences1and a vehicle with a license from QueryLicences2 have been?
First, this query needs to find corresponding moving objects quickly using the index on the licence field. Then, it retrieves the objects’ trajectories using the operator . The operator calculates the distance between two trajectories.
Query 6: What are the pairs of license plate numbers of ‘trucks’ that have ever been as close as 10 m or less to each other?
Because the complexity of this query is , the execution time grows quickly as the number of trucks increases. The index on the type field appears to be helpful. The operator is important for influencing the efficiency of this query.
Query 7: What are the license plate numbers of the ’passenger’ cars that have reached the points from QueryPoints first out of all ’passenger’ cars during the complete observation period?
This query first needs to locate all moving passenger cars in ObjectGraph and obtain all trajectories using the operator . Then, this query extracts the time that objects pass the input query points using the operator . The operator returns the time that objects first pass the points. Finally, this query uses the operator to find corresponding moving objects’ nodes.
Query 8: What are the overall traveled distances of the vehicles with license plate numbers from QueryLicences1 during the periods from QueryPeriods1?
This query uses the operator to extract moving objects’ trajectory segments during the query periods. The operator length calculates the travel distances of moving objects. The index on licence is helpful.
Query 9: What is the longest distance that was traveled by a vehicle during each of the periods from QueryPeriods?
This query is similar to Query 8. It needs to retrieve all of the vehicle’s trajectories and then extract the trajectory segments during the query periods. The operator determines the longest travel distance.
Query 10: When and where did the vehicles with license plate numbers from QueryLicences1 meet other vehicles (distance <3 m), and what are the latter’s licenses?
This query also belongs to a complex query that is similar to Query 6. It needs to determine the accurate location and time that the two vehicles meet each other.
Query 11: Which vehicles passed a point from QueryPoints1 at one of the instants from QueryInstants1?
This query mainly tests the performance of the spatial index. It needs to determine all trajectories for which vehicles passed the query points using the spatial index on the GEOM. Then, the operator retrieves the corresponding locations. This query uses the operator to locate moving objects that pass the query points.
Query 12: Which vehicles met at a point from QueryPoints1 at an instant from QueryInstants1?
This query is very similar to Query 11. It needs to determine whether there are two vehicles that meet at query points at query instants using operator .
Query 13: Which vehicles traveled within one of the regions from QueryRegions1 during the periods from QueryPeriods1?
This query tests the performance of the time index and spatial index. The two indices enhance the efficiency of this query.
Query 14: Which vehicles traveled within one of the regions from QueryRegions1 at one of the instants from QueryInstants1?
Unlike Query 13, this query needs to use the operator to obtain corresponding trajectories that travel within query regions.
Query 15: Which vehicles passed a point from QueryPoints1 during a period from QueryPeriods1?
This query also tests the performance of the spatial index and time index.
Query 16: List the pairs of licenses for vehicles, the first from QueryLicences1, the second from QueryLicences2, where the corresponding vehicles are both present within a region from QueryRegions1 during a period from QueryPeriod1, but do not meet each other there and then.
This query first locates all moving vehicles’ trajectories and then determines whether the trajectory and query regions intersect using the operator . The operator retrieves trajectory segments during the query periods. Then, the query uses the operator to determine pairs of licenses for vehicles.
Query 17: Which points from QueryPoints have been visited by a maximum number of different vehicles?
This query benefits from the GSMNet model at the extreme because the query could easily retrieve all trajectories’ segments that move in a specific segment through the edge from the trajectory node to segment node.
6.1. Experimental Settings
The proposed GSMNet model was implemented using Java as the main programming language and Eclipse 4.4.1 as the development environment. The experiments were conducted on a virtual machine, SecondoVM with Intel i7-4790 CPU, 2G RAM and 20 G mechanical hard disk, which was a Linux-based installation of the Secondo extensible DBMS and provided on the web. Ubuntu 11.10 was installed as the operating system, with Secondo DBMS and BerlinMOD Benchmark. The experimental data were pre-generated BerlinMOD data with different scale factors
0.05, 0.2 and 0.1. The parameter
is the global factor of BerlinMOD that determines the amount of data generated. Table 3
illustrates the detailed information of experimental dataset for different scalefactor values. As shown in the table, we can see that the scale of data grows explosively; for scale factor 1.0, the size of the data is about 11 GB, and the number of trips is 292,940. Hence, the experiments have enough data to evaluate the computational performance of our proposed GSMNet model. Figure 5
shows the spatial distribution of a different number of trajectories. The dataset was directly downloaded from the Secondo website in CSV format. The files included datamcar.csv, trips.csv, queryinstants.csv, querylicences.csv, queryperiods.csv, querypoints.csv, queryregions.csv and streets.csv.
6.2. Experimental Results
We repeated the benchmark query execution several times for both approaches. Table 4
and Figure 6
compare the average query run times in seconds for the proposed GSMNet model and Secondo for different
, data models and approaches.
For Queries 1 and 2, GSMNet outperformed TBA and OBA for the different , and the query run times were almost the same for different numbers of trajectories. An index on Licence was useful to improve the performance. The results show that our implementation has reliable performance on standard types and indices.
For Query 3, GSMNet was faster than TBA, but slower that OBA. This result was expected because the number of trajectory units in GSMNet and TBA was greater than the number of units in OBA. Therefore, the query implementation in OBA could quickly be restricted to single query instants. However, compared with TBA, GSMNet easily retrieved the entire trajectories through the relationships and saved a great deal of query run time. Both approaches were benefit from indexes on Licence.
GSMNet outperformed TBA and OBA for Queries 4 and 5 because it benefited from the relationships pointing from trajectory unit to road segment . Therefore, GSMNet could easily retrieve all trajectories’ units that passed the query points in road segments. That also reflects that GSMNet characterized by graph traversal has strong potential to reduce time-consuming table join operations in traditional approaches.
For Query 6, OBA outperformed GSMNet and TBA for all amounts of data. This query first needed to select candidate trucks and then compare all corresponding trajectories’ units. Because the number of units in TBA and GSMNet was greater than the number of units in OBA, the query required slightly less time in OBA than in TBA and GSMNet.
GSMNet outperformed OBA for Query 7. In GSMNet, we retrieved a candidate passenger from object graph and determined all of the query points from segment graph . The relationships between trajectory unit and road segment helped us to retrieve all trajectories’ units. Then, the query determined if there were relationships between a trajectory unit and moving object .
The classical Query 8 needed to calculate the distance of trajectories, and it was a fast query in TBA, OBA and GSMNet. However, GSMNet loses at 1.0 because the number of trajectories’ units in GSMNet was greater than the other approaches.
The good result from Query 9 exceeded our expectations. This query summed the lengths of all trajectories and returned the longest distance. In GSMNet, the relationship retrieved all trajectory units ; mainly because the length of trajectory unit is pre-computed. Hence, this query in GSMNet only summed the lengths of trajectory units. Therefore, it saved a great deal of time.
For complex Query 10, GSMNet outperformed TBA and OBA. This query needed to simultaneously consider both the temporal and spatial distance. The advantage of GSMNet is that we used many relationships to connect moving objects, road segments and trajectories’ units. However, TBA and OBA required many time-consuming aggregation operations in this query.
Query 11 is similar to Query 12. However, we did not expect that GSMNet would be slower than TBA and OBA. In the experiments, the spatial index on the trip and temporal index on query instants in TBA and OBA played an important part in the improvement of efficiency. By contrast, GSMNet still first retrieved the corresponding road segments from query points. Then, we used the relationships between trajectory unit and road segment to determine all candidate trajectory units. Many loops through the trajectory units were performed to determine if candidates met the query instants run more times than the spatial-temporal index.
Queries 13, 14 and 15 focused on testing the performance of spatial-temporal indices. TBA and OBA outperformed GSMNet because our implementation used the relationships and to substitute for the spatial indices.
For Queries 16 and 17, the performance of GSMNet was in line with our expectations. The number of trajectory units had a significant impact on performance.
In our experiments, we have detected some points of the strengths and weaknesses in the GSMNet model by comparison with the most mature moving objects database Secondo. The pairwise comparison results show that GSMNet has higher efficiency in several queries involving more table-join operations, such as Queries 3, 5, 7, 9, 10, 16, 17. The weakness of GSMNet occurs in queries with a large data scale. For example, when the number of trips is 292,940 at scalefactor 1.0, GSMNet shows signs of performance degradation in Queries 11, 12, 14. However, Secondo performs high stability.
(1) The proposed GSMNet model has the capability of representing semantic information, including traffic state and social relationships. To keep contrasting experiments at the same starting point, the standard 17 benchmark queries remained relatively untouched, although they involved a small amount of semantic information in the experiments. However, the experimental results show that the performance of our proposed GSMNet is workable and reliable. The benchmark queries could also be easily extended to cover semantic information. For example, we could add social relationships to Query 12, in which vehicles met their friends at a point from QueryPoints1 at an instant from QueryInstants1. More experiments containing semantic information need to be performed in the future. Meanwhile, GSMNet should be extended to represent more semantics, for instance human behavior information, including group behavior and individual behavior, such as herd, swarm, convoy pattern and moving clusters.
(2) Graph structures are widely used to represent road networks. However, the proposed GSMNet model innovatively adopted two dual graph structures to model the network at different levels of granularity. The advantage is that traffic information could be easily integrated into the model and the topological relationships between routes and segments could be represented as edges. Additionally, GSMNet also represents trajectories and moving objects’ social relationships as graph structures, thus enabling the integration of spatial and semantic information. Based on this design, uniform graph traversal operations could be used to substitute time-consuming table join operations, as shown in the experimental results of Queries 4 and 5.
(3) The proposed GSMNet model mainly focuses on modeling massive trajectories and the underlying road networks. However, benefiting from the design of the proposed GSMNet model, it can be finely tuned to support the representation of other activity environments, such as indoor or geographical free spaces [38
]. However, storing too much information through the attributes of nodes or edges will make the graphs overstaffed or redundant and cause performance degradation. The experimental results reflect the weakness of the proposed GSMNet model. The efficiency of benchmark queries all decreased at
1.0. Compressing the trajectories and storing the attributes of graph nodes or edges with a binary system may be a useful strategy for solving the problem.