VIEWS: 7 PAGES: 44 POSTED ON: 11/17/2011
Moving objects Moving Objects 1 Various Queries Location-aware Database Server How many cars in this area? Static Query over moving Object Keep talking with 3 Keep me updated by nearest police cars hospitals in 3 miles Moving Query over moving Object How many cars in Keep updating how Continuous Highlight now? many airplanes within K-nearest Neigbor 100 miles Moving Query over Moving Query over moving Object Moving Query over Static Object Snapshot moving Object Continuous Range Based 2 System Alpha System Alpha O-Table Q-Table Object report their locations periodically O-table Too many reports if Store the tuple too frequently Update the table receiving new location sample otherwise Always store the newest locations of objects inaccuracy Q-table Store tuple Update the table receiving new focal locations Evaluate a coming query scan o-table to search right objects Scan for searching?! Output results too much overhead, use Put it in Q-table Index Evaluate existing queries For each query in Q-table Scan o-table to find right objects Completely redo Output results every query, not Or for each object in O-table incremental evl. Too Scan Q-table to find whether it meets each queries much overhead Output results 3 Improve System Alpha How the object efficiently reports location changes? Objects does not change their velocity too frequently, Report motion function change instead of location changes DB can predict the future position: pi+1 = pi + Δt* v Benefit Greatly reduce the amount of position report, if objects don’t change velocity a lot. Allow the DB to precompute future query results 4 Improve System Alpha How to efficient search O-table and Q-table Use index! Which keyword? Location is Keyword! How to design a hierarchical index structure? 5 R-tree R-tree based indexes are used in spatial DBs. For each index record (I, tuple-identifier), in a leaf node, I is the smallest rectangle that spatially contains the n-dimensional data object represented by the indicated tuple (n-dimensional bounding box) Non-leaf nodes covers all rectangles in the lower nodes Good enough? How about update? object changes location → update index object changes location frequently update operations are costful 6 Indexing moving objects Database stores the current location of each object and the velocity vector. Example: cars moving in a highway system. GPS can provide position/velocity 7 Moving Objects:Representation Consider the 1-d case (objects moving on a line) Storing the locations of moving objects is a challenge: Update the database with the new locations Use a function of time f(t) to store a location f (t ) v t u Update overhead is reduced; update the database only when velocity changes 8 Space-time Trajectories are plotted as lines in the time- location space (y, t); p(t) = vt+a trajectories o1 o2 o3 o4 (t) time 9 Indexing Use R-tree to index the lines Large MBRs, extensive overlap Use a Quadtree approach (or a grid) Partition the space into cells, store for each cell the lines that intersect it Disk space is increased 10 TP R-tree Time-Parametrized R-tree Store the MBRs as functions of time The MBRs grow with time, at any time instant in the future we can compute the “MBR” 11 Modeling Continuous Movement Instead of storing position values, store the positions as functions of time, yielding time- parameterized positions. We use linear functions to capture the present and future positions. x (t ) x (t0 ) v (t t0 ), where t now Updates are necessary only when the parameters of the functions change. For example, given t0 , the current and anticiapted, future position of a two-dimensional point can be described by four parameters. x (t ), y (t ), v , v 0 0 x y 12 Time-Parameterized Rectangles The TPR-tree is based on the R- tree. Moving points are bounded with time-parameterized rectangles. Are bounding from now on. The R-tree allows overlap. Ideally, bounding rectangles should be always minimal. Excessive storage cost ximin (tc ) mino.xi (tc ) o node ximax(tc ) maxo.xi (tc ) o node vimin mino.vi o node vimax maxo.vi o node 13 Queries Type 1: objects that intersect a given rectangle x at t 6 o3 Type 2: objects that 5 intersect a given rectangle 4 sometime from t1 to t 2 3 o2 o1 2 o Type 3: objects that 1 o 1 intersect a given moving 4 rectangle sometime 1 2 3 4 5 6 t between t and t1 2 14 Value 40 o2 30 o1 20 Q1 10 Q0 0 -10 Q2 -20 o4 -30 o3 Q3 -40 1 2 3 4 5 time 15 Query examples Q0 and Q1 are timeslice queries Q2 is window query and Q3 moving query Iss(Q) – time when query issued Ref position and velocity depend on iss(Q) because objects update their parameters as time goes Answer to query Q1 is o1 if iss(Q1) < 1 and none if iss(Q1) >1 Queries in far future little value because positions predicted less accurate Real World – expect queries concentrated in some limited time window extending from current time 16 Problem Parameters Querying window(W) : how far queries can look into the future Iss(Q) <= t <= Iss(Q) + W for timeslice queries Iss(Q) <= t |- <= t -| <= Iss(Q) + W for other queries Index Usage Time(U) : time interval during which an index will be used for querying tl <= Iss(Q) <= tl + U ( tl index creation time) Time Horizon(H) : length of the time interval from which t,t |-, t -| are drawn Time horizon for an index is index usage time plus the querying window 17 Newly created index must support queries that reach H units in future H=U+W W Iss(Q) t |- t -| tl U 18 Querying Type 1 : a bounding rectangle specified by satisfies a query iff Type 2, 3 Represent type 2, 3 query as a time-parameterized rectangle with starting and ending times 19 20 21 Insertion: Grouping Points How to group moving points? The R-tree’s algorithms minimize characteristics of MBRs such as area, overlap. How does that work for moving points? 5 5 7 7 5 5 4 4 7 4 4 7 6 6 6 6 2 2 2 2 1 1 1 1 3 3 3 3 22 Insertion in the TPR-Tree • The bounding rectangle characteristics (area, overlap) are functions of time. • The goal is to minimize these for all time points from now to now+H. • What H to use? • H is close to Zero • R-tree • H is large • Keep the growth rates of the bounding rectangles low now H A(t )dt, now where A(t) is, e.g., the area of an MBR 23 Improve TPR-tree Update when process query TM : maximum update interval The longest time interval between two consecutive updates of an object Keep the objects’ movement information up to date and serve as heartbeat signals in practice 24 y o1 o2 o3 o4 t update time An example of update and re-computation of MBR (1D) Reference: Simonas Saltenis, Christian S. Jensen, Scott T. Leutenegger, Mario A. Lopez: Indexing the Positions of Continuously Moving Objects. SIGMOD Conference 2000: 331-342 25 Improve System Alpha What did we get by far? New motion modeling and motion update mechanism TPR-tree Benefit Reduce No. of update operation and the overall cost Useful for predicting query results 26 How about continuous queries? 27 Motivation (Traditional) Intersection join Given two sets of spatial objects A and B, find all object pairs ‹i,j›, where iA, j B, such that i intersects j. Intersection join on moving objects Moving Continuous 28 u Indexing Moving Objects u u Monitoring moving objects u u u Sampling-based Trajectory-based p = p ( t ref ) + v (t - t ref ) TM : maximum update u interval R-tree [SIGMOD’84] N3 N1 Minimum bounding rectangle 3 N1 N2 (MBR) A N1 D TPR-tree [SIGMOD’00] N1 N2 F C A C D B E F Add time parameters to the E N2 B R-tree Other indexes: Bx-tree [VLDB’04], STRIPES [SIGMOD’04] Only for points 29 The Time Parameterized (TP) Window Query Returns: The current query result R The validity period T of R The change of result C at the end of T Result: y a xis 10 a R={b} 8 d 6 b mo vin g ea st at speed 1 e 4 c th e qu ery q 2 at current time x a xis 0 2 4 6 8 10 30 The TP Window Query Returns: The current query result R The validity period T of R The change of result C at the end of T y a xis Result: 10 a R={b}, T=1, C={-b} 8 d 6 b e 4 c th e qu ery q at time 1 2 x a xis 0 2 4 6 8 10 31 The TP Nearest Neighbor Query Returns: The current query result R The validity period T of R The change of result C at the end of T y a xis 10 Result: g R={d} 8 a 6 f qu ery q b 4 d 2 e c x a xis 0 2 4 6 8 10 32 The TP Nearest Neighbor Query Returns: The current query result R The validity period T of R The change of result C at the end of T y a xis 10 Result: g R={d}, T=1.5, C={f} 8 a qu ery q f 6 at time 1.5 b 4 d 2 e c x a xis 0 2 4 6 8 10 33 The TP Spatial Join Query y axis Result: 10 A1 B1 B3 1 R={(A1, B1), (B3, A4)} 8 1 1 A4 6 A2 1 4 A3 B2 A5 2 1 1 x axis 0 2 4 6 8 10 34 The TP Spatial Join Query y axis Result: 10 A1 B1 B3 1 R={(A1, B1), (B3, A4)} 8 1 T={1} 1 C={A3, B2} A4 6 A2 1 4 A3 B2 A5 2 1 1 x axis 0 2 4 6 8 10 35 Naive Algorithm (NaiveJoin) Join nodes from two TPR-trees recursively If intersected, check on children Otherwise, disregard it For an update, compute its join pairs and update the answer Join result ‹a1,b1›, [0,3] ‹a2,b2›, [1,4] ‹a3,b4›, [6,8] 36 Extended TP-Join Algorithm (ETP-Join) Time Parameterized Join (TP-Join) [SIGMOD’02] Current result ‹a1,b1› Expiry time 1 Event that causes the change ‹a2,b2› Join result ‹a1,b1›, [0,3] ‹a2,b2›, [1,4] ‹a3,b4›, [6,8] For the 1st TP-Join Node access (IO) roots, N1, N3 Comparison (CPU) root A vs root B, N1 vs N3 37 Summary NaiveJoin ETP-Join One tree traversal per Cheaper traversal, but too update, but expensive frequent traversals traversal For the 1st TP-Join Node access (IO) Node access (IO) roots, N1, N2, N3, N4 roots, N1, N3 Comparison (CPU) Comparison (CPU) root A vs root B, N1 vs N3, N2 vs N4 root A vs root B, N1 vs N3 Too long Too short 38 Key Problem Find a good time range for computing the join pairs The joint result between any two objects only needs to be valid until the next update on any of the two objects. Observation Consider object a and b Let the next update time for them be ta and tb Perfect time range for computing their join result is [tc, min(ta,tb)] How do we know ta or tb? TM gives a bound for them Time range is cut from [tc, ] to [tc, tc+TM] 39 Time Constrained Processing (TC-Join) NaiveJoin with constrained processing time range [tc, tc+TM] Assume Tm=5 Join result ‹a1,b1›, [0,3] ‹a2,b2›, [1,4] ‹a3,b4›, [6,8] Node access (IO) roots, N1, N3 Comparison (CPU) root A vs root B, N1 vs N3 40 Experiments: setting Computer: 2.6G Pentium IV CPU, 1G RAM Datasets: Uniform, Gaussian, Battlefield Measure: IO and Time Parameter Value Node capacity 113 Maximum update interval (TM) 60, 120, 240 Maximum object speed 1, 2, 3, 4, 5 Object size (% of space) 0.5, 0.1, 0.2, 0.4, 0.8 Dataset size 1K, 10K, 50K, 100K Dataset Uniform, Gaussian, Battlefield 41 Comparison: Initial Join MTB-Join outperforms others Half an hour for NaiveJoin 42 Conclusion and future work Conclusion The TPR-tree indexes the current and predicted future positions of moving objects. The tree can be tuned to take advantage of a specific update rate and querying window length. Time Constrained processing However How about multiple queries? 43 References R-tree [SIGMOD’84] Antonin Guttman. R-Trees: A Dynamic Index Structure for Spatial Searching . ACM SIGMOD Conference 1984. TPR-tree [SIGMOD’00] S. Saltenis, C. S.Jensen, S. T. Leutenegger, and M. A. Lopez. Indexing the positions of continuously moving objects. ACM SIGMOD Conference 2000. Bx-tree [VLDB’04] C. Jensen, D. Lin, and B.C.Ooi. Query and update efficient B+-tree based indexing of moving objects. International conference on Very Large Databases, 2004. STRIPES [SIGMOD’04] J. M. Patel, Y. Chen, and V. P. Chakka. STRIPES: An efficient index for predicted trajectories. ACM SIGMOD Conference 2004. TP-Join [SIGMOD’02] Y. Tao and D. Papadias. Time-parameterized queries in spatio-temporal databases. ACM SIGMOD Conference 2002. TC-Join[ICDE’08] R. Zhang, D. Lin, K. Ramamohanarao, and E. Bertino. Continuous Intersection Joins Over Moving Objects. ICDE 2008 H. V. Jagadish: Linear Clustering of Objects with Multiple Atributes. ACM SIGMOD Conference 1990: 332-342 Walid G. Aref, Hanan Samet: A Window Retrieval Algorithm for Spatial Databases Using Quadtrees. ACM-GIS 1995: 69-77 44