A method and system for quickly searching for mobile objects in a specified area of a road network
By dividing the road network into subgraphs with boundary constraints and building a double-layer index structure, fully covering the subgraphs is identified, which solves the problem of low query efficiency in the existing technology and achieves the effect of quickly searching for moving objects.
Patent Information
- Application Number
- CN202310770427.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-27
- Publication Date
- 2024-09-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology has low query efficiency when querying the range of moving objects in the road network, especially when the query range is large or the distribution density of moving objects is low, resulting in too long calculation time and difficulty in directly determining the subdivisions completely covered by the query range. Figure, making internal exploration inevitable.
Abstract the road network into a graph, and divide the graph into multiple subgraphs with boundary constraints. Use Dijkstra's algorithm and double-layer index structure to identify subgraphs that do not require internal exploration, and directly determine the complete coverage of the subgraph. and perform internal searches only on partially covered subgraphs.
It realizes fast search for moving objects within the specified range, avoids internal exploration of completely covered subgraphs, improves query efficiency, and reduces calculation time.
Smart Images

Figure CN116756437B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer application technology, and in particular to a method and system for quickly searching for mobile objects in a designated area of a road network. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] In recent years, with the rapid development of the Internet and the widespread application of mobile terminals, a number of problems in the fields of location-based services, traffic management, disaster response, and public security can be abstracted as mobile object range query problems based on road networks. For example, food delivery services need to frequently query riders within a specified range in the road network based on user requests to complete the delivery of goods. For another example, in the Internet of Vehicles service, each vehicle can query vehicles within a specified range in the road network, and promptly broadcast the current road conditions to the queried vehicles to help other vehicles avoid congested sections. In the above services, the riders and vehicles whose positions are constantly changing can be abstracted as mobile objects. Therefore, the basic theoretical problems of the above services can be abstracted as mobile object range query problems based on road networks.
[0004] In the mobile object range query problem based on the road network, the road network is first mapped into an undirected non-negative weighted graph, that is, each intersection is regarded as a vertex of the graph, the road sections between the intersections are regarded as the edges between the corresponding vertices, and the road distance is regarded as the weight of the edge; then the people or cars moving along the road network are regarded as mobile objects and mapped to the graph, and it is calculated whether the mobile objects are covered by the query range. Therefore, the mobile object range query problem based on the road network is mapped into the mobile object range query problem based on the graph.
[0005] The range query problem of mobile objects based on road networks has been widely studied by scholars at home and abroad, but the query efficiency of existing work still needs to be improved, as follows:
[0006] (1) Some existing works start from the query point on the graph, use the Dijkstra algorithm to gradually expand the search range, identify all edges on the graph that are covered by or intersect the query range, and then check which moving objects on these edges belong to the query results. However, when the query range is large, the number of vertices that need to be visited is large, resulting in a long query time; in addition, when the distribution density of moving objects is low, a large part of the computing time is wasted on visiting vertices and edges without moving objects.
[0007] (2) Some existing works divide the graph into subgraphs to help the algorithm filter out subgraphs that are unlikely to contain query results, so as to avoid accessing vertices and edges without mobile objects. However, these works still need to calculate the shortest distance from each mobile object in the subgraph containing potential results to the query point, that is, the sum of the weights of all edges on the shortest path between them in the graph, to determine whether the mobile object is within the query range, resulting in low query efficiency.
[0008] In summary, if it can be determined that a subgraph is completely covered by the query range, then it can be concluded that all mobile objects in the subgraph are covered by the query range, and there is no need to perform internal search, that is, there is no need to check one by one whether the mobile objects in the subgraph are within the query range. However, the existing range query algorithm is difficult to directly determine the subgraph that is completely covered by the query range without searching the vertices and edges inside the subgraph. Therefore, how to avoid internal exploration of subgraphs that are completely covered by the query range to achieve efficient query has become a technical problem that needs to be solved urgently. Summary of the invention
[0009] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a method and system for quickly searching for mobile objects in a specified area of a road network. First, the road network is abstracted into a graph, and then the graph is divided into multiple sub-graphs with boundary constraints to help the query algorithm identify sub-graphs that do not require internal exploration, thereby realizing a quick search for mobile objects in a specified range.
[0010] In order to achieve the above object, the present invention proposes the following technical solutions:
[0011] A first aspect of the present invention provides a method for quickly searching for mobile objects in a specified area of a road network, comprising the following steps:
[0012] The road network is constructed as a graph, each intersection is regarded as a vertex on the graph, the road segments between intersections are regarded as edges between corresponding vertices, and the length of the road segments between intersections is regarded as the weight of the edge;
[0013] Map the moving objects in the road network to the edges of the graph and move randomly along the edges of the graph;
[0014] A graph is divided into multiple subgraphs with boundary constraint properties, and the vertices of each subgraph are divided into boundary vertices and internal vertices, wherein a boundary vertex of a subgraph refers to a vertex with at least one adjacent edge not covered by the subgraph, and an internal vertex of a subgraph refers to a vertex whose all adjacent edges are covered by the subgraph. The specific division steps include: creating a set for storing seed vertices, wherein a seed vertex refers to a boundary vertex in a subgraph with at least one adjacent edge not covered by the subgraph, and in the initial state, randomly selecting a vertex in the graph as a seed vertex and putting it into the set; randomly taking a vertex from the seed vertex set as the starting vertex of a subgraph to be divided, wherein the subgraph to be divided is called an extended subgraph; and under the premise of satisfying the boundary constraint properties, adding vertices to the current extended subgraph until the number of vertices in the current extended subgraph reaches the specified number. A threshold is set, or there is no vertex to be assigned in the graph that satisfies the boundary constraint property, where the vertex to be assigned refers to a vertex in the graph that has at least one adjacent edge that does not belong to any subgraph; under the premise of satisfying the boundary constraint property, potential edges are added to the current extended subgraph in order from small to large according to the weight of the potential edges, where a potential edge refers to an edge where two adjacent vertices are already in the current extended subgraph; when all potential edges of the current extended subgraph have been added or there is no potential edge that makes the current extended subgraph meet the boundary constraint property, the partition of the current extended subgraph is completed, and the extended subgraph after the partition is completed is called a subgraph; if the seed vertex set is not empty, randomly select a vertex from the seed vertex set as the starting vertex of the next subgraph to be partitioned, and iterate in sequence according to the above steps until the seed vertex set is empty, and the partition of all subgraphs is completed;
[0015] Construct a two-layer index structure based on the partitioned subgraph;
[0016] The set of moving objects within the specified query range is queried based on the double-layer index structure.
[0017] Furthermore, the specific steps for adding vertices to the current extended subgraph are:
[0018] Starting from the seed vertex of the current extended subgraph, use the Dijkstra algorithm to traverse the vertices to be allocated in the graph;
[0019] Assume that the vertex currently being traversed can be added to the extended subgraph through its necessary adjacent edges, and the boundary vertices in the extended subgraph are updated, where the vertex currently being traversed is called the processing vertex, and the necessary adjacent edges refer to the edges connecting the processing vertex and the existing vertices in the extended subgraph, where the starting vertex and the vertex being processed are both regarded as the boundary vertices of the current extended subgraph;
[0020] Calculate the inner and outer boundaries of each boundary vertex in the current expanded subgraph;
[0021] If the current extended subgraph satisfies the boundary constraint, the addition of the vertex being processed and its necessary adjacent edges is valid and complete, otherwise, the addition of the vertex being processed and its necessary adjacent edges is canceled;
[0022] Furthermore, the boundary constraint property is that the external boundary of each boundary vertex in any subgraph is greater than or equal to its internal boundary, wherein the internal boundary of the boundary vertex refers to the maximum value of the shortest distances from the boundary vertex to all internal vertices and any position of each edge in the current extended subgraph; the external boundary of the boundary vertex refers to the maximum value of the shortest distances from the boundary vertex to other boundary vertices in the current extended subgraph.
[0023] Furthermore, the specific steps for calculating the inner boundary and outer boundary of each existing boundary vertex in the current extended subgraph are:
[0024] Create a distance matrix for the current extended subgraph. The distance matrix is used to store the shortest distance from each boundary vertex in the current extended subgraph to any vertex in the current extended subgraph.
[0025] Insert the vertex being processed into the distance matrix;
[0026] Calculate the shortest distance from the vertex being processed to the existing vertices in the current expanded subgraph;
[0027] Calculate the inner and outer boundaries of each existing boundary vertex in the current extended subgraph based on the shortest distance between existing vertices.
[0028] Furthermore, the specific steps of adding potential edges to the current extended subgraph in order from small to large according to the weights of the potential edges are:
[0029] According to the weight of the potential edge, try to add a potential edge to the current extended subgraph, and update the vertex states of the two end vertices of the potential edge, wherein the potential edge being tried to be added is called the potential edge being processed, and the two end vertices of the potential edge being processed are respectively called the left vertex and the right vertex;
[0030] Update the shortest distance from any boundary vertex to the left vertex and the right vertex in the current extended subgraph stored in the distance matrix;
[0031] If the shortest distance from a boundary vertex to the left vertex in the current extended subgraph becomes smaller, update the shortest distance from the boundary vertex to each adjacent vertex on the left except the right vertex stored in the distance matrix, and update the internal and external boundaries of the boundary vertex; the same applies to the right vertex;
[0032] Repeat the previous step until all boundary vertices whose shortest distances to the left or right vertices become smaller are processed;
[0033] If one or both of the left vertex and the right vertex become internal vertices due to processing potential edge addition, update the internal and external boundaries of other boundary vertices in the current expanded subgraph;
[0034] If the current extended subgraph satisfies the boundary constraints, the addition of the potential edge being processed is valid and complete; otherwise, the addition of the potential edge being processed is canceled.
[0035] Furthermore, all the divided subgraphs constitute the first layer of the double-layer index structure; the boundary vertices of all the subgraphs in the first layer are extracted, and any pair of boundary vertices in the same subgraph are connected by edges. These boundary vertices and edges constitute the second layer of the double-layer index structure, and the second layer is also called the skeleton graph.
[0036] Furthermore, the specific steps of querying the set of mobile objects within the specified query range based on the double-layer index structure are as follows:
[0037] For a given range query, a candidate subgraph is identified based on the skeleton graph; a candidate subgraph is a subgraph that is completely or partially covered by the query range;
[0038] The candidate subgraph is queried for the set of moving objects within the query range.
[0039] Furthermore, for a given range query, the specific steps for identifying candidate subgraphs based on the skeleton graph are:
[0040] Add the edge where the query point is located to the skeleton graph;
[0041] Starting from the query point, use the Dijkstra algorithm to traverse the vertices in the skeleton graph after adding the edge where the query point is located to identify the vertices covered by the query range;
[0042] According to whether the boundary vertices in the candidate subgraph are covered by the query range, the candidate subgraphs are classified into fully covered subgraphs and partially covered subgraphs. In addition, the subgraph where the query point is located is classified as the root subgraph.
[0043] A second aspect of the present invention provides a system for quickly searching for mobile objects in a specified area of a road network, comprising:
[0044] A graph construction module is configured to construct the road network as a graph, wherein each intersection is regarded as a vertex on the graph, the road segments between the intersections are regarded as edges between corresponding vertices, and the lengths of the road segments between the intersections are regarded as weights of the edges;
[0045] A mapping module, configured to map mobile objects in the road network to edges of the graph and move randomly along the edges of the graph;
[0046] A partitioning module is configured to partition a graph into multiple subgraphs with boundary constraint properties, wherein the vertices of each subgraph are divided into boundary vertices and internal vertices, wherein a boundary vertex of a subgraph refers to a vertex having at least one adjacent edge not covered by the subgraph, and an internal vertex of a subgraph refers to a vertex having all its adjacent edges covered by the subgraph, and the specific partitioning steps include: creating a set for storing seed vertices, wherein a seed vertex refers to a boundary vertex in a subgraph having at least one adjacent edge not covered by the subgraph, and in an initial state, randomly selecting a vertex in the graph as a seed vertex and putting it into the set; randomly taking a vertex from the seed vertex set as a starting vertex of a subgraph to be partitioned, wherein the subgraph to be partitioned is called an extended subgraph; and, on the premise of satisfying the boundary constraint properties, adding vertices to the current extended subgraph until the number of vertices in the current extended subgraph is The amount reaches the specified threshold, or there are no vertices to be assigned in the graph that make the current extended subgraph satisfy the boundary constraint property, where the vertex to be assigned refers to the vertex in the graph that has at least one adjacent edge that does not belong to any subgraph; under the premise of satisfying the boundary constraint property, potential edges are added to the current extended subgraph in order from small to large according to the weight of the potential edges, where a potential edge refers to an edge where two adjacent vertices are already in the current extended subgraph; when all potential edges of the current extended subgraph have been added or there are no potential edges that make the current extended subgraph meet the boundary constraint property, the partitioning of the current extended subgraph is completed, and the extended subgraph that has been partitioned is called a subgraph; if the seed vertex set is not empty, randomly select a vertex from the seed vertex set as the starting vertex of the next subgraph to be partitioned, and iterate in sequence according to the above steps until the seed vertex set is empty, and the partitioning of all subgraphs is completed;
[0047] An index building module is configured to build a double-layer index structure based on the divided subgraphs;
[0048] The query module is configured to query a set of mobile objects within a specified query range based on a double-layer index structure.
[0049] One or more of the above technical solutions have the following beneficial effects:
[0050] The present invention proposes a method and system for quickly searching for mobile objects in a specified area of a road network, designs a subgraph partitioning algorithm, and aims to divide a graph into multiple subgraphs with boundary constraints to help the query algorithm identify subgraphs that do not need to be explored internally. Any vertex in such a subgraph and any position on each edge are within the query range, which is called a fully covered subgraph. A range query algorithm is proposed to quickly search for mobile objects in a specified range. That is, based on a subgraph with boundary constraints, a subgraph that is completely or partially covered by the query range is identified. For a fully covered subgraph, all mobile objects in the subgraph can be directly determined as part of the query result without calculating the exact shortest distance from all mobile objects in the subgraph to the query point. Then, only the partially covered subgraph is internally explored and the subgraph where the query point is located is processed according to the location of the query point, so as to calculate the final query result. Compared with other prior arts, the present invention can directly determine the subgraph that is completely covered by the query range, avoids internal exploration of the subgraph that is completely covered by the query range, and thus realizes a fast search for mobile objects in the specified range.
[0051] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0053] Figure 1 This is a schematic diagram of Figure G before it is divided into sub-figures according to the first embodiment of the present invention;
[0054] Figure 2 It is a schematic diagram of Figure G being divided into three sub-figures according to the first embodiment of the present invention;
[0055] FIG3 is a schematic diagram of a process of dividing a subgraph SG1 according to a first embodiment of the present invention, wherein bold vertices are boundary vertices and non-bold vertices are internal vertices;
[0056] FIG3( a ) is a schematic diagram of the state change of the extended subgraph SG1 when a vertex and its necessary adjacent edges are added according to the first embodiment of the present invention;
[0057] FIG3(b) is a schematic diagram of the state change of the extended subgraph SG1 when a vertex and its necessary adjacent edges are added on the basis of FIG3(a) according to the first embodiment of the present invention;
[0058] FIG3(c) is a schematic diagram of the state change of the extended subgraph SG1 when a vertex and its necessary adjacent edges are added on the basis of FIG3(b) according to the first embodiment of the present invention;
[0059] FIG3(d) is a schematic diagram of the state change of the extended subgraph SG1 when a potential edge is added based on FIG3(c) according to the first embodiment of the present invention;
[0060] FIG3(e) is a schematic diagram of the state change of the extended subgraph SG1 when a potential edge is added on the basis of FIG3(d) according to the first embodiment of the present invention;
[0061] Figure 4 For the first embodiment of the present invention, Figure 2 On this basis, a graph G with moving objects and query point information is added;
[0062] Figure 5 The skeleton graph G after extracting the boundary vertices in the first embodiment of the present invention is shown in FIG. s ;
[0063] Figure 6 In the first embodiment of the present invention, the edge where the query point is located is added to the skeleton graph G s The skeleton graph G s ′. DETAILED DESCRIPTION
[0064] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0065] It should be noted that in the embodiments of the present invention, data related to mobile objects in a specified area of a road network and the like, when the above embodiments of the present invention are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0066] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "include" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or their combinations;
[0067] Embodiment 1:
[0068] The existing mobile object range query problem based on road network is mapped to the mobile object range query problem based on graph G. This problem refers to given a graph G, a mobile object set O and a range query q(v q , d q ), find a set of mobile objects R that satisfies Then R is the query result of range query q. q is the query point. In this embodiment, the query is determined according to the actual task. q is the query distance, SD(o,v q ) represents the moving object o and the query point v q The shortest distance in the graph G. For ease of description, the query point v in the graph G is q Centered, d q The coverage of the query distance is defined as the query range C of q q If SD(o,v q )≤d q , then the mobile object o is said to be within the query range C q cover.
[0069] In view of the problem that the existing range query algorithm is difficult to directly determine the subgraph that is completely covered by the query range without searching the vertices and edges inside the subgraph. Embodiment 1 of the present invention provides a method for quickly searching for mobile objects in a specified area of a road network, which can avoid internal exploration of the subgraph that is completely covered by the query range to achieve efficient query. Among them, internal exploration refers to calculating the shortest distance from each mobile object in the subgraph to the query point to determine whether the mobile object is within the query range.
[0070] The method specifically comprises the following steps:
[0071] S1: Construct the road network as a graph G.
[0072] In this embodiment, each intersection is regarded as a vertex on the graph G, the road sections between the intersections are regarded as edges between corresponding vertices, and the lengths of the road sections between the intersections are regarded as the weights of the edges.
[0073] S2: Map the moving objects in the road network to the edges of the graph G and move along the edges of the graph.
[0074] In this embodiment, a person or a car moving along the road network is regarded as a moving object.
[0075] S3: Divide the graph G into multiple subgraphs with boundary constraint properties. Each subgraph has a boundary constraint property, so that the corresponding subgraph can be directly determined whether it is covered by the query range.
[0076] S4: Construct a two-layer index structure based on the partitioned subgraph.
[0077] S5: Query the set of moving objects within the specified query range based on the double-layer index structure.
[0078] A method for quickly searching for people and vehicles in a specified area of a road network, including:
[0079] S1: Construct the road network as a graph G; that is, consider each intersection as a vertex on the graph, the road sections between intersections as edges between corresponding vertices, and the length of the road sections between intersections as the weight of the edge;
[0080] S2: Map the moving objects in the road network to the edges of the graph G and move along the edges of the graph;
[0081] S3: Divide the graph G into multiple subgraphs, and each subgraph has a boundary constraint property, so that the corresponding subgraph can be directly determined whether it is covered by the query range;
[0082] S4: Building a two-layer index structure based on the partitioned subgraph;
[0083] S5: Query the set of moving objects within the specified query range based on the double-layer index structure.
[0084] As one or more embodiments, the S3: divide the graph G into multiple subgraphs, for example Figure 1 The graph G shown is divided into Figure 2 The three subgraphs shown in the figure have boundary constraints, so that the corresponding subgraph can be directly determined whether it is covered by the query range; the specific steps include:
[0085] S31: Create a set S v , set S v Used to store seed vertices. In the initial state, a vertex in the graph G is randomly selected as the seed vertex and put into the set S. v ; A seed vertex refers to a boundary vertex in a subgraph that has at least one adjacent edge that is not covered by the subgraph;
[0086] S32: From the set S v Randomly pick a seed vertex v s As the starting vertex of a subgraph to be divided; the subgraph to be divided is called the extended subgraph SG f ;
[0087] S33: Expand subgraph SG f Add vertices to
[0088] S34: Expand subgraph SG f Add potential edges; where a potential edge refers to two vertices that are already in the extended subgraph SG f The edge in
[0089] S35: Extended subgraph SG f The partition is completed, and the extended subgraph SG of the partition is completed f It is called subgraph SG f ;
[0090] S36: Subgraph SGf The unallocated boundary vertices in the set S are stored as seed vertices. v Among them, a boundary vertex is a vertex that has at least one adjacent edge that is not bounded by the subgraph SG. f Covered vertices; unallocated border vertices are border vertices that have at least one adjacent edge that does not belong to any subgraph. In addition, the subgraph SG f The vertices other than the boundary vertices are called internal vertices, that is, all adjacent edges are covered by the subgraph SG f covered vertices;
[0091] S37: Delete set S v All unassigned adjacent edges in the original are added to the subgraph SG f The seed vertices in ; where unassigned edges refer to edges that do not belong to any subgraph;
[0092] S38: Repeat steps S32-S37 to continue constructing the next subgraph until the set S v When it is empty, it ends.
[0093] Further, the S33: extending the subgraph SG f Add vertices in ; the specific implementation method is:
[0094] S331: From the seed vertex v s Start using Dijkstra's algorithm to traverse the vertex v to be assigned in graph G i ; Among them, the vertex to be assigned refers to the vertex in the graph G that has at least one adjacent edge that does not belong to any subgraph.
[0095] S332: Assume that the currently traversed vertex v i Through its necessary adjacent edge e i,j Add to extended subgraph SG f Then update the extended subgraph SG f The boundary vertices in i,j It refers to the connection vertex v i and the extended subgraph SG f There is already a vertex v in j The edge of the vertex v j At the seed vertex v s To the vertex v i The shortest path SP(v s , v i ) on the top; and the seed vertex v s and the vertex v being processed i are considered as boundary vertices.
[0096] S333: Calculate the extended subgraph SG f For each existing boundary vertex vb The outer and inner boundaries of b The outer boundary refers to the boundary vertex v b To the extended subgraph SG f The maximum value among the shortest distances of other boundary vertices in the vertex v b The outer boundary of b ); boundary vertex v b The internal boundary refers to the boundary vertex v b To the extended subgraph SG f The maximum value of the shortest distances between all internal vertices and their farthest points, the boundary vertex v b The internal boundary of b ); an internal vertex is one whose all adjacent edges are covered by the subgraph SG f Covered vertices.
[0097] The farthest point is defined as follows: In a given subgraph SG i For a boundary vertex v b and an edge e i,j , if from the boundary vertex v b To the vertex v i The shortest path from the boundary vertex v b To the vertex v j The shortest path does not contain edge e i,j , then at the edge i,j Satisfy SD(v b , v i )+w i,p =SD(v b , v j )+w j,p Point p b is the boundary vertex v b On the side i,j The farthest point on b (dis,e i,j ), where w i,p and w j,p They are respectively i,j Upper point p b To the vertex v i and v j The distance of the boundary vertex v b The farthest point p b To the boundary vertex v b The shortest distance;
[0098] S334: If the subgraph SG is extended f If the boundary constraint property is satisfied, then the vertex v i and its necessary adjacent edge ei,j The addition is valid and complete; otherwise, cancel the vertex v i and the necessary adjacent edges e i,j The addition of boundary constraints refers to any subgraph SG i Each boundary vertex v in b All satisfy EB(v b )≥IS(v b );
[0099] S335: Repeat steps S331-S334 until the subgraph SG is expanded. f The number of vertices in reaches the threshold θ, or no vertices can be added to the extended subgraph SG due to the nature of the boundary constraints. f , or there is no vertex to be assigned in the graph, stop traversal.
[0100] In this embodiment, the set S v Take the vertex v1 as the seed vertex of the extended subgraph SG1 as an example. As shown in Figure 3(b), at this time, vertex v3 and its necessary adjacent edges e 1,3 , vertex v2 and its necessary adjacent edges e 2,3 According to the steps S332-S334, the vertex v4 and its necessary adjacent edges e are added to the extended subgraph SG1. 3,4 : As shown in Figure 3(c), assume that the currently traversed vertex v4 can be connected to its necessary adjacent edges e 3,4 Add to the extended subgraph SG1, then update the boundary vertices in the extended subgraph SG1; among them, the necessary adjacent edges e 3,4 It refers to the edge connecting vertex v4 and the existing vertex v3 in the extended subgraph SG1, and vertex v3 is on the shortest path SP(v1, v4) from seed vertex v1 to vertex v4; and the seed vertex v1 and the vertex v4 being processed are both considered boundary vertices; calculate each existing boundary vertex v in the extended subgraph SG1 b If the extended subgraph SG1 satisfies the boundary constraint property, then vertex v4 and its necessary adjacent edge e 3,4 The addition is valid and complete; otherwise, remove vertex v4 and the necessary adjacent edge e 3,4 Repeat the above steps until the number of vertices in the extended subgraph SG1 reaches the threshold θ or no vertices can be added to the extended subgraph SG1 due to the nature of the boundary constraint, then stop traversal and set the threshold θ=4.
[0101] Furthermore, the S332: Assume that the currently traversed vertex v i and its necessary adjacent edge e i,j Add to extended subgraph SG fThen update the extended subgraph SG f The boundary vertices in ; the specific implementation method is:
[0102] S3321: Vertex v i Set as boundary vertex;
[0103] S3322: Vertex v i and its necessary adjacent edge e i,j Add extended subgraph SG f After that, if the vertex v i The adjacent vertex v j All adjacent edges of the extended subgraph SG f If included, then the vertex v j Set as an internal vertex, otherwise, vertex v j It is still a boundary vertex.
[0104] In this embodiment, taking the attempt to add vertex v4 as an example, vertex v4 is set as a boundary vertex. Vertex v4 and its necessary adjacent edges e 3,4 After being added to the extended subgraph SG1, if all the adjacent edges of vertex v3 of vertex v4 are included in the extended subgraph SG1, vertex v3 is set as an internal vertex, otherwise, vertex v3 is still a boundary vertex.
[0105] Furthermore, the S333: calculating the extended subgraph SG f For each existing boundary vertex v b The internal and external boundaries of ; the specific implementation method is:
[0106] S3331: To expand the subgraph SG f Create an m×m distance matrix D, which is used to store the extended subgraph SG f Each boundary vertex and the extended subgraph SG f The shortest distance between any vertices in D a,b Store vertex v i and v j The shortest distance between SD(v i , v j ); the distance matrix D is initialized to contain only the seed vertex v s ; where m refers to the extended subgraph SG f The number of vertices in , and m increases with the addition of new vertices; a and b refer to the vertex v i and v j When a boundary vertex becomes an internal vertex, delete the internal vertex in the distance matrix D to the subgraph SG f The shortest distance to any vertex in ;
[0107] S3332: Vertex vi Insert into the distance matrix D;
[0108] S3333: Calculate vertex v i To the extended subgraph SG f Update the internal and external boundaries of each existing boundary vertex in the extended subgraph according to the shortest distance between the existing vertices;
[0109] S3334: Vertex v i (boundary vertex) internal boundary IB(v i ) is set to Max{SD(v i , v n )}, external boundary EB(v i ) is set to Max{SD(v i , v b )}; where v n refers to the extended subgraph SG f Any internal vertex in b refers to the extended subgraph SG f Any boundary vertex in; and if the extended subgraph SG f If there is no internal vertex in , then the subgraph SG is expanded f Any inner boundary vertex v b The internal boundary IB(v b ) are all 0;
[0110] S3335: Extended subgraph SG f Except for vertex v i Each existing boundary vertex v except b The internal boundary IB(v b ) and the external boundary EB(v b ) are updated to Max{SD(v b , v n )} and Max{SD(v b , v b ′)}; where v b ′ refers to the extended subgraph SG f Except for the border vertex v b Other boundary vertices other than .
[0111] In this embodiment, taking the extended subgraph SG1 as an example, an m×m distance matrix D is created. When the distance matrix D is initialized, it only contains the seed vertex v1. Vertex v4 is inserted into the distance matrix D; the distance from vertex v4 to the extended subgraph SG i The internal boundary IB(v4) of vertex v4 (boundary vertex) is set to Max{SD(v4,v n)}, the outer boundary EB(v4) is set to Max{SD(v4,v b )}.
[0112] Furthermore, the S3333: calculate vertex v i To the extended subgraph SG f The shortest distance of the existing vertices in the . The specific steps are:
[0113] S33331: Vertex v i To its adjacent vertex v j The shortest distance SD(v i , v j ) is set to w i,j ;
[0114] S33332: will be from vertex v i To the extended subgraph SG f Another vertex inside The shortest distance SD(v i , v h ) is set to w i,j +SD(v j , v h ), where SD(v j , v h ) has been stored in the extended subgraph SG f In the distance matrix D;
[0115] S33333: Repeat S33332 until vertex v is obtained i To the extended subgraph SG f The shortest distance to all existing vertices in .
[0116] In this embodiment, the vertex v4 is calculated to the extended subgraph SG i As an example, let the shortest distance SD(v3, v4) from vertex v4 to its adjacent vertex v3 be w. 3,4 ; will go from vertex v4 to another vertex in the extended subgraph SG1 The shortest distance SD(v4,v h ) is set to w 3,4 +SD(v3,v h ); where SD(v3,v h ) has been stored in the distance matrix D of the extended subgraph SG1; repeat the above steps until the shortest distance from vertex v4 to all existing vertices in the extended subgraph SG1 is obtained.
[0117] As shown in Figure 3(c), suppose that the currently traversed vertex v4 and its necessary adjacent edges e 3,4When added to the extended subgraph SG1, vertex v4 becomes a boundary vertex. There is no boundary vertex in the extended subgraph SG1 because vertex v4 and its necessary adjacent edge e 3,4 Add it as an internal vertex. Insert vertex v4 into the distance matrix D, and calculate SD(v4, v1) = 6 + 6 = 12, SD(v4, v2) = 6 + 5 = 11, SD(v4, v3) = 6. At this time, since there are no internal vertices and farthest points in the extended subgraph SG1, the internal boundary of each boundary vertex is 0. The external boundary of each boundary vertex is updated to EB(v1) = 12, EB(v2) = 11, EB(v3) = 6, EB(v4) = 12 respectively. The extended subgraph SG1 satisfies the boundary constraint property, then the vertex v4 and its necessary adjacent edge e 3,4 The extended subgraph SG1 is successfully added. At this point, since the number of vertices in the extended subgraph SG1 has reached the threshold θ=4, potential edges are added next.
[0118] Figure 3(a), Figure 3(b), and Figure 3(c) show the addition of vertex v3 and its necessary adjacent edge e respectively. 1,3 , vertex v2 and its necessary adjacent edges e 2,3 , vertex v4 and its necessary adjacent edge e 3,4 The state of the extended subgraph SG1 changes when . The bold vertices in the graph are boundary vertices, and the non-bold vertices are internal vertices. If there are no internal vertices in the extended subgraph, the internal boundary of any boundary vertex in the extended subgraph is assumed to be 0.
[0119] Furthermore, the step S34: extending the subgraph SG f Add potential edges in ; the specific implementation method is:
[0120] S341: Set P e The potential edges in are arranged in ascending order according to their weights; among them, the set P e is the set of all potential edges;
[0121] S342: Set P e The potential edges in are added to the extended subgraph SG in sequence f middle.
[0122] Furthermore, the step S342: set P e The potential edges in are added to the extended subgraph SG in sequence f The specific implementation method is:
[0123] S3421: Try to add potential edge e according to the weight of the potential edge x,y , update vertex v x and v y Status;
[0124] S3422: Update from extended subgraph SG f From any boundary vertex to vertex v x and v y The shortest distance;
[0125] S3423: If the subgraph SG is extended f A boundary vertex v in b To the vertex v x The shortest distance becomes smaller, then check the vertex v x Each adjacent edge of (except edge e x,y ) whether there is a boundary vertex v on b The new farthest point of , and the boundary vertex v b To the vertex v x Each adjacent vertex (except vertex v y ) becomes smaller; vertex v y Similarly;
[0126] S3424: Update boundary vertex v b The internal boundary IB(v b ) and the external boundary EB(v b ), that is, IB(v b )=Max{SD(v b , v n ), dis}, EB(v b )=Max{SD(v b , v′ b )}; where v n refers to the extended subgraph SG f Any internal vertex in v b ′ refers to the extended subgraph SG f Except for the border vertex v b Other boundary vertices other than v b The farthest point to the boundary vertex v b The shortest distance;
[0127] S3425: Repeat steps S3423-S3424 until all the vertices v are processed. x or vertex v y The shortest distance to the boundary vertex becomes smaller;
[0128] S3426: If the vertex v x and v y One or two vertices in the x,y If it becomes an internal vertex, the extended subgraph SG is updated. f The inner and outer boundaries of other boundary vertices in;
[0129] S3427: If the extended subgraph SG f If the boundary constraint property is satisfied, then the potential edge e x,y Can be added to the extended subgraph SG f ; Otherwise, cancel the operations of steps S3421-S3426;
[0130] S3428: Repeat steps S3421-S3427 until there is no extended subgraph SG f Potential edges or sets P that meet the boundary constraint properties e When it is empty, it ends.
[0131] In this embodiment, the set P e Take the potential edges in the extended subgraph SG1 as an example: according to the weight of the edge, try to add potential edge e 2,4 ; Update the status of vertices v2 and v4; Update the shortest distance from any boundary vertex to vertices v2 and v4; If the boundary vertex v b The shortest distance to vertex v2 becomes smaller, then check each adjacent edge of vertex v2 (except edge e 2,4 ) whether there is a boundary vertex v on b The new farthest point of , and the boundary vertex v b Whether the shortest distance to each adjacent vertex of vertex v2 (except vertex v4) becomes smaller; the same is true for vertex v4; update the boundary vertex v b The internal boundary IB(v b ) and the external boundary EB(v b ), repeat the above steps until all the boundary vertices whose shortest distance to vertex v2 or vertex v4 is smaller are processed. If one or both of vertices v2 and v4 are removed due to adding potential edge e 2,4 If the extended subgraph SG1 satisfies the boundary constraint property, the potential edge e 2,4 can be added to the extended subgraph SG1; otherwise, cancel the above operation; repeat the above steps until no potential edge can be added to the extended subgraph SG1 or the set P e When it is empty, it ends.
[0132] Furthermore, the S3421: taking a set P e The potential edge e with the smallest weight currently x,y , try adding potential edge e x,y , update vertex v x and v y The specific steps are:
[0133] S34211: Assume that the potential edge e x,y Can be added to the extended subgraph SGf Then the potential edge e x,y Add to extended subgraph SG f After that, if the vertex v x All adjacent edges of are expanded subgraph SG f Cover, then vertex v x becomes an internal vertex; otherwise, vertex v x It is still a boundary vertex; the opposite vertex v y The same applies to the treatment of .
[0134] In this embodiment, according to the weight of the edge, try to add potential edge e 2,4 ; Update the states of vertices v2 and v4: Assume that the potential edge e 2,4 can be added to the extended subgraph SG1, then the potential edge e 2,4 After being added to the extended subgraph SG1, if all the adjacent edges of vertex v2 are covered by the extended subgraph SG1, vertex v2 becomes an internal vertex; otherwise, vertex v2 remains a boundary vertex; the same applies to vertex v4.
[0135] Further, the S3422: updating the extended subgraph SG f From any boundary vertex to vertex v x and v y The shortest distance; the specific steps are:
[0136] S34221: For extended subgraph SG f Any boundary vertex v in b , the boundary vertex v b To the vertex v x The shortest distance SD(v b , v x ) is set to Min{SD(v b , v x ), {SD(v b , v y )+wx, y )}; Similarly, update any vertex v b To the vertex v y The shortest distance; where SD(v b , v x ) and SD(v b , v y ) before inserting potential edge e x,y Previously stored in the extended subgraph SG f The distance matrix D of .
[0137] In this embodiment, the method of updating the shortest distance from any boundary vertex to vertices v2 and v4 is taken as an example. b, the boundary vertex v b The shortest distance SD(v b , v2) is set to Min{SD(v b , v2), (SD(v b , v4)+w 2,4 )}; Similarly, update any vertex v b The shortest distance to vertex v4; where SD(v b , v2) and SD(v b , v4) inserting potential edge e 2,4 It has been previously stored in the distance matrix D of the extended subgraph SG1;
[0138] Furthermore, the S3423: if the extended subgraph SG f A boundary vertex v in b To the vertex v x The shortest distance becomes smaller, then check the vertex v x Each adjacent edge of (except edge e x,y ) whether there is a boundary vertex v on b The new farthest point of , and the boundary vertex v b To the vertex v x Each adjacent vertex (except vertex v y ) becomes smaller; vertex v y Similarly, the specific steps are:
[0139] S34231: Create a priority queue Q v , the vertex v x The adjacent vertices (except vertex v y ) Join the team;
[0140] S34232: Take out the head vertex v j ;
[0141] S34233: If SD(v b , v j )<SD(v b , v x )+w x,j , then at the edge x,j There will be a boundary vertex v b The new farthest point p b ; Among them, SD(v b , v j ) and SD(v b , v x ) has been stored in the extended subgraph SG f In the distance matrix D;
[0142] S34234: If SD(vb , v j )=SD(v b , v x )+w x,j , then no operation is performed;
[0143] S34235: If SD(v b , v j )>SD(v b , v x )+w x,j , then SD(v b , v j ) is set to SD(v b , v x )+w x,j , and the vertex v j The adjacent vertices (except vertex v x ) into the priority queue Q v middle;
[0144] S34236: Repeat steps S33232-S33235 until the priority queue Q v When it is empty, it ends.
[0145] In this embodiment, a priority queue Q is created. v , add the adjacent vertices of vertex v2 (except vertex v4) to the queue; remove the head vertex v j ; The vertex taken here is v3; if SD(v b , v3)<SD(v b ,v2)+w 2,3 , then at the edge 2,3 There will be a boundary vertex v b The new farthest point p b ; Among them, SD(v b , v3) and SD(v b , v2) has been stored in the distance matrix D of the extended subgraph SG1; if SD(v b , v3) = SD(v b ,v2)+w 2,3 , no operation is performed; if SD(v b , v3)>SD(v b ,v2)+w 2,3 , then SD(v b , v3) is set to SD(v b ,v2)+w 2,3 , and put the adjacent vertices of vertex v3 (except vertex v2) into the priority queue Q v Repeat the above steps until the priority queue Q v When it is empty, it ends.
[0146] Furthermore, the S34233: if SD(v b , v j )<SD(v b , v x )+w x,j , then at the edge x,j There will be a boundary vertex v b The new farthest point p b ; The specific steps are:
[0147] S342331: On the edge x,j Satisfy SD(v b , v j )+w j,p =SD(v b , v x )+w x,p Point p b is the boundary vertex v b On the side x,j The farthest point on b (dis,e x,j ), where w j,p and w x,p They are respectively x,j Upper point p b To the vertex v x and v j The distance of the boundary vertex v b The farthest point p b To the boundary vertex v b The shortest distance;
[0148] S342332: For the boundary vertex v b , if SD(v b , p b )>SD(v b , p′ b ), then the boundary vertex v b The farthest point is updated to p b (dis,e x,y ), where p′ b It means that when p is found b The boundary vertex v recorded previously b The farthest point.
[0149] In this embodiment, at the edge 2,3 Satisfy SD(v b , v3)+w 3,p =SD(v b ,v2)+w 2,p Point p bis the boundary vertex v b On the side 2,3 The farthest point on b (dis,e 2,3 ), where w 3,p and w 2,p They are respectively 2,3 Upper point p b The distance to vertices v2 and v3; dis refers to the boundary vertex v b The farthest point p b To the boundary vertex v b The shortest distance; for the boundary vertex v b , if SD(v b , p b )>SD(v b , p′ b ), then the boundary vertex v b The farthest point is updated to p b (dis,e 2,3 ).
[0150] Set P e The potential edges in are e 2,4 , e 1,2 As shown in Figure 3(d), we try to add potential edge e 2,4 , no vertex in the extended subgraph SG1 becomes an internal vertex. Next, update the shortest distance from any boundary vertex in the extended subgraph SG1 to vertices v2 and v4, that is, SD(v2, v4) = Min{11, 0+5} = 5. For vertex v2, the shortest distance from boundary vertex v4 to vertex v2 becomes smaller, so put vertex v3 of vertex v2 into the priority queue Q v Take out the head vertex v3, then SD(v4, v3)<SD(v4, v2)+w 2,3 , that is, 6<5+5, which means that the edge e 2,3 The new farthest point on the boundary vertex v4. Because SD(v4, v3)+w 3,p =SD(v4,v2)+w 2,p , that is, 6+2=5+3, so the farthest point is recorded as p4(8, e 2,3 ). At this time, the priority queue Q v is empty, then EB(v4)=12, IB(v4)=8. Next, we start to process the boundary vertex v2. Similarly, we can get the boundary vertex v2 on the potential edge e. 3,4 There is a farthest point p2(8,e 3,4 ), then EB(v2)=11, IB(v2)=8. At this time, add the potential edge e 2,4 The extended subgraph SG1 satisfies the boundary constraint property, so the potential edge e 2,4Successfully added to extended subgraph SG1.
[0151] Next, try adding potential edge e 1,2 , as shown in Figure 3(e), due to the potential edge e 1,2 With the addition of , vertex v2 becomes an internal vertex. In addition, there is no shortest distance from any boundary vertex to vertex v1 or v2 due to the potential edge e 1,2 , then directly update the internal and external boundaries of each boundary vertex in the extended subgraph SG1. After the update, it can be seen that the addition of potential edge e 1,2 The extended subgraph SG1 satisfies the boundary constraint property, so the potential edge e 1,2 Successfully added to the extended subgraph SG1. So far, the set P e When it is empty, stop adding potential edges.
[0152] At this point, the partitioning of the extended subgraph SG1 is completed, and vertices v3 and v4 are saved as seed vertices in the set S v The next subgraph can be divided in the following steps. Then, the subgraphs SG2 and SG3 are obtained by dividing the graph G into Figure 2 As shown, in Figure 2 The graph G with moving objects and query point information added is as follows Figure 4 shown.
[0153] As one or more embodiments, the S4: constructing a double-layer index structure based on the divided subgraphs; the specific steps include:
[0154] S41: All sub-graphs divided in step S3 constitute the first layer of the index; Figure 4 As shown, all the divided subgraphs constitute the first layer of the index.
[0155] S42: Extract the boundary vertices of all subgraphs in the first layer. Any pair of boundary vertices v in the same subgraph i and v j The edge e′ i,j connected; due to the vertex pair v i and v j may appear in multiple subgraphs, then edge e′ i,j The weight is reset to vertex v i and v j The minimum value among the shortest distances among the different subgraphs to which it belongs; these boundary vertices and edges constitute the second layer of the index, called the skeleton graph G s ; and this layer records the subgraph to which each boundary vertex belongs. In this embodiment, the skeleton graph G s like Figure 5 shown.
[0156] Furthermore, in step S41, all subgraphs divided in step S3 constitute the first layer of the index; each subgraph SG k The following important information is recorded:
[0157] 1) Subgraph SG k Each edge e i,j The set of moving objects O i,j , moving object set O i,j Record along the edge i,j All moving objects that move;
[0158] 2) Subgraph SG k Each boundary vertex v b The internal boundary IB(v b )、External boundary EB(v b ) and the farthest point p b (dis,e x,y );
[0159] 3) A distance matrix D, recording the subgraph SG k Each boundary vertex in the subgraph SG k The shortest distance to any vertex in .
[0160] In this embodiment, Tables 1, 2, and 3 respectively give the shortest distance information from the boundary vertex to any vertex in the subgraph recorded in the first layer of the double-layer index structure of the subgraphs SG1, SG2, and SG3:
[0161] Table 1. The shortest distance information from the boundary vertices v1, v3, v4 to any vertex in the subgraph recorded in the first layer of the double-layer index structure of subgraph SG1.
[0162]
[0163]
[0164] It can be seen from the table that EB(v1)=12, IB(v1)=11, EB(v3)=6, IB(v3)=5, EB(v4)=12. 2,3 ), then IB(v4)=8.
[0165] Move the object list to O 1,3 ={o1(v1,2)},O 3,4 ={o2(v3,3)},O 2,4 ={o3(v2,2)}.
[0166] Table 2. The shortest distance information from the boundary vertices v3, v5, v6, and v4 to any vertex in the subgraph recorded in the first layer of the double-layer index structure of subgraph SG2.
[0167] <![CDATA[SG2]]> <![CDATA[V3]]> <![CDATA[V5]]> <![CDATA[V6]]> <![CDATA[V4]]> <![CDATA[V3]]> 0 7 11 12 <![CDATA[V5]]> 7 0 4 5 <![CDATA[V6]]> 11 4 0 9 <![CDATA[V4]]> 12 5 9 0
[0168] It can be seen from the table that EB(v3)=12, EB(v4)=12, EB(v5)=7, and EB(v6)=11.
[0169] Move the object list to O 3,5 ={o4(v3,3)},O 4,5 ={o5(v4,2)}.
[0170] Table 3. The shortest distance information from the boundary vertices v5 and v6 to any vertex in the subgraph recorded in the first layer of the double-layer index structure of subgraph SG3.
[0171] <![CDATA[SG2]]> <![CDATA[V5]]> <![CDATA[V7]]> <![CDATA[V8]]> <![CDATA[V6]]> <![CDATA[V5]]> 0 6 9 11 <![CDATA[V6]]> 11 5 2 0
[0172] It can be seen from the table that EB(v5)=11, IB(v5)=9, EB(v6)=11, IB(v6)=5.
[0173] Move the object list to O 5,7 ={o6(v5,3)},O 7,8 ={o7(v7,2)}.
[0174] As one or more embodiments, S5: querying a set of mobile objects within a specified query range based on a double-layer index structure; the specific steps include:
[0175] S51: For a given range query q(v q , d q ), according to the skeleton graph G s Identify candidate subgraphs; where the candidate subgraph refers to the query range C q Fully covered or partially covered subgraphs;
[0176] S52: Process the candidate subgraphs to efficiently search for subgraphs in the query range C in these candidate subgraphs. q A collection of moving objects within.
[0177] In this embodiment, Figure 4 As shown, given a range query q(v q , d q ), where the query point v q On the side 1,2 Up, d q =21, and the query point v q The distances to vertices v1 and v2 are 4 and 7 respectively; the range query q(v q , 21) as an example, the set of mobile objects within the query range is queried based on the double-layer index structure.
[0178] Further, the S51: for a given range query q(v q , d q ), according to the skeleton graph G s Identify candidate subgraphs; the specific implementation method is:
[0179] S511: query point v q The side e l,r Add to skeleton graph G s middle;
[0180] S512: From query point v q Start traversing the skeleton graph G′ using Dijkstra’s algorithm s to identify the queried range C q Covered vertices; where G′ s It means adding query point v q The skeleton diagram behind the edge;
[0181] S513: Classify the candidate subgraphs.
[0182] Furthermore, the step S511: query point v q The side e l,r Add to skeleton graph G s The specific steps are:
[0183] S5111: Vertex v l and vertex v r Add to skeleton graph G s In the skeleton graph G s Add the vertex v l To query point v q Subgraph SG q Each boundary vertex v b The weight of each new edge is reset to vertex v l To subgraph SG q Each boundary vertex v b The shortest distance of vertex v r The same applies to adding ;
[0184] S5112: With edge e l,r Connect vertices v l and vertex v r .
[0185] In this embodiment, the query point v q The side e 1,2 Add to skeleton graph G s Take the example in the following example. Add vertices v1 and v2 to the skeleton graph G. s In the skeleton graph Gs Add a link from vertex v2 to query point v q Each boundary vertex v in the subgraph SG1 b The weight of each new edge is reset to vertex v2 to each boundary vertex v in subgraph SG1. b The shortest distance; the addition of vertex v1 is the same; with edge e 1,2 Connect vertices v1 and v2; query point v q Add to skeleton graph G s The skeleton graph G′ s like Figure 6 shown.
[0186] Further, the S512: from the query point v q Start traversing the skeleton graph G′ using Dijkstra’s algorithm s to identify the queried range C q Covered vertices; the specific steps are:
[0187] S5121: If the skeleton graph G′ s From a vertex in to the query point v q If the shortest distance of has been identified, the vertex is marked as "processed"; otherwise, the vertex is marked as "unprocessed"; in the initial state, all vertices are marked as "unprocessed";
[0188] S5122: Create a priority queue Q for query q v , priority queue Q v Used to store the current query point v q The distance between the vertices is not infinite, the priority queue Q v According to each current vertex to the query point v q The distance is stored in ascending order, the priority queue Q v Initialized to query point v q All adjacent vertices of v The adjacent vertices in are initialized to vertex v1 and vertex v2.
[0189] S5123: Create set V for query q p , set V p Used to store query points v q The processed vertices of p Initialized to empty; finally set V p The skeleton graph G s ′ to the query point v q The shortest distance is no more than d q The vertex of
[0190] S5124: Set the query point v qThe shortest distance to its non-adjacent vertex is set to infinity, denoted as ∞;
[0191] S5125: Set the query point v q To its adjacent vertex v l and v r The distances are set as w l,q and w r,q ; Among them, w l,q and w r,q They refer to the edge e l,r Upper query point v q To its adjacent vertex v l and v r distance;
[0192] S5126: Get priority queue Q v The head vertex v f ; If SD(v q , v f )≤d q , then process vertex v f ; Otherwise, do not process vertex v f ;
[0193] S5127: Repeat step S5126 until the priority queue Q v Empty or skeleton graph G′ s After being completely traversed, it ends.
[0194] In this embodiment, the query point v q The adjacent vertices are v1 and v2. q The distances to its adjacent vertices v1 and v2 are set to w 1,q and w 2,q , d q is 21.
[0195] Furthermore, the S5126: processing vertex v f The specific steps are:
[0196] S51261: For vertex v f An unprocessed adjacent vertex v j , if SD(v q , v j )>SD(v q , v f )+w f,j , then SD(v q , v j )=SD(v q , v f )+w f,j ;
[0197] S51262: Vertex v j Put it into the priority queue Q v ;
[0198] S51263: Repeat steps S51261-S51262 until the vertex v is updated. f Each unprocessed adjacent vertex to the query point v q The shortest distance;
[0199] S51264: Vertex v f Add to set V p , and the vertex v f Mark as processed.
[0200] In this embodiment, taking the first head vertex v1 as an example, for an unprocessed adjacent vertex v1 j , if SD(v q , v j )>SD(v q ,v1)+w 1,j , then SD(v q , v j )=SD(v q ,v1)+w 1,j ; Set the vertex v j Put it into the priority queue Q v Repeat the above steps until all unprocessed adjacent vertices of vertex v1 are updated to the query point v q The shortest distance; put vertex v1 into set V p , and marks vertex v1 as processed.
[0201] Furthermore, the S513: classifying the candidate subgraphs; the specific steps are:
[0202] S5131: If at least one boundary vertex in a subgraph is included in the set V p If it contains, then the subgraph is a candidate subgraph; all such subgraphs are candidate subgraphs;
[0203] S5132: If all boundary vertices in a candidate subgraph are included in the set V p Contains, and the subgraph has at least one boundary vertex v b Satisfy SD(v q , v b )+EB(v b )≤d q , then the candidate subgraph is called a completely covered subgraph; all such subgraphs are completely covered subgraphs; otherwise, the candidate subgraph is called a partially covered subgraph, denoted by SG p ; All such subgraphs are partially covered subgraphs;
[0204] S5133: Query point v q The subgraph where it is located is called the root subgraph, denoted by SG q .
[0205] In this embodiment, taking candidate subgraphs SG1, SG2 and SG3 as examples, if all boundary vertices in a candidate subgraph are included in the set V p Contains, and the subgraph has at least one boundary vertex v b Satisfy SD(v q , v b )+EB(v b )≤d q , then the candidate subgraph is called a fully covered subgraph; all such subgraphs are fully covered subgraphs, namely subgraph SG2; otherwise, the candidate subgraph is called a partially covered subgraph, denoted by SG p ; All such subgraphs are partially covered subgraphs; that is, subgraph SG3; query point v q The subgraph where it is located is called the root subgraph, denoted by SG q , that is, subgraph SG1.
[0206] Furthermore, the specific steps of S52: processing candidate subgraphs are as follows:
[0207] S521: Process the fully covered subgraph, that is, add all mobile objects in each fully covered subgraph to the query result set R q In this embodiment, all mobile objects in subgraph SG2 are added to the query result set R q
[0208] S522: Processing a partially covered sub-graph;
[0209] S523: Process the root subgraph.
[0210] Furthermore, the specific steps of S522: processing a partially covered sub-graph are as follows:
[0211] S5221: For ease of understanding, for each partially covered subgraph SG p , with B p Represents a partially covered subgraph SG p V p Included boundary vertices;
[0212] S5222: For any one on edge e x,y Moving object o on i , from the query point v q To move object o i The shortest path SP(v q , o i ) will definitely pass through Bp A boundary vertex in p The shortest path SP(v q , o i )'s shortest distance SD(v q , o i );
[0213] S5223: Repeat step S5222 until the partially covered subgraph SG is processed p Moving objects on each edge of ;
[0214] S5224: Repeat steps S5221-S5223 until all partially covered sub-graphs are processed.
[0215] In this embodiment, the partially covered sub-graph processed is sub-graph SG3.
[0216] Further, the S5222: for any one on edge e x,y Moving object o on i , calculated through B p The shortest path SP(v q , o i )'s shortest distance SD(v q , o i ); the specific steps are:
[0217] S52221: For B p A boundary vertex v in b , SD(v q , o i )=Min{SD(v q , v b )+SD(v b , v x )+dis(v x , o i ), SD(v q , v b )+SD(v b , v y )+dis(v y , o i )}; where dis(v x , o i ) and dis(v y , o i ) refer to the edge e x,y Move object o up i To the vertex v x and vertex v y Distance; SD(v b , v x) and SD(v b , v y ) has been stored in the partially covered subgraph SG p In the distance matrix D of SD(v q , v b ) has been traversing the skeleton graph G′ s Time calculation;
[0218] S52222: Repeat step S52221 to calculate the p The shortest path SP(v q , o i )'s shortest distance SD(v q , o i );
[0219] S52223: During step S52222, if SD(v q , o i )≤d q , then move the object o i Add query result set R q , and stop calculating after B p The shortest path SP(v q , o i )'s shortest distance SD(v q , o i );
[0220] S52224: If you pass B p The shortest path SP(v q , o i )'s shortest distance SD(v q , o i ) are greater than d q , then the object o will not be moved i Add query result set R q ;
[0221] S52225: Repeat steps S52221-S52224 until edge e is processed x,y All moving objects on the
[0222] In this embodiment, Figure 4 Located at the edge 5,7 Take the moving object o6 on B as an example. p A boundary vertex v in b , SD(v q , o6) = Min{SD(v q , v b )+SD(v b, v5)+dis(v5,o6),SD(v q , v b )+SD(v b , v7)+dis(v7, o6)}; where dis(v5, o6) and dis(v7, o6) refer to the edges e 5,7 The distance from object o6 to vertex v5 and vertex v7; SD(v b , v5) and SD (v b , v7) has been stored in the distance matrix D of the partially covered subgraph SG3; SD(v q , v b ) has been traversing the skeleton graph G′ s Repeat the above steps to calculate the time after B p The shortest path SP(v q , o6) the shortest distance SD(v q , o6);
[0223] In the process of repeating the above steps, if SD(v q , o6)≤21, then add the moving object o6 to the query result set R q , and stop calculating after B p The shortest path SP(v q , o6) the shortest distance SD(v q , o6); if through B p The shortest path SP(v q , o6) the shortest distance SD(v q , o6) are both greater than 21, then the moving object o6 is not added to the query result set R q ;
[0224] Repeat the above steps until edge e is processed. 5,7 All moving objects on the
[0225] Furthermore, the step S523: processing the root subgraph is divided into two cases:
[0226] Case 1: Query point v q The side e l,r The vertices v at both ends l and v r are all boundary vertices; the specific processing steps in this case are:
[0227] S52311: If the set V p Contains the root subgraph SG q All boundary vertices in the root subgraph SG qAll moving objects in the query result set R are added q ;
[0228] S52312: If the set V p Does not contain the root subgraph SG q All boundary vertices in the root subgraph SG q is considered as a partially covered subgraph, and the root subgraph SG is processed according to step S522 q ;
[0229] Case 2: Query point v q The side e l,r The vertices v at both ends l and v r There is at least one internal vertex; the specific processing steps in this case are:
[0230] S52321: SG the root subgraph q All edges in are marked as “unprocessed”;
[0231] S52322: traverse the root subgraph SG according to step S512 q , to obtain the root subgraph SG q The queried range C q The set of covered vertices V′ p ;
[0232] S52323: For each edge traversed in step S52322, add all mobile objects located on this edge to the query result set R q , and mark these edges as “processed”;
[0233] S52324: For a set whose one or two vertices are in the set V′ p The edge e in the middle and "unprocessed" w,k , processing is located at edge e w,k Each moving object o on i ;
[0234] S52325: Repeat step S52324 until the root subgraph SG q There is no such a set that one or both of its vertices are in the set V′ p After the "unprocessed" edges are found, the process ends.
[0235] In this embodiment, case 1: query point v q The side e 1,2 The vertices v1 and v2 at both ends are boundary vertices; Case 2: Query point v q The side e 1,2 The two end vertices v1 and v2 have at least one internal vertex.
[0236] Further, the S52324: for a set whose one or two vertices are in the set V′ p The edge e in the middle and "unprocessed" w,k , processing is located at edge e w,k Each moving object o on i ; The specific steps are:
[0237] S523241: For edge e w,k Any moving object o on i , SD(v q , o i )=Min{SD(v q , v w )+dis(v w , o i ), SD(v q , v k )+dis(v k , o i )}; where dis(v w , o i ) and dis(v k , o i ) refer to the edge e w,k Move object o up i To the vertex v x and vertex v y distance;
[0238] S523242: If SD(v q , o i )≤d q , then move the object o i Add query result set R q ;
[0239] S523243: If SD(v q , o i )>d q , then the object o will not be moved i Add query result set R q ;
[0240] S523244: Repeat steps S523241-S523243 until edge e is processed w,k All moving objects on the edge e w,k Mark as processed.
[0241] In this embodiment, Figure 4 Located at the edge 3,4 Take the mobile object o2 on the edge as an example, the specific processing method is: for edge e 3,4 A moving object o2 on theq , o2) = Min{SD(v q , v3)+dis(v3,o2),SD(v q , v4)+dis(v4, o2)}; where dis(v3, o2) and dis(v4, o2) refer to the edges e 3,4 The distance that object o2 is moved to vertex v3 and vertex v4. If SD(v q , o2)≤21, then add the moving object o2 to the query result set R q ; If SD(v q , o2)>21, then the moving object o2 is not added to the query result set R q ; Repeat the above steps until edge e is processed 3,4 All moving objects on the edge e 3,4 Mark as processed.
[0242] The query point v q The side e 1,2 Add to skeleton graph G s In this case, we add vertex v2 and edge e. 2,1 、e 2,3 、e 2,4 , the weights are 11, 5, 5 respectively, the skeleton graph G′ after processing s like Figure 6 As shown. Next, we start traversing the skeleton graph G′ s . In the initial state, the priority queue Q v Contains vertices v1 and v2, the set V p Is empty, query point v q The distances to vertices v1 and v2 are 4 and 7 respectively. The query point v q To the skeleton graph G′ s The shortest distances of other vertices in are set to infinity. First, vertex v1 is processed. For the unprocessed adjacent vertex v3 of vertex v1, since SD(v q , v3)>SD(v q ,v1)+w 1,3 , then SD(v q , v3) = 4 + 6 = 10; the processing of other unprocessed adjacent vertices v2 and v4 of vertex v1 is similar, and SD(v q , v2)=7,SD(v q , v4)=16; put vertices v3 and v4 into the priority queue Q in sequence v , and put vertex v1 into set V p ; Next, process vertices v2, v3, v4, v5, and v6 in turn, and update SD(v q , v2)=7,SD(vq , v3)=10,SD(v q , v4)=12,SD(v q , v5)=17,SD(v q , v6) = 21. At this time, the priority queue Q v Is empty, stop traversing the skeleton graph G′ s .
[0243] At this time, the set V p contains vertices v1, v2, v3, v4, v5, and v6, then subgraphs SG1, SG2, and SG3 are all candidate subgraphs. q In subgraph SG1, subgraph SG1 is the root subgraph; set V p contains vertices v3, v4, v5, and v6, and SD(v q , v3)+EB(v3)≤21, then subgraph SG2 is a completely covered subgraph; the boundary vertices in subgraph SG3 are all in the set V p Included, but SD(v q , v5)+EB(v5)>21,SD(v q ,v6)+EB(v6)>21, so subgraph SG3 is a partially covered subgraph.
[0244] Because subgraph SG2 is a completely covered subgraph, objects o4 and o5 are directly moved to join the query result set R q Next, we process the moving objects in the partially covered subgraph SG3, then B p The boundary vertices in are v5 and v6; Figure 4 As shown, the mobile object o6 is located at edge e 5,7 On, then SD(v q , o6) = Min{SD(v q , v5)+SD(v5, v5)+dis(v5, o6), SD(v q , v5)+SD(v5, v7)+dis(v7, o6)}={17+0+3,17+6+3}=20, because SD(v q , o6)<21, so there is no need to calculate the shortest distance through the boundary vertex v6, and directly add the moving object o6 to the query result set R q Similarly, after calculation, we get the 7,8 Move object o7 to query point v q The shortest distance SD(v q , o7)=24, due to SD(v q , o7)>21, then the moving object o7 is not added to the query result set R q .
[0245] Start processing the root subgraph SG1. Query point v q The side e 1,2 If vertex v2 is an internal vertex, then we traverse the root subgraph SG1, and the traversed edge is e 1,2 , e 1,3 , e 2,4 , then directly add the moving objects o1 and o3 to the query result set R q ; For edge e 3,4 The moving object o2 on the q , o2) = Min{SD(v q , v3)+dis(v3,o2),SD(v q , v4)+dis(v4,o2)}=13, because SD(v q , o2)<21, so the moving object o2 is added to the query result set R q At this point, the range query q(v q , 21) The query results are o1, o2, o3, o4, o5, o6.
[0246] Embodiment 2:
[0247] Embodiment 2 of the present invention provides a system for quickly searching for mobile objects in a specified area of a road network, comprising:
[0248] A graph construction module is configured to construct the road network as a graph; each intersection is regarded as a vertex on the graph, the road segments between the intersections are regarded as edges between corresponding vertices, and the lengths of the road segments between the intersections are regarded as weights of the edges;
[0249] A mapping module, configured to map mobile objects in the road network to edges of the graph and move randomly along the edges of the graph;
[0250] The partitioning module is configured to partition a graph into multiple subgraphs with boundary constraint properties; the vertices of each subgraph are divided into boundary vertices and internal vertices, wherein a boundary vertex of a subgraph refers to a vertex with at least one adjacent edge not covered by the subgraph, and an internal vertex of a subgraph refers to a vertex with all its adjacent edges covered by the subgraph. The specific partitioning steps include: creating a set for storing seed vertices, wherein a seed vertex refers to a boundary vertex in a subgraph with at least one adjacent edge not covered by the subgraph, and randomly selecting a vertex in the graph as a seed vertex and putting it into the set in the initial state; randomly taking a vertex from the seed vertex set as the starting vertex of a subgraph to be partitioned; wherein the subgraph to be partitioned is called an extended subgraph; and under the premise of satisfying the boundary constraint property, adding vertices to the current extended subgraph until the number of vertices in the current extended subgraph reaches a specified threshold, or there are no vertices to be allocated in the graph that make the current extended subgraph satisfy the boundary constraint property, wherein the vertices to be allocated refer to vertices in the graph with at least one adjacent edge. The adjacent edges do not belong to the vertices of any subgraph; under the premise of satisfying the boundary constraint property, potential edges are added to the current extended subgraph in order from small to large according to the potential edge weights; among them, potential edges refer to the edges between two adjacent vertices that are already in the current extended subgraph; when all the potential edges of the current extended subgraph have been added or there are no potential edges that make the current extended subgraph meet the boundary constraint property, the partition of the current extended subgraph is completed, and the extended subgraph after the partition is completed is called a subgraph; if the seed vertex set is not empty, randomly select a vertex from the seed vertex set as the starting vertex of the next subgraph to be divided, and iterate in sequence according to the above steps until the seed vertex set is empty, and the partition of all subgraphs is completed;
[0251] An index building module is configured to build a double-layer index structure based on the divided subgraphs;
[0252] The query module is configured to query a set of mobile objects within a specified query range based on a double-layer index structure.
[0253] The steps involved in the above embodiment 2 correspond to those in the method embodiment 1. For the specific implementation method, please refer to the relevant description part of the embodiment 1.
[0254] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A method for searching for mobile objects in a specified area of a road network, characterized in that: The following steps are involved: The road network is constructed as a graph, each intersection is regarded as a vertex on the graph, the road segments between intersections are regarded as edges between corresponding vertices, and the length of the road segments between intersections is regarded as the weight of the edge; Map the moving objects in the road network to the edges of the graph and move randomly along the edges of the graph; A graph is divided into multiple subgraphs with boundary constraint properties, and the vertices of each subgraph are divided into boundary vertices and internal vertices, wherein a boundary vertex of a subgraph refers to a vertex with at least one adjacent edge not covered by the subgraph, and an internal vertex of a subgraph refers to a vertex whose all adjacent edges are covered by the subgraph. The specific division steps include: creating a set for storing seed vertices, wherein a seed vertex refers to a boundary vertex in a subgraph with at least one adjacent edge not covered by the subgraph, and in an initial state, randomly selecting a vertex in the graph as a seed vertex and putting it into the set; randomly taking a vertex from the seed vertex set as the starting vertex of a subgraph to be divided, wherein the subgraph to be divided is called an extended subgraph; under the premise of satisfying the boundary constraint property, adding vertices to the current extended subgraph until the number of vertices in the current extended subgraph reaches a specified threshold, or there are no vertices to be assigned in the graph that make the current extended subgraph satisfy the boundary constraint property. The vertex to be assigned refers to the vertex in the graph that has at least one adjacent edge that does not belong to any subgraph; under the premise of satisfying the boundary constraint property, potential edges are added to the current extended subgraph in order from small to large according to the weight of the potential edges, wherein a potential edge refers to an edge between two adjacent vertices that are already in the current extended subgraph; when all potential edges of the current extended subgraph have been added or there are no potential edges that make the current extended subgraph meet the boundary constraint property, the partition of the current extended subgraph is completed, and the extended subgraph whose partition is completed is called a subgraph; the boundary vertices that have not been assigned in the subgraph are saved as seed vertices in the seed vertex set, and the boundary vertices that have not been assigned refer to the boundary vertices that have at least one adjacent edge that does not belong to any subgraph. If the seed vertex set is not empty, a vertex is randomly taken from the seed vertex set as the starting vertex of the next subgraph to be divided, and the above steps are iterated in sequence until the seed vertex set is empty, and the partition of all subgraphs is completed; A double-layer index structure is constructed based on the divided subgraphs, including: all the divided subgraphs constitute the first layer of the double-layer index structure; the boundary vertices of all the subgraphs in the first layer are extracted, and any pair of boundary vertices in the same subgraph are connected by edges, and these boundary vertices and edges constitute the second layer of the double-layer index structure, and the second layer is also called a skeleton graph; Query the set of mobile objects within the specified query range based on the double-layer index structure; The boundary constraint property is that the external boundary of each boundary vertex in any subgraph is greater than or equal to its internal boundary, wherein the internal boundary of a boundary vertex refers to the maximum value of the shortest distances from the boundary vertex to all internal vertices and any position of each edge in the current extended subgraph; the external boundary of a boundary vertex refers to the maximum value of the shortest distances from the boundary vertex to other boundary vertices in the current extended subgraph.
2. The method for searching for mobile objects in a designated area of a road network as claimed in claim 1, characterized in that: The specific steps to add vertices to the extended subgraph are: Starting from the seed vertex of the current extended subgraph, use the Dijkstra algorithm to traverse the vertices to be allocated in the graph; Assuming that the vertex currently being traversed can be added to the extended subgraph through its necessary adjacent edges, the boundary vertices in the extended subgraph are updated, where the vertex currently being traversed is called the processing vertex, and the necessary adjacent edges refer to the edges connecting the processing vertex and the existing vertices in the extended subgraph, where the seed vertex and the vertex being processed are both regarded as the boundary vertices of the current extended subgraph; Calculate the inner and outer boundaries of each existing boundary vertex in the current extended subgraph; If the current extended subgraph satisfies the boundary constraint property, the addition of the vertex being processed and its necessary adjacent edges is valid and complete, otherwise, the addition of the vertex being processed and the necessary adjacent edges is canceled.
3. The method for searching for mobile objects in a designated area of a road network as claimed in claim 1, characterized in that: The specific steps for calculating the internal and external boundaries of each existing boundary vertex in the current extended subgraph are: Create a distance matrix for the current extended subgraph. The distance matrix is used to store the shortest distance from each boundary vertex in the current extended subgraph to any vertex in the current extended subgraph. Insert the vertex being processed into the distance matrix; Calculate the shortest distance from the vertex being processed to the existing vertices in the current expanded subgraph; Calculate the inner and outer boundaries of each existing boundary vertex in the current extended subgraph based on the shortest distance between existing vertices.
4. The method for searching for mobile objects in a designated area of a road network as claimed in claim 1, characterized in that: The specific steps of adding potential edges to the current extended subgraph in ascending order according to the weight of the potential edges are: Take a potential edge with the smallest weight in the current extended subgraph, try to add it to the current extended subgraph, and update the vertex states of the two end vertices of the potential edge being processed, where the potential edge being tried to be added is called the potential edge being processed, and the two end vertices of the potential edge being processed are respectively called the left vertex and the right vertex; Update the shortest distance from any boundary vertex to the left vertex and the right vertex in the current extended subgraph stored in the distance matrix; If the shortest distance from a boundary vertex to the left vertex in the current extended subgraph becomes smaller, update the shortest distance from the boundary vertex to each adjacent vertex on the left except the right vertex stored in the distance matrix, and update the internal and external boundaries of the boundary vertex; the same applies to the right vertex; Repeat the previous step until all boundary vertices whose shortest distances to the left or right vertices become smaller are processed; If one or both of the left vertex and the right vertex become internal vertices due to processing potential edge addition, update the internal and external boundaries of other boundary vertices in the current expanded subgraph; If the current extended subgraph satisfies the boundary constraints, the addition of the potential edge being processed is valid and complete; otherwise, the addition of the potential edge being processed is canceled.
5. The method for searching for mobile objects in a designated area of a road network as claimed in claim 1, characterized in that: The specific steps for querying the set of mobile objects within the specified query range based on the double-layer index structure are as follows: For a given range query, a candidate subgraph is identified based on the skeleton graph; a candidate subgraph is a subgraph that is completely or partially covered by the query range; The candidate subgraph is processed to query a set of moving objects located within a query range in the candidate subgraph.
6. The method for searching for mobile objects in a designated area of a road network as claimed in claim 5, characterized in that: For a given range query, the specific steps to identify candidate subgraphs based on the skeleton graph are: Add the edge where the query point is located to the skeleton graph; Starting from the query point, use the Dijkstra algorithm to traverse the vertices in the skeleton graph after adding the edge where the query point is located to identify the vertices covered by the query range; According to whether the boundary vertices in the candidate subgraph are covered by the query range, the candidate subgraphs are classified into fully covered subgraphs and partially covered subgraphs. In addition, the subgraph where the query point is located is classified as the root subgraph.
7. The method for searching for mobile objects in a designated area of a road network as claimed in claim 6, characterized in that: The moving objects in the fully covered subgraph can be directly determined as part of the query result. The final query result can be obtained by only performing internal exploration on the partially covered subgraph and processing the root subgraph according to the location of the query point.
8. A mobile object search system in a specified area of a road network, characterized in that: include: A graph construction module, configured to construct the road network as a graph, wherein each intersection is regarded as a vertex on the graph, road segments between intersections are regarded as edges between corresponding vertices, and lengths of road segments between intersections are regarded as weights of the edges; A mapping module, configured to map mobile objects in the road network to edges of the graph and move randomly along the edges of the graph; A partitioning module is configured to partition a graph into multiple subgraphs with boundary constraint properties, wherein the vertices of each subgraph are divided into boundary vertices and internal vertices, wherein a boundary vertex of a subgraph refers to a vertex having at least one adjacent edge not covered by the subgraph, and an internal vertex of a subgraph refers to a vertex having all its adjacent edges covered by the subgraph, and the specific partitioning steps include: creating a set for storing seed vertices, wherein a seed vertex refers to a boundary vertex in a subgraph having at least one adjacent edge not covered by the subgraph, and in an initial state, randomly selecting a vertex in the graph as a seed vertex and putting it into the set; randomly taking a vertex from the seed vertex set as a starting vertex of a subgraph to be partitioned, wherein the subgraph to be partitioned is called an extended subgraph; and, under the premise of satisfying the boundary constraint property, adding vertices to the current extended subgraph until the number of vertices in the current extended subgraph reaches a specified threshold, or there is no vertex to be partitioned in the graph that satisfies the boundary constraint property. The vertices to be assigned are vertices in the graph that have at least one adjacent edge that does not belong to any subgraph; potential edges are added to the current extended subgraph in order from small to large according to the weight of the potential edges under the premise of satisfying the boundary constraint property, wherein a potential edge refers to an edge between two adjacent vertices that are already in the current extended subgraph; when all potential edges of the current extended subgraph have been added or there are no potential edges that make the current extended subgraph meet the boundary constraint property, the partition of the current extended subgraph is completed, and the extended subgraph whose partition is completed is called a subgraph; the boundary vertices that have not been assigned in the subgraph are saved as seed vertices in the seed vertex set, and the boundary vertices that have not been assigned are the boundary vertices that have at least one adjacent edge that does not belong to any subgraph. If the seed vertex set is not empty, a vertex is randomly taken from the seed vertex set as the starting vertex of the next subgraph to be divided, and the above steps are iterated in sequence until the seed vertex set is empty, and the partition of all subgraphs is completed; The index building module is configured to build a double-layer index structure based on the divided subgraphs, including: all the divided subgraphs constitute the first layer of the double-layer index structure; extracting the boundary vertices of all the subgraphs in the first layer, any pair of boundary vertices in the same subgraph are connected by edges, and these boundary vertices and edges constitute the second layer of the double-layer index structure, which is also called the skeleton graph; A query module, configured to query a set of mobile objects within a specified query range based on a double-layer index structure; The boundary constraint property is that the external boundary of each boundary vertex in any subgraph is greater than or equal to its internal boundary, wherein the internal boundary of a boundary vertex refers to the maximum value of the shortest distances from the boundary vertex to all internal vertices and any position of each edge in the current extended subgraph; the external boundary of a boundary vertex refers to the maximum value of the shortest distances from the boundary vertex to other boundary vertices in the current extended subgraph.
