Optimal path query method for time series graph of traffic network

By establishing a time series graph model in the traffic road network, using edge representation and reverse search strategy, combined with B+ tree index, the problem of low efficiency of shortest path query in the traffic road network is solved, and efficient and accurate optimality is achieved Path query to adapt to the needs of different query scenarios.

CN114969571BActive Publication Date: 2025-01-14SHEN ZHEN WAN ZHI DA QI YE GUAN LI YOU XIAN GONG SI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210549014.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-20
Publication Date
2025-01-14
Estimated Expiration
2042-05-20

AI Technical Summary

Technical Problem

The existing shortest path query method cannot meet the needs of time series graphs in the traffic road network, and cannot effectively handle the dynamic traversal time and cost, resulting in low query efficiency and inability to meet the actual application needs.

Method used

Adopt the time series graph optimal path query method for the traffic road network, establish a traffic road network model, define the time series graph, use edge representation and B+ tree index, combine with reverse search strategy, quickly query the optimal path, and Introduce variable thresholds when necessary to deal with emergencies.

Benefits of technology

It improves the efficiency and accuracy of optimal path query in the traffic road network, can effectively handle dynamic path query requirements in the time series graph, adapt to different query scenarios, and provide efficient path selection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114969571B_ABST
    Figure CN114969571B_ABST
Patent Text Reader

Abstract

The present invention relates to an optimal path query method for a time series graph of a traffic road network, and belongs to the field of graph data processing. The present invention abstracts the actual road network and establishes a traffic road network model. First, the concept and characteristics of the time series graph are defined, and the traffic road network model is converted into a time series graph; at the same time, based on the consideration of time cost and cost cost, an input edge representation method of the time series graph is introduced. Secondly, in view of the shortcomings of the classic shortest path query, a reverse search strategy is proposed, which effectively improves the efficiency and accuracy of the optimal path query in the traffic road network; at the same time, a variable threshold optimal path query method is proposed for emergencies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of graph data processing, and in particular relates to a processing technology for a graph data set with time characteristics, and specifically relates to an optimal path query method for a time series graph of a transportation network. Background Art

[0002] In recent years, with the development and progress of computer technology, the graph field has attracted more and more attention from researchers, and more and more research results have been applied to various fields in real life, especially in the field of traffic network. How to reduce fuel consumption and time cost has become the most concerned issue for drivers. However, with the development of information technology and the changes in application requirements, the inherent simple graph model can no longer meet the needs of research, and the graph model has developed towards diversification and complexity. How to find the optimal path result set that meets user needs in a diversified and complex graph data set is a research hotspot in the graph field. The shortest path query has always been a classic problem in graph model research, which is used to calculate the shortest path from one vertex to other vertices. The classic shortest path query is usually defined in a static graph. However, in practical applications, the graph model is often dynamically changing, and the edges in the graph usually have time characteristics, so this type of graph model is defined as a time series graph. In the time series graph model, the edge has a time characteristic, and each edge has a traversal time and cost cost related to the time characteristic. For example, in the passenger transportation system, the bus from point A to point B has a specific departure time t, and for different departure times, the traversal time λ and cost f are often different. At this point, the classic shortest path query method can no longer meet actual needs. It is necessary to combine time characteristics and different query requirements to achieve optimized query of time series graphs under different paths, and perform real-time query in stages according to actual needs, and finally achieve the optimal path query in the time series graph.

[0003] At present, the path query problem on the time series graph model in the traffic network is mainly focused on the shortest travel time problem (TDSP), that is, given the starting vertex, the target vertex and the departure time interval, find the optimal path from the starting vertex to the target vertex so that the cost of the path is minimized. Moreover, in the time series graph, the query of the shortest path is dynamically related to time. For example, in the traffic network, due to the restrictions on the schedule of public transportation, the time consumed by the same starting point to the same destination at different times is different. For example, taking a bus from place a to place b, assuming that the bus schedule is 08:05-08:15, 08:15-08:25..., if the user departs at 08:00, he will arrive at 08:15, which takes 15 minutes. If the user departs at 08:08, he will arrive at the destination at 08:25, which takes 17 minutes. In the time series graph, the same starting point and end point, due to different departure times, the total consumption time (and the transportation taken) is also different.

[0004] The existing optimal path query methods for time series graphs for traffic networks have the following shortcomings: some methods set the traversal time of all edges to the same fixed value, which cannot meet the dynamic nature of the traversal time; some methods need to scan all the information of the graph, the traversal cost is too high, and the query efficiency for large-scale graphs is low; some methods do not have dynamic departure time characteristics of the edges, so they cannot solve the path query problem of time series graphs well. Therefore, designing an efficient optimal path query method for time series graphs for traffic networks is of great significance for the optimal path query of time series graphs. Summary of the invention

[0005] In order to solve the deficiency that the classic shortest path query method in the traffic network cannot be applied to the time series graph, the present invention provides an optimal path query method for the time series graph of the traffic network with low computational complexity and high execution capability.

[0006] To achieve the above object, the technical solution adopted by the present invention is: an optimal path query method for a time series graph of a traffic network, characterized in that it includes the following steps:

[0007] Step 1: Establishment of traffic network model: Abstract the actual road network model and describe the road elements such as road sections and nodes that constitute the traffic network, so that it can represent the attributes and geometry of the relevant sections of the actual road;

[0008] Step 2: Define the time series graph: formalize the traffic network model into a time series graph to prepare for the next step of optimal path query, and define the optimal path for the given time series graph;

[0009] Step 3: Use the inbound edge representation method to mark and sort the time series graph, which can quickly obtain the information of all inbound neighbor roads of a path vertex and establish B according to the actual situation. + Tree index to improve query efficiency;

[0010] Step 4: Through reverse search, query and obtain the optimal path in the time series graph.

[0011] Furthermore, the specific implementation process of step 1 includes:

[0012] When modeling the traffic road network, the following requirements are met: a polygon composed of several continuous points, where the first and last points are called "nodes" and the middle points are called "connection points"; "nodes" represent the starting and ending points of the road, and roads are connected through nodes; "connection points" represent the digital coordinates of the road and do not have the function of expressing topological relationships. All the middle points between the first and last points are sections that have a reachable or reachable relationship with the section at the first and last points, which can improve the efficiency of path search to a certain extent; the detailed description of the data structure of a road in the traffic road network is shown in Table 1;

[0013]

[0014]

[0015] The data structure of some roads in the schematic diagram of the traffic network model in Table 1 is shown in Table 2;

[0016]

[0017] Table 2

[0018] Furthermore, the specific implementation process of step 2 includes:

[0019] Step 2-1: Time series graph definition:

[0020] The time series graph is a directed graph, denoted by G = (V, E, D, T, C), where V is the set of path vertices, E is the set of road edges, D is the set of path vertex departure times, T is the set of road edge traversal times, and C is the set of road edge cost costs;

[0021] For any road edge e = (a, b), there exists a set D of departure times ab , a set T of traversal times ab and a set of cost C ab , so that D ab , T ab and C ab The elements in correspond to each other; for D ab Any element d in Tab There exists a unique element t, C ab There is a unique element c in the equation such that d, t, and c correspond to each other; that is, when starting from the road edge e = (a, b) at time d, the traversal time is t and the cost is c; the cost c is usually related to the departure time and the traversal time, and the cost is set to a discrete value; at the same time, define represents the set of incoming edge neighbor paths of path vertex a, represents the set of outgoing neighbor paths of path vertex a, represents the in-degree of path vertex a, Represents the out-degree of path vertex a; for an undirected graph, all undirected edges of the undirected graph are converted into two directed edges in opposite directions, and their in-degree and out-degree are calculated;

[0022] In the time series diagram, each pair of numbers on each road edge represents the traversal time and cost. In practical applications, the traversal time and cost must be greater than zero. Therefore, this method sets the traversal time and cost to be greater than zero. The underlined number represents the departure time from the road edge. For any i (1<i≤k), the road edge e i =(v i ,v i+1 ) and D vivi+1 , T vivi+1 and C vivi+1 The corresponding elements in the combination are connected into a quintuple (v i ,d i ,v i+1 ,t i ,c i ), the quintuple satisfies d i -d i-1 -t i-1 =ω i ,ω i ≥0 means ω i is the i-th path vertex v i The waiting time from the path vertex v i Start along the roadside i Arrival i+1 , need to wait i Time, can be in time i Therefore, the path in the time series graph is defined as follows: For any i (1 < i ≤ k), the path P is a quintuple (v i ,d i ,v i+1 ,t i ,c i ) is an ordered sequence; meanwhile, define: arrive(P)=(d k +t k), i.e., the arrival time of path P; depart(P) = d1, i.e., the departure time of path P; dura(P) = arrive(P) - depart(P), i.e., the duration of path P; That is, the number of transit vertices in path P; That is, the cost of path P;

[0023] Step 2-2: Optimal path definition:

[0024] Given a time series graph G, the time interval [t s ,t e ], starting path vertex V s , target path vertex V e , V s To V e The path set of P is denoted as P; the path P in P satisfies the following conditions: depart(P)≥t s ,arrive(P)≤t e ; From this expansion we can get:

[0025] The earliest arrival path P: P∈P, satisfying arrive(P)≤arrive(P'),

[0026] The latest departure path P: P∈P, satisfying depart(P)≥depart(P'),

[0027] The minimum time path P: P∈P, and satisfies dura(P)≤dura(P'),

[0028] The minimum transit path P: P∈P, and trans(P)≤trans(P'),

[0029] Minimum cost path P: P∈P, and cost(P)≤cost(P'),

[0030] Therefore, the optimal path of the time series graph includes: the earliest arrival path, the latest departure path, the least time path, the least transfer path and the set of the minimum cost path.

[0031] Furthermore, the specific implementation process of step three is as follows:

[0032] The five-tuple (v i ,d i ,v i+1 ,t i ,c i) is similar to the time series graph, which contains the path vertices, road edges, departure time, traversal time and cost information to form (v i ,d i ,v i+1 ,t i ,c i ) ; the inbound edge representation method is used, that is, for each path vertex in the time series graph, the path vertex and road edge information pointing to it are stored in the form of a five-tuple, and the road edges pointing to the same path vertex are arranged in ascending order according to the label of the path vertex and the departure time of the road edge. At the same time, an index can be established according to the actual situation to improve the query efficiency; based on the inbound edge representation of the time series graph, the information of all inbound neighbor roads of a path vertex can be quickly obtained; at the same time, B + Tree index improves query efficiency.

[0033] Furthermore, the specific implementation process of step 4 is as follows:

[0034] Step 4-1 is a reverse search based on cost constraints. The process is as follows:

[0035] The reverse search method for the target vertex V e For each incoming neighbor road, query and expand the road edges that meet the conditions. First, for the first incoming neighbor road u obtained by the query, the path (transmitted parameter) is empty at the beginning. After the calculation and expansion, if the path is still empty, query the next incoming neighbor road. Otherwise, determine whether u is equal to V s If yes, save the result to resultPath (result set) and then turn to query expansion V e Otherwise, recursively query the starting vertex V s The path to u, the time interval is [t s ,t e ] is updated to [t s ,d], where d is the departure time of the last road edge added to currPath (temporary result set) (the departure time of this road edge is the largest, that is, d is the largest); for u's incoming neighbor road v, path is not empty at this time, the queried road edge is connected with path, if the arrival time of the road edge is less than or equal to the departure time of a path in path and the cost of the road edge plus the cost of the path in path is less than or equal to fee (maximum cost), then the road edge is inserted into the path as the initial road edge, and the result is saved in currPath; if there is no road edge that can be expanded, that is, currPath is empty, then this loop ends and recursively queries another incoming neighbor road of u; if currPath is not empty, then continue to judge and calculate until the target vertex V is reached. eAll incoming neighbor roads have been queried and expanded;

[0036] If the resultPath is empty, it means there is no path that meets the conditions and the search process ends; otherwise, the departure time, arrival time, duration, number of transfer stations and cost of each path in the resultPath are calculated and compared to obtain the optimal path;

[0037] Step 4-2 Optimal path query in time series graph:

[0038] As can be seen from step 4-1, the reverse search method adopts a reverse recursive search strategy. Starting from the target vertex, it takes the satisfaction of time conditions and cost as the basis for judgment, recursively traverses the incoming edge neighbor roads in turn, and calculates and searches for paths that meet the cost restrictions. Therefore, based on the characteristics of reverse search, the optimal path query method is divided into two stages: first, call the reverse search method based on cost restrictions to calculate all paths that meet the restrictions; second, calculate the time cost and cost cost of the paths that meet the condition restrictions, and obtain the optimal path after comparison based on different cost considerations. When the optimal path query method is initialized, resultPath and path are assigned empty values, and then the reverse search method is called to calculate the path that meets the time conditions and cost. If the resultPath obtained is empty, it means that there is no path that meets the conditions and the method ends; otherwise, the path selection phase is executed to calculate the departure time, arrival time, duration, number of transfer stations and cost of each path in resultPath, and compare the relevant data of each path according to the default priority or user needs, and finally obtain the optimal path; the default priority of the result path is arranged as follows: cost> traversal time> arrival time> departure time> number of transfers; the corresponding priority can also be flexibly set according to user needs, and the results are filtered accordingly to return the results required by the user.

[0039] Furthermore, the method further includes step 5: a variable threshold optimal path based on a specific situation; the search process of the variable threshold optimal path is to expand the reverse search method of the reverse search stage, that is, to expand the five-tuple in the input edge representation of the time series graph, add a threshold variable k to indicate the state of the road edge; and set a system threshold κ at the same time; the value of the threshold variable k is assigned by experts in the relevant field according to the actual situation and is dynamically updated, and the system threshold κ is set as a critical value by experts in the relevant field;

[0040] When executing the extended reverse search method, the comparison between the value of the threshold variable k of the incoming edge information of this query and the system threshold κ determines whether to perform an extended query through the road edge. That is, if and only if the threshold variable k is less than the system threshold κ, the extended query is performed through the road edge, otherwise the road edge is directly eliminated;

[0041] In the reverse search phase of the variable threshold optimal path based on specific situations, a comparison of the threshold variable is added during execution: when the threshold variable is less than the system threshold, it means that the road side is normal and will not affect the query results, and the extended calculation can be performed through the road side; when the threshold variable is greater than or equal to the system threshold, it means that an abnormal situation has occurred and the extended calculation cannot be performed through the road side, and this query ends.

[0042] Beneficial effects of the present invention: The present invention abstracts the actual road network and establishes a traffic network model. First, the concept and characteristics of the time series graph are defined, and the traffic network model is converted into a time series graph; at the same time, based on the consideration of time cost and cost cost, an inbound edge representation method of the time series graph is introduced. Secondly, in view of the shortcomings of the classic shortest path query, a reverse search strategy is proposed, which effectively improves the efficiency and accuracy of the optimal path query in the traffic network; at the same time, a variable threshold optimal path query method is proposed for emergencies. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 The flowchart of the optimal path query method for the time series graph of the traffic network.

[0044] Figure 2 Schematic diagram of the traffic network model of the present invention.

[0045] Figure 3 It is a schematic diagram of the time series diagram of the present invention.

[0046] Figure 4 Schematic diagram of the input edge index of the time series graph of the present invention.

[0047] Figure 5 This is a schematic diagram of the reverse search of the present invention. DETAILED DESCRIPTION

[0048] The optimal path query method for time series graph of traffic network, such as Figure 1 As shown, the following steps are included:

[0049] Step 1: Establishment of traffic network model: Abstract the actual road network model and describe the road elements such as road sections and nodes that constitute the traffic network, so that it can represent the attributes and geometry of the relevant sections of the actual road;

[0050] The traffic network model is an abstraction of the actual traffic network. It should be consistent with the actual traffic network. Therefore, a good traffic network model should represent as much road information as possible on the traffic network. When modeling a traffic network, the following requirements must be met: a polygon composed of several continuous points, where the first and last points are called "nodes" and the middle points are called "connections"; "nodes" represent the starting and ending points of the road, and roads are connected by nodes; "connections" represent the digitized coordinates of the road and do not have the function of expressing topological relationships. All the middle points between the first and last points are sections that are reachable or reachable to the sections at the first and last points, which can improve the efficiency of path search to a certain extent. The traffic network model constructed according to the above rules is as follows: Figure 2 The detailed description of the data structure of a road in the traffic road network is shown in Table 1.

[0051]

[0052] The data structure of some roads in the traffic network model diagram is shown in Table 2.

[0053]

[0054] In the traffic network model diagram, the starting vertex of each road is represented by FirstNode, the target vertex is represented by LastNode, and each pair of numbers on the edge of each road represents the traversal time (Time) and cost (Cost), thereby specifically describing the detailed information of a road.

[0055] Step 2: Define the time series graph: formalize the traffic network model into a time series graph to prepare for the next step of optimal path query, and define the optimal path for the given time series graph;

[0056] The specific steps include:

[0057] Step 2-1: Time series graph definition:

[0058] In view of the shortcomings of the current method, such as the traversal time of the road edge is set to the same fixed value, all the information of the map needs to be scanned when scanning the road edge, and the dynamic departure time of the road edge is not considered, the present invention proposes a new time series graph under the traffic network model to make up for the shortcomings of the current method and improve the query efficiency and accuracy. The time series graph is defined as follows.

[0059] The time series graph is a directed graph, denoted by G = (V, E, D, T, C), where V is the set of path vertices, E is the set of road edges, D is the set of path vertex departure times, T is the set of road edge traversal times, and C is the set of road edge cost costs;

[0060] For any road edge e = (a, b), there exists a set D of departure times ab , a set T of traversal times ab and a set of cost C ab , so that D ab , T ab and C ab The elements in correspond to each other; for D ab Any element d in T ab There exists a unique element t, C ab There is a unique element c in the equation such that d, t, and c correspond to each other; that is, when starting from the road edge e = (a, b) at time d, the traversal time is t and the cost is c; the cost c is usually related to the departure time and the traversal time, and the cost is set to a discrete value; at the same time, define represents the set of incoming edge neighbor paths of path vertex a, represents the set of outgoing neighbor paths of path vertex a, represents the in-degree of path vertex a, Represents the out-degree of path vertex a; for an undirected graph, all undirected edges of the undirected graph are converted into two directed edges in opposite directions, and their in-degree and out-degree are calculated;

[0061] In the time series diagram, each pair of numbers on each road edge represents the traversal time and cost. In practical applications, the traversal time and cost must be greater than zero. Therefore, this method sets the traversal time and cost to be greater than zero. The underlined number represents the departure time from the road edge. For any i (1<i≤k), the road edge e i =(v i ,v i+1 ) and D vivi+1 , T vivi+1 and C vivi+1 The corresponding elements in the combination are connected into a quintuple (v i ,d i ,v i+1 ,t i ,c i ), the quintuple satisfies d i -d i-1 -t i-1 =ω i ,ω i ≥0 means ω i is the i-th path vertex v i The waiting time from the path vertex v i Start along the roadside i Arrival i+1 , need to wait i Time, can be in time iTherefore, the path in the time series graph is defined as follows: For any i (1 < i ≤ k), the path P is a quintuple (v i ,d i ,v i+1 ,t i ,c i ) is an ordered sequence; meanwhile, define: arrive(P)=(d k +t k ), i.e., the arrival time of path P; depart(P) = d1, i.e., the departure time of path P; dura(P) = arrive(P) - depart(P), i.e., the duration of path P; That is, the number of transit vertices in path P; That is, the cost of path P;

[0062] Step 2-2: Optimal path definition:

[0063] Given a time series graph G, the time interval [t s ,t e ], starting path vertex V s , target path vertex V e , V s To V e The path set of P is denoted as P; the path P in P satisfies the following conditions: depart(P)≥t s ,arrive(P)≤t e ; From this expansion we can get:

[0064] The earliest arrival path P: P∈P, satisfying arrive(P)≤arrive(P'),

[0065] The latest departure path P: P∈P, satisfying depart(P)≥depart(P'),

[0066] The minimum time path P: P∈P, and satisfies dura(P)≤dura(P'),

[0067] The minimum transit path P: P∈P, and trans(P)≤trans(P'),

[0068] Minimum cost path P: P∈P, and cost(P)≤cost(P'),

[0069] Therefore, the optimal path of the time series graph includes: the earliest arrival path, the latest departure path, the least time path, the least transfer path and the set of the minimum cost path.

[0070] Step 3: Use the inbound edge representation method to mark and sort the time series graph, which can quickly obtain the information of all inbound neighbor roads of a path vertex and establish B according to the actual situation. + Tree index to improve query efficiency;

[0071] Specifically: with the five-tuple (v i ,d i ,v i+1 ,t i ,c i ) is similar to the time series graph, which contains the path vertices, road edges, departure time, traversal time and cost information to form (v i ,d i ,v i+1 ,t i ,c i ) ; the inbound edge representation method is used, that is, for each path vertex in the time series graph, the path vertex and road edge information pointing to it are stored in the form of a five-tuple, and the road edges pointing to the same path vertex are arranged in ascending order according to the label of the path vertex and the departure time of the road edge. At the same time, an index can be established according to the actual situation to improve the query efficiency; based on the inbound edge representation of the time series graph, the information of all inbound neighbor roads of a path vertex can be quickly obtained; at the same time, B + Tree index improves query efficiency.

[0072] Step 4: Through reverse search, query and obtain the optimal path in the time series graph;

[0073] The specific steps include:

[0074] Step 4-1 Reverse search based on cost limit:

[0075] In actual situations, the time characteristics of the time series graph are determined by the target vertex to be reached, that is, if the target vertex is not reached within the required time range, the selected path is completely meaningless. Therefore, the present invention proposes a reverse search method to select the optimal path, by reversely searching from the destination vertex to the departure vertex, eliminating the path that does not meet the time limit as soon as possible, reducing the calculation of meaningless paths and improving query efficiency.

[0076] The reverse search method for the target vertex V e For each incoming neighbor road, query and expand the road edges that meet the conditions. First, for the first incoming neighbor road u obtained by the query, the path (transmitted parameter) is empty at the beginning. After the calculation and expansion, if the path is still empty, query the next incoming neighbor road. Otherwise, determine whether u is equal to V sIf yes, save the result to resultPath (result set) and then turn to query expansion V e Otherwise, recursively query the starting vertex V s The path to u, the time interval is [t s ,t e ] is updated to [t s ,d], where d is the departure time of the last road edge added to currPath (temporary result set) (the departure time of this road edge is the largest, that is, d is the largest); for u's incoming neighbor road v, path is not empty at this time, the queried road edge is connected with path, if the arrival time of the road edge is less than or equal to the departure time of a path in path and the cost of the road edge plus the cost of the path in path is less than or equal to fee (maximum cost), then the road edge is inserted into the path as the initial road edge, and the result is saved in currPath; if there is no road edge that can be expanded, that is, currPath is empty, then this loop ends and recursively queries another incoming neighbor road of u; if currPath is not empty, then continue to judge and calculate until the target vertex V is reached. e All incoming neighbor roads have been queried and expanded;

[0077] If the resultPath is empty, it means there is no path that meets the conditions and the search process ends; otherwise, the departure time, arrival time, duration, number of transfer stations and cost of each path in the resultPath are calculated and compared to obtain the optimal path;

[0078] Step 4-2 Optimal path query in time series graph:

[0079] As can be seen from step 4-1, the reverse search method adopts a reverse recursive search strategy. Starting from the target vertex, it takes the satisfaction of time conditions and cost as the basis for judgment, recursively traverses the incoming edge neighbor roads in turn, and calculates and searches for paths that meet the cost restrictions. Therefore, based on the characteristics of reverse search, the optimal path query method is divided into two stages: first, call the reverse search method based on cost restrictions to calculate all paths that meet the restrictions; second, calculate the time cost and cost cost of the paths that meet the condition restrictions, and obtain the optimal path after comparison based on different cost considerations. When the optimal path query method is initialized, resultPath and path are assigned empty values, and then the reverse search method is called to calculate the path that meets the time conditions and cost. If the resultPath obtained is empty, it means that there is no path that meets the conditions and the method ends; otherwise, the path selection phase is executed to calculate the departure time, arrival time, duration, number of transfer stations and cost of each path in resultPath, and compare the relevant data of each path according to the default priority or user needs, and finally obtain the optimal path; the default priority of the result path is arranged as follows: cost> traversal time> arrival time> departure time> number of transfers; the corresponding priority can also be flexibly set according to user needs, and the results are filtered accordingly to return the results required by the user.

[0080] Under normal circumstances, the corresponding result information can be accurately obtained by executing the optimal path query method. However, in real applications, path queries are often affected by many unexpected factors such as weather, traffic, natural disasters, etc., which lead to blockage of some vertices in the time series graph and certain errors in the calculation results. For example, in the public transportation passenger system, some cities cannot be dispatched on time due to the influence of local bad weather and other conditions, resulting in blockage. When performing the optimal path query, if the query is still performed under normal circumstances, the result path containing these cities will be returned, which will cause errors and cannot be reached as required by the user.

[0081] In view of the above specific situation, the present invention proposes a variable threshold optimal path query method.

[0082] That is, on the basis of the previous steps, step 5 is also included: a variable threshold optimal path based on a specific situation;

[0083] This step is to expand the reverse search method in the reverse search phase on the basis of the optimal path query method. That is, the five-tuple in the input edge representation of the time series graph is expanded, and a threshold variable k is added to indicate the state of the road edge. At the same time, a system threshold κ is set. The value of the threshold variable k is assigned by experts in the relevant field according to the actual situation and dynamically updated. The system threshold κ is set as the critical value by experts in the relevant field. By setting the threshold variable and the system threshold, accurate query for emergencies is achieved, and the availability and accuracy of the method are improved. At the same time, when returning the query results, the threshold in the path can be converted into corresponding characteristics such as punctuality rate and delay rate according to the actual application scenario, which is convenient for users to consider comprehensively.

[0084] When executing the extended reverse search method, the comparison between the value of the threshold variable k of the incoming edge information of this query and the system threshold κ determines whether to perform an extended query through the road edge. That is, if and only if the threshold variable k is less than the system threshold κ, the road edge is extended to perform an extended query, otherwise the road edge is directly eliminated.

[0085] In the reverse search phase of the variable threshold optimal path query method based on specific situations, a comparison of the threshold variable is added during execution. When the threshold variable is less than the system threshold, it means that the road side is normal and will not affect the query results. The road side can be used for extended calculation. When the threshold variable is greater than or equal to the system threshold, it means that an abnormal situation has occurred and the road side cannot be used for extended calculation, and this query ends.

[0086] Specific application example: An application example of the present invention is given below in conjunction with the accompanying drawings:

[0087] Attach Figure 3 and Figure 4 For example, let a be the starting vertex of the path, f be the target vertex of the path, the time interval is [2,6], and the cost is 6.

[0088] First, find the incoming neighbor roads of the path target vertex f, which have three vertices: b, c, and d. First consider vertex b. In the initialization phase, path is assigned to be empty, so for the incoming road (b, 4, f, 1, 1), the method determines that 4+1≤6, 4≥2 and 1≤6, so (b, 4, f, 1, 1) is added to currPath. After all the edges related to vertex b are calculated, determine whether currPath is empty. If it is empty, end the calculation, otherwise continue the calculation.

[0089] Since vertex b is not the starting vertex of the path, the method recursively calculates the path from a to b, and the time interval is updated to [2,4], and the parameter path is passed as the current currPath. Similarly, for b's incoming neighbor road a, since the path is not empty at this time, all road edges related to vertex a are connected to the paths in the path. For (a,1,b,1,1), 1<2, the condition is not met, so this loop ends. Then consider (a,2,b,2,2), (a,2,b,2,2) and perform a connection operation with the path in the path to obtain the path <(a,2,b,2,2),(b,4,f,1,1)>, which is saved in the temporary result set currPath, and the connection operation ends at this time. Since vertex a is the same as the starting vertex, resultPath is updated with currPath, and this loop ends.

[0090] Since all the inbound neighbor roads of b have been calculated, the method backtracks to the previous level. For vertex f, continue to consider the next inbound neighbor road c. Since 5+2>6, this loop ends. Then continue to consider the inbound neighbor road d of vertex f. Perform the same operation to get resultPath. Since all the inbound neighbor roads of f have been calculated, the paths in resultPath are calculated and compared, and finally the optimal path is obtained.

[0091] The calculation results are as follows: the earliest arrival path: <(a,2,b,2,2),(b,4,f,1,1)>, the latest departure path: <(a,3,d,2,2),(d,5,f,1,2)>, the minimum cost path: <(a,2,b,2,2),(b,4,f,1,1)>. Since the path with the least time and the path with the least transit both contain the following two paths: <(a,3,d,2,2),(d,5,f,1,2)> and <(a,2,b,2,2),(b,4,f,1,1)>. Therefore, this example gives priority to the cost and uses it to filter the results. After filtering, the path with the least time and the path with the least transit are: <(a,2,b,2,2),(b,4,f,1,1)>.

[0092] Since the optimal path query method for traffic road networks proposed by the present invention takes into account all paths that meet time conditions and cost conditions, and only calculates path vertices and road edges related to the paths, the optimal path query method for traffic road networks has high accuracy and query efficiency.

Claims

1. The optimal path query method for the time series graph of the traffic network is characterized by: The following steps are involved: Step 1: Establishment of traffic network model: Abstract the actual road network model, describe the road sections and node road elements that constitute the traffic network, so that it can represent the attributes and geometric information of the relevant sections of the actual road; Step 2: Define the time series graph: formalize the traffic network model into a time series graph to prepare for the next step of optimal path query, and define the optimal path for the given time series graph; Step 3: Use the inbound edge representation method to mark and sort the time series graph, which can quickly obtain the information of all inbound neighbor roads of a path vertex and establish B according to the actual situation. + Tree index to improve query efficiency; Step 4: Through reverse search, query and obtain the optimal path in the time series graph; The specific implementation process of step 2 includes: Step 2-1: Time series graph definition: The time series graph is a directed graph, denoted by G = (V, E, D, T, C), where V is the set of path vertices, E is the set of road edges, D is the set of path vertex departure times, T is the set of road edge traversal times, and C is the set of road edge cost costs; For any road edge e = (a, b), there exists a set D of departure times ab , a set T of traversal times ab and a set of cost C ab , so that D ab , T ab and C ab The elements in correspond to each other; for D ab Any element d in T ab There exists a unique element t, C ab There is a unique element c in the equation such that d, t, and c correspond to each other; that is, when starting from the road edge e = (a, b) at time d, the traversal time is t and the cost is c; the cost c is usually related to the departure time and the traversal time, and the cost is set to a discrete value; at the same time, define T in (a) represents the set of inbound neighbor paths of path vertex a, T out (a) represents the set of outgoing neighbor paths of path vertex a, d in (a) represents the in-degree of path vertex a, d out (a) represents the out-degree of path vertex a; for an undirected graph, all undirected edges of the undirected graph are converted into two directed edges in opposite directions, and their in-degree and out-degree are calculated; In the time series diagram, each pair of numbers on each road edge represents the traversal time and cost. In practical applications, the traversal time and cost must be greater than zero, so the traversal time and cost are both set to be greater than zero. The underlined number represents the departure time from the road edge. For any i (1<i≤k), the road edge e i =(v i ,v i+1 ) and D vivi+1 , T vivi+1 and C vivi+1 The corresponding elements in the combination are connected into a quintuple (v i ,d i ,v i+1 ,t i ,c i ), the quintuple satisfies d i -d i-1 -t i-1 =ω i ,ω i ≥0 means ω i is the i-th path vertex v i The waiting time from the path vertex v i Start along the roadside i Arrival i+1 , need to wait i Time, can be in time i Therefore, the path in the time series graph is defined as follows: For any i (1 < i ≤ k), the path P is a quintuple (v i ,d i ,v i+1 ,t i ,c i ) is an ordered sequence; meanwhile, define: arrive(P)=(d k +t k ), i.e., the arrival time of path P; depart(P) = d1, i.e., the departure time of path P; dura(P) = arrive(P) - depart(P), i.e., the duration of path P; That is, the number of transit vertices in path P; That is, the cost of path P; Step 2-2: Optimal path definition: Given a time series graph G, the time interval [t s ,t e ], starting path vertex V s , target path vertex V e , V s To V e The path set of P is denoted as P; the path P in P satisfies the following conditions: depart(P)≥t s ,arrive(P)≤t e ; From this expansion we can get: The earliest arrival path P: P∈P, satisfying arrive(P)≤arrive(P'), The latest departure path P: P∈P, satisfying depart(P)≥depart(P'), The minimum time path P: P∈P, and satisfies dura(P)≤dura(P'), The minimum transit path P: P∈P, and trans(P)≤trans(P'), Minimum cost path P: P∈P, and cost(P)≤cost(P'), Therefore, the optimal path of the time series graph includes: the earliest arrival path, the latest departure path, the least time path, the least transfer path and the set of the minimum cost path.

2. The optimal path query method for a time series graph of a traffic network according to claim 1 is characterized in that: The specific implementation process of step 1 includes: When modeling the traffic road network, the following requirements are met: a polygon composed of several continuous points, where the first and last points are called "nodes" and the middle points are called "connections"; "nodes" represent the starting and ending points of the road, and roads are connected through nodes; "connections" represent the digital coordinates of the road and do not have the function of expressing topological relationships. All the middle points between the first and last points are sections that have a reachable or reachable relationship with the section at the first and last points, which can improve the efficiency of path search to a certain extent; the detailed description of the data structure of a road in the traffic road network is shown in Table 1; Table 1 The data structure of some roads in the traffic network model diagram is shown in Table 2; Table 2.

3. The optimal path query method for a time series graph of a traffic network according to claim 1 is characterized in that: The specific implementation process of step three is as follows: The five-tuple (v i ,d i ,v i+1 ,t i ,c i ) is similar to the time series graph, which contains the path vertices, road edges, departure time, traversal time and cost information to form (v i ,d i ,v i+1 ,t i ,c i ) ; the inbound edge representation method is used, that is, for each path vertex in the time series graph, the path vertex and road edge information pointing to it are stored in the form of a five-tuple, and the road edges pointing to the same path vertex are arranged in ascending order according to the label of the path vertex and the departure time of the road edge. At the same time, an index can be established according to the actual situation to improve the query efficiency; based on the inbound edge representation of the time series graph, the information of all inbound neighbor roads of a path vertex can be quickly obtained; at the same time, B + Tree index improves query efficiency.

4. The optimal path query method for a time series graph of a traffic network according to claim 1 is characterized in that: The specific implementation process of step 4 is as follows: Step 4-1 is a reverse search based on cost constraints. The process is as follows: The reverse search method for the target vertex V e For each incoming neighbor road, query and expand the road edges that meet the conditions; first, for the first incoming neighbor road u obtained by the query, the path (transmitted parameter) is empty at the beginning. After the calculation and expansion, if the path is still empty, query the next incoming neighbor road; Otherwise, determine whether u is equal to V s If yes, save the result to resultPath (result set) and then turn to query expansion V e Another incoming neighbor path of ; otherwise, recursively query from the starting vertex V s The path to u, the time interval is [t s ,t e ] is updated to [t s ,d], where d is the departure time of the last road edge added to currPath (temporary result set), and the departure time of this road edge is the largest, that is, d is the largest; for u's incoming neighbor road v, path is not empty at this time, and the road edge obtained by the query is connected with path. If the arrival time of the road edge is less than or equal to the departure time of a path in path and the cost of the road edge plus the cost of the path in path is less than or equal to fee (maximum cost), then the road edge is inserted into the path as the initial road edge, and the result is saved in currPath; if there is no road edge that can be expanded, that is, currPath is empty, then this loop ends and recursively queries another incoming neighbor road of u; if currPath is not empty, then continue to judge and calculate until the target vertex V is reached. e All incoming neighbor roads have been queried and expanded; If the resultPath is empty, it means there is no path that meets the conditions and the search process ends; otherwise, the departure time, arrival time, duration, number of transfer stations and cost of each path in the resultPath are calculated and compared to obtain the optimal path; Step 4-2 Optimal path query in time series graph: As can be seen from step 4-1, the reverse search method adopts a reverse recursive search strategy. Starting from the target vertex, it takes the time condition and cost as the judgment basis, recursively traverses the neighbor roads of the incoming edges in turn, and calculates and searches for paths that meet the cost restrictions. Therefore, based on the characteristics of reverse search, the optimal path query method is divided into two stages: first, the reverse search method based on cost restrictions is called to calculate all paths that meet the restrictions; second, the time cost and cost cost of the paths that meet the restrictions are calculated, and the optimal path is obtained after comparison based on different cost considerations; when the optimal path query method is initialized, resultPath and path are assigned to empty, and then the optimal path query method is called. Use the reverse search method to calculate the path that meets the time conditions and cost. If the resultPath obtained is empty, it means that there is no path that meets the conditions and the method ends; otherwise, the path selection phase is executed to calculate the departure time, arrival time, duration, number of transfer stations and cost of each path in the resultPath, and compare the relevant data of each path according to the default priority or user needs, and finally obtain the optimal path; the default priority of the result path is arranged as follows: cost> traversal time> arrival time> departure time> number of transfers; the corresponding priority can also be flexibly set according to user needs, and the results are filtered accordingly to return the results required by the user.

5. The optimal path query method for a time series graph of a traffic network according to claim 4 is characterized in that: The method further includes step 5: a variable threshold optimal path based on a specific situation; the search process of the variable threshold optimal path is to expand the reverse search method of the reverse search stage, that is, to expand the five-tuple in the input edge representation of the time series graph, add a threshold variable k to indicate the state of the road edge; and set a system threshold κ at the same time; the value of the threshold variable k is assigned by experts in the relevant field according to the actual situation and is dynamically updated, and the system threshold κ is set as a critical value by experts in the relevant field; When executing the extended reverse search method, the comparison between the value of the threshold variable k of the incoming edge information of this query and the system threshold κ determines whether to perform an extended query through the road edge; that is, if and only if the threshold variable k is less than the system threshold κ, the extended query is performed through the road edge, otherwise the road edge is directly eliminated; In the reverse search phase of the variable threshold optimal path based on specific situations, a comparison of the threshold variable is added during execution: when the threshold variable is less than the system threshold, it means that the road side is normal and will not affect the query results, and the extended calculation can be performed through the road side; when the threshold variable is greater than or equal to the system threshold, it means that an abnormal situation has occurred and the extended calculation cannot be performed through the road side, and this query ends.

Citation Information

Patent Citations

  • Vehicle emergency navigation method with space-time characteristic situation information

    CN112797995A

  • Top-k path sequence query method and system under multiple backgrounds

    CN114254213A