Top-K spatial keyword query method based on road network index

Through the Top-K spatial keyword query method based on the road network index, using the shortest travel time function and TF-IDF model, combined with the construction and pruning technology of TKG-tree, the efficiency problem of Top-K query on the road network is solved, and the implementation It achieves the effects of low storage cost and fast response time.

CN114896480BActive Publication Date: 2024-09-24SOUTH CHINA UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210356274.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-06
Publication Date
2024-09-24
Estimated Expiration
2042-04-06

AI Technical Summary

Technical Problem

Existing technology is difficult to support efficient Top-K queries on road networks. The main bottleneck lies in the high cost of calculating the shortest path from point to point and the lack of efficient pruning algorithms, resulting in high storage costs and long preprocessing time, making it unable to handle large-scale road networks. .

Method used

The Top-K spatial keyword query method based on road network index is used to construct the road network index by dividing subgraphs, using the shortest travel time function and TF-IDF model to measure spatial and text scores, and constructing and pruning through TKG-tree , improve query speed.

Benefits of technology

It reduces the index storage cost and pre-processing time, achieves millisecond-level query response time, is suitable for data sets of different sizes, and has good versatility and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114896480B
    Figure CN114896480B
Patent Text Reader

Abstract

The invention discloses a Top-K spatial keyword query method based on a road network index, comprising: 1) defining relevant concepts of a road network; 2) using the shortest travel time and a TF-IDF model for weighted calculation to obtain a spatial text score function that can measure the spatial proximity and text similarity of an object; 3) using the edge and vertex information contained in the road network to construct a road network index TKG-tree, wherein the road network index includes a travel time matrix that records spatial index information and an inverted document that records text index information; 4) using the spatial text score as an indicator for sorting Top-K results, and using the constructed road network index TKG-tree to find the spatial keyword objects ranked Top-K; the invention constructs a road network index in a subgraph-dividing manner, thereby alleviating the problem of too high index storage cost, and using the spatial text score of a node as an upper bound pruning object, thereby improving the speed of finding the Top-K spatial keyword objects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of road network index and Top-K query, and in particular to a Top-K spatial keyword query method based on road network index. Background Art

[0002] The Top-k spatial keyword query problem is a hot topic in spatial database research. Its purpose is to query several objects that are close to the user's location and meet the user's query preferences, and its query intent is expressed by keywords. The Top-k spatial keyword query problem not only considers the matching degree between the object and the keyword, but also considers the spatial distance between the user and the query object. According to the difference in the measurement method of spatial distance, it can be divided into two different distances: Euclidean space and road network space. Euclidean space represents that the distance between two points is measured by straight-line distance, while the distance between two points in road network space is measured by the shortest distance on the road network.

[0003] However, it is very difficult to support efficient Top-K queries on road networks. The main bottleneck is that the cost of calculating the shortest path from point to point is extremely high, which is not as simple as calculating the Euclidean straight-line distance between two points. In addition, even if the shortest road distance can be obtained quickly, it is very time-consuming to calculate the Top-K results without efficient pruning algorithms and strategies. Although there is a lot of work studying the Top-K query processing problem on road networks. However, the existing methods cannot support large-scale road networks. The main problem with these methods is that the index will lead to too high storage cost or too high preprocessing time cost. Summary of the invention

[0004] The purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art, and proposes a Top-K spatial keyword query method based on road network index. The road network index is constructed in a sub-graph division manner, which alleviates the problem of high index storage cost. The spatial text scores of the nodes are divided into upper bound pruning objects, which can improve the speed of searching for Top-K spatial keyword objects.

[0005] To achieve the above object, the technical solution provided by the present invention is: a Top-K spatial keyword query method based on road network index, comprising the following steps:

[0006] 1) Define the relevant concepts of the road network, including the spatial keyword object o, the road network graph G, and the shortest travel time function τ between two vertices * (t);

[0007] 2) Use the shortest travel time function τ obtained in step 1) * (t) Measure the spatial proximity of the spatial keyword object o and obtain the spatial score function, denoted as fs (o); Use the TF-IDF model to measure the text similarity of the spatial keyword object o and obtain the text score function, denoted as f d (o); Use the text score function f d (o) and the spatial score function f s (o) The spatial text score function is obtained by weighted calculation, denoted as

[0008] 3) Based on the road network defined in step 1), the road network index TKG-tree is constructed using the edge and vertex information it contains; TKG-tree is a balanced tree structure cut from the graph, whose root node corresponds to the entire road network graph G and has the following properties: each descendant node n of the root node i Each corresponds to a subgraph G i , the bottom layer of nodes are called leaf nodes; TKG-tree has two hyperparameters f and μ, which represent the number of branches of non-leaf nodes and the upper limit of the number of vertices of leaf nodes respectively; each node n i Both contain a travel time matrix M i and an inverted document D that records the object keyword information o.key i ;

[0009] 4) Using the spatial text score function obtained in step 2) As the index for sorting the Top-K results, from the query point v q Starting from step 3), the road network index TKG-tree constructed is used to find the spatial keyword object o ranked Top-K.

[0010] Furthermore, in step 1), the following concepts are defined:

[0011] a. In the edge of the road network, the travel time is used to represent the length of the edge, and the travel time of the edge will change with the time t, so the travel time function of the edge is recorded as ω(t); in the vertices of the road network, some of the vertices carry text information in the form of keywords. The vertex with spatial position information and text keyword information is called spatial keyword object o, which is expressed as:

[0012] o=(v o ,o.key)

[0013] In the formula, v o Indicates the vertex position of the object, and o.key indicates the object keyword information;

[0014] b. Model the road network as an undirected graph, expressed as:

[0015]

[0016] In the formula, G is a road network graph, which represents an undirected graph road network structure composed of several intersecting edges; v1 represents the first vertex, v n represents the nth vertex, V = {v1,v2,...v n} represents the set of all vertices in the road network; e1 represents the first edge, e n represents the nth edge, E = {e1, e2, ...e n} represents the set of edges in the road network; and ω1(t) represents the travel time function of the first edge, ω n (t) represents the travel time function of the nth edge, W = {ω1(t),ω2(t),...ω n (t)} represents the set of travel time functions associated with the corresponding edge;

[0017] c. In a road network, a path ρ from the starting point to the end point is represented by a series of adjacent connected vertex sequences <v i ,...v j >, where v i represents the i-th vertex, v j represents the jth vertex, and P is used to represent the set of all paths from the starting point to the end point; let the travel time function of path ρ be τ(t), then the shortest travel time function from the starting point to the end point is τ * (t) is defined as follows:

[0018] τ * (t) = min{τ(t)|ρ∈P}

[0019] Where τ(t) represents the travel time function of path ρ starting at time t; τ * (t) represents the shortest travel time function among all paths from the starting point to the end point starting at time t.

[0020] Further, the step 2) comprises the following steps:

[0021] 2.1) Define the query parameter query based on the Top-K spatial keyword of the road network space:

[0022] query= <v q ,q.key,t,k>

[0023] In the formula, v q represents the query point, q.key represents the keyword phrase of the query, t represents the time of the search, and k represents the number of spatial keyword objects o returned;

[0024] 2.2) Use the shortest travel time function τ * (t) is used to measure the spatial keyword object o and the query point vq The spatial proximity of s (o) are as follows:

[0025]

[0026] In the formula, Represents the vertex v where the spatial keyword object o is located o To query point v q The shortest travel time between

[0027] 2.3) Use the TF-IDF model to measure the text similarity between the spatial keyword object o and the query keyword phrase q.key, and define the text score function f d (o) are as follows:

[0028]

[0029] In the formula, key and q.key represent the keyword and the keyword phrase of the query respectively, tf(key) represents the number of times the keyword key appears in the spatial keyword object o, and idf(key) represents the inverse frequency of the keyword key in all spatial keyword objects o. The importance of the keyword key increases in direct proportion to the number of times it appears in the spatial keyword object o, but at the same time it decreases in inverse proportion to the frequency of its appearance in all spatial keyword objects o.

[0030] 2.4) Use the text score function f d (o) and the spatial score function f s (o) Get the spatial text score function The calculation formula is as follows:

[0031]

[0032] In the formula, α represents the weight factor, represents the spatial text score function, which is composed of the spatial score function f s (o) and the text score function f d (o) Obtained by weighted calculation.

[0033] Furthermore, in step 3), the road network index TKG-tree is constructed by graph cutting. First, the entire road network graph G is taken as the root node, and then G is cut into f subgraphs of the same size and taken as the child nodes of the root node. Then, these subgraphs are cut recursively until the number of vertices contained in the final subgraph does not exceed μ. According to the topological relationship of the road network, the Floyd algorithm is run to obtain the node n i The travel time matrix M i , the matrix M i Records the node ni Corresponding subgraph G i The shortest travel time function τ between each vertex in * (t); for the node n i Corresponding subgraph G i Take the union of the keyword information o.key of all spatial keyword objects o in the node n i Inverted document D i .

[0034] Further, in step 4), after entering the query parameters, the spatial text score function As the index for sorting the Top-K results, we first define a maximum priority queue Q and a result set R, starting from the query point v q Start searching the subgraph where the spatial keyword object o is located, add all spatial keyword objects o in the subgraph to the priority queue Q and calculate them according to the spatial text score function Sorting; using n x Record the highest level node currently visited on the TKG-tree, and mark the current search range as the subgraph G corresponding to the node x , and at the same time, define the spatial text score of the node Prune as an upper bound:

[0035]

[0036] In the formula, f s (node) represents the query point v q To the current subgraph G x The shortest travel time is calculated by using the travel time matrix M of the road network index TKG-tree. i Calculated; Represents the maximum text score that a spatial keyword object o can achieve, using the inverted document D of the road network index TKG-tree i Calculate; remove the spatial keyword objects o from the queue Q in sequence, and filter out the spatial texts with a score higher than the upper bound The high spatial keyword object o is added to the result set R; if the queue Q is empty and the result set R is less than k, n x Update to the parent node of the original node and expand the current search range to n x The corresponding subgraph after the node is updated, and Change to n x The spatial text score after the node is updated, repeat the above operation until the result set R has k results, and the algorithm ends automatically; the maximum priority queue Q and the upper bound It is guaranteed that from the query point v q The kth result is the global optimal one, so the Top-K space keyword object o can be found correctly.

[0037] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0038] 1. The present invention takes into account the influence of time factors on the Top-K road network distance and has more practical application value.

[0039] 2. Compared with other Top-K query methods in road network space, the present invention has shorter preprocessing time and lower storage cost.

[0040] 3. The present invention has a millisecond-level query response time on data sets of different sizes and has good versatility and scalability. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 The figure is a logical flow diagram of the method of the present invention.

[0042] Figure 2 Schematic diagram of the road network index TKG-tree used in the present invention. DETAILED DESCRIPTION

[0043] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.

[0044] See also Figure 1 As shown, this embodiment provides a Top-K spatial keyword query method based on road network index, and its specific situation is as follows:

[0045] 1) The spatial keyword object, road network diagram and shortest travel time are defined:

[0046] a. In the edge of the road network, the travel time is used to represent the length of the edge, and the travel time of the edge will change with the time t, so the travel time function of the edge is recorded as ω(t); in the vertices of the road network, some of the vertices carry text information in the form of keywords. The vertex with spatial position information and text keyword information is called spatial keyword object o, which is expressed as:

[0047] o=(v o ,o.key)

[0048] In the formula, v o Indicates the vertex position of the object, and o.key indicates the keyword information of the object;

[0049] b. Model the road network as an undirected graph, expressed as:

[0050]

[0051] In the formula, G is a road network graph, which represents an undirected graph road network structure composed of several intersecting edges; v1 represents the first vertex, v n represents the nth vertex, V = {v1,v2,...v n} represents the set of all vertices in the road network; e1 represents the first edge, e n represents the nth edge, E = {e1, e2, ...e n} represents the set of edges in the road network; and ω1(t) represents the travel time function of the first edge, ω n (t) represents the travel time function of the nth edge, W = {ω1(t),ω2(t),...ω n (t)} represents the set of travel time functions associated with the corresponding edge;

[0052] c. In a road network, a path from the starting point to the end point can be represented by a series of adjacent connected vertex sequences <v i ,...v j >, where v i represents the i-th vertex, v j represents the jth vertex, and P can be used to represent the set of all paths from the starting point to the end point. Let the travel time function of path ρ be τ(t), then the shortest travel time function from the starting point to the end point τ * (t) is defined as follows:

[0053] τ * (t) = min{τ(t)|ρ∈P}

[0054] Where τ(t) represents the travel time function of path ρ starting at time t; τ * (t) represents the shortest travel time function among all paths from the starting point to the end point starting at time t.

[0055] 2) Use the shortest travel time function τ obtained in step 1) * (t) measuring the spatial proximity of the spatial keyword object o; using the TF-IDF model to measure the text similarity of the spatial keyword object o; using the text score function and the spatial score function to perform a weighted calculation to obtain the spatial text score function, which includes the following steps:

[0056] 2.1) Define the query parameter query based on the Top-K spatial keyword of the road network space:

[0057] query= <v q ,q.key,t,k>

[0058] In the formula, v qrepresents the query point, q.key represents the keyword phrase of the query, t represents the time of the search, and k represents the number of spatial keyword objects o returned;

[0059] 2.2) Use the shortest travel time function τ * (t) is used to measure the spatial keyword object o and the query point v q The spatial proximity of s (o) as follows:

[0060]

[0061] In the formula, Represents the vertex v where the spatial keyword object o is located o To query point v q The shortest travel time between them.

[0062] 2.3) Use the TF-IDF model to measure the text similarity between the spatial keyword object o and the query keyword phrase q.key, and define the text score function f d (o) as follows:

[0063]

[0064] In the formula, key and q.key represent the keyword and the keyword phrase of the query respectively, tf(key) represents the number of times the keyword key appears in the spatial keyword object o, and idf(key) represents the inverse frequency of the keyword key in all spatial keyword objects o; the importance of the keyword key increases in direct proportion to the number of times it appears in the spatial keyword object o, but at the same time it decreases in inverse proportion to the frequency of its appearance in all spatial keyword objects o.

[0065] 2.4) Use the text score function f d (o) and the spatial score function f s (o) Get the spatial text score function The calculation formula is as follows:

[0066]

[0067] In the formula, α represents the weight factor, represents the spatial text score function, which is composed of the spatial score function f s (o) and the text score function f d (o) Obtained by weighted calculation.

[0068] 3) Use the edge and vertex information of the road network defined in step 1) to construct the road network index TKG-tree; the road network index TKG-tree is constructed by the graph cutting method, such as Figure 2 As shown in the figure, we set the number of branches f of non-leaf nodes to 2 and the maximum number of vertices μ of leaf nodes to 4. First, the entire road network graph G is taken as the root node, and then G is cut into f subgraphs of the same size and made the subgraphs the child nodes of the root node. Then, these subgraphs are cut recursively until the number of vertices contained in the final subgraph does not exceed μ. According to the topological relationship of the road network, the Floyd algorithm is run to obtain the node n. i The travel time matrix M i , the matrix M i Records the node n i Corresponding subgraph G i The shortest travel time function τ between each vertex in * (t); for the node n i Corresponding subgraph G i Take the union of the keyword information o.key of all spatial keyword objects o in the node n i Inverted document D i .

[0069] 4) Using the spatial text score function obtained in step 2) As the index for sorting the Top-K results, from the query point v q Starting from step 3), we use the road network index TKG-tree constructed to find the top-K ranking spatial keyword objects; first define a maximum priority queue Q and result set R, starting from the query point v q Start searching the subgraph where the spatial keyword object o is located, add all spatial keyword objects o in the subgraph to the priority queue Q and calculate them according to the spatial text score function Sorting; using n x Record the highest level node currently visited on the TKG-tree, and mark the current search range as the subgraph G corresponding to the node x , and at the same time, define the spatial text score of the node Prune as an upper bound:

[0070]

[0071] In the formula, f s (node) represents the query point v q To the current subgraph G x The shortest travel time is calculated by using the travel time matrix M of the road network index TKG-tree. i Calculated; Represents the maximum text score that a spatial keyword object o can achieve, using the inverted document D of the road network index TKG-tree i Calculate; remove the spatial keyword objects o from the queue Q in sequence, and filter out the spatial texts with a score higher than the upper bound The high spatial keyword object o is added to the result set R; if the queue Q is empty and the result set R is less than k, n x Update to the parent node of the original node and expand the current search range to n x The corresponding subgraph after the node is updated, and Change to n x The spatial text score of the node is updated, and the above operation is repeated until the Top-K spatial keyword object o is found correctly.

[0072] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. Top-K spatial keyword query method based on road network index, It is characterized in that The following steps are involved: 1) Define the relevant concepts of the road network, including the spatial keyword object o, the road network graph G, and the shortest travel time function τ between two vertices * (t); 2) Use the shortest travel time function τ obtained in step 1) * (t) Measure the spatial proximity of the spatial keyword object o and obtain the spatial score function, denoted as f s (o); Use the TF-IDF model to measure the text similarity of the spatial keyword object o and obtain the text score function, denoted as f d (o); Use the text score function f d (o) and the spatial score function f s (o) The spatial text score function is obtained by weighted calculation, denoted as 3) Based on the road network defined in step 1), the road network index TKG-tree is constructed using the edge and vertex information it contains; TKG-tree is a balanced tree structure cut from the graph, whose root node corresponds to the entire road network graph G and has the following properties: each descendant node n of the root node i Each corresponds to a subgraph G i , the bottom layer of nodes are called leaf nodes; TKG-tree has two hyperparameters f and μ, which represent the number of branches of non-leaf nodes and the upper limit of the number of vertices of leaf nodes respectively; each node n i Both contain a travel time matrix M i and an inverted document D that records the object keyword information o.key i ; 4) Using the spatial text score function obtained in step 2) As the index for sorting the Top-K results, from the query point v q Starting from step 3), the road network index TKG-tree constructed is used to find the spatial keyword object o ranked Top-K.

2. According to the Top-K spatial keyword query method based on road network indexing according to claim 1, It is characterized in that In step 1), the following concepts are defined: a. In the edge of the road network, the travel time is used to represent the length of the edge, and the travel time of the edge will change with the time t, so the travel time function of the edge is recorded as ω(t); in the vertices of the road network, some of the vertices carry text information in the form of keywords. The vertex with spatial position information and text keyword information is called spatial keyword object o, which is expressed as: o=(v o (key) In the formula, v o Indicates the vertex position of the object, and o.key indicates the object keyword information; b. Model the road network as an undirected graph, expressed as: In the formula, G is a road network graph, which represents an undirected graph road network structure composed of several intersecting edges; v 1 represents the first vertex, v n represents the nth vertex, V = {v 1 ,v 2 ,...v n } represents the set of all vertices in the road network; e 1 represents the first edge, e n represents the nth edge, E={e 1 ,e 2 ,...e n } represents the set of edges in the road network; and ω 1 (t) represents the travel time function of the first edge, ω n (t) represents the travel time function of the nth edge, W = {ω 1 (t),ω 2 (t),...ω n (t)} represents the set of travel time functions associated with the corresponding edge; c. In a road network, a path ρ from the starting point to the end point is represented by a series of adjacent connected vertex sequences <v i ,...v j >, where v i represents the i-th vertex, v j represents the jth vertex, and P is used to represent the set of all paths from the starting point to the end point; let the travel time function of path ρ be τ(t), then the shortest travel time function from the starting point to the end point τ * (t) is defined as follows: t * (t)=min{τ(t)|ρ∈P} Where τ(t) represents the travel time function of path ρ starting at time t; τ * (t) represents the shortest travel time function among all paths from the starting point to the end point starting at time t.

3. According to the Top-K spatial keyword query method based on road network indexing according to claim 1, It is characterized in that The step 2) comprises the following steps: 2.1) Define the query parameter query based on the Top-K spatial keyword of the road network space: query=<v q ,q.key,t,k> In the formula, v q represents the query point, q.key represents the keyword phrase of the query, t represents the time of the search, and k represents the number of spatial keyword objects o returned; 2.2) Use the shortest travel time function τ * (t) is used to measure the spatial keyword object o and the query point v q The spatial proximity of s (o) as follows: In the formula, Represents the vertex v where the spatial keyword object o is located o To query point v q The shortest travel time between 2.3) Use the TF-IDF model to measure the text similarity between the spatial keyword object o and the query keyword phrase q.key, and define the text score function f d (o) as follows: In the formula, key and q.key represent the keyword and the keyword phrase of the query respectively, tf(key) represents the number of times the keyword key appears in the spatial keyword object o, and idf(key) represents the inverse frequency of the keyword key in all spatial keyword objects o. The importance of the keyword key increases in direct proportion to the number of times it appears in the spatial keyword object o, but at the same time it decreases in inverse proportion to the frequency of its appearance in all spatial keyword objects o. 2.4) Use the text score function f d (o) and the spatial score function f s (o) Get the spatial text score function The calculation formula is as follows: In the formula, α represents the weight factor, represents the spatial text score function, which is composed of the spatial score function f s (o) and the text score function f d (o) Obtained by weighted calculation.

4. According to the Top-K spatial keyword query method based on road network indexing according to claim 1, Features: In step 3), the road network index TKG-tree is constructed by graph cutting. First, the entire road network graph G is taken as the root node, and then G is cut into f subgraphs of the same size and made the subgraphs the child nodes of the root node. Then, these subgraphs are cut recursively until the number of vertices contained in the final subgraph does not exceed μ. According to the topological relationship of the road network, the Floyd algorithm is run to obtain the node n. i The travel time matrix M i , the matrix M i Records the node n i Corresponding subgraph G i The shortest travel time function τ between each vertex in * (t); for the node n i Corresponding subgraph G i Take the union of the keyword information o.key of all spatial keyword objects o in the node n i Inverted document D i .

5. According to the Top-K spatial keyword query method based on road network indexing according to claim 1, Features: In step 4), after entering the query parameters, the spatial text score function As the index for sorting the Top-K results, we first define a maximum priority queue Q and a result set R, starting from the query point v q Start searching the subgraph where the spatial keyword object o is located, add all spatial keyword objects o in the subgraph to the priority queue Q and calculate them according to the spatial text score function Sorting; using n x Record the highest level node currently visited on the TKG-tree, and mark the current search range as the subgraph G corresponding to the node x , and at the same time, define the spatial text score of the node Prune as an upper bound: In the formula, f s (node) represents the query point v q To the current subgraph G x The shortest travel time is calculated by using the travel time matrix M of the road network index TKG-tree. i Calculated; Represents the maximum text score that a spatial keyword object o can achieve, using the inverted document D of the road network index TKG-tree i Calculate; remove the spatial keyword objects o from the queue Q in sequence, and filter out the spatial texts with a score higher than the upper bound The high spatial keyword object o is added to the result set R; if the queue Q is empty and the result set R is less than k, n x Update to the parent node of the original node and expand the current search range to n x The corresponding subgraph after the node is updated, and Change to n x The spatial text score after the node is updated, repeat the above operation until the result set R has k results, and the algorithm ends automatically; the maximum priority queue Q and the upper bound It is guaranteed that from the query point v q The kth result is the global optimal one, so the Top-K space keyword object o can be found correctly.