Training method and prediction method of traffic time distribution prediction model, equipment and medium

By acquiring discretized labels and traffic spatiotemporal feature sequences, and using the graph attention network algorithm to train a deep learning model, the problems of low training efficiency and low accuracy of the travel time distribution prediction model are solved, achieving more efficient and accurate prediction.

CN121724201APending Publication Date: 2026-03-24CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-16
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing travel time distribution prediction models suffer from low training efficiency and low prediction accuracy, mainly because they are trained based on individual continuous historical travel times, neglecting travel uncertainties and road characteristics.

Method used

By acquiring discretized labels of historical travel times and traffic spatiotemporal feature sequences, a graph attention network algorithm is used to extract traffic flow change relationships. This is then combined with a deep learning model for training to construct a travel time distribution prediction model.

Benefits of technology

It improves the efficiency of model training and prediction accuracy, accelerates the convergence speed through discretization, and enhances prediction accuracy by combining road features for prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121724201A_ABST
    Figure CN121724201A_ABST
Patent Text Reader

Abstract

The invention provides a traffic time distribution prediction model training method, a traffic time distribution prediction method, equipment and a medium, relates to the technical field of traffic, and is used for improving the training efficiency and prediction accuracy of a traffic time distribution prediction model. The method comprises the following steps: acquiring a corresponding discretization label through each historical passing time; in a historical passage path corresponding to each historical passage time, through a graph attention network algorithm, extracting a corresponding traffic space-time characteristic sequence indicating a flow change relationship between a starting point and an end point, and then taking the obtained at least one group of discretization labels and the corresponding traffic space-time characteristic sequence as training data; and training the to-be-trained deep learning model to obtain a traffic time distribution prediction model. Therefore, the training efficiency and the prediction accuracy of the traffic time distribution prediction model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of transportation technology, and in particular to a training method, prediction method, equipment and medium for a travel time distribution prediction model. Background Technology

[0002] Travel time distribution prediction is used to predict the complete probability distribution of the time required to travel a certain route within a future time period. Related travel time distribution prediction schemes typically train prediction models based on individual, continuous historical travel times.

[0003] However, prediction models trained based on individual continuous historical passage times suffer from low training efficiency and low prediction accuracy. Summary of the Invention

[0004] This application provides a training method, prediction method, device, and medium for a travel time distribution prediction model, which can improve the training efficiency and prediction accuracy of the travel time distribution prediction model.

[0005] Firstly, this application provides a training method for a travel time distribution prediction model, comprising: Obtain at least one set of historical passage times and at least one set of corresponding historical passage paths; Based on at least one set of historical travel times, obtain at least one set of corresponding discretized labels. A set of discretized labels is used to indicate the travel time in different travel time intervals within the corresponding set of historical travel times. In at least one set of historical travel paths, at least one set of traffic spatiotemporal feature sequences are extracted using a graph attention network algorithm. A set of traffic spatiotemporal feature sequences is used to indicate the flow change relationship from the origin to the destination in the corresponding set of historical travel paths. At least one set of discretized labels and at least one corresponding set of traffic spatiotemporal feature sequences are used as training data to train the deep learning model to obtain a travel time distribution prediction model.

[0006] The technical solution provided in this application offers at least the following advantages: It obtains corresponding discrete labels based on historical travel times; within the historical travel paths corresponding to each historical travel time, it extracts traffic spatiotemporal feature sequences indicating the flow change relationship between the starting and ending points using a graph attention network algorithm; then, it uses at least one set of discrete labels and the corresponding traffic spatiotemporal feature sequences as training data to train a deep learning model, thereby obtaining a travel time distribution prediction model. Thus, by transforming large amounts of continuous time data into smaller amounts of discrete labels for training the prediction model, the convergence speed is accelerated, and training efficiency is improved; the prediction model trained by combining the traffic spatiotemporal feature sequences and discrete labels corresponding to each historical travel path can predict travel time distribution by incorporating road features, thereby improving prediction accuracy.

[0007] One possible implementation involves obtaining at least one set of discretized labels based on at least one set of historical travel times, including: performing one-hot encoding on each historical travel time to obtain multiple sets of one-hot labels, where the one-hot labels are used to indicate the encoding of the travel time within the corresponding travel time interval; Each unique heat label is smoothed to obtain the corrected unique heat labels. All corrected unique heat labels are used as discretized labels.

[0008] Another possible implementation is to perform one-hot encoding on the historical travel times in each historical travel record to obtain multiple sets of one-hot labels, including: determining the normal travel time and / or long-tail travel time based on the historical travel time, where the normal travel time is used to indicate the time portion during peak travel periods, and the long-tail travel time is used to indicate the time portion during off-peak travel periods. By pre-setting a regular travel window, the regular travel time is divided into multiple first travel sub-intervals. Based on the travel time corresponding to each first travel sub-interval, a unique hot label for the regular travel time is generated. The first travel sub-interval is used to indicate the time interval within the regular travel time. By pre-setting a long-tail travel window, the long-tail travel time is divided into multiple second travel sub-intervals. Based on the travel time corresponding to each second travel sub-interval, a unique hot label for the long-tail travel time is generated. The second travel sub-interval is used to indicate the time interval within the long-tail travel time.

[0009] Another possible implementation involves extracting at least one set of traffic spatiotemporal feature sequences using a graph attention network algorithm, including: constructing an initial spatial association graph based on all historical travel paths, whereby the initial spatial association graph is used to indicate the spatial relationships between each starting point and the destination in the historical travel paths; Based on the initial spatial association graph, the second adjacency matrix is ​​obtained. The second adjacency matrix is ​​used to indicate the reconstructed adjacency matrix that satisfies pairwise similarity. Based on the second adjacency matrix, the initial spatial association graph is updated to obtain the target spatial association graph, which is used to indicate the spatial relationships in the historical travel path after excluding noise interference. By using a graph attention network algorithm, the target space association graph is convolved to obtain the traffic spatiotemporal feature sequence.

[0010] Another possible implementation involves constructing an initial spatial association graph based on all historical travel paths, including: constructing a first adjacency matrix based on the start and end points of each historical travel path, where each node in the first adjacency matrix indicates the start and end points; The weights between adjacent nodes are obtained based on the spatial distance between each starting point and the ending point. Based on the nodes in the first adjacency matrix and the weights between the nodes, an initial spatial association graph is constructed.

[0011] Another possible implementation involves determining the weights between adjacent nodes based on the spatial distance between each starting point and ending point, including: Calculate the first average Euclidean distance between adjacent starting points as the weight between adjacent starting points. The first average Euclidean distance is used to indicate the average spatial distance between destinations in a travel path that starts from the same starting point but has different destinations. Calculate the second average Euclidean distance between adjacent endpoints as a weight between adjacent endpoints. The second average Euclidean distance is used to indicate the average spatial distance between starting points in a travel path that arrives at the same endpoint but has different starting points. The third average Euclidean distance between the start and end points in the historical travel paths is calculated and used as the weight of the start and end points in the historical travel paths. The third average Euclidean distance is used to indicate the average straight-line distance between each start point and its corresponding end point in all travel paths.

[0012] Another possible implementation is to update the initial spatial association graph based on the second adjacency matrix to obtain the target spatial association graph, including: in the second adjacency matrix, sorting the weights between adjacent nodes in descending order from high to low, and taking the preset number of weights in the upper position as the target weights; In the second adjacency matrix, the target weight is retained, and all weights other than the target weight are updated to zero, resulting in the updated second adjacency matrix. Based on the updated second adjacency matrix, the corresponding symmetric post-adjacency matrix is ​​obtained. The symmetric post-adjacency matrix and the first adjacency matrix are then fused using residuals to obtain the target fusion matrix. The target fusion matrix is ​​used to indicate the target spatial association graph.

[0013] Secondly, this application provides a method for predicting travel time distribution, including: obtaining the target travel path to be traveled; The target travel path is input into the travel time distribution prediction model to obtain the predicted travel time probability. The travel time probability is used to indicate the probability that the user will need a certain amount of time to travel through the target travel path. The travel time distribution prediction model is trained using the training method described above.

[0014] Thirdly, this application provides an electronic device comprising: a processor and a memory; the memory storing processor-executable instructions; when the processor is configured to execute the instructions, causing the electronic device to implement the methods of the first and second aspects described above.

[0015] Fourthly, this application provides a computer-readable storage medium comprising: computer software instructions; which, when executed in an electronic device, cause the electronic device to implement the methods of the first and second aspects described above.

[0016] The beneficial effects of the second to fourth aspects mentioned above are described in the corresponding description of the first aspect and will not be repeated here. Attached Figure Description

[0017] Figure 1 A flowchart illustrating a training method for a travel time distribution prediction model provided in an embodiment of this application; Figure 2 A flowchart illustrating another training method for a travel time distribution prediction model provided in this application embodiment; Figure 3 A flowchart illustrating a training method for another travel time distribution prediction model provided in this application embodiment; Figure 4 A flowchart illustrating a training method for another travel time distribution prediction model provided in this application embodiment; Figure 5 A flowchart illustrating a training method for another travel time distribution prediction model provided in this application embodiment; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0018] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0019] To facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish the same or similar items with essentially the same function and effect. Those skilled in the art can understand that the terms "first" and "second" are not intended to limit the quantity or execution order.

[0020] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.

[0021] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0022] In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0023] In current travel scenarios, predicting travel time is becoming increasingly important. Relevant prediction methods for travel time include travel time forecasting and travel time distribution forecasting.

[0024] Travel time prediction refers to forecasting the individual point in time of arrival at the destination. Related methods include segment-based and route-based approaches. Segment-based methods first independently estimate the travel time for each segment, then aggregate the overall travel time by adding additional waiting times at intersections. Route-based methods, on the other hand, focus on capturing segment dependencies within each route to provide end-to-end travel time predictions.

[0025] However, the relevant travel time prediction methods are mainly trained under the supervision of single-label real travel times, ignoring the probabilistic nature of travel time under various travel uncertainties. Therefore, the predicted arrival time has a large error compared with the actual arrival time.

[0026] Travel time distribution prediction refers to the complete probability distribution of the time required to travel along a certain route within a future time period. Related schemes for travel time distribution prediction include parametric and non-parametric algorithm models. Parametric algorithm models typically use machine learning and deep learning models to estimate the probability distribution based on prior features of the observed travel time distribution shape in traffic data. Non-parametric algorithm models, on the other hand, can predict non-parametric travel time distributions in scenarios where historical travel time distributions are unavailable, using quantile regression and ensemble methods.

[0027] However, in the relevant schemes for predicting travel time distribution, parametric algorithm models are usually trained based on continuous historical travel times without discretizing the historical travel times, which results in slow convergence speed and low training efficiency. Non-parametric algorithm models cannot extract road traffic features of travel paths, resulting in low prediction accuracy.

[0028] Therefore, the relevant schemes for predicting travel time distribution suffer from drawbacks such as low training efficiency of the prediction model and low prediction accuracy.

[0029] To address the aforementioned technical problems, this application provides a training method for a travel time distribution prediction model, as well as a travel time distribution prediction method. Figure 1 A flowchart illustrating a training method for a travel time distribution prediction model provided in this application embodiment is shown below. Figure 1 As shown, the method includes: S101. Obtain at least one set of historical passage times and at least one set of corresponding historical passage paths.

[0030] As an example, multiple sets of travel records are obtained from the historical travel database. Each set of travel records corresponds to the historical travel time of a single trip of the vehicle, as well as the historical travel route within the historical travel time.

[0031] Among them, the historical travel time is the time interval from the vehicle's departure time to its arrival time, and the historical travel path is the set of the road segments where the vehicle is located at each time within the corresponding historical travel time.

[0032] S102. Obtain at least one set of corresponding discretized tags based on at least one set of historical passage times.

[0033] As an example, after obtaining at least one set of historical travel times and corresponding historical travel routes, for each set of historical travel times, the historical travel times are divided into multiple time intervals using a preset travel window. Each time interval includes at least one time. The preset travel window includes a preset regular travel window and a preset long-tail travel window.

[0034] As an example, the one-hot algorithm is used to encode each time interval one-hot to obtain the corresponding discretized label, so that multiple times in the same time interval correspond to the same discretized label. The discretized label is used to indicate the travel time in different travel time intervals.

[0035] Among them, multiple discretized tags generated corresponding to a set of historical passage times are regarded as a set of discretized tags.

[0036] S103. Extract at least one set of traffic spatiotemporal feature sequences from at least one set of historical travel routes using a graph attention network algorithm.

[0037] As an example, based on all historical travel routes, a corresponding initial spatial association graph is constructed. The initial spatial association graph is used to indicate the spatial and traffic flow changes of each road segment in the travel route. The nodes in the initial spatial association graph are used to indicate the location of each road segment in each historical travel route and the corresponding traffic flow. The weights between the nodes in the initial spatial association graph are used to indicate the similarity of the locations of each road segment.

[0038] In one implementation, the initial spatial correlation map is updated to obtain a target spatial correlation map, wherein the target spatial correlation map indicates the spatial relationships and traffic flow changes of each road segment after noise interference has been eliminated.

[0039] As an example, at least one set of traffic spatiotemporal feature sequences is extracted from the target spatial association graph using a graph attention network algorithm. The traffic spatiotemporal feature sequences include multiple node embedding vectors that are on the same historical travel path. The node embedding vectors are used to indicate the traffic flow changes at each road segment location on the historical travel path.

[0040] S104. Use at least one set of discretized labels and at least one set of corresponding traffic spatiotemporal feature sequences as training data to train the deep learning model to obtain a traffic time distribution prediction model.

[0041] As an example, a set of discretized labels corresponding to historical travel times and a set of traffic spatiotemporal feature sequences corresponding to historical travel paths are used as a set of sample data. Multiple sets of sample data are used as training data to train the conditional variational autoencoder model to be trained, thus obtaining the trained travel time distribution prediction model.

[0042] During the training phase, the Conditional Variational Autoencoder (CVA) model requires inputting a set of discretized labels corresponding to each historical travel time, and a set of traffic spatiotemporal feature sequences corresponding to historical travel paths, into the encoder. The encoder learns the posterior probability distribution relationship among multiple sets of discretized labels and corresponding traffic spatiotemporal feature sequences. The posterior probability distribution relationship indicates the probability of the required travel time for the target travel path within a given travel time interval. For example, during Friday evening rush hour, the probability of a travel path with a travel time of 60 minutes is 0.8.

[0043] After training the conditional variational autoencoder model to obtain the travel time distribution prediction model, the target travel path is obtained and input into the travel time distribution prediction model. The model then extracts the target spatiotemporal feature sequence of the target travel path. Based on this sequence, the model calculates the predicted travel time probability, which indicates the probability that a user will need a specific time interval to traverse the target travel path.

[0044] In this embodiment, discrete labels are obtained based on historical travel times. Within the historical travel paths corresponding to each historical travel time, a graph attention network algorithm is used to extract traffic spatiotemporal feature sequences indicating the flow change relationship between the starting and ending points. At least one set of discrete labels and the corresponding traffic spatiotemporal feature sequences are then used as training data to train the deep learning model, resulting in a travel time distribution prediction model. Thus, by transforming large amounts of continuous time data into smaller amounts of discrete labels for training the prediction model, the convergence speed is accelerated, and training efficiency is improved. The prediction model trained by combining the traffic spatiotemporal feature sequences and discrete labels corresponding to each historical travel path can predict travel time distribution by incorporating road features, thereby improving prediction accuracy.

[0045] Figure 2 This is a flowchart illustrating a training method for another travel time distribution prediction model provided in an embodiment of this application. Figure 2 As shown, in step S102 above, obtaining at least one set of corresponding discretized tags based on at least one set of historical passage times can be implemented as follows: S201. Perform unique hot encoding on each historical passage time to obtain multiple unique hot tags.

[0046] As an example, historical travel times are determined to fall within normal travel times or long-tail travel times, where normal travel times indicate the portion of time during peak travel periods, and long-tail travel times indicate the portion of time during off-peak travel periods.

[0047] In one implementation, historical travel times are divided into multiple travel sub-intervals by pre-setting a normal travel window or a pre-setting long-tail travel window. Each travel sub-interval includes multiple corresponding times. One-hot encoding is performed on each travel sub-interval to obtain a corresponding one-hot label. Times within the same travel sub-interval correspond to the same one-hot code. In this way, multiple one-hot labels for normal travel times and multiple one-hot labels for long-tail travel times are obtained.

[0048] S202. Perform smoothing correction on each unique hot label to obtain the corrected unique hot label, and use all the corrected unique hot labels as discretization labels.

[0049] As an example, after obtaining the one-hot labels corresponding to each passage time, the one-hot labels are corrected to avoid encoding errors that may occur in the one-hot algorithm, thereby mitigating the possible computational errors when training the conditional variational autoencoder model using discretized labels.

[0050] In one possible implementation, the index of the modified discretized label is determined by the following formula (1):

[0051] in, Here, i represents the current index of the different travel sub-intervals divided by each preset window, and c represents the actual index of the travel sub-interval. To pre-set regular travel windows, For the preset long-tail travel window, p is the first preset hyperparameter controlling the smoothness of the labels, and ω is the second preset hyperparameter controlling the width of the local distribution support. The third preset hyperparameter is used to control the smoothness of the label.

[0052] Figure 3 This is a flowchart illustrating a training method for another travel time distribution prediction model provided in an embodiment of this application. Figure 3 As shown, in step S201 above, performing one-hot encoding on each historical passage time to obtain multiple one-hot tags can be implemented as follows: S2011. By pre-setting the ordinary travel window, the ordinary travel time is divided into multiple first travel sub-intervals. Based on the travel time corresponding to each first travel sub-interval, a unique hot tag for the ordinary travel time is generated.

[0053] As an example, if the historical travel time is less than the hyperparameter J of the normal travel time interval boundary, then the historical travel time is confirmed as the normal travel time.

[0054] In one possible implementation, a pre-set regular travel window is used. The normal travel time is divided into multiple first travel sub-intervals. The labels of the times in each first travel sub-interval are one-hot encoded to obtain the corresponding one-hot labels. One-hot labels mean that the labels of the times in the corresponding sub-interval are all set to one, and the labels of the times not in the corresponding sub-interval are all set to zero, such as

[00100] .

[0055] S2012. By pre-setting the long-tail travel window, the long-tail travel time is divided into multiple second travel sub-intervals. Based on the travel time corresponding to each second travel sub-interval, a unique hot tag is generated for the long-tail travel time.

[0056] As an example, if the historical travel time is greater than the hyperparameter J of the normal travel time boundary but less than the hyperparameter K of the long-tail travel time boundary, then for the time portion within the normal travel time, a preset normal travel window is used. Divide the trip into multiple first-trip sub-intervals, and for the time segments that fall within the long-tail travel time, use preset long-tail travel windows. Divide the second row into multiple sub-intervals.

[0057] Among them, a pre-set regular travel window Smaller than the preset long-tail travel window .

[0058] In one possible implementation, for a first travel sub-interval including multiple corresponding times, each first travel sub-interval is uniquely encoded to obtain a corresponding uniquely hot label, and in the ordinary travel time part, multiple uniquely hot labels about ordinary travel times are obtained; for a second travel sub-interval including multiple corresponding times, each second travel sub-interval is uniquely encoded to obtain a corresponding uniquely hot label, and in the long-tail travel time part, multiple uniquely hot labels about long-tail travel times are obtained.

[0059] In summary, the indexes of the unique hot labels corresponding to each of the first and second travel sub-intervals are obtained through the following formula (2): (2); in, For unique hot tag indexing, For the historically accepted time period, To pre-set regular travel windows, For the preset long-tail travel window, N is the number of first travel sub-intervals obtained after being divided by the preset ordinary travel window within the ordinary travel time interval, and M is the number of first travel sub-intervals and second travel sub-intervals obtained after being divided by the corresponding preset ordinary travel window within the long-tail travel time interval and the ordinary travel time interval.

[0060] Figure 4 This is a flowchart illustrating a training method for another travel time distribution prediction model provided in an embodiment of this application. Figure 4 As shown, in step S103 above, extracting at least one set of traffic spatiotemporal feature sequences using the graph attention network algorithm can be achieved through the following steps: S301. Based on all historical travel routes, construct an initial spatial relationship diagram. The initial spatial relationship diagram is used to indicate the spatial relationship between each starting point and the ending point in the historical travel routes.

[0061] As an example, the locations of each road segment in each group of historical travel paths are numbered. Based on the location number and traffic flow of each road segment, a corresponding first adjacency matrix is ​​constructed. The nodes in the first adjacency matrix indicate the spatial and traffic flow of each road segment location. Based on the spatial distance between nodes in each historical travel path, the weights of the edges between adjacent nodes are calculated. Based on each node and the weights of the edges between adjacent nodes, an initial spatial association graph is constructed. .

[0062] S302. Based on the initial spatial association graph, the second adjacency matrix is ​​obtained. The second adjacency matrix is ​​used to indicate the reconstructed adjacency matrix that satisfies pairwise similarity.

[0063] As an example, after constructing the initial spatial relation graph, node embeddings are obtained from the initial spatial relation graph using a graph learner based on metric learning. Then, the adjacency matrix is ​​reconstructed based on the pairwise similarity of the node embeddings to obtain the second adjacency matrix. The second adjacency matrix is ​​calculated using the following formula (3): (3); in, This represents a graph learner with parameter ω. This represents a metric function based on cosine similarity. Let be the weights of the edges between adjacent nodes in the initial spatial association graph. This is the first adjacency matrix.

[0064] S303. Based on the second adjacency matrix, update the initial spatial association graph to obtain the target spatial association graph.

[0065] As an example, since the input data of the graph attention network algorithm needs to be non-negative, after obtaining the second adjacency matrix, it is necessary to perform non-negative processing on the second adjacency matrix through an activation function to obtain the non-negative second adjacency matrix. The non-negative second adjacency matrix is ​​calculated by the following formula (4): (4); in, For activation function, This is the second adjacency matrix after non-negation processing.

[0066] As an example, for each node in the second adjacency matrix after non-negative processing, only the top K edges of its adjacent edges, sorted by edge weight, are retained, and the remaining edges are set to 0, in order to reduce computational cost and eliminate noise interference from edges with weak similarity relationships to subsequent model training.

[0067] As an example, for the second adjacency matrix after non-negative processing, the weights between adjacent nodes are sorted in descending order from high to low, and the weights at the top of the set number K are taken as the target weights; the target weights are retained, and the weights other than the target weights are updated to zero, resulting in the updated second adjacency matrix. The edge weights of each node in the updated second adjacency matrix are determined by the following formula (5): (5); in, The edge weights of each node in the updated second adjacency matrix are... The target weights of the preset number K are retained.

[0068] As an example, based on the updated second adjacency matrix, the corresponding symmetric post-adjacency matrix is ​​obtained, and the symmetric post-adjacency matrix is ​​residually fused with the first adjacency matrix to obtain the target fusion matrix indicating the target spatial association graph.

[0069] S304. Using the graph attention network algorithm, convolution is performed on the target space association graph to obtain the traffic spatiotemporal feature sequence.

[0070] As an example, after obtaining the target fusion matrix indicating the spatial association graph of the target, the graph attention network algorithm is used to perform graph convolution operation on the target fusion matrix to generate multiple node embedding vectors. The node embedding vectors are used to indicate the traffic flow changes at each road segment location. Multiple node embedding vectors that are on the same historical travel path are used as the traffic spatiotemporal feature sequence of the corresponding historical travel path.

[0071] Figure 5 This is a flowchart illustrating a training method for another travel time distribution prediction model provided in an embodiment of this application. Figure 5 As shown, in step S301 above, constructing the initial spatial association graph based on all historical travel paths can be achieved through the following steps: S3011. Based on the starting point and ending point of each historical travel path, construct the first adjacency matrix.

[0072] As an example, the locations of each road segment in each group of historical travel routes are numbered. For each road segment from the start to the end point in the same historical travel route, the corresponding start and end point arrays are obtained. Based on multiple sets of start-endpoint arrays of different historical travel paths, a first adjacency matrix including the locations of all road segments is constructed. .

[0073] S3012. Based on the spatial distance between each starting point and the ending point, obtain the weights between adjacent nodes.

[0074] As an example, in the first adjacency matrix, the first average Euclidean distance between adjacent starting points is calculated and used as the weight between adjacent starting points. The first average Euclidean distance is used to indicate the average Euclidean spatial distance between destinations on a travel path that starts from the same point but ends at different points.

[0075] As an example, the second average Euclidean distance between adjacent endpoints is calculated as the weight between adjacent endpoints. The second mean Euclidean distance is used to indicate the average spatial distance between starting points on a travel path that leads to the same destination but has different starting points.

[0076] As an example, the third mean Euclidean distance between the start and end points in the historical travel path is calculated as the weight of the location of each segment in the historical travel path. The third mean Euclidean distance is used to indicate the average straight-line distance between each starting point and corresponding ending point in the entire travel path.

[0077] The weights between adjacent nodes indicate the degree of similarity between historical travel paths. The greater the weights between the corresponding adjacent nodes in two historical travel paths, the higher the similarity between the two historical travel paths.

[0078] S3013. Based on each node in the first adjacency matrix and the weights between each node, construct an initial spatial association graph.

[0079] As an example, in the first adjacency matrix that includes the weights of adjacent nodes, weights less than a preset weight threshold are filtered out to remove connections between distant nodes with weak similarity. Based on the first adjacency matrix after weight filtering, an initial spatial association graph is constructed. .

[0080] Further explanation is provided regarding step S104, in which at least one set of discretized labels and at least one corresponding set of traffic spatiotemporal feature sequences are used as training data to train the deep learning model to be trained, thereby obtaining the travel time distribution prediction model.

[0081] When training the conditional variational autoencoder model, training is performed based on a constructed target loss function, which includes a first loss function, a second loss function, and a third loss function.

[0082] As an example, the first loss function is used to indicate the loss function for training at least one set of discretized labels; the second loss function is used to indicate the loss function for training the traffic spatiotemporal feature sequence; and the third loss function is used to indicate the loss function with respect to the mean absolute error (MAE), which indicates the error between the predicted travel time and the actual travel time.

[0083] For the first loss function, it is expressed by the following formula (6): (6); in, Let Q be the first loss function, and let Q be the total number of sub-intervals in the first and second trips. An index for discretized labels. These are the probability distribution parameters learned by the encoder.

[0084] The second loss function is expressed by the following formula (7): (7); in, M is the second loss function, used to restrict the numerical scale of the second loss function to be on the same dimension as the first loss function. The mean value in the conditional variational autoencoder model. The variance of the conditional variational autoencoder model, These are the embedding vectors for each node in the traffic spatiotemporal feature sequence.

[0085] Based on the first loss function, the second loss function, and the third loss function, a target loss function is constructed. The target loss function is expressed by the following formula (8): (8); in, For the first loss function, For the second loss function, This is the third loss function.

[0086] As can be seen, the above mainly describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, the embodiments of this application provide corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the modules and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.

[0087] This application embodiment can divide the training device and the travel time distribution prediction device of the travel time distribution prediction model into functional modules according to the above method example. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. Optionally, the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0088] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 6 As shown, the electronic device includes: a processor 602, a communication interface 603, and a bus 604. Optionally, the electronic device may also include a memory 601.

[0089] Processor 602 may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 602 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 602 may also be a combination implementing computational functions, such as including CPU0 and CPU1.

[0090] The communication interface 603 includes a receiving unit and a transmitting unit, and is used to connect with other devices via a communication network. This communication network can be Ethernet, a wireless access network, a wireless local area network (WLAN), etc.

[0091] The memory 601 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.

[0092] As one possible implementation, the memory 601 can exist independently of the processor 602. The memory 601 can be connected to the processor 602 via a bus 604 and is used to store instructions or program code. When the processor 602 calls and executes the instructions or program code stored in the memory 601, it can implement the training method and the prediction method of the travel time distribution prediction model provided in this embodiment of the invention.

[0093] In another possible implementation, the memory 601 can also be integrated with the processor 602.

[0094] Bus 604 can be an extended industry standard architecture (EISA) bus, etc. Bus 604 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0095] Through the above description of the implementation methods, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the service calling device can be divided into different functional modules to complete all or part of the functions described above.

[0096] This application also provides a computer-readable storage medium. All or part of the processes in the above method embodiments can be executed by computer instructions instructing related hardware. The program can be stored in the aforementioned computer-readable storage medium, and when executed, it can include the processes of the above method embodiments. The computer-readable storage medium can be any of the foregoing embodiments or memory. The aforementioned computer-readable storage medium can also be an external storage device of the aforementioned service invocation device, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the aforementioned service invocation device. Further, the aforementioned computer-readable storage medium can include both internal storage units of the aforementioned service invocation device and external storage devices. The aforementioned computer-readable storage medium is used to store the aforementioned computer program and other programs and data required by the aforementioned service invocation device. The aforementioned computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0097] This application also provides a computer program product, which includes a computer program that, when run on a computer, causes the computer to execute the training method and the travel time distribution prediction method of any of the travel time distribution prediction models provided in the above embodiments.

[0098] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A training method for a travel time distribution prediction model, characterized in that, include: Obtain at least one set of historical passage times and at least one set of corresponding historical passage paths; Based on the at least one set of historical travel times, obtain at least one set of corresponding discretized tags. The set of discretized tags is used to indicate the travel time in different travel time intervals within the corresponding set of historical travel times. In the at least one set of historical travel paths, at least one set of traffic spatiotemporal feature sequences are extracted using a graph attention network algorithm. The set of traffic spatiotemporal feature sequences is used to indicate the flow change relationship from the starting point to the destination in the corresponding set of historical travel paths. The at least one set of discretized labels and the corresponding at least one set of traffic spatiotemporal feature sequences are used as training data to train the deep learning model to obtain the travel time distribution prediction model.

2. The method according to claim 1, characterized in that, The step of obtaining at least one set of corresponding discretized tags based on the at least one set of historical passage times includes: Each of the historical travel times is individually encoded to obtain multiple sets of individually encoded tags. The individually encoded tags are used to indicate the encoding of the travel time within the corresponding travel time interval. Each of the unique heat labels is smoothed to obtain the corrected unique heat labels, and all the corrected unique heat labels are used as the discretized labels.

3. The method according to claim 2, characterized in that, The historical travel time in each of the aforementioned historical travel records is uniquely encoded to obtain multiple sets of uniquely hot tags, including: Based on historical travel times, determine the normal travel time and / or the long tail travel time, wherein the normal travel time is used to indicate the time portion of the peak travel period, and the long tail travel time is used to indicate the time portion of the off-peak travel period. By pre-setting a normal travel window, the normal travel time is divided into multiple first travel sub-intervals. Based on the travel time corresponding to each first travel sub-interval, a unique hot tag is generated for the normal travel time. The first travel sub-interval is used to indicate the time interval within the normal travel time. By pre-setting a long-tail travel window, the long-tail travel time is divided into multiple second travel sub-intervals. Based on the travel time corresponding to each second travel sub-interval, a unique hot tag is generated for the long-tail travel time. The second travel sub-interval is used to indicate the time interval within the long-tail travel time.

4. The method according to claim 1, characterized in that, The extraction of at least one set of traffic spatiotemporal feature sequences using the graph attention network algorithm includes: Based on all the historical travel paths, an initial spatial relationship graph is constructed, which is used to indicate the spatial relationship between each starting point and the ending point in the historical travel paths; Based on the initial spatial association graph, a second adjacency matrix is ​​obtained, which is used to indicate the reconstructed adjacency matrix that satisfies pairwise similarity. Based on the second adjacency matrix, the initial spatial association graph is updated to obtain the target spatial association graph, which is used to indicate the spatial relationships in the historical travel path after excluding noise interference. The target spatial association graph is convolved using a graph attention network algorithm to obtain the traffic spatiotemporal feature sequence.

5. The method according to claim 4, characterized in that, The step of constructing an initial spatial association graph based on all the historical travel paths includes: Based on the starting point and ending point of each of the historical travel paths, a first adjacency matrix is ​​constructed, and each node in the first adjacency matrix is ​​used to indicate each of the starting points and the ending points; The weights between adjacent nodes are obtained based on the spatial distance between each starting point and the ending point. Based on each node in the first adjacency matrix and the weights between each node, the initial spatial association graph is constructed.

6. The method according to claim 5, characterized in that, The step of obtaining the weights between adjacent nodes based on the spatial distance between each of the starting points and the ending points includes: Calculate the first average Euclidean distance between adjacent starting points as the weight between adjacent starting points. The first average Euclidean distance is used to indicate the average spatial distance between destinations in a travel path that starts from the same starting point but has different destinations. Calculate the second average Euclidean distance between adjacent endpoints as a weight between adjacent endpoints. The second average Euclidean distance is used to indicate the average spatial distance between starting points in a travel path that reaches the same endpoint but has different starting points. Calculate the third average Euclidean distance between the start and end points in the historical travel paths, and use it as the weight of the start and end points in the historical travel paths. The third average Euclidean distance is used to indicate the average straight-line distance between each start point and corresponding end point in all travel paths.

7. The method according to claim 5, characterized in that, The step of updating the initial spatial association graph based on the second adjacency matrix to obtain the target spatial association graph includes: In the second adjacency matrix, the weights between adjacent nodes are sorted in descending order from high to low, and a predetermined number of weights at the top are taken as target weights. In the second adjacency matrix, the target weight is retained, and all weights other than the target weight are updated to zero to obtain the updated second adjacency matrix; Based on the updated second adjacency matrix, the corresponding symmetric post-adjacency matrix is ​​obtained, and the symmetric post-adjacency matrix is ​​residually fused with the first adjacency matrix to obtain the target fusion matrix, which is used to indicate the target spatial association graph.

8. A method for predicting travel time distribution, characterized in that, The method includes: Obtain the target travel path to be traversed; The target travel path is input into the travel time distribution prediction model to obtain the predicted travel time probability, which indicates the probability that a user will need a certain amount of time to travel through the target travel path; wherein the travel time distribution prediction model is trained by the training method of the travel time distribution prediction model according to any one of claims 1 to 7.

9. An electronic device, characterized in that, The device includes a processor and a memory, the processor being coupled to the memory; the memory is used to store computer instructions, which are loaded and executed by the processor to enable the computer device to implement a training method for a travel time distribution prediction model as described in any one of claims 1 to 7, or to implement a travel time distribution prediction method as described in claim 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer-executable instructions that, when executed on a computer, cause the computer to perform a training method for a travel time distribution prediction model according to any one of claims 1 to 7, or to perform a travel time distribution prediction method according to claim 8.