Transportation time prediction method and prediction system based on space-time heterogeneous graph neural network and application

By constructing a stay hotspot transfer relationship diagram and generating embedded representation, combining multi-task learning and recurrent neural network technology, the accuracy problem of bulk freight transportation time prediction in the existing technology is solved, and accurate capture of driver dynamic behavior patterns and efficient prediction of transportation time is achieved.

CN120146740APending Publication Date: 2025-06-13EAST CHINA NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510209319.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

The prior art is difficult to accurately predict the transportation time of bulk freight, especially when the driver's stay and driving behavior are affected by various factors and change dynamically, resulting in limited application scalability of prediction methods based on a given transportation path in actual scenarios.

Method used

Using a transportation time prediction method based on a spatiotemporal heterogeneous graph neural network, a residence hotspot transfer relationship diagram is constructed and embedded representations of the residence hotspot and driving path are generated. Combined with multi-task learning and recurrent neural network technology, the residence hotspot sequence and transportation duration are iteratively generated.

Benefits of technology

It realizes accurate capture of the driver's stay and driving behavior patterns dynamically changing with time, improves the accuracy and application scalability of transportation time prediction, and reduces the average absolute error and root mean square error of transportation time prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0005285532320000051
    Figure BDA0005285532320000051
  • Figure BDA0005285532320000056
    Figure BDA0005285532320000056
  • Figure BDA0005285532320000069
    Figure BDA0005285532320000069
Patent Text Reader

Abstract

The invention discloses a transportation time prediction method based on a space-time heterogeneous graph neural network, and the method comprises the steps: obtaining a waybill track matched with a transportation task through the timestamp data of a waybill record, converting the waybill track into a passing staying hotspot sequence, and constructing a staying hotspot transfer relation graph; generating a time slice sequence based on the departure timestamp, extracting node features and edge features of time slices, and generating a snapshot sequence of the staying hotspot transfer relation graph; a space-time heterogeneous graph neural network is used for coding the sequence of the staying hotspot transfer relation graph snapshots, the relevance between nodes and / or edges and the time sequence dependency relation are captured, and embedded representation is generated; introducing a de-noising diffusion model, and generating embedded representation of the transportation route based on the query request; and iteratively predicting a staying hot spot sequence through the recurrent neural network, predicting the transportation time of each staying hot spot based on the LSTM, and iteratively generating the total transportation duration. The invention further discloses a corresponding prediction system which has wide application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data mining, and particularly relates to a transportation time prediction method, a prediction system and an application based on a spatio-temporal heterogeneous graph neural network. Background Art

[0002] In the field of bulk freight transportation, the "door-to-door" road transportation mode dominates. This mode uses heavy-duty trucks to directly transport bulk commodities from the origin warehouse to the destination warehouse. Predicting the transportation duration is one of the fundamental tasks to support transportation capacity scheduling and transportation monitoring, and has become the key to ensuring the efficient operation of the freight transportation link. Different from the travel time prediction problem in urban road networks, bulk freight transportation has the characteristic of "long-distance transportation". Freight drivers face diverse stopover needs during a single transportation journey, such as refueling, resting, dining, etc. Freight drivers will choose multiple locations to stay during a single transportation trip. Therefore, it is necessary to accurately predict the transportation arrival time by combining the personalized stopover behavior patterns of truck drivers. In addition, since the passable sections of trucks are restricted by time, even for the same pair of origin and destination, drivers may choose different driving routes when starting at different departure times, and even deviate significantly from the pre-planned route. This results in limited scalability of the travel time prediction method based on a given transportation route in actual freight scenarios.

[0003] Predicting the freight transportation duration based on the origin and destination information is a challenging task. The stopover and driving behaviors of drivers are affected by multiple factors and interact with the previous stopover and driving behaviors during the transportation trip. Specifically, affected by factors such as departure time, stopover intention, and weather, drivers choose different sequences of stopover hotspots between the same pair of origin and destination, thereby resulting in different stopover durations and driving durations. In addition, there are sequence dependencies among these sequences of stopover hotspots and the driving routes between them. For example, after staying at a previous stopover hotspot for a long time, a driver usually chooses a route with a shorter travel time to drive to the transportation destination to ensure that the goods can be delivered within the specified time period. Therefore, how to effectively integrate the stopover and driving behavior patterns of drivers affected by multiple factors to accurately predict the transportation route and time has become the primary challenge. On the other hand, the stopover and driving behavior patterns of drivers also show the characteristic of dynamic change over time. Taking the stopover hotspot of the dining point category as an example, there are more frequent stopovers during the dining period. Similarly, due to the time limit for the passage of heavy-duty transport vehicles on road sections, drivers will choose different routes to connect stopover hotspots at different times, thereby resulting in different driving durations. To sum up, due to the diverse and personalized stopover needs of drivers, the stopover and driving behavior patterns of drivers that change dynamically over time, and the significant difference between their actual transportation routes and the pre-planned routes, the application scalability of the transportation duration prediction method based on a given transportation route in actual scenarios is limited, further increasing the difficulty of the transportation time prediction problem. Summary of the Invention

[0004] To address the deficiencies of the prior art, the objective of the present invention is to provide a transportation time prediction method, prediction system, and application based on a spatio-temporal heterogeneous graph neural network. By using deep learning methods to model the driver's stay behavior patterns, it realizes the prediction of the freight arrival duration based on the origin and destination information. First, to capture the stay and driving behavior patterns that change dynamically over time, the present invention constructs a stay hot spot transfer relationship graph based on historical waybill trajectories. This graph structure is used to represent the driver's stay behavior patterns at each stay hot spot during different time periods and the transfer behavior patterns between them. On this basis, a spatio-temporal heterogeneous graph attention network is proposed to generate the embedded representations of stay hot spots and the driving paths between stay hot spots for different time periods. At the same time, the present invention introduces a conditional denoising diffusion model to model the potential correlations between various factors (including transport drivers, origin and destination, departure time periods, etc.) and the transport route, thereby generating the embedded representation of the transport route connecting the origin and destination. Thereafter, based on the embedded representation of the stay hot spot transfer relationship graph obtained and the embedded representation of the stay hot spot sequence based on the origin and destination, the present invention designs a stay hot spot sequence and time decoder by combining multi-task learning and recurrent neural network techniques to iteratively generate the stay hot spot sequence connecting the origin and destination and the time to reach each stay hot spot.

[0005] Furthermore, the freight transportation duration prediction method of the present invention consists of three stages: encoding of the stay hot spot transfer relationship graph, generation of the embedded representation of the transport route, and decoding of the stay hot spot sequence and time. The encoding stage of the stay hot spot transfer relationship graph takes the existing historical waybill trajectories as input and obtains the embedded representations of all stay hot spots and the driving paths between them for different time periods through two modules: construction of the stay hot spot transfer relationship graph and encoding of the spatio-temporal heterogeneous graph neural network. At the same time, the generation stage of the embedded representation of the transport route takes the trip context information (including origin and destination, departure time period, transport driver, transported goods, etc.) as input and uses the denoising diffusion model to generate the embedded representation of the transport route that conforms to the trip context information. Subsequently, the decoding stage of the stay hot spot sequence and time takes the encoding of the stay hot spot transfer relationship graph and the embedded representation of the transport route as input, iteratively generates the stay hot spot sequence connecting the origin and destination through a recurrent neural network, and predicts the arrival time of each stay hot spot based on the multi-task learning technique with a shared underlying representation. Finally, the time to reach the destination is obtained as the transport arrival time.

[0006] To achieve the above technical objectives, the technical solution adopted by the present invention is as follows:

[0007] The present invention proposes a transportation time prediction method based on a spatio-temporal heterogeneous graph neural network, which includes the following steps:

[0008] Step S1: Construction of the hotspot transfer relationship graph: First, according to the start and end timestamps of the waybill record, the waybill track that matches the transportation task is intercepted from the original track. Then, the hotspot sequence of each track is obtained in turn. At this point, each waybill track is converted into a hotspot sequence. Finally, the hotspot sequence is used to construct the hotspot transfer relationship graph. The stay hotspot transfer relationship graph uses the stay hotspot as a node Directly reachable relationships between stay hotspots are edges

[0009] Step S2: Feature extraction of the hotspot transfer relationship graph: First, generate a time slice T of a given unit length according to the departure timestamp (r) , and generate m consecutive time slice sequences of equal length, namely [T (r-m+1) ,T (r-m+2) ,…,T (r) ] Then extract each time slice T (t) The node features and edge features of (r-m+1≤t≤r) are used to generate a snapshot of the residence hotspot transfer relationship graph for each time slice. The node features include the category of hotspots, the longitude and latitude coordinates of hotspots, the frequency of time slice visits, the average time slice duration, the median time slice duration, etc.; the edge features include the Euclidean distance between hotspots, the frequency of time slice passage, the average time slice travel duration, the median time slice travel duration, etc. Finally, a snapshot sequence of the hotspot transfer relationship graph corresponding to the time slice sequence is generated.

[0010] Step S3: encoding of the stop hotspot transfer relationship graph: using the spatiotemporal heterogeneous graph neural network to encode the stop hotspot transfer relationship graph snapshot sequence. The spatiotemporal heterogeneous graph neural network includes a heterogeneous graph spatial correlation encoding and a meta-temporal correlation encoding module, wherein the spatiotemporal heterogeneous graph neural network encoding is used to capture the correlation between nodes (i.e., stop hotspots), between edges (i.e., the driving paths connecting the stop hotspots), and between nodes and edges in the stop hotspot transfer relationship graph; the meta-temporal correlation encoding is used to capture the temporal dependency of each node and edge in the stop hotspot transfer relationship graph snapshot sequence. Finally, the time slice T is generated. (r) The embedded representation of nodes and edges in the hotspot transfer relationship graph (expressed as ), which is used for the subsequent stay hotspot sequence and time decoding module.

[0011] Step S4: Generation of Embedded Representation of Transportation Route: First, obtain a query request (denoted as Req) composed of information such as the origin and destination, departure timestamp, and transportation driver. Subsequently, use a denoising diffusion model to model the association pattern between the historical trajectory corresponding to the query request and the transportation route selected by the driver. The denoising diffusion model generates data samples by simulating a random diffusion process. The core of this model is to construct a denoiser that can gradually remove noise from randomly sampled Gaussian noise samples, thereby generating an embedded representation (denoted as ω 0 ) of the transportation route similar to the original data sample. The denoiser takes minimizing the reconstruction error of the transportation route as the optimization objective and is trained using the historical waybill trajectory dataset.

[0012] Step S5: Decoding of Stop Hotspot Sequence and Time: Based on the embedded representations of the stop hotspots and driving paths obtained in Step S3 (i.e., ), and the embedded representation of the transportation route obtained in Step S4 (i.e., ω 0 ), iteratively calculate the transition probability from the current node to neighbor nodes through a recurrent neural network, and select the stop hotspot with the maximum transition probability as the next stop location that the freight driver will visit. At the same time, based on the multi-task learning technique, use long short-term memory (LSTM) units to predict the transportation time for each stop hotspot generated during the decoding process. The above decoding steps are executed in a loop until the final destination node is generated. Finally, obtain the transportation time of the destination node as the total transportation duration. The decoding network for stop hotspot prediction and time prediction and the encoding network of the stop hotspot transition relationship graph constructed in Step S3 jointly form an encoder-decoder model for training, and take minimizing the reconstruction error of the stop hotspot sequence and the prediction error of the transportation time as the optimization objective, and are trained using the historical waybill trajectory dataset.

[0013] To optimize the above technical solution, the specific measures taken in each step also include:

[0014] The above Step S1 specifically includes:

[0015] Step 1.1) Waybill Trajectory Interception: According to the start and end timestamps recorded in the waybill, intercept the waybill trajectory that matches the transportation task from the original trajectory of the corresponding transportation vehicle.

[0016] Step 1.2) Stop Point Extraction: To obtain the stop behavior of the driver during the transportation journey for subsequent modeling, extract the sequence of zero-speed trajectory points with a duration longer than the given stop duration threshold thr dur from each waybill trajectory (to avoid extracting noisy stop points generated when the vehicle waits for traffic lights, in a specific embodiment, set the stop duration threshold thr dur to 8 minutes), and take the first trajectory point in these sequences as the stop point.

[0017] Step 1.3) Stop hotspot matching: In order to obtain the stop hotspot sequence that each waybill track passes through, the stop points in the waybill track are matched to the nearest stop hotspot, which includes gas stations, service areas, restaurants, logistics parks and other points of interest data. At this point, each waybill track is converted into a stop hotspot sequence for the construction of the stop hotspot transfer relationship graph.

[0018] Step 1.4) Construction of the hotspot transfer relationship graph: Use the hotspot sequence to construct the hotspot transfer relationship graph The hotspot transfer relationship graph uses all hotspots as nodes and the directly reachable relationships between hotspots as edges. Build from v i to v j Edge

[0019] The above step S2 specifically includes:

[0020] In order to accurately capture the stay and travel behavior patterns in different periods, this step generates a time slice T of a given unit length with the departure timestamp as the center. (r) The unit length of the time slice is mainly set in combination with the distribution of historical data and the traffic conditions in the experimental area, and is set to 2 hours in a specific implementation scheme. (r) The first 12 time slice sequences are represented as [T (r-11) ,T (r-10) ,…,T (r) ]. Finally, based on the hotspot transfer relationship graph constructed in step S1, the node features and edge features of each time slice are extracted (as described in steps 2.1 and 2.2), thereby generating a snapshot sequence of the hotspot transfer relationship graph. The number of nodes per time slice is the number of stay hotspots in the experimental area, and the number of nodes in each time slice is the same.

[0021] Step 2.1) Node feature extraction: For each node in the hotspot transfer relationship graph, extract its hotspot category, longitude and latitude coordinates and other static features, and extract the information about the time slice T (t) The visit frequency, average time slice stay duration and median time slice stay duration of (r-11≤t≤r) are used to generate dynamic features such as visit frequency, average time slice stay duration and median time slice stay duration of (r-11≤t≤r). All static features corresponding to the node are concatenated with all dynamic features of the node corresponding to each time slice to generate the node feature vector of the stay hotspot transfer relationship graph of each time slice.

[0022] Each node of the stay hotspot transfer relationship graph corresponds to a stay hotspot in the real scenario, and the average stay duration and the median stay duration are obtained by statistically analyzing the historical stay behaviors of the driver within the corresponding time slices of the stay hotspot. If there is only one stay in a certain time slice at a stay hotspot, the average value and the median value are the stay duration of this stay behavior itself.

[0023] Step 2.2) Edge feature extraction: For each edge in the stay hotspot transfer relationship graph (used to represent the driving path connecting stay hotspots), extract static features such as the Euclidean distance between its associated stay hotspots, and extract dynamic features such as the passing frequency, the average driving duration of the time slice, and the median of the driving duration of the time slice between its associated stay hotspots for the time slice T(t) (r - 11 ≤ t ≤ r). Concatenate all the static features corresponding to the edge with all the dynamic features of the edge corresponding to each time slice, so as to generate the edge feature vector of the stay hotspot transfer relationship graph for each time slice.

[0024] Since the waybill trajectory data may be missing in some time slices, resulting in the inability to directly obtain the dynamic features of the nodes and edges of these time slices, in this case, fill them by copying the feature values of their nearest neighbor time slices; if the missing time slice is in the middle, randomly select the feature values of two adjacent time slices before and after for filling.

[0025] The above-mentioned step S3 specifically includes:

[0026] Based on the node and edge feature vectors of the stay hotspot transfer relationship graph generated in step S2, this step obtains the initial representations of the nodes and edges through the embedding layer and the linear layer. Specifically, for discrete features such as stay hotspot categories, longitude and latitude coordinates, etc., use the embedding layer to project these features into dense vectors. For continuous features such as the average stay duration, the median stay duration, the access frequency, the Euclidean distance between stay hotspots, the passing frequency, the average driving duration, and the median of the driving duration, use the linear layer to project them into dense vectors.

[0027] The above process is defined as:

[0028]

[0029] Among them, is the feature matrix of the node, is the feature matrix of the edge. W v , W e , b v , b e are the learned parameter matrices, d emb represents the embedding representation dimension of the node or edge of the stay hotspot transfer relationship graph, X conti , X disc represent the continuous and discrete feature matrices of the stay hotspots respectively.

[0030] Given the heterogeneity characteristics of stay hot spot categories with different functions, the present invention introduces a heterogeneous graph attention mechanism based on the graph attention network to model the stay hot spot transfer relationship graph. In addition, in order to further capture the fusion correlation between the stay and driving behaviors of drivers in each time slice, different from the traditional graph attention network that only updates node features according to neighbor nodes, the present invention designs a new information transfer mechanism in the graph attention network to further update the features of edges. Specifically, given the time slice T (t) the target node in the stay hot spot transfer relationship graph and its neighborhood node set The process of the heterogeneous graph attention mechanism for learning the embedding representations of nodes and edges is defined as:

[0031]

[0032] where respectively represent the embedding representations of nodes and edges obtained by learning through the heterogeneous graph attention network, respectively represent the feature vectors of node v i and e i→j HST θ is the parameter of the heterogeneous graph spatial correlation encoding network, represents the neighborhood node set of node i.

[0033] The heterogeneous graph spatial correlation encoding network (HST) first maps their feature vectors to the same latent space using the corresponding weight matrices according to the categories of nodes and edges. Subsequently, to capture the importance of different categories of neighbor nodes (edges) for a given target node v i , inspired by the attention mechanism, HST introduces the attention mechanism to iteratively calculate and update the latent feature vectors of nodes and edges in the heterogeneous relationship graph. The key to the above process is to calculate the relevant attention coefficients between neighbor nodes using the latent features of nodes and edges. Specifically, for a given stay hot spot transfer relationship graph the embedding representation i of the target node v at the l-th layer and the embedding representations of its neighbor nodes edge e i→j The embedding representation is HST maps to a query vector, fuses and and maps them to key and value vectors. The above process is defined as:

[0034]

[0035] where is a weight mapping matrix for nodes and edges of different functional categories, mapping nodes and edges of different categories into the same latent vector space; respectively represent the transformation matrices of query, key, and value.

[0036] So far, for node v i and v j the attention coefficient is calculated as follows:

[0037]

[0038] The attention coefficient is used to update the node representation to generate the embedding representation of the nodes in the (l + 1)-th layer On this basis, the edge features are updated based on a linear transformation.

[0039] The above process is defined as follows:

[0040]

[0041] where, are the learned parameters.

[0042] In addition, to stabilize the learning process of the attention mechanism, HST executes P independent attention heads in parallel and then averages the embedding representations they learn to obtain the following output:

[0043]

[0044] Without loss of generality, stack L layers of HST to capture L-order neighbor information and obtain the embedding representation vectors of all nodes and edges in the last layer as the (t) staying hot spot transfer relationship graph at time slice T (t) The embedding representations of nodes and edges in. So far, the eigenvector matrix of the staying hot spots and driving paths at each time slice T

[0045] To further capture the temporal dependence of the snapshot sequence of the staying hot spot transfer relationship graph, the present invention introduces meta-learning technology into the Gated Recurrent Unit (GRU) and constructs different GRUs according to the temporal context of each node and edge. Specifically, for the staying hot spot transfer relationship graph (t) at a given time slice T for node v i in it, its meta-temporal correlation encoding network is defined as follows:

[0046]

[0047] Among them, FCN represents a fully connected network with one hidden layer, represents the parameters of FCN, represents the representation node v output by the HST module i at time slice T (t) of the potential feature vector, is the GRU parameter corresponding to node v, and these parameters are generated by FCN rather than training. MetaGRU represents a gated recurrent unit based on meta-learning. i The specific calculation formula of the GRU is as follows:

[0048] The specific calculation formula of the GRU is as follows:

[0049]

[0050] Among them, σ represents the sigmod function, and ⊙ represents element-wise multiplication of vectors. are the reset gate and the update gate. Similarly, through the meta-temporal modeling method consistent with the node, the edge e will be generated i→j at any time slice T (t) of the potential feature vector. After r steps of iteration, the embedding representations of all nodes and edges are obtained, forming the embedding representation matrix of the stay hotspots and the driving path at time slice T (r) (i.e., ) for subsequent modeling.

[0051] The above step S4 specifically includes:

[0052] Given that the transportation duration is highly correlated with the transportation route selected by the driver, the goal of this step is to learn the correlation between the historical transportation route and the query request (such as the origin and destination, transportation driver, departure time period, etc.) to generate the transportation route embedding representation. That is, given the query request Req and its corresponding transportation route (represented as ), the goal of this step is to learn the posterior probability Inspired by the successful application of the denoising diffusion model in the field of data generation, the present invention uses the denoising diffusion model to model the distribution probability of data. The denoising diffusion model mainly consists of a forward diffusion process and a reverse denoising process. The forward diffusion process gradually adds noise to the transportation route embedding representation (represented as ω 0 ) until a simple prior distribution (such as a Gaussian distribution, and represented as ω N ) is reached. In order to generate the embedding representation of the transportation route according to Req, based on the reverse denoising process, the noise is gradually removed from the noisy transportation route embedding representation until a noise-free transportation route embedding representation is generated. The forward diffusion process and the reverse denoising process are defined as follows:

[0053]

[0054] Among them, α i = 1 - β i . β i ∈(0, 1) is fixed. It is used to control the level of noise added in each forward process step and satisfies β 1 , β 2 , …, β N with an increasing constraint. At the Nth step of the diffusion process, the noisy vectorized embedding representation follows a standard Gaussian distribution, that is, ω N ~N(ω N ; 0, 1). ω N does not include any prior knowledge and can be obtained by randomly sampling noise from a Gaussian distribution, and it is used as the starting point of the reverse denoising process. The reverse denoising process can directly generate a noise-free transportation route embedding representation from random Gaussian noise (i.e., ω N ) through N steps of denoising; ∈ is a Gaussian noise term sampled from the standard normal distribution N(0, 1).

[0055] The key to applying the denoising diffusion model to generate the transportation route embedding representation is to learn a denoiser which is used to predict the noise at each time step n, so as to generate ω n-1 . In the present invention, Unet is used to construct the denoiser, which consists of M downsampling blocks and upsampling blocks, and each sampling block is composed of components such as residual blocks and Transformer. Among them, max-pooling operation is used for downsampling, and linear interpolation operation is used for padding during upsampling. In order to better learn the noise at each time step and guide the transportation route embedding generation process, the denoiser first embeds the query request Req and the time step n through an encoding layer. Specifically, it encodes the time step n using the position encoding technique and concatenates it with the feature vector of the query request passing through the embedding layer and then sends it into each residual block. Subsequently, each sampling block learns the correlation between the query request and the transportation route through the Transformer component. Taking the first sampling block at time slice n as an example, the Transformer mainly realizes the modeling process through two attention mechanisms:

[0056]

[0057] Among them, represents the transportation route feature embedding matrix of sampling block i, is the concatenated vector of the query request feature vector and the feature vector of time step n. and are both learning parameters.

[0058] Based on this, the output of the Tranformer is calculated as follows:

[0059]

[0060] Finally, the above denoiser is used to perform a denoising process on the randomly sampled Gaussian noise ω N by iteratively executing N steps to generate an embedded representation of the transportation route.

[0061] To obtain the denoiser, in this stage, the existing waybill trajectory data is used to learn its parameters, and the following loss function is used for model training:

[0062]

[0063] where is used to minimize the mean square error between the noise added in the forward diffusion process and the noise generated by the denoiser. In addition, in order to generate an embedded representation that is more similar to the actual transportation route, another loss function is further introduced in this stage to co-train the denoising model. This loss function is used to minimize the mean square error between the generated embedded representation ω 0 of the transportation route and the embedded representation of the actual transportation route.

[0064] The above step S5 specifically includes:

[0065] To accurately predict the transportation duration in the scenario where only the starting and ending points are given, this step is based on the embedded representation of the stay hotspot transfer relationship graph generated in step S3 (i.e., ), and the embedded representation of the transportation route obtained in step S4 (i.e., ω 0 ). Using multi-task learning technology, the transportation route and the transportation duration are decoded and predicted simultaneously. For transportation route prediction, a recurrent neural network (RNN) equipped with a masked attention mechanism is used to gradually generate the sequence of visited stay hotspots of the driver from the starting point to the ending point of the transportation through an iterative method. To ensure the rationality of the predicted stay hotspot sequence, the present invention introduces a masking mechanism in the decoding process of each step of the stay hotspot. Let represent the set of neighbor nodes of node v j in the stay hotspot transfer relationship graph , represent the sequence of stay hotspots that have been generated at the i-th step of decoding The masking mechanism first masks the nodes that have been output in the previous step (i.e., ), secondly masks the nodes of other transportation end point categories in the neighbor nodes that are not in this task, and finally masks the non-neighbor nodes of the current node. Thereafter, the decoding process of the stay hotspot sequence for a given query request Req is defined as:

[0066]

[0067] wherein represents the parameters of the decoding network, represents the embedded representation of the stay hotspot. To obtain the current state at each time step (with i representing the current time step) during the decoding process, the present invention uses a Long Short-Term Memory (LSTM) network to aggregate the sequence of stay hotspots generated previously (i.e., ) into a vector Then is concatenated with the query request embedded representation to obtain a current state representation that fuses the behavior pattern and task information.

[0068] The decoding process of the stay hotspot sequence is transformed into:

[0069]

[0070] The above decoding process is iterated, and its core is to calculate the transition probability between the current node and the neighbor nodes of the masked node set removed at each step, obtain the neighbor node with the maximum probability for output, and concatenate the embedded representation of the edge connecting the output node and the current node (i.e., ) and input it into the LSTM to obtain a new state representation. Specifically, in the i-th step of the decoding process, the concatenated vector of and ω 0 constitutes the attention query vector, and the embedded representation of the unmasked nodes of the output node at the previous time step is used as the key vector to calculate the transition probability distribution of the unmasked nodes:

[0071]

[0072] wherein, represents the masked node set for the current node v i . is a learning parameter.

[0073] Finally, the softmax layer is used to output the probability of each node at the i-th time step:

[0074]

[0075] Thus far, the node with the maximum probability in each time step is obtained for output, and the above process is iteratively executed until the end point is output. Meanwhile, at each time step of the stay hotspot prediction, the transportation duration of each stay hotspot is cyclically generated through the LSTM unit. Specifically, the LSTM unit at the i-th time step takes the node and the edge In summary, for a node the prediction of the transportation duration is defined as follows:

[0076]

[0077] To obtain the encoding network of the stay hotspot transfer relationship graph (see step S3 in detail) and the decoding network of step S5, the present invention uses the existing waybill trajectory data to jointly learn an "end-to-end" model composed of an encoder-decoder, and uses the following loss function for model training:

[0078]

[0079] where is the loss function for the transportation route prediction task, is the loss function for the transportation time prediction task. |TR| is the number of training waybill trajectories, and |hs t | represents the number of stay hotspots associated with the t-th waybill trajectory sample. σ 1 , σ 2 are learning parameters, which are updated as the model is trained.

[0080] After the model training is completed, the model receives a query request, historical waybill trajectories, and stay hotspot data as inputs. First, it constructs a stay hotspot transfer relationship graph based on the historical waybill trajectories, and generates a time slice sequence [T (r) and the corresponding snapshot sequence of the stay hotspot transfer relationship graph based on the query time slice T (r-11) , T (r-10) , …, T (r) . Subsequently, the snapshot sequence of the stay hotspot transfer relationship graph is fed into the spatio-temporal heterogeneous graph neural network to generate an embedding representation (r) of the stay hotspot transfer relationship graph for the query time T At the same time, the transportation route embedding generation module generates a transportation route embedding representation ω 0 connecting the start and end points based on the query request. Finally, and ω 0 are jointly fed into the stay hotspot sequence and time decoding stage to generate a stay hotspot sequence and a transportation duration, and the transportation duration reaching the end point is extracted as the freight transportation duration prediction result.

[0081] The present invention also provides a prediction system for implementing the above prediction method. The prediction system includes: a data preprocessing and feature extraction module, a stay hotspot transfer relationship graph construction module, a spatio-temporal heterogeneous graph neural network encoding module, a transportation route embedding generation module, a stay hotspot sequence and time decoding module, a prediction and result output module;

[0082] The data preprocessing and feature extraction module extracts trajectory, stay hotspots, and query request features from logistics data including waybills, trajectories, etc., providing standardized input for subsequent steps;

[0083] The stay hotspot transfer relationship graph construction module constructs a transfer relationship graph between stay hotspots based on the waybill trajectory, describing the association between nodes and paths;

[0084] The spatio-temporal heterogeneous graph neural network encoding module generates dense embedding representations of stay hotspots and driving paths through spatial and temporal correlation modeling;

[0085] The transportation route embedding generation module uses a denoising diffusion model to generate transportation route embeddings related to the query request, capturing the potential association between historical trajectories and transportation context information (transportation context information includes origin and destination, departure time period, driver, etc.);

[0086] The stay hotspot sequence and time decoding module iteratively generates a stay hotspot sequence, while predicting the transportation time and accumulating the total transportation duration;

[0087] The prediction and result output module generates the final stay hotspot sequence and transportation time prediction results based on the trained model and input data.

[0088] In a specific embodiment, the prediction system further includes a multi-task learning and joint optimization module;

[0089] The multi-task learning and joint optimization module jointly optimizes the generation of the stay hotspot sequence and the prediction of the transportation time, improving the overall performance of the model.

[0090] The present invention also discloses the above prediction method, or the application of the above prediction system in freight transportation time prediction, freight path dynamic planning, logistics capacity scheduling optimization, etc.

[0091] In the specific implementation process of the present invention, considering that the edges in the stay hotspot transfer relationship graph may not correspond to a single type of driving path category. For example, an edge may correspond to two categories of the connection between a highway and a rural road in the actual road network. Therefore, the present invention does not extract the category of the driving path as an edge feature. For different categories of driving paths, the present invention mainly models by extracting features such as the average value, median, and distance of the driving duration, and the above features imply the impact of different driving paths on the transportation time.

[0092] In the specific implementation process of the present invention, the spatio-temporal heterogeneous graph neural network designed by the present invention is improved based on the graph attention network that can capture the correlation between different nodes.

[0093] In the specific implementation process of the present invention, a cross-validation strategy is adopted to ensure that the model is evaluated on multiple different data subsets, thereby improving the generalization ability of the model. Specifically, 5-fold cross-validation is adopted in the present invention. The experimental data sets of multiple routes are respectively divided into 5 subsets. Each time, 4 subsets are used for training, and the remaining one subset is used for validation.

[0094] In the specific implementation process of the present invention, in the stage of converting the waybill trajectory into a stay hot spot sequence, since some stay points within non-stay hot spots cannot be matched, the present invention deletes these stay points that cannot be matched to stay hot spots.

[0095] The present invention includes the following beneficial effects:

[0096] The present invention proposes a transportation duration prediction framework based on a spatio-temporal heterogeneous graph neural network. This framework uses the waybill trajectory and the stay hot spot data set to construct a stay hot spot transfer relationship graph. On this basis, a spatio-temporal heterogeneous graph attention network is designed to model the stay behavior pattern, driving behavior pattern of the driver during the transportation journey, and the correlation between them, and a gated recurrent unit using embedded meta-learning technology is used to capture the temporal correlation between the stay hot spots and the driving path, which can accurately capture the dynamic changes of the driver's stay and driving behavior patterns over time.

[0097] The present invention proposes a starting and ending point-based transportation duration prediction method based on a denoising diffusion model. This method uses the denoising diffusion model to model the potential correlation between different factors and the transportation route, so as to generate an embedded representation of the transportation route connecting the starting and ending points based on the query information. On this basis, a decoder based on a recurrent neural network is designed in combination with multi-task learning technology to generate the stay hot spot sequence and the transportation duration prediction result in an iterative manner. This method can realize the prediction of the transportation duration without presetting the transportation route.

[0098] Based on experiments on a large-scale logistics data set, the effectiveness of the method proposed in this paper is verified. Compared with advanced methods in the express logistics and transportation fields, the proposed scheme in this paper improves the 6.88% F-score (F1-pairs) of transportation route prediction; on average, it reduces the 29.6% mean absolute error (MAE) and 27.21% root mean square error (RMSE) of transportation time prediction. Description of the Drawings

[0099] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0100] Figure 1 The transportation time prediction framework diagram constructed for the present invention.

[0101] Figure 2 The spatio-temporal heterogeneous graph attention network structure diagram constructed for the present invention.

[0102] Figure 3 It is an example diagram of the forward diffusion and reverse denoising processes of the transportation route embedding representation.

[0103] Figure 4 It is the structure diagram of the denoiser constructed for the present invention. Detailed implementation manners

[0104] Combined with the following specific embodiments and the accompanying drawings, the present invention will be further described in detail. The processes, conditions, experimental methods, etc. for implementing the present invention, except for the specifically mentioned content below, are all general knowledge and well-known common sense in the art, and the present invention has no particularly limited content.

[0105] The present invention proposes a transportation time prediction method based on a spatio-temporal heterogeneous graph neural network. In view of the fact that existing travel time prediction methods do not consider the stop behavior of transportation drivers during long-distance transportation and are not applicable to the bulk freight scenario with multiple stop behaviors, in order to accurately capture the stop and driving behavior patterns of drivers that change dynamically over time, the present invention first constructs a stop hot spot transfer relationship graph using historical waybill trajectory data. On this basis, a spatio-temporal heterogeneous graph attention network is designed to model different categories of stop hot spots, driving paths, and the association patterns between them. In addition, in response to the challenges of stop and driving behaviors affected by multiple factors, the present invention introduces a denoising diffusion model, which is used to model the potential correlation between multiple factors and the transportation route, so as to generate an embedding representation of the transportation route connecting the starting and ending points. Finally, a multi-task stop hot spot sequence and time decoder is proposed based on a recurrent neural network to iteratively generate the stop hot spot sequence and the transportation time prediction result step by step.

[0106] In order to capture the stop and driving behavior patterns that change dynamically over time, the present invention proposes a modeling strategy based on a spatio-temporal heterogeneous graph. Specifically, different from traditional graph modeling methods, the spatio-temporal heterogeneous graph modeling strategy uses a heterogeneous graph attention mechanism to capture the spatial correlations between different categories of stop hot spots, between driving paths, and between stop hot spots and driving paths. In addition, meta-learning technology is introduced into the gated recurrent unit to capture the periodic change trends between different stop hot spots or driving paths.

[0107] Facing the challenges of staying and driving behaviors affected by complex factors, the present invention proposes an "end-to-end" multi-task stay hot spot sequence and transportation time prediction method, which introduces a denoising diffusion model to model the potential relationship between various complex factors and the embedded representation of transportation routes. Different from traditional methods, the present invention constructs a denoiser based on Transformer components, which can accurately generate the embedded representation of transportation routes in the scenario of given start and end points. Finally, a decoder is constructed based on recurrent neural network and multi-task learning technology to accurately model the mutually influencing stay behavior patterns during the journey.

[0108] The present invention provides a transportation time prediction method based on spatio-temporal heterogeneous graph neural network. As Figure 1 shown, this method includes three stages. In the encoding stage of the stay hot spot transfer relationship graph, a stay hot spot transfer relationship graph is constructed based on historical trajectories and stay hot spots, and a spatio-temporal heterogeneous graph attention network is used on this graph to learn the embedded representation of the stay hot spot transfer relationship graph at different time slices (the graph nodes represent stay hot spots, and the edges represent the driving paths between stay hot spots); in the generation part of the transportation route embedded representation, a denoising diffusion model is used to model the correlation between the query request and the real transportation route, so as to generate the embedded representation of the transportation route connecting the start and end points; in the decoding stage of the stay hot spot sequence and time, based on the encoding of the stay hot spot transfer relationship graph and the embedded representation of the transportation route, a recurrent neural network and multi-task learning technology are used to iteratively generate the stay hot spot sequence connecting the start and end points and the transportation duration for reaching each stay hot spot step by step.

[0109] As Figure 1 shown, the present invention adopts a three-stage transportation time prediction framework, including the following five steps:

[0110] Step S1: Construction of the stay hot spot transfer relationship graph: First, according to the start and end timestamps recorded in the waybill, the waybill trajectory matching the transportation task is intercepted from the original trajectory. Subsequently, the sequence of stay hot spots passed by each trajectory is obtained in turn. At this point, each waybill trajectory is transformed into a sequence of stay hot spots. Finally, a stay hot spot transfer relationship graph is constructed using the sequence of stay hot spots The stay hot spot transfer relationship graph uses stay hot spots as nodes The direct reachable relationship between stay hot spots as edges

[0111] In the embodiment, step S1 specifically includes:

[0112] Step 1.1) Interception of the waybill trajectory: According to the start and end timestamps of the transportation recorded in the waybill, the waybill trajectory matching the transportation task is intercepted from the original trajectory of the corresponding transportation vehicle.

[0113] Step 1.2) Stop point extraction: In order to obtain the driver's stop behavior during the transportation trip for subsequent modeling, extract the stop points in each waybill trajectory whose duration is greater than the given stop time threshold thr dur The zero-speed trajectory point sequence (to avoid extracting the noise stop points generated when the vehicle is waiting for the traffic light, the stop time threshold thr dur set to 8 minutes), and the first trajectory point in these sequences was taken as the dwell point.

[0114] Step 1.3) Stop hotspot matching: In order to obtain the stop hotspot sequence that each waybill track passes through, the stop points in the waybill track are matched to the nearest stop hotspot, which includes gas stations, service areas, restaurants, logistics parks and other points of interest data. At this point, each waybill track is converted into a stop hotspot sequence for the construction of the stop hotspot transfer relationship graph.

[0115] Step 1.4) Construction of the hotspot transfer relationship graph: Use the hotspot sequence to construct the hotspot transfer relationship graph The hotspot transfer relationship graph uses all hotspots as nodes and the directly reachable relationships between hotspots as edges. Build from v i to v j Edge

[0116] Step S2: Feature extraction of the hotspot transfer relationship graph: First, generate a time slice T of a given unit length according to the departure timestamp (r) , and generate m consecutive time slice sequences of equal length, namely [T (r-m+1) ,T (r-m+2) ,…,T (r) ] Then extract each time slice T (t) The node features and edge features of (r-m+1≤t≤r) are used to generate a snapshot of the residence hotspot transfer relationship graph for each time slice. The node features include the category of hotspots, longitude and latitude coordinates, visit frequency, average and median dwell time; the edge features include the frequency of travel, average and median travel time. Finally, a snapshot sequence of the hotspot transfer relationship graph corresponding to the time slice sequence is generated.

[0117] In the embodiment, step S2 specifically includes:

[0118] In order to accurately capture the stay and travel behavior patterns in different periods, this step generates a time slice T of a given unit length with the departure timestamp as the center. (r) , the unit length of the time slice is set to 2 hours. Then, obtain T (r)The first 12 time slice sequences, denoted as [T (r-11) , T (r-10) , …, T (r) . Finally, based on the stay hotspot transfer relationship graph constructed by S1, extract the node features and edge features of each time slice (as described in steps 2.1 and 2.2), so as to generate a snapshot sequence of the stay hotspot transfer relationship graph

[0119] Step 2.1) Node feature extraction: For each node in the stay hotspot transfer relationship graph, extract its static features such as function category, longitude and latitude coordinates, etc., and extract the dynamic features such as the access frequency, average stay duration, and median of the stay duration for the time slice T (t) (r - 11 ≤ t ≤ r). Concatenate all the static features corresponding to the node with all the dynamic features of the nodes corresponding to each time slice, so as to generate the node feature vectors of the stay hotspot transfer relationship graph for each time slice

[0120] Step 2.2) Edge feature extraction: For each edge in the stay hotspot transfer relationship graph (used to represent the driving path connecting the stay hotspots), extract its static features such as the Euclidean distance between the associated stay hotspots, etc., and extract the dynamic features such as the passing frequency, average driving duration, and median of the driving duration between the associated stay hotspots for the time slice T(t) (r - 11 ≤ t ≤ r). Concatenate all the static features corresponding to the edge with all the dynamic features of the edges corresponding to each time slice, so as to generate the edge feature vectors of the stay hotspot transfer relationship graph for each time slice

[0121] Since some time slices may lack waybill trajectory data, resulting in the inability to directly obtain the dynamic features of the nodes and edges of these time slices, this step fills them by copying the feature values of their nearest neighbor time slices; or randomly selects the feature values of two adjacent time slices to fill the missing intermediate time slices

[0122] Step S3: Encoding of the stay hotspot transfer relationship graph: Use a spatio-temporal heterogeneous graph neural network to encode the snapshot sequence of the stay hotspot transfer relationship graph. As Figure 2 shown, the spatio-temporal heterogeneous graph neural network consists of a heterogeneous graph spatial correlation encoding and a meta-temporal correlation encoding module. Among them, the spatio-temporal heterogeneous graph neural network encoding is used to capture the correlations between the nodes (i.e., stay hotspots), edges (i.e., the driving paths connecting the stay hotspots), and between the nodes and edges in the stay hotspot transfer relationship graph; the meta-temporal correlation encoding is used to capture the temporal dependencies of each node and edge in the snapshot sequence of the stay hotspot transfer relationship graph. Finally, generate the embedding representations of the nodes and edges in the stay hotspot transfer relationship graph for the time slice T (r) (denoted as ), which are used for the subsequent stay hotspot sequence and time decoding module

[0123] In the embodiment, step S3 specifically includes:

[0124] Based on the node and edge feature vectors of the stay hotspot transfer relationship graph generated in step S2, this step obtains the initial representations of the nodes and edges through an embedding layer and a linear layer. Specifically, for discrete features such as stay hotspot categories, longitude and latitude coordinates, etc., the embedding layer is used to project these features into dense vectors. For continuous features such as the average stay duration, median stay duration, visit frequency, Euclidean distance between stay hotspots, passage frequency, average driving duration, median driving duration, etc., the linear layer is used to project them into dense vectors. The above process is defined as:

[0125]

[0126] Among them, is the feature matrix of the node, is the feature matrix of the edge. W v , W e , b v , b e are the learned parameter matrices, d emb represents the embedding representation dimension of the node or edge of the stay hotspot transfer relationship graph, X conti , X disc respectively represent the continuous and discrete feature matrices of the stay hotspots.

[0127] In view of the heterogeneity characteristics of stay hotspot categories with different functions, the present invention introduces a heterogeneous graph attention mechanism on the basis of the graph attention network to model the stay hotspot transfer relationship graph. In addition, in order to further capture the fusion correlation between the stay and driving behaviors of the driver in each time slice, the features of the nodes and edges are updated through an information transfer mechanism in the graph attention network. Given the target node (t) in the stay hotspot transfer relationship graph at time slice T and its neighborhood node set The process of the heterogeneous graph attention mechanism for learning the embedding representations of nodes and edges is defined as:

[0128]

[0129]

[0130] Among them, respectively represent the embedding representations of the nodes and edges obtained by learning through the heterogeneous graph attention network, respectively represent the feature vectors of nodes v i and e i→j , HST θ is the parameter of the heterogeneous graph spatial correlation encoding network, Denotes the set of neighboring nodes of node i.

[0131] The HST first maps the feature vectors of nodes and edges to the same latent space using the corresponding weight matrices according to their categories. Subsequently, to capture the importance of neighbor nodes (edges) of different categories for a given target node v i , inspired by the attention mechanism, the HST introduces an attention mechanism to iteratively calculate and update the latent feature vectors of nodes and edges in the heterogeneous relationship graph. The key to the above process is to calculate the relevant attention coefficients between neighbor nodes using the latent features of nodes and edges. Specifically, for a given stay hotspot transfer relationship graph the target node v i in the l-th layer embedding representation and the embedding representations of its neighbor nodes edge e i→j the embedding representation is The HST maps to a query vector, fuses and and maps them to key-value vectors (key, value). The above process is defined as:

[0132]

[0133] where is the weight mapping matrix for nodes and edges of different functional categories, which maps nodes and edges of different categories to the same latent vector space. represent the transformation matrices of query, key, and value respectively. So far, the attention coefficient i between node v j and v is calculated as follows:

[0134]

[0135] where denotes the set of neighbor nodes of node v i . The attention coefficient is used to update the node representation to generate the embedding representation of the node at the (l + 1)-th layer On this basis, the edge features are updated based on a linear transformation. The above process is defined as follows:

[0136]

[0137] where, Parameters for learning. In addition, to stabilize the learning process of the attention mechanism, HST executes P independent attention heads in parallel (P is set to 4 in a specific implementation of the present invention), and then averages the embedding representations learned by them to obtain the following output:

[0138]

[0139] Without loss of generality, stack L layers of HST to capture L-order neighbor information (L is set to 3), and obtain the embedding representation vectors of all nodes and edges in the last layer as the stay hot spot transfer relationship graph (t) of nodes and edges in time slice T At this point, the eigenvector matrix of the stay hot spots and driving paths in the spatial dimension for each time slice T (t) is obtained

[0140] To further capture the temporal dependence of the snapshot sequence of the stay hot spot transfer relationship graph, the present invention introduces meta-learning technology into the Gated Recurrent Unit (GRU), and constructs different GRUs according to the temporal context of each node and edge. Specifically, for the stay hot spot transfer relationship graph (t) in a given time slice T of node v i , its meta-temporal correlation encoding network is defined as follows:

[0141]

[0142] Among them, FCN represents a fully connected network with one hidden layer, represents the parameters of FCN, represents the potential feature vector of node v i output by the HST module at time slice T (t) , is the GRU parameter corresponding to node v i . These parameters are generated by FCN rather than through training.

[0143] The specific calculation formula of the GRU is as follows:

[0144]

[0145] Among them, σ represents the sigmod function, and ⊙ represents element-wise multiplication of vectors. are the reset gate and update gate. Similarly, through a meta-temporal modeling method consistent with the node, the edge e i→j will be generated at any time slice T (t)The potential feature vectors. After r steps of cycling, the embedding representations of all nodes and edges are obtained, constituting the embedding representation matrix of the stay hotspots and the driving paths in time slice T (r) is used for subsequent modeling. )

[0146] Step S4: Generation of transportation route embedding representation: First, obtain a query request (denoted as Req) composed of information such as the starting and ending points, departure timestamp, transportation driver, etc. Subsequently, use a denoising diffusion model to model the association pattern between the historical trajectory corresponding to the query request and the transportation route selected by the driver. The denoising diffusion model generates data samples by simulating a random diffusion process. The core of this model is to construct a denoiser that can gradually remove noise from randomly sampled Gaussian noise samples to generate an embedding representation (denoted as ω 0 ) of the transportation route similar to the original data sample. The denoiser is trained using the historical waybill trajectory dataset with the optimization goal of minimizing the reconstruction error of the transportation route.

[0147] In the embodiment, step S4 specifically includes:

[0148] Given that the transportation duration is highly correlated with the transportation route selected by the driver, the goal of this step is to learn the correlation between the historical transportation route and the query request (such as the starting and ending points, transportation driver, departure period, etc.) to generate the transportation route embedding representation. That is, given the query request Req and its corresponding transportation route (denoted as ), the goal of this step is to learn the posterior probability Inspired by the successful application of the denoising diffusion model in the field of data generation, the present invention uses the denoising diffusion model to model the distribution probability of data. As Figure 3 shown, the denoising diffusion model mainly consists of a forward diffusion process and a reverse denoising process. The forward diffusion process gradually adds noise to the transportation route embedding representation (denoted as ω 0 ) until a simple prior distribution (such as a Gaussian distribution, denoted as ω N ) is reached. To generate the embedding representation of the transportation route according to Req, based on the reverse denoising process, noise is gradually removed from the noisy transportation route embedding representation until a noiseless transportation route embedding representation is generated. The forward diffusion process and the reverse denoising process are defined as follows:

[0149]

[0150] Among them, α i = 1 - β i . β i ∈(0,1) is fixed, which is used to control the level of noise added in each forward process step and satisfies β 1 , β2 , …, β N Increasing constraints. At the Nth step of the diffusion process, the noisy vectorized embedding representation follows a standard Gaussian distribution, i.e., ω N ~N(ω N ; 0, 1). ω N Without including any prior knowledge, it can be randomly sampled from the Gaussian distribution to obtain noise, which is used as the starting point of the reverse denoising process. The reverse denoising process can directly generate a noise-free transportation route embedding representation from the random Gaussian noise (i.e., ω N ) through N steps of denoising (in the present invention, N is set to 800); ∈ is a Gaussian noise term sampled from the standard normal distribution N(0, 1).

[0151] The key to applying the denoising diffusion model to generate the transportation route embedding representation is to learn a denoiser which is used to predict the noise at each time step n, so as to generate ω n-1 . In the present invention, Unet is used to construct the denoiser, as Figure 4 shown, which consists of M downsampling blocks and upsampling blocks (in the present invention, M is set to 4), and each sampling block is composed of components such as residual blocks and Transformers. Among them, max pooling operation is used for downsampling, and linear interpolation operation is used for padding during upsampling. In order to better learn the noise at each time step and guide the transportation route embedding generation process, the denoiser first embeds the query request Req and the time step n through an encoding layer. Specifically, it encodes the time step n using the position encoding technique, and concatenates it with the query request feature vector passing through the embedding layer and then sends it into each residual block. Subsequently, each sampling block learns the correlation between the query request and the transportation route through the Transformer component. Taking the first sampling block at time slice n as an example, the Transformer mainly realizes the modeling process through two attention mechanisms:

[0152]

[0153] Among them, represents the transportation route feature embedding matrix of sampling block i, is the concatenated vector of the query request feature vector and the feature vector of time step n. and are both learning parameters.

[0154] Based on this, the output of the Tranformer is calculated as follows:

[0155]

[0156] Finally, the above denoiser is used for the randomly sampled Gaussian noise ω NIteratively execute the denoising process for N steps to generate an embedded representation of the transportation route. To obtain the denoiser, this stage uses the existing waybill trajectory data to learn its parameters and adopts the following loss function for model training:

[0157]

[0158] where is used to minimize the mean square error between the noise added in the forward diffusion process and the noise generated by the denoiser. In addition, to generate an embedded representation more similar to the actual transportation route, this stage further introduces another loss function to co-train the denoising model. This loss function is used to minimize the mean square error between the generated embedded representation ω 0 of the transportation route and the embedded representation of the actual transportation route.

[0159] Step S5: Decoding of the sequence of stay hotspots and time: Based on the embedded representations of the stay hotspots and driving paths obtained in step S3 (i.e., ), and the embedded representation of the transportation route obtained in step S4 (i.e., ω 0 ), iteratively calculate the transition probabilities from the current node to neighbor nodes through a recurrent neural network, and select the stay hotspot with the maximum transition probability as the next stay location that the freight driver will visit. At the same time, based on the multi-task learning technique, use long short-term memory (LSTM) units to predict the transportation time for each stay hotspot generated during the decoding process. The above decoding steps are executed in a loop until the final destination node is generated. Finally, obtain the transportation time of the destination node as the total transportation duration. The decoding network for stay hotspot prediction and time prediction and the encoding network of the stay hotspot transition relationship graph constructed in S3 form an encoder-decoder model for joint training, and are trained using the historical waybill trajectory dataset with the optimization goal of minimizing the reconstruction error of the sequence of stay hotspots and the prediction error of the transportation time.

[0160] In the embodiment, step S5 specifically includes:

[0161] To accurately predict the transportation duration in a scenario where only the starting and ending points are given, this step is based on the embedded representation of the stay hotspot transition relationship graph generated in S3 (i.e., ), and the embedded representation of the transportation route obtained in S4 (i.e., ω 0) By using multi-task learning technology, the transportation route and transportation duration are decoded and predicted simultaneously. For transportation route prediction, a recurrent neural network (RNN) equipped with a masked attention mechanism is used to gradually generate the sequence of visited hotspots of the driver from the starting point to the ending point of the transportation through an iterative manner. To ensure the rationality of the predicted sequence of visited hotspots, the present invention introduces a masking mechanism in the decoding process of visited hotspots at each step. Taking to represent node v j in the visited hotspot transition relationship graph in the neighbor node set, to represent the sequence of visited hotspots generated at the i-th step of decoding The masking mechanism first masks the nodes that have been output in the previous step (i.e., ), secondly masks the nodes of other transportation end point categories in the neighbor nodes that are not in this task, and finally masks the non-neighbor nodes of the current node. After that, the decoding process of the sequence of visited hotspots for a given query request Req is defined as:

[0162]

[0163] where represents the parameters of the decoding network, represents the embedded representation of the visited hotspot. To obtain the current state at each time step (with i representing the current time step) in the decoding process, the present invention uses a long short-term memory network (LSTM) to aggregate the previously generated sequence of visited hotspots (i.e., ) into a vector Then is concatenated with the query request embedded representation to obtain a current state representation that fuses the behavior pattern and task information. The decoding process of the sequence of visited hotspots is transformed into:

[0164]

[0165] The above decoding process is iteratively performed, and its core is to calculate the transition probability between the current node and the neighbor nodes of the masked node set removed at each step, obtain the neighbor node with the highest probability for output, and concatenate the embedded representation of the edge connecting the output node and the current node (i.e., ) and input it into the LSTM to obtain a new state representation. Specifically, in the i-th step of the decoding process, the concatenated vector of and ω 0 constitutes the attention query vector, and the embedded representation of the non-masked nodes of the output node in the previous time step is used as the key vector to calculate the transition probability distribution of the non-masked nodes:

[0166]

[0167] Among them, represents the set of masked nodes for the current node v i .

[0168] are learning parameters. Finally, the softmax layer is used to output the probability of each node at the i-th time step:

[0169]

[0170] Up to this point, the node with the maximum probability in each time step is obtained for output, and the above process is iteratively executed until the end point is output. At the same time, at each time step of the stay hot spot prediction, the transportation duration of each stay hot spot is cyclically generated through the LSTM unit. Specifically, the LSTM unit at the i-th time step takes the node and the edge In summary, for the node , the transportation duration prediction is defined as follows:

[0171]

[0172] In order to obtain the encoding network of the stay hot spot transfer relationship graph (see step S3 for details) and the decoding network of step S5, the present invention jointly learns an "end-to-end" model composed of an encoder-decoder using the existing waybill track data, and uses the following loss function for model training:

[0173]

[0174] Among them, is the loss function for the transportation route prediction task, is the loss function for the transportation time prediction task. |TR| is the number of training waybill tracks, and |hs t | represents the number of stay hot spots associated with the t-th waybill track sample. σ 1 , σ 2 are learning parameters, which are updated as the model is trained.

[0175] After the model training is completed, the model receives a query request, historical waybill tracks, and stay hot spot data as inputs. First, a stay hot spot transfer relationship graph is constructed based on the historical waybill tracks, and a time slice sequence [T (r) is generated based on the query time slice T (r-11) , T (r-10) , …, T (r) and the corresponding snapshot sequence of the stay hot spot transfer relationship graph Subsequently, the snapshot sequence of the stay hotspot transfer relationship graph is fed into the spatio-temporal heterogeneous graph neural network to generate the stay hotspot transfer relationship graph regarding the query time T (r) of the stay hotspot transfer relationship graph of the embedding representation Meanwhile, the transportation route embedding representation generation module generates the transportation route embedding representation ω connecting the starting and ending points based on the query request 0 . Finally, together with ω 0 are fed into the stay hotspot sequence and time decoding stage to generate the stay hotspot sequence and the transportation duration, and the transportation duration of reaching the end point is extracted as the freight duration prediction result

[0176] To verify the effectiveness of the present invention, two real bulk logistics datasets (denoted as LinYi / QingDao) are selected to predict the stay hotspot sequence of the visit and the transportation duration. Among them, the dataset "LinYi" represents the logistics data of the transportation route in Linyi, including trajectory and waybill data. Similarly, the dataset "QingDao" represents the logistics data of the transportation route in Qingdao, including trajectory and waybill data. Subsequently, the present invention compares the prediction results of the stay hotspot sequence with the prediction results of traditional route prediction methods (BERT-Trip, Query-Trip, Graph-Route, CP-Route), and selects HR@K (prediction hit rate), LSD (route deviation distance), and Pairs-F1 (F-score) as the evaluation indicators for the stay hotspot sequence prediction; the comparison results of the stay hotspot sequence prediction are shown in Table 1. Using the stay hotspot sequence prediction method of the present invention has the optimal performance, with a 6.88% improvement in the F-score (Pairs-F1) compared to the sub-optimal method

[0177] Subsequently, the transportation duration prediction results are compared with the prediction results of traditional methods (Meta-STP, Deep-OD, MWSL-TTE, M2G4RTP); MAPE (mean absolute percentage error), MAE (mean absolute error), and RMSE (root mean square error) are selected as the evaluation indicators; the comparison results of the transportation duration prediction are shown in Table 2. Using the transportation duration prediction of the present invention has the optimal performance, with an average reduction of 29.6% in the mean absolute error (MAE) and 27.21% in the root mean square error (RMSE) compared to the sub-optimal method

[0178] Table 1 Comparison table of stay hotspot sequence prediction results of different methods

[0179]

[0180] Table 2 Comparison table of transportation duration prediction results of different methods

[0181]

[0182] In summary, based on the construction of a heterogeneous graph neural network, the present invention can accurately capture the staying and driving behavior patterns of transport drivers that change dynamically over time, and is more suitable for application scenarios with a large time span in bulk logistics transportation. At the same time, a denoising diffusion model is used to model the potential correlation between different factors and transportation routes, so that an embedded representation of the transportation route connecting the starting and ending points can be generated based on query information. On this basis, a decoder based on a recurrent neural network is designed by combining multi-task learning techniques to iteratively generate the staying hot spot sequence and the prediction result of the transportation duration. This method can predict the transportation duration without presetting the transportation route.

[0183] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present application can be implemented in various computer languages, for example, object-oriented programming languages such as Java and interpreted scripting languages such as JavaScript.

[0184] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0185] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0186] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are executed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions for implementing the functions specified in one process or a plurality of processes and / or blocks Figure 1 in one block or a plurality of blocks Figure 1 in the steps of the method.

[0187] Although the preferred embodiments of the present application have been described, additional changes and modifications can be made by those skilled in the art once they learn of the basic creative concept. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the present application.

[0188] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

[0189] The protection scope of the present invention is not limited to the above embodiments. Without departing from the spirit and scope of the inventive concept of the present invention, all changes and advantages that can be conceived by those skilled in the art are included in the present invention, and the appended claims are taken as the protection scope.

Claims

1. A method for predicting transportation time based on spatiotemporal heterogeneous graph neural network, characterized in that: The following steps are involved: Step S1: using the timestamp data of the waybill record to obtain the sequence of hotspots that each waybill track passes through, and constructing a hotspot transfer relationship diagram; Step S2: Generate multiple consecutive time slice sequences of equal length based on the departure timestamp, extract the node features and edge features of each time slice, and generate a snapshot sequence of the stay hotspot transfer relationship graph of each time slice; Step S3: Encode the snapshot sequence of the stay hotspot transfer relationship graph using a spatiotemporal heterogeneous graph neural network to capture the correlation and temporal dependency between nodes and / or edges, and generate an embedded representation of the nodes and edges in the stay hotspot transfer relationship graph for the time slice; Step S4: introduce the denoising diffusion model to generate an embedding representation of the transportation route based on the query request; Step S5: Iteratively predict the sequence of hotspots through a recurrent neural network, and predict the transportation time of each hotspot based on a long short-term memory network, and iteratively generate the total transportation time.

2. The prediction method according to claim 1, characterized in that: In step S1, the waybill track is intercepted from the original track of the transport vehicle, and the corresponding transport task is matched with the transport start and end timestamps in the waybill record; and / or, The nodes in the stay hotspot transfer relationship graph represent different stay hotspots, and the directly reachable relationships between the stay hotspots are the edges in the stay hotspot transfer relationship graph; and / or, Extract a sequence of zero-speed trajectory points whose duration is greater than a preset dwell time threshold in each waybill trajectory, and use the first trajectory point in the sequence of zero-speed trajectory points as a dwell point; match the dwell point to a predefined dwell hotspot; and / or, The preset stay time threshold is 8 minutes; and / or, The hot spots include gas stations, service areas, restaurants, and logistics parks; and / or, With all the hotspots as nodes and the directly reachable relationships between the hotspots as edges, a hotspot transfer relationship graph is constructed.

3. The prediction method according to claim 1, characterized in that: In step S2, the unit length of the time slice is set in combination with the distribution of historical data and the traffic conditions in the experimental area; and / or, The unit length of each time slice is set to 2 hours; and / or, The node features include: hotspot category, hotspot latitude and longitude coordinates, time slice visit frequency, time slice average time slice stay duration, and time slice median time slice stay duration; the edge features include: Euclidean distance between hotspots, time slice pass frequency, time slice travel duration average time slice travel duration, and time slice median travel duration; and / or, The category of the stay hotspot and the longitude and latitude coordinates of the stay hotspot are the static features of the node, and the time slice access frequency, the average stay duration of the time slice, and the median stay duration of the time slice are the dynamic features of the node; the Euclidean distance between the stay hotspots is the static feature of the edge, and the time slice passage frequency, the average travel duration of the time slice, and the median travel duration of the time slice are the dynamic features of the edge; and / or, All static features corresponding to the nodes are spliced ​​with all dynamic features of the nodes corresponding to each time slice to obtain the node feature vector of the hotspot transfer relationship graph of each time slice; all static features corresponding to the edges are spliced ​​with all dynamic features of the edges corresponding to each time slice to obtain the edge feature vector of the hotspot transfer relationship graph of each time slice; and / or, Fill in the features of nodes and edges with missing time slices by copying the feature values ​​of the nearest neighbor time slices; and / or, The feature values ​​of the two time slices before and after are randomly selected to fill the missing part of the middle time slice.

4. The prediction method according to claim 1, characterized in that: In step S3, the spatiotemporal heterogeneous graph neural network includes a heterogeneous graph spatial correlation encoding module and a meta-temporal correlation encoding module, wherein the spatiotemporal heterogeneous graph neural network encoding module is used to capture the correlation between nodes, between edges, and between nodes and edges in the stay hotspot transfer relationship graph; the meta-temporal correlation encoding module is used to capture the temporal dependency of each node and edge in the snapshot sequence of the stay hotspot transfer relationship graph; and / or, Using an embedding layer to project discrete features in nodes and / or edges into dense vectors, and using a linear layer to project continuous features in nodes and / or edges into dense vectors; and / or, In the graph attention network, a heterogeneous graph attention mechanism is introduced to model the stop hotspot transfer relationship graph. The features of nodes and edges are updated through the information transmission mechanism to capture the fusion correlation of drivers' stop and driving behaviors in each time slice. Different weight mapping matrices are assigned to different types of nodes and edges and mapped to the same latent space. The relevant attention coefficients between neighboring nodes are calculated using the latent features of nodes and edges, and the latent feature vectors of nodes and edges are iteratively calculated and updated in the heterogeneous relationship graph. and / or, Stack L layers of HST to capture L-order neighbor information, and obtain the embedding representation vectors of all nodes and edges in the last layer as the embedding representation of nodes and edges in the stay hotspot transfer relationship graph of the time slice, and finally obtain each time slice T (t) The characteristic vector matrix of the stay hot spots and driving paths in spatial latitude; and / or, Meta-learning technology is introduced into the gated recurrent unit to construct different gated recurrent units according to the temporal context of each node and edge, capturing the temporal dependencies of the snapshot sequence of the residence hotspot transfer relationship graph.

5. The prediction method according to claim 1, characterized in that: In step S4, the transport route embedding representation is generated by learning the correlation between the historical transport routes and the query request; and / or, A denoising diffusion model is used to model the distribution probability of data, and the denoising diffusion model includes a forward diffusion process and a reverse denoising process; the forward diffusion process gradually adds noise to the embedded representation of the transportation route until the prior distribution is reached; in order to generate the embedded representation of the transportation route according to Req, the noise is gradually removed from the noisy embedded representation of the transportation route based on the reverse denoising process until a noise-free embedded representation of the transportation route is generated; and / or, Construct a denoiser to predict the noise at each time step, wherein the denoiser includes one or more downsampling blocks and one or more upsampling blocks, and each sampling block includes a residual block and a Transformer component; Iterative denoising is performed to obtain a complete transport route embedding representation.

6. The prediction method according to claim 1, characterized in that: In step S5, the recurrent neural network is equipped with a masked attention mechanism to iteratively generate a sequence of driver's visit and stay hot spots from the transportation starting point to the transportation end point; and / or, The masked attention mechanism first masks the nodes that have been output in the previous step, then masks the nodes of other transport destination categories that are not in this task among the neighboring nodes, and finally masks the non-neighboring nodes of the current node; and / or, The long short-term memory network is used to aggregate the sequence of stay hot spots generated in the previous order into a vector, and the vector is concatenated with the query request embedding representation to obtain the current state representation of the fusion behavior pattern and task information; and / or, At each step, the transition probability between the current node and the neighboring nodes without the masked node set is calculated, the neighboring node with the largest probability is obtained for output, and the embedded representation of the edge connecting the output node and the current node is concatenated and input into the LSTM to obtain a new state representation; and / or, Use the softmax layer to obtain the probability of each node at each time step, and output the node with the maximum probability in each time step, iteratively until the output end point; at each time step of the hotspot prediction, the transportation time of each hotspot is cyclically generated through the LSTM unit, and the total transportation prediction time is iteratively generated.

7. A prediction system for implementing the prediction method according to any one of claims 1 to 6, characterized in that: The prediction system includes: a data preprocessing and feature extraction module, a stay hotspot transfer relationship graph construction module, a spatiotemporal heterogeneous graph neural network encoding module, a transportation route embedding generation module, a stay hotspot sequence and time decoding module, and a prediction and result output module; The data preprocessing and feature extraction module extracts trajectories, stop hot spots and query request features from logistics data to provide standardized input for subsequent steps; The stop hotspot transfer relationship graph construction module constructs a transfer relationship graph between stop hotspots according to the waybill track, describing the association between nodes and paths; The spatiotemporal heterogeneous graph neural network encoding module generates dense embedding representations of stay hotspots and driving paths by modeling spatial and temporal correlations; The transport route embedding generation module generates transport route embeddings related to the query request using a denoising diffusion model, capturing the potential association between historical trajectories and transport context information; The stay hotspot sequence and time decoding module generates the stay hotspot sequence through iteration, and predicts the transportation time and accumulates the total transportation time; The prediction and result output module generates the final stopover hotspot sequence and transportation time prediction results according to the trained model and input data.

8. The prediction system according to claim 7, characterized in that The prediction system also includes a multi-task learning and joint optimization module; The multi-task learning and joint optimization module jointly optimizes the generation of stay hotspot sequences and the prediction of transportation time to improve the overall performance of the model.

9. Application of the prediction method as described in any one of claims 1 to 6, or the prediction system as described in claim 7 or 8 in freight transportation time prediction, dynamic planning of freight routes, and optimization of logistics capacity scheduling.