310 likes | 426 Views
Computational Data Modeling and Queries for Location-Based Services in Road Networks. Irina Aleksandrova, Augustas Kligys, Laurynas Speičys. Mobile User. Ph. Road Network. Problem Setting. Topic:. location-based services. Application domain:. road networks. Scenario :.
E N D
Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys
Mobile User Ph Road Network Problem Setting Topic: • location-based services Applicationdomain: • road networks Scenario: • mobile users issue queries about stationary objects “Find the 3 nearest open pharmacies” Main issues: • data modeling • system architecture for query processing • algorithms, underlying computation of the query result
Outline Problem Setting Data Model and Transformation Querying System Architecture Query Processing Algorithms Future Work
Road Network 2D Road Network Data Model Road elements: Segments: • bi-directional, one-directional roads • separating lines • different properties on different directions of the single road (e.g., surface quality, speed limit) Connections: • traffic regulations on intersections
qp Ph Road Network Ph Ph 2D Objects’ Data Model Objects on the road network: Query point: • position Data points: • position • several locations • accessibility from different movement directions • properties
Transformation: the Idea Identify chains of segments • two segments meet • the same movement directions • the same properties Transform: • chains to edges • ending connections of chains to vertices 100km/h 70km/h 100km/h Transformation
100km/h e1 e2 pth1 pth2 100km/h 70km/h Transformation: Segments to Edges Components: • A chain of segments ch = {s1, … , sn} • An edge e = (vs, ve, w, l) • Co-edge relation coE vs, ve corresponds to ends of chains l corresponds to a sum of road distances of chain’s segments Weight is computed according to travel distance of paths of a chain: (e1, e2)coE if turn around on segments is allowed
Transformation: Connections To Vertices Components: • connection c =(p, mx) • vertexv Semantics of vertex: can move to any outgoing edge from any ingoing edge Mapping according to restrictions on movement on v: • no restrictions c v • any restrictions c {v1,…,vn}{ ,…, } qp qp qp X X Single Vertex Multiple Vertices Connections
t2 qp qp posl t1 pth pk posw p1 QP Transformation: Objects Query point: • 2D: qp2D= (p, s) • Graph: dpG = (e , posl, posw, speedw, t) • posl = RD(pth) + d(pk, qp) • posw = TD (pth) + TDs (pk, qp)
Transformation: Objects Query point: t2 • 2D: qp2D= (p, s) qp qp posl • Graph: dpG = (e , posl, posw, speedw, t) t1 pth pk posw • posl = RD(pth) + d(pk, qp) p1 QP • posw = TD (pth) + TDs (pk, qp) Data point: • 2D: dp2D= (prop={…}, loc={lc1,lc2,…}) Ph lc1 • Graph: dpG = (e , posl , posw) lc2 • One location to one (two) data point: • lc1dp1G, lc2dp2G, … DP
Outline Problem Setting Data Model andTransformation Querying System Architecture Query Processing Algorithms Future Work
Querying Query: ”Find 2 nearest pharmacies” Problem: compute k-NN T=t1 Answer: {A,B} Problem: active result T=t2 Answer: {B,A} B A
Outline Problem Setting Data Model andTransformation Querying System Architecture Query Processing Algorithms Future Work
Find 3 nearest open pharmacies within 10 km, Find not less than 3 open pharmacies around (157, 52) not further than 10 km 4 open pharmacies, location of the query window Visualization of 3 pharmacies Scenario of Processing a New Query GPS Position tracking Quick selection Validation User Active result Visual. Server k NN search Client • User issues a query providing NNs, their number k, and Max Road Distance • Client issues a query to Server with user’s query and current position (x, y) • Server “quickly” selects l NNCs from an area around (x, y), 0l max NNCs in map. • Client searches for k NNs and validates the data set: • upon invalid data set reissues the query + Minimal Road Distance • upon valid data set maintains an active result and visualizes the result
Outline Problem Setting Data Model and Transformation Querying System Architecture Query Processing Algorithms • “Quick” Selection • Validation • k NN Search Algorithms • Handling Updates Future work
Grid Data Structure 375 A 2D map is covered by a grid. 400 Each data point in the map is associated with a cell. Each cell has information about all data points within it. 425 1.850 1.875 1.825 A cell is accessed directly. Y30 Y31 X10 X11
x1 x2 x3 x4 x5 x6 y1 y2 • While ((NNCs < k)& (MRD not reached) & (there are unexplored cells)) y3 QPoint QWindow1 y4 QWindow2 {select NNCs from additional “ring”} y5 QWindow3 “Quick” Selection Processing initial query: • Select data points from the cell of QPoint (QWindow1)
x1 x2 x3 x4 x5 x6 y1 y2 QPoint • While ((NNCs < k)& (MRD not reached) & (there are unexplored cells)) y3 QWindow1 y4 QWindow2 {select NNCs from additional “ring”} y5 QWindow3 • Only an update is sent to the Client: • additional data points • discarded data points QWindow2 “Quick” Selection Processing initial query: • Select data points from the cell of QPoint (QWindow1) Processing subsequent query: • A query is received from Client • A new QWindow is formed reusing already selected data. QPoint
Outline Problem Setting Data Model and Transformation Querying System Architecture Query Processing Algorithms • “Quick” Selection • Validation • k NN Search Algorithms • Handling Updates Future work
Frame validation: • solves data shortage problem • correct, if RD(qp, nnRDlast) < dist(qp,qw) • frame = normalized TD Validation Validation The result of the NNs list: • incorrect, if TD(qp, dp’) < TD (qp,dp)
Outline Problem Setting Data Model and Transformation Querying System Architecture Query Processing Algorithms • “Quick” Selection • Validation • k NN Search Algorithms • Handling Updates Future work
root edge qp NN Search Algorithms Search in the graph is based on best-first search. Next step – vertex that start 5 • was not visited • has the lowest travel distance 5 1 3 8 1 8 12 12 knnWOTturn-around is not allowed 8 knnWTturn-around is allowed
qp Algorithm knnWOT Search • scans the root edge and runs the best-first search from the end point of the root edge data points • data points on the root edge might appear twice in the NN list
qp Algorithm knnWOT Search • scans the root edge and runs the best-first search from the end point of the root edge • data points on the root edge might appear twice in the NN list Active result • discards data points from the NNlist that are behind the query point
dp4 dp3 dp2 co-qp dp1 dp3 Algorithm knnWT Search • Two search trees the first:considers the nearest data pointsthe query point is approaching to qp dp1 the second:considers the nearest data pointsthe query point is moving away • Merge results of both trees Active result • changes the order of the elements in the NN list
alarms -1 1.5 -3.5 speed=1 qp [1] Active Result for knnWT now now +1.5 dp1 dp3 dp2 dp4 B C [4] [14] [9] [4]
alarms -1 1.5 -3.5 SWAPPING alarms 4 0 NULL speed=1 qp [2.5] Active Result for knnWT now now +1.5 dp1 dp3 dp2 dp4 B C [4] [14] [9] [4]
Outline Problem Setting Data Model and Transformation Querying System Architecture Query Processing Algorithms • “Quick” Selection • Validation • k NN Search Algorithms • Handling Updates Future work
Deletion of the data point from the NN list • perform NN search algorithm from the scratch Handling Updates Insertion of the data point into the NN list • if the edge was already traversed (it is in the search tree) then insert a new data point into NN list (no other points are discarded) • if edge was not traversed – do not insert a data point
Outline Problem Setting Data Model and Transformation Querying System Architecture Query Processing Algorithms • “Quick” Selection • Validation • k NN Search Algorithms • Handling Updates Future work
Future Work Moving function for query point in 2D representation Predefined routes Using indexing in data selection accordingto the density of roads or objects Experiments