Path query method

By combining a time-varying H2H index with a sliding time window, the problem of insufficient query efficiency and accuracy in traditional TDSP solutions is solved, and efficient and accurate path query is achieved.

CN121388296APending Publication Date: 2026-01-23HONG KONG UNIV OF SCI & TECH (GUANGZHOU) +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511398381.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-26
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

In the time-varying shortest path problem, existing technologies cannot simultaneously satisfy query efficiency and accuracy. Graph search-based methods have low computational efficiency, while methods based on pre-computed indexes are costly and difficult to adapt to dynamic traffic environments.

Method used

A time-varying H2H index combined with a sliding time window is adopted. The time-varying H2H index is constructed through incremental expansion and updating, and the sliding time window is used to frequently update it to adapt to the dynamic changes in traffic prediction data. The query is combined with the bidirectional time-varying Dijkstra algorithm.

Benefits of technology

It achieves query response speeds in milliseconds or even microseconds, significantly improving query efficiency, reducing index maintenance overhead, ensuring route planning is based on the latest traffic forecast data, and improving the accuracy of query results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121388296A_ABST
    Figure CN121388296A_ABST
Patent Text Reader

Abstract

The invention discloses a path query method, which comprises the following steps: acquiring graph data of a time-varying road network, the graph data comprising a vertex set, an edge set, a time-varying transit time function set and a current time window; constructing a time-varying H2H index based on the vertex set, the edge set and the time-varying passing time function set; setting a sliding time window taking the current time window as a reference; sliding the sliding time window along the positive direction of the time axis at a preset time interval, and obtaining corresponding updated traffic prediction data; according to the updated traffic prediction data, performing incremental expansion and updating on the time-varying H2H index to obtain an updated time-varying H2H index; obtaining a query request of a user; and according to the query request, outputting the path with the shortest required passing time corresponding to the query request and the corresponding passing time by using the updated time-varying H2H index.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of path planning technology, and in particular to a path query method. Background Technology

[0002] With the rapid development of intelligent transportation systems, path planning based on real-time traffic forecasting has become a research hotspot. The time-varying shortest path problem aims to find the path with the shortest travel time at a specific departure time. Its core challenge lies in how to efficiently process constantly updated traffic forecast data. Traditional TDSP solutions face a dilemma: graph search-based methods (such as the time-varying Dijkstra algorithm) can guarantee accuracy, but their computational efficiency is low and cannot meet the needs of real-time queries; while pre-computation index-based methods (such as TD-PLL) offer fast query speeds, but the index building and maintenance costs are extremely high, making it difficult to adapt to dynamically changing traffic environments. Existing methods typically require building indexes for time intervals of up to 24 hours, but the accuracy of traffic forecasts drops sharply over time, and most user queries are concentrated in the near future (e.g., within the next 2 hours). This mismatch results in a huge waste of computational resources. Therefore, there is an urgent need in this field for a TDSP solution that can guarantee both query efficiency and accuracy while efficiently adapting to traffic forecast updates. Summary of the Invention

[0003] This application aims to propose a path query method that can improve the efficiency and accuracy of query results.

[0004] In a first aspect, embodiments of this application provide a path query method, including:

[0005] Obtain graph data of a time-varying road network. The graph data includes a vertex set, an edge set, a time-varying travel time function set, and a current time window. Multiple vertices in the vertex set are used to represent intersections. Multiple directed edges in the edge set are used to represent one-way road segments connecting the intersections. Multiple time-varying travel time functions in the time-varying travel time function set correspond to multiple directed edges. The time-varying travel time functions are used to represent the travel time through the corresponding one-way road segments at different departure times. The current time window is used to limit the effective time range of the time-varying travel time functions.

[0006] Based on the vertex set, the edge set, and the time-varying passage time function set, a time-varying H2H index is constructed;

[0007] Set a sliding time window based on the current time window;

[0008] The sliding time window is slid along the positive direction of the time axis at preset time intervals, and the corresponding updated traffic prediction data is obtained.

[0009] Based on the updated traffic prediction data, the time-varying H2H index is incrementally expanded and updated to obtain the updated time-varying H2H index.

[0010] Get the user's query request;

[0011] Based on the query request, using the updated time-varying H2H index, output the path with the shortest required travel time and the corresponding travel time for the query request.

[0012] According to some embodiments of this application, constructing a time-varying H2H index based on the vertex set, the edge set, and the time-varying passage time function set includes:

[0013] Based on the vertex set, the edge set, and the time-varying passage time function set, the time-varying road network is decomposed into a tree. A tree structure is generated through iterative vertex elimination operations. When eliminating each vertex, shortcut edges are created or updated for the neighbor pairs of the vertex. The function value of the shortcut edge is obtained by calculating the corresponding time-varying passage time function.

[0014] Based on the tree structure, the outgoing and incoming markers between each vertex and its ancestor nodes are calculated in reverse order of vertex elimination to obtain the time-varying H2H index. The outgoing marker is used to store the target travel time function from the vertex to the ancestor node, and the incoming marker is used to store the target travel time function from the ancestor node to the vertex. The target travel time function represents the minimum travel time among all possible paths between two vertices within the current time window. The function values ​​of the outgoing and incoming markers are obtained by calculating the corresponding time-varying travel time function.

[0015] According to some embodiments of this application, the step of constructing a time-varying H2H index based on the vertex set, the edge set, and the time-varying passage time function set further includes:

[0016] For directed edges in the edge set that lack corresponding reverse edges, create virtual edges and assign virtual travel time functions with values ​​of positive infinity to the virtual edges.

[0017] According to some embodiments of this application, the step of constructing a time-varying H2H index based on the vertex set, the edge set, and the time-varying passage time function set further includes:

[0018] During vertex elimination, if there is no effective path between the neighbor pairs of a vertex to calculate the function value of the shortcut edge, then a virtual shortcut edge is created for the neighbor pair, and a virtual travel time function with a value of positive infinity is assigned to the virtual shortcut edge.

[0019] According to some embodiments of this application, the step of constructing a time-varying H2H index based on the vertex set, the edge set, and the time-varying passage time function set further includes:

[0020] If there is no valid path between the vertex and the ancestor node to calculate the outgoing and incoming markers, then a virtual marker is created for the vertex, and a virtual travel time function with a value of positive infinity is assigned to the virtual marker.

[0021] According to some embodiments of this application, the incremental expansion and updating of the time-varying H2H index based on the updated traffic prediction data includes:

[0022] Determine the latest valid departure time for each of the time-varying travel time functions in the time-varying H2H index;

[0023] The latest valid departure time of each of the time-varying passage time functions is extended to the end time after the sliding time window has been slid;

[0024] Based on the association relationship of each vertex in the time-varying H2H index, the time-varying travel time function of the directed edges of each path is constructed through function composition processing. The time-varying travel time function of each shortcut edge, the exit mark and the entry mark after sliding in the sliding time window is calculated to obtain the extended time-varying travel time function generated by the function composition processing.

[0025] Update the extended time-varying passage time function to the time-varying H2H index.

[0026] According to some embodiments of this application, when calculating the time-varying passage time function of each of the shortcut edges, the exit marker and the entry marker after the sliding time window has slid, the intermediate state data in the calculation process is temporarily stored.

[0027] After the calculation process is completed and the extended time-varying passage time function is obtained, the extended time-varying passage time function is updated in the time-varying H2H index.

[0028] According to some embodiments of this application, it also includes:

[0029] Establish a record of the time interval segment dependency relationship of each of the time-varying passage time functions in the time-varying H2H index;

[0030] When a change in the time interval of the time-varying passage time function in the time-varying passage time function set is detected, the time interval that needs to be updated is determined according to the dependency record;

[0031] For the time interval segment that needs to be updated, the corresponding time-varying passage time function is regenerated through the function composition process.

[0032] According to some embodiments of this application, the step of outputting the path with the shortest required travel time and the corresponding travel time corresponding to the query request using the updated time-varying H2H index, based on the query request, includes:

[0033] If the departure time in the query request falls within the time interval after the sliding time window has been moved, and the departure time falls within the time interval covered by the updated traffic prediction data:

[0034] With the outgoing and incoming markers in the updated time-varying H2H index already calculated, a query is performed using the outgoing and incoming markers according to the query request, and the path with the shortest required travel time and the corresponding travel time corresponding to the query request are output.

[0035] If the outgoing and incoming markers in the updated time-varying H2H index have not been calculated, and the shortcut edges in the updated time-varying H2H index have been calculated, then according to the query request, the shortcut edges are used in combination with the bidirectional time-varying Dijkstra algorithm to perform the query, and the path with the shortest required travel time and the corresponding travel time corresponding to the query request are output.

[0036] If the outgoing and incoming markers in the updated time-varying H2H index have not been calculated, and the shortcut edges in the updated time-varying H2H index have not been calculated, the time-varying Dijkstra algorithm is used to perform a query based on the query request, and the path with the shortest required travel time and the corresponding travel time corresponding to the query request are output.

[0037] According to some embodiments of this application, the step of outputting the path with the shortest required travel time and the corresponding travel time corresponding to the query request using the updated time-varying H2H index, based on the query request, includes:

[0038] If the departure time in the query request is outside the time interval after the sliding time window has been slid, or if the departure time is outside the time interval covered by the updated traffic forecast data:

[0039] Based on the query request, the outgoing and incoming markers in the time-varying H2H index before the update are used to perform the query, and the path with the shortest required travel time and the corresponding travel time corresponding to the query request are output.

[0040] Secondly, embodiments of this application provide an electronic device, including:

[0041] At least one processor;

[0042] At least one memory for storing at least one program;

[0043] The path lookup method described above is implemented when at least one program is executed by at least one processor.

[0044] Thirdly, embodiments of this application provide a path query device, which is equipped with the electronic equipment described above.

[0045] Fourthly, embodiments of this application provide a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to implement the path query method described above.

[0046] Fifthly, embodiments of this application provide a path query device, including:

[0047] The first acquisition module is used to acquire graph data of a time-varying road network. The graph data includes a vertex set, an edge set, a time-varying travel time function set, and a current time window. Multiple vertices in the vertex set are used to represent intersections, and multiple directed edges in the edge set are used to represent one-way road segments connecting the intersections. Multiple time-varying travel time functions in the time-varying travel time function set correspond to multiple directed edges. The time-varying travel time functions are used to represent the travel time through the corresponding one-way road segments at different departure times. The current time window is used to limit the effective time range of the time-varying travel time functions.

[0048] The construction module is used to construct a time-varying H2H index based on the vertex set, the edge set, and the time-varying passage time function set;

[0049] The setting module is used to set a sliding time window based on the current time window;

[0050] A sliding module is used to slide the sliding time window along the positive direction of the time axis at preset time intervals and obtain the corresponding updated traffic prediction data.

[0051] An update module is used to incrementally expand and update the time-varying H2H index based on the updated traffic prediction data to obtain the updated time-varying H2H index.

[0052] The second acquisition module is used to acquire the user's query request;

[0053] The query module is used to output the path with the shortest required travel time and the corresponding travel time corresponding to the query request, based on the updated time-varying H2H index.

[0054] In this embodiment, by combining the time-varying H2H index with a sliding time window, a query response speed of milliseconds or even microseconds is achieved, significantly improving query efficiency. The sliding time window reduces the maintenance scope of the time-varying H2H index from the whole day to the near future. Combined with incremental expansion technology, the index update time is reduced from hours to minutes, greatly reducing the maintenance overhead of the time-varying H2H index. Through the frequently sliding time window and real-time updates of the time-varying H2H index, it is ensured that route planning is always based on updated and accurate traffic prediction data, improving the accuracy of query results.

[0055] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0056] The present application will be further described below with reference to the accompanying drawings and embodiments, wherein:

[0057] Figure 1 A flowchart illustrating an embodiment of the path query method provided in this application;

[0058] Figure 2 A schematic diagram of an embodiment of the electronic device provided in this application.

[0059] Figure label:

[0060] Electronic device 100, processor 110, memory 120. Detailed Implementation

[0061] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0062] In the description of this application, it should be understood that the orientation descriptions, such as up, down, etc., are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.

[0063] In the description of this application, "multiple" refers to two or more. The use of "first" and "second" is for the purpose of distinguishing technical features only and should not be construed as indicating or implying relative importance, or implicitly indicating the number of technical features indicated, or the order in which the technical features are indicated.

[0064] In the description of this application, unless otherwise expressly defined, terms such as "setup," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this application in conjunction with the specific content of the technical solution.

[0065] The following is based on Figures 1 to 2 This application describes a path query method provided by an embodiment.

[0066] This application provides a path query method, such as... Figure 1 As shown, it includes:

[0067] Step S100: Obtain the graph data of the time-varying road network. The graph data includes a vertex set, an edge set, a time-varying travel time function set, and a current time window. Multiple vertices in the vertex set are used to represent intersections, and multiple directed edges in the edge set are used to represent one-way road segments connecting intersections. Multiple time-varying travel time functions in the time-varying travel time function set correspond to multiple directed edges. The time-varying travel time functions are used to represent the travel time through the corresponding one-way road segments at different departure times. The current time window is used to limit the effective time range of the time-varying travel time functions.

[0068] Step S200: Construct a time-varying H2H index based on the vertex set, edge set, and time-varying passage time function set;

[0069] Step S300: Set a sliding time window based on the current time window;

[0070] Step S400: Slide the sliding time window along the positive direction of the time axis at preset time intervals and obtain the corresponding updated traffic prediction data;

[0071] Step S500: Based on the updated traffic prediction data, the time-varying H2H index is incrementally expanded and updated to obtain the updated time-varying H2H index;

[0072] Step S600: Obtain the user's query request;

[0073] Step S700: Based on the query request, use the updated time-varying H2H index to output the path with the shortest required travel time and the corresponding travel time for the query request.

[0074] In this embodiment, by combining the time-varying H2H index with a sliding time window, a query response speed of milliseconds or even microseconds is achieved, significantly improving query efficiency. The sliding time window reduces the maintenance scope of the time-varying H2H index from the whole day to the near future. Combined with incremental expansion technology, the index update time is reduced from hours to minutes, greatly reducing the maintenance overhead of the time-varying H2H index. Through the frequently sliding time window and real-time updates of the time-varying H2H index, it is ensured that route planning is always based on updated and accurate traffic prediction data, improving the accuracy of query results.

[0075] In step S100 above: the vertex set contains all vertices of the graph data of the time-varying road network, each vertex representing an intersection. The edge set contains all directed edges of the graph data of the time-varying road network, each directed edge denoted as e(u,v), representing a directed connection from vertex u to vertex v, each directed edge representing a one-way road segment connecting two intersections. The time-varying traffic time function set contains the time-varying traffic time function f_{u,v}(t) corresponding to each directed edge e(u,v) in the edge set. Each time-varying traffic time function f_{u,v} is a positive piecewise linear function, defined by a series of points:

[0076] f_{u,v}={(x1=t_s,y1),(x2,y2),...,(x_τ=t_e,y_τ)};

[0077] Where x_i represents the departure time, and y_i represents the travel time required to travel from vertex u to the directed edge e(u,v) at departure time x_i. For any departure time t∈[x_i,x_{i+1}], the travel time is calculated using linear interpolation:

[0078] f_{u,v}(t)=y_i+(t-x_i)*(y_{i+1}-y_i) / (x_{i+1}-x_i).

[0079] In step S300 above, the current time window T = [t_s, t_e] defines the effective time range of all current time-varying travel time functions f_{u, v}, where t_s represents the current time and t_e represents a future deadline. The sliding time window is a "sliding prediction window" whose length is much shorter than traditional methods, such as 2 hours instead of 24 hours, thus reducing computational complexity.

[0080] In step S500, traffic prediction data is updated every Δt time interval (e.g., 10 minutes), and each update performs two operations:

[0081] For sliding time windows: slide T from [t_s, t_e] to [t_s+Δt, t_e+Δt].

[0082] Update the time-varying traffic time function set: Based on the new traffic forecast data, modify the time-varying traffic time function: add new forecast values ​​to the new time interval [t_e,t_e+Δt], and update the forecast values ​​that have changed in the existing time interval [t_s+Δt,t_e].

[0083] In some embodiments of this application, the step S200 of "constructing a time-varying H2H index based on vertex set, edge set, and time-varying passage time function set" is further described. Step S200 includes:

[0084] Step S210: Based on the vertex set, edge set, and time-varying passage time function set, perform tree decomposition on the time-varying road network, generate a tree structure through iterative vertex elimination operation, and create or update shortcut edges for the neighbor pairs of each vertex when eliminating each vertex, wherein the function value of the shortcut edge is obtained by calculating the corresponding time-varying passage time function;

[0085] Step S220: Based on the tree structure, calculate the outgoing and incoming markers between each vertex and its ancestor nodes in reverse order of vertex elimination to obtain the time-varying H2H index. The outgoing marker is used to store the target travel time function from the vertex to the ancestor node, and the incoming marker is used to store the target travel time function from the ancestor node to the vertex. The target travel time function represents the minimum travel time among all possible paths between two vertices within the current time window. The function values ​​of the outgoing and incoming markers are obtained by calculating the corresponding time-varying travel time function.

[0086] In this implementation, the time-varying road network is first decomposed into a tree, and each vertex is processed sequentially according to the vertex elimination order (e.g., minimum degree priority order). When processing a vertex, a corresponding tree node is created, containing the current vertex and all its neighboring vertices. For each pair of neighboring vertices of the current vertex, the path travel time function via the current vertex is calculated (this function is obtained by combining the time-varying travel time functions between the current vertex and its neighboring vertices). Shortcut edges between neighboring vertices are created or updated by comparing and taking the minimum value. Each shortcut edge corresponds to a function value, which is the calculated target travel time function. For directed edges in the edge set that lack a corresponding reverse edge, a virtual edge is created, and a virtual travel time function with a value of positive infinity is assigned to the virtual edge. If there is no valid path between a vertex's neighbor pairs to calculate the function value of the shortcut edge, a virtual shortcut edge is created for that neighbor pair, and a virtual travel time function with a value of positive infinity is assigned to the virtual shortcut edge. If there is no valid path between a vertex and its ancestor nodes to calculate the infeed and outfeed labels, a virtual label is created for the vertex, and a virtual travel time function with a value of positive infinity is assigned to the virtual label.

[0087] By introducing virtual edges and virtual shortcut edges, and assigning them virtual travel time functions with values ​​of positive infinity, the computational challenges arising from the asymmetry and non-commutativity of time-varying travel time functions are effectively overcome. This makes the tree-based index construction method applicable to time-varying road networks, laying the foundation for efficient querying. The index construction process is entirely based on function composition and minimization operations, eliminating the need for time-consuming graph search processes. This computational approach significantly reduces the computational complexity of index construction and improves efficiency. The correctness and completeness of the time-varying H2H index structure are guaranteed. Through tree decomposition and the introduction of virtual edges and virtual shortcut edges, a complete tree structure and index labels can be generated under any network topology, ensuring the correctness and reliability of subsequent query results.

[0088] In some embodiments of this application, the step S500, "incrementally expanding and updating the time-varying H2H index based on the updated traffic forecast data," is further explained. Step S500 includes:

[0089] Step S510: Determine the latest valid departure time for each time-varying travel time function in the time-varying H2H index;

[0090] Step S520: Extend the latest valid departure time of each time-varying passage time function to the end time after the sliding time window has slid;

[0091] Step S530: Based on the association relationship of each vertex in the time-varying H2H index, the time-varying passage time function of the directed edges of each path is constructed through function composition processing. The time-varying passage time function of each shortcut edge, exit mark and entry mark after sliding in the sliding time window is calculated to obtain the extended time-varying passage time function generated by function composition processing.

[0092] Step S540: Update the extended time-varying passage time function to the time-varying H2H index.

[0093] In this implementation, the latest valid departure time of each time-varying travel time function in the time-varying H2H index is determined. The latest valid departure time refers to the latest time point that guarantees arrival at the destination before the end of the time window. Next, the latest valid departure time of each time-varying travel time function is extended to the end time after the sliding time window has slid. This step is achieved by expanding the upper time limit of the function's domain, providing a time range basis for subsequent calculations. Then, based on the association relationships of each vertex in the time-varying H2H index, the time-varying travel time functions of the directed edges of each path are constructed through function composition processing. The time-varying travel time functions of each shortcut edge, outgoing marker, and incoming marker after the sliding time window has slid are calculated. Function composition processing calculates the time-varying travel time functions of paths through function composition operations and selects the optimal path through minimization operations, ultimately obtaining the updated time-varying travel time functions to ensure the mathematical correctness of the calculation results. Finally, the calculated extended time-varying travel time functions are updated in the time-varying H2H index, replacing the original function values, completing the incremental expansion and update process of the time-varying H2H index. Through the above steps, efficient updates of the time-varying H2H index are achieved during time window sliding, ensuring both the timeliness and accuracy of the time-varying H2H index data and avoiding the computational overhead of completely rebuilding the time-varying H2H index.

[0094] In some embodiments of this application, when calculating the time-varying passage time function of each shortcut edge, exit mark, and entry mark after sliding in the sliding time window, the intermediate state data during the calculation process is temporarily stored; after the calculation process is completed and the extended time-varying passage time function is obtained, the extended time-varying passage time function is updated to the time-varying H2H index.

[0095] In this embodiment, during the incremental expansion and update of the time-varying H2H index based on the updated traffic prediction data, a temporary storage mechanism is used to ensure data consistency when calculating the time-varying traffic time function of each shortcut edge, outgoing marker, and incoming marker after sliding within the sliding time window.

[0096] Specifically, when calculating the extended time-varying passage time function through function composition, intermediate state data generated during the calculation process are stored in a temporary storage area. This intermediate state data includes, but is not limited to, partially calculated function fragments, path segment functions that have not yet undergone composition calculation, and intermediate results of minimization operations being compared. After the entire calculation process is completed and the complete extended time-varying passage time function is obtained, the final determined function value is updated in the time-varying H2H index, replacing the original function value. This process ensures that the original index data remains complete and available during the time-varying H2H index update; the entire time-varying H2H index is only atomically updated after all calculations have been confirmed to be correct. By using a temporary storage mechanism to separate intermediate state data from the formal index data, data consistency and reliability during the index update process are ensured. This method prevents inconsistencies in the time-varying H2H index state caused by partial updates during complex calculations, improving the stability and robustness of the time-varying H2H index update process. At the same time, this mechanism supports atomic commits in the update process, ensuring that query operations either see the complete old time-varying H2H index or the complete new time-varying H2H index, and do not see a time-varying H2H index in an inconsistent state in between.

[0097] In some embodiments of this application, it also includes:

[0098] Step S550: Establish time interval segment dependency records for each time-varying passage time function in the time-varying H2H index;

[0099] Step S560: When a change in the time interval of the time-varying passage time function in the time-varying passage time function set is detected, the time interval that needs to be updated is determined according to the dependency record;

[0100] Step S570: For the time interval segment that needs to be updated, regenerate the corresponding time-varying passage time function through function composition processing.

[0101] In this embodiment, during the construction and updating of the time-varying H2H index, a time interval segment dependency record for each time-varying travel time function in the time-varying H2H index is established and maintained. The dependency record is used to track the dependencies between each function segment and other function segments, specifically including:

[0102] Establish a dependency list, recording the source function segment information that each time interval segment of each time-varying passability function depends on. Each dependency is recorded in the form of a vertex-segment pair, indicating that the function segment depends on a specific function segment of a specific vertex.

[0103] A segment contribution map is established to record the contribution relationship of each function segment to the result function segment in function composition. This map supports bidirectional queries: it allows queries to determine which target function segments a source function segment contributes to, and also to determine which source function segments contribute to a target function segment.

[0104] When a change is detected in a specific time interval of a time-varying passage time function within a time-varying passage time function set, an impact range analysis is performed based on dependency records. First, the segment contribution mapping is queried to determine all target function segments affected by the changed segment; then, the dependency list is queried to determine all source function segments on which these target function segments depend.

[0105] Based on the dependency analysis results, the time intervals that need to be updated are determined. For each interval that needs updating, the corresponding time-varying travel time function is regenerated through function composition. Specifically, this includes: re-executing the function composition operation to calculate the path travel time, and re-executing the minimization operation to select the optimal path.

[0106] By establishing a refined segment-level dependency record, targeted time-varying H2H index updates are achieved. This method accurately identifies the affected function segment ranges, avoiding unnecessary updates to unaffected parts of the time-varying H2H index and significantly improving the efficiency of time-varying H2H index maintenance. Simultaneously, segment-level dependency tracking ensures the accuracy of the index update process, guaranteeing that the updated time-varying H2H index has consistent query accuracy with the fully rebuilt time-varying H2H index. This refined maintenance mechanism is particularly suitable for handling localized traffic prediction updates, greatly reducing the computational overhead of time-varying H2H index maintenance.

[0107] In some embodiments of this application, the step S700, "based on the query request, using the updated time-varying H2H index, outputting the path with the shortest required travel time and the corresponding travel time corresponding to the query request," is further explained. Step S700 includes:

[0108] Step S710: If the departure time in the query request falls within the time interval after the sliding time window has been moved, and the departure time is within the time interval covered by the updated traffic forecast data:

[0109] Step S720: With the outgoing and incoming markers in the updated time-varying H2H index already calculated, perform a query using the outgoing and incoming markers according to the query request, and output the path with the shortest required travel time and the corresponding travel time for the query request.

[0110] Step S730: If the outgoing and incoming markers in the updated time-varying H2H index have not been calculated, and the shortcut edges in the updated time-varying H2H index have been calculated, then according to the query request, use the shortcut edges combined with the bidirectional time-varying Dijkstra algorithm to perform the query, and output the path with the shortest required travel time and the corresponding travel time corresponding to the query request.

[0111] Step S740: If the outgoing and incoming markers in the updated time-varying H2H index have not been calculated, and the shortcut edges in the updated time-varying H2H index have not been calculated, perform a query using the time-varying Dijkstra algorithm according to the query request, and output the path with the shortest required travel time and the corresponding travel time for the query request.

[0112] In this implementation, after obtaining the user's query request, a multi-stage query strategy is adopted to output the query results based on the departure time characteristics and the update status of the time-varying H2H index in the query request:

[0113] Phase 1: Prioritize querying the marker layer

[0114] If the departure time in the query request falls within the time interval after the sliding time window has been moved, and is also within the time interval covered by the updated traffic forecast data, the system first checks whether the outgoing and incoming markers in the updated time-varying H2H index have been calculated. If they have, the system then uses the outgoing and incoming markers to perform the query, directly outputting the path with the shortest required travel time and the corresponding travel time.

[0115] Phase Two: Quick Edge-Level Auxiliary Queries

[0116] If the outgoing and incoming markers have not been calculated, but the shortcut edges in the updated time-varying H2H index have been calculated, then the query is performed using shortcut edges combined with the bidirectional time-varying Dijkstra algorithm, based on the query request. This query performs a bidirectional search on the enhanced graph containing the original graph and all shortcut edges, outputting the shortest path with the required travel time corresponding to the query request, along with the corresponding travel time.

[0117] Phase 3: Basic Map Query Guarantee

[0118] If the outgoing and incoming markers have not been calculated, and the shortcut edges have not been calculated either, then based on the query request, the time-varying Dijkstra algorithm is directly used to query the original graph, and the path with the shortest required travel time corresponding to the query request and the corresponding travel time are output.

[0119] By employing a multi-stage query approach and dynamically selecting query strategies based on the time-varying H2H index update status, an optimal balance between query efficiency and data freshness is achieved. This method ensures timely query services at any index update stage: providing the fastest query response when the marker layer update is complete; providing accelerated queries when the marker layer is not complete but shortcut edges are available; and providing basic query guarantees when the time-varying H2H index is not updated at all. This hierarchical query mechanism significantly improves query availability and response efficiency, ensuring that users still obtain accurate path query results during the time-varying H2H index update process.

[0120] In some embodiments of this application, the step S750, "based on the query request, using the updated time-varying H2H index, outputting the path with the shortest required travel time and the corresponding travel time corresponding to the query request," is further explained. Step S750 also includes:

[0121] Step S750: If the departure time in the query request is outside the time interval after the sliding time window has been slid, or if the departure time is outside the time interval covered by the updated traffic forecast data:

[0122] Step S760: Based on the query request, use the outgoing and incoming markers in the time-varying H2H index before the update to perform the query, and output the path with the shortest required travel time and the corresponding travel time corresponding to the query request.

[0123] In this implementation, after obtaining the user's query request, the time range of the query conditions is first verified. If the departure time in the query request is not within the time interval after the sliding time window has been slid, or if the departure time is not within the time interval covered by the updated traffic forecast data, a historical index query strategy is adopted.

[0124] Specifically, a copy of the time-varying H2H index before the update is used, which contains complete out and in tags. When the above time conditions are met, the copy of the time-varying H2H index is directly invoked, and the query is processed using the out and in tags from the historical index according to the query request.

[0125] During query processing, the system retrieves the tag information related to the source and destination vertices corresponding to the query request from the outgoing and incoming tags of the time-varying H2H index replicas. The target travel time function is calculated through tag combination, and the path with the shortest required travel time and its corresponding travel time are output accordingly. By intelligently determining the matching degree between the query time range and the current coverage of the time-varying H2H index, optimal allocation of query resources is achieved. This effectively utilizes the integrity and stability of the time-varying H2H index replicas, avoids unnecessary replica update operations, and significantly improves the efficiency and reliability of processing query requests for historical time periods. Simultaneously, it ensures the consistency of query results, guaranteeing stable and reliable path planning results for query requests within the same historical time period, enhancing usability and user experience.

[0126] In addition, this application provides an electronic device 100, such as... Figure 2 As shown, it includes:

[0127] At least one processor 110;

[0128] At least one memory 120 is used to store at least one program;

[0129] The path lookup method described above is implemented when at least one program is executed by at least one processor 110.

[0130] The electronic device 100 provided in this application embodiment can implement the various processes implemented in the above method embodiments and achieve the same beneficial effects. To avoid repetition, it will not be described again here.

[0131] In addition, this application provides a path query device, which is equipped with the electronic device 100 as described above.

[0132] The path query device provided in this application embodiment can implement the various processes implemented in the above method embodiment and achieve the same beneficial effects. To avoid repetition, it will not be described again here.

[0133] In addition, embodiments of this application provide a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to implement the path query method described above.

[0134] The computer-readable storage medium provided in this application embodiment can implement the various processes implemented in the above method embodiments and achieve the same beneficial effects. To avoid repetition, it will not be described again here.

[0135] In addition, embodiments of this application provide a path query device, including:

[0136] The first acquisition module is used to acquire graph data of the time-varying road network. The graph data includes a vertex set, an edge set, a time-varying travel time function set, and a current time window. Multiple vertices in the vertex set are used to represent intersections, and multiple directed edges in the edge set are used to represent one-way road segments connecting intersections. Multiple time-varying travel time functions in the time-varying travel time function set correspond to multiple directed edges. The time-varying travel time functions are used to represent the travel time through the corresponding one-way road segments at different departure times. The current time window is used to limit the effective time range of the time-varying travel time functions.

[0137] The building module is used to construct a time-varying H2H index based on the vertex set, edge set, and time-varying passage time function set;

[0138] The settings module is used to set a sliding time window based on the current time window.

[0139] The sliding module is used to slide the sliding time window along the positive direction of the time axis at preset time intervals and obtain the corresponding updated traffic prediction data.

[0140] The update module is used to incrementally expand and update the time-varying H2H index based on the updated traffic prediction data, so as to obtain the updated time-varying H2H index.

[0141] The second acquisition module is used to acquire the user's query request;

[0142] The query module is used to output the path with the shortest required travel time and the corresponding travel time based on the query request and the updated time-varying H2H index.

[0143] The path query device provided in this application embodiment can implement all the processes implemented in the above method embodiments and achieve the same beneficial effects. To avoid repetition, it will not be described again here.

[0144] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0145] The embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of this application.

Claims

1. A path query method, characterized in that, include: Obtain graph data of a time-varying road network. The graph data includes a vertex set, an edge set, a time-varying travel time function set, and a current time window. Multiple vertices in the vertex set are used to represent intersections. Multiple directed edges in the edge set are used to represent one-way road segments connecting the intersections. Multiple time-varying travel time functions in the time-varying travel time function set correspond to multiple directed edges. The time-varying travel time functions are used to represent the travel time through the corresponding one-way road segments at different departure times. The current time window is used to limit the effective time range of the time-varying travel time functions. Based on the vertex set, the edge set, and the time-varying passage time function set, a time-varying H2H index is constructed; Set a sliding time window based on the current time window; The sliding time window is slid along the positive direction of the time axis at preset time intervals, and the corresponding updated traffic prediction data is obtained. Based on the updated traffic prediction data, the time-varying H2H index is incrementally expanded and updated to obtain the updated time-varying H2H index. Get the user's query request; Based on the query request, using the updated time-varying H2H index, output the path with the shortest required travel time and the corresponding travel time for the query request.

2. The path query method according to claim 1, characterized in that, The construction of a time-varying H2H index based on the vertex set, the edge set, and the time-varying passage time function set includes: Based on the vertex set, the edge set, and the time-varying passage time function set, the time-varying road network is decomposed into a tree. A tree structure is generated through iterative vertex elimination operations. When eliminating each vertex, shortcut edges are created or updated for the neighbor pairs of the vertex. The function value of the shortcut edge is obtained by calculating the corresponding time-varying passage time function. Based on the tree structure, the outgoing and incoming markers between each vertex and its ancestor nodes are calculated in reverse order of vertex elimination to obtain the time-varying H2H index. The outgoing marker is used to store the target travel time function from the vertex to the ancestor node, and the incoming marker is used to store the target travel time function from the ancestor node to the vertex. The target travel time function represents the minimum travel time among all possible paths between two vertices within the current time window. The function values ​​of the outgoing and incoming markers are obtained by calculating the corresponding time-varying travel time function.

3. The path query method according to claim 2, characterized in that, The construction of the time-varying H2H index based on the vertex set, the edge set, and the time-varying passage time function set further includes: For directed edges in the edge set that lack corresponding reverse edges, create virtual edges and assign virtual travel time functions with values ​​of positive infinity to the virtual edges.

4. The path query method according to claim 2, characterized in that, The construction of the time-varying H2H index based on the vertex set, the edge set, and the time-varying passage time function set further includes: If there is no valid path between the neighbor pairs of the vertex to calculate the function value of the shortcut edge, then a virtual shortcut edge is created for the neighbor pair, and a virtual travel time function with a value of positive infinity is assigned to the virtual shortcut edge.

5. The path query method according to claim 2, characterized in that, The construction of the time-varying H2H index based on the vertex set, the edge set, and the time-varying passage time function set further includes: If there is no valid path between the vertex and the ancestor node to calculate the outgoing and incoming markers, then a virtual marker is created for the vertex, and a virtual travel time function with a value of positive infinity is assigned to the virtual marker.

6. The path query method according to claim 2, characterized in that, The incremental expansion and updating of the time-varying H2H index based on the updated traffic prediction data includes: Determine the latest valid departure time for each of the time-varying travel time functions in the time-varying H2H index; The latest valid departure time of each of the time-varying passage time functions is extended to the end time after the sliding time window has been slid; Based on the association relationship of each vertex in the time-varying H2H index, the time-varying travel time function of the directed edges of each path is constructed through function composition processing. The time-varying travel time function of each shortcut edge, the exit mark and the entry mark after sliding in the sliding time window is calculated to obtain the extended time-varying travel time function generated by the function composition processing. Update the extended time-varying passage time function to the time-varying H2H index.

7. The path query method according to claim 6, characterized in that: When calculating the time-varying passage time function of each of the shortcut edges, the exit marker, and the entry marker after the sliding time window has slid, the intermediate state data during the calculation process is temporarily stored. After the calculation process is completed and the extended time-varying passage time function is obtained, the extended time-varying passage time function is updated in the time-varying H2H index.

8. The path query method according to claim 6, characterized in that, Also includes: Establish a record of the time interval segment dependency relationship of each of the time-varying passage time functions in the time-varying H2H index; When a change in the time interval of the time-varying passage time function in the time-varying passage time function set is detected, the time interval that needs to be updated is determined according to the dependency record; For the time interval segment that needs to be updated, the corresponding time-varying passage time function is regenerated through the function composition process.

9. The path query method according to claim 2, characterized in that, The step of outputting the path with the shortest required travel time and the corresponding travel time corresponding to the query request, based on the updated time-varying H2H index, includes: If the departure time in the query request falls within the time interval after the sliding time window has been moved, and the departure time falls within the time interval covered by the updated traffic prediction data: With the outgoing and incoming markers in the updated time-varying H2H index already calculated, a query is performed using the outgoing and incoming markers according to the query request, and the path with the shortest required travel time and the corresponding travel time corresponding to the query request are output. If the outgoing and incoming markers in the updated time-varying H2H index have not been calculated, and the shortcut edges in the updated time-varying H2H index have been calculated, then according to the query request, the shortcut edges are used in combination with the bidirectional time-varying Dijkstra algorithm to perform the query, and the path with the shortest required travel time and the corresponding travel time corresponding to the query request are output. If the outgoing and incoming markers in the updated time-varying H2H index have not been calculated, and the shortcut edges in the updated time-varying H2H index have not been calculated, the time-varying Dijkstra algorithm is used to perform a query based on the query request, and the path with the shortest required travel time and the corresponding travel time corresponding to the query request are output.

10. The path query method according to claim 9, characterized in that, The step of outputting the path with the shortest required travel time and the corresponding travel time corresponding to the query request, based on the updated time-varying H2H index, includes: If the departure time in the query request is outside the time interval after the sliding time window has been slid, or if the departure time is outside the time interval covered by the updated traffic forecast data: Based on the query request, the outgoing and incoming markers in the time-varying H2H index before the update are used to perform the query, and the path with the shortest required travel time and the corresponding travel time corresponding to the query request are output.