A method for predicting travel time

By employing weighted attribute fusion and self-attention mechanism in the AttentionTTE model, the problem of existing models dealing with spatial correlation and changes in external information under complex traffic conditions is solved, achieving more accurate travel time prediction.

CN116432853BActive Publication Date: 2026-07-17BEIHANG UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIHANG UNIV
Filing Date
2023-04-27
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

Existing travel time prediction models struggle to accurately handle spatial correlations and changes in external information under complex traffic conditions, resulting in insufficient prediction accuracy.

Method used

The AttentionTTE model is adopted, which uses a weighted attribute fusion module to process external information, a local and global spatial correlation extraction module, a time dependency extraction module, and a multi-task learning module to dynamically fuse external information and spatial features, thereby improving prediction accuracy.

Benefits of technology

It improves the accuracy of travel time prediction, better handles the spatial and temporal dependencies under complex traffic conditions, dynamically adjusts for the influence of external information, and provides more accurate prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116432853B_ABST
    Figure CN116432853B_ABST
Patent Text Reader

Abstract

This invention implements a travel time prediction method using deep learning techniques. It achieves travel time prediction by establishing an AttentionTTE model, which mainly consists of four parts: a weighted attribute fusion module; a local spatial correlation extraction module; a spatial correlation and temporal dependency extraction module, which is the core module of the model, used to learn the temporal dependency of the trajectory and the global spatial correlation of the trajectory, and to fuse external information items into the trajectory; and a multi-task learning module used to predict the travel time of the provided trajectory and balance individual and collective predictions to generate a predicted travel time value. The method provided by this invention designs a novel self-attention mechanism to solve the problem of extracting the global spatial correlation of the trajectory, which is impossible with previous methods. Furthermore, by designing a weighted attribute fusion method based on the L2 norm, it models the mutual influence between external information and the process of external information changing over time, providing a more accurate travel time prediction service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method for predicting travel time. Background Technology

[0002] With economic and technological development, urban transportation systems, while providing residents with a better travel environment and methods, also generate a large amount of data. Simultaneously, further social development places higher demands on transportation systems, leading to frequent occurrences of traffic congestion and deteriorating travel conditions. To address these abnormal traffic phenomena, effective analysis of data mined from various urban sectors and infrastructure is crucial for designing predictive models to maximize the value of hidden information within the data. This approach supports the further development and improvement of urban transportation systems, constructing a smart city system centered on big data, and providing residents with more cost-effective and convenient transportation services.

[0003] Estimated Time of Arrival (ETA), also known as travel time prediction, is a crucial task in intelligent transportation systems. Based on a given departure time, it accurately estimates the time required to travel from the start to the destination of a route, helping to save users' travel time and optimize vehicle scheduling and route planning. In real-world scenarios, the travel time prediction problem needs to consider not only the temporal characteristics of the transportation system, such as regular congestion during rush hours and occasional congestion caused by traffic accidents, but also its spatial characteristics, such as the number of traffic lights, speed limits, whether the road is a main road, and whether it passes by schools. Furthermore, it requires consideration of additional factors. Since the primary driver of the transportation system is people, and it is susceptible to natural factors, the ETA problem also needs to incorporate modeling of driver individual characteristics and external environmental characteristics, such as driver style and the impact of rain or fog on vehicle speed. In summary, the complexity of traffic conditions is closely related to the accuracy of time-of-arrival (TOA) prediction. That is, the more complex the road conditions and the more external interference factors a travel trajectory has, the more difficult it is to accurately predict its arrival time. Therefore, TOA prediction typically involves learning from multiple different data sets based on various characteristics of the route, including its attributes, spatiotemporal features, environmental features, and driver characteristics, to generate predicted values.

[0004] GPS trajectory-based travel time prediction has wide applications in the transportation sector. A complete travel time prediction algorithm typically takes a complete historical GPS trajectory sequence as input and outputs the predicted travel time for the current trajectory segment. This paper studies the problem of travel time prediction based on GPS trajectories.

[0005] Existing time of arrival prediction models based on GPS trajectory datasets with high prediction accuracy are mainly based on deep learning models. Several common deep learning-based algorithm models will be given below.

[0006] One commonly used model is the Recurrent Neural Network (RNN), which can model time-series data. In arrival time prediction based on GPS trajectory data, by converting the trajectory data into time-series data, the RNN can learn the time-dependent features in the time series and generate predicted values. Furthermore, RNN-based variants, such as Long Short-Term Memory (LSTM) networks and Gated Recurrent Units (GRUs), are also widely used to process GPS trajectory data.

[0007] Another commonly used model is the Convolutional Neural Network (CNN). CNNs can model spatial data and capture spatial correlations between different regions. In time-of-arrival prediction based on GPS trajectory data, CNNs can convert trajectory data into spatial data and learn the spatial correlation features between adjacent trajectory coordinates. Furthermore, CNN-based variants, such as Convolutional Long Short-Term Memory (ConvLSTM) networks and Spatial Transformer Networks (STNs), are also widely used to process GPS trajectory data.

[0008] Furthermore, hybrid models composed of multiple benchmark models have also achieved certain results in the task of predicting time of arrival. For example, the DeepTTE time of arrival prediction model uses a deep learning model composed of convolutional neural networks, long short-term memory networks, and residual networks as its core. It can learn the spatiotemporal features of trajectories well and integrate external information to a certain extent, achieving good prediction results. Moreover, compared with the single models mentioned above, the DeepTTE model has stronger generalization ability.

[0009] pass Figure 1 The diagram details the challenges of providing accurate travel times. Orange circles represent moving vehicles; the closer the orange circles are, the more severe the traffic congestion. Red circles indicate vehicles involved in accidents, and green arrows indicate the direction of travel. Red dashed boxes represent special sub-segments (abnormal spatial features or abnormal traffic conditions), and green dashed boxes represent affected sub-segments. Long arrows indicate impact relationships; black arrows indicate impact on more distant sub-segments, and red arrows indicate impact on adjacent sub-segments.

[0010] Although the problem of estimating arrival time has been extensively studied in the past, providing accurate travel times remains very challenging, mainly due to the following factors:

[0011] Traffic conditions are primarily influenced by spatial correlation, temporal dependence, and external information. The spatial correlation of the entire trajectory is variable, complex, and strongly correlated. For example, in... Figure 1 In (a), the red dashed box marks segment A, which has special spatial characteristics (one-way lane). When most upstream vehicles are heading towards segment A, if segment A is congested, traffic flow in upstream segments will not be able to pass smoothly. Therefore, segment B, which is directly adjacent to segment A, as well as segments C and D, which are further away, will be congested. Segments B, C, and D are all within the influence range of segment A. When A is congested, if adjacent segment B is traveling towards A, B will be affected by the congestion of A; this is called a direct impact. At the same time, the situation where segment B is congested due to the influence of A, and subsequently causes congestion in segments C and D adjacent to B, is called an indirect impact. These two impact patterns differ. Compared to the direct impact pattern, the indirect impact pattern is more significantly affected by the spatial characteristics of upstream and downstream road segments. For example, if sub-segment B is expanded to a two-lane road, sub-segment A will only directly affect lanes traveling in the direction of sub-segment A within sub-segment B; lanes traveling in the direction of sub-segment B will remain unaffected. Therefore, the indirect impact of sub-segment A on sub-segments C and D is weaker than when sub-segment B is a single-lane road. Furthermore, in natural life, there is a high probability of traffic anomalies, such as traffic congestion, upstream or downstream of the trajectory segment where a traffic accident occurs. This does not mean that this type of road segment always experiences abnormal traffic conditions, but rather that it is caused by abnormal road segments upstream or downstream, such as... Figure 1 As shown in (b). Therefore, spatial correlation of a single road segment or sub-path (which we call local spatial correlation) is insufficient to extract the spatial correlation of a trajectory.

[0012] Furthermore, with the continuous development of transportation networks and the gradual improvement of intelligent transportation systems, the amount of road traffic data is constantly increasing, which brings higher requirements to traffic prediction. To improve the prediction accuracy of a given path, many researchers have incorporated external information into road traffic prediction models. Past work, such as the DeepTTE algorithm, has fused external information (e.g., driver ID, vehicle ID, weather information, etc.) into each road segment or historical trajectory point to improve prediction accuracy. One approach is to concatenate the encoded external information with each trajectory point and transmit it to the model. This method assigns the same external information to nodes on each trajectory, thereby improving the model's predictive power. However, in reality, this external information still varies over time, and some external information may influence each other. For example, the driving characteristics of the same driver in the same vehicle will be affected by current road traffic conditions, cumulative driving time for the day, climate, and other factors. Therefore, if these changes in external information are ignored, the model's prediction accuracy will be limited. In addition, different related external information has other impacts on travel time in different application scenarios. For example, on congested roads, the driver's driving experience has less impact on travel time than weather information. Therefore, when incorporating external information into a predictive model, it is necessary to select and process it according to different application scenarios. This is the only way to improve the predictive accuracy of the model. Summary of the Invention

[0013] To address this, this invention first proposes a travel time prediction method. This method uses an AttentionTTE model to predict travel time, which consists of four main parts: a weighted attribute fusion module for processing external information about the current trajectory; a local spatial correlation extraction module for mapping GPS coordinates to a vector space, extracting local spatial correlation, and generating feature maps for subsequent processing; a spatial correlation and temporal dependency extraction module, the main module of the model, for learning the temporal dependency and global spatial correlation of the trajectory, and fusing external information items into the trajectory; and a multi-task learning module for predicting the travel time of the provided trajectory and balancing individual and collective predictions.

[0014] The weighted fusion attribute module maps all attribute information values ​​to a feature space of the same dimension, and dynamically constructs attribute information features based on the contribution of each attribute information value. Specifically, for each attribute information, it maps it to a low-dimensional space using word embedding and calculates its vector representation in that space, converting all attribute information corresponding to a trajectory into a feature vector of the same dimension. The word embedding technique uses driver ID, weather conditions, date, and departure time as four different original category variables. The departure time divides the time of day into 86,400 category values ​​at minute intervals. Each value v, v∈V, belongs to the i-th original category variable. iProjected onto vector space (E i (This refers to the dimension of the i-th original categorical variable embedded into the feature vector). Specifically, it involves embedding the original categorical variable values ​​of each attribute, after one-hot encoding, into a series of learnable matrices W of the same dimension. i The multiplication calculation yields a low-dimensional vector corresponding to each attribute information, where each matrix W... i , Where N i This is the total number of category values ​​for the i-th original category value. The attribute feature vector Attr of the trajectory is obtained as follows: Then through a learnable matrix W env ∈R E×E To obtain the attribute feature vectors corresponding to each attribute information under the current external environment conditions:

[0015] Then, an L2 norm-based method is used to calculate the weight of each attribute. To obtain the corresponding weight of each attribute feature vector, the L2 norm of each attribute feature vector is calculated. The L2 norm of each attribute feature vector is the magnitude of that vector, and the proportion of the magnitude of each attribute in the total magnitude is the weight of that attribute. Here, represents the L2 norm of all attribute feature vectors, and represents the L2 norm of each attribute feature vector.

[0016]

[0017] The weights corresponding to each attribute feature vector are as follows:

[0018] We obtain the weighted attribute information features by multiplying the weight of each attribute information with its vector representation. Finally, the weighted features are fused with other features of the model to achieve accurate prediction of the target variable.

[0019] The local spatial correlation extraction module employs a correlation deep learning method, utilizing a neural network based on a one-dimensional convolutional kernel as the local spatial feature extraction module to learn the local spatial correlation of multiple adjacent trajectory points in the historical trajectory: each historical trajectory consists of a series of continuous GPS trajectory points P = {p1,...,p...} T It consists of}, where each trajectory point p i Including longitude (p i .lng), latitude (p i .lat) and timestamp (p i The .ts method utilizes a local geographic convolutional neural network to learn the local spatial correlation of each trajectory point and its surrounding area.

[0020] The local geographic convolutional neural network uses a one-dimensional convolutional kernel to extract local features around each trajectory point. The kernel is applied to each trajectory point and its neighboring points to capture their spatial correlations. The spatial correlations of each trajectory point in the historical trajectory are extracted to form a feature vector. Before inputting the data, the raw data is processed by concatenating the longitude and latitude coordinates of each trajectory point to form a pair. These pairs are then concatenated to form a sequence containing the trajectory's geographic features, which serves as the input to the neural network. The specific process is as follows: p i =p i .lng°p i .lat

[0021] Where ° represents the concatenation operation of longitude and latitude of a single trajectory point, and p i ∈R 2×1 ,p i ∈traj,traj={p1,p2… p T},

[0022] For each GPS trajectory coordinate point p i First, through a learnable matrix W local Project it onto a low-dimensional space, where W local ∈R C×2 Then we get loc i loc i =tanh(W local ·(p i ))

[0023] The output sequence loc (loc∈R) is then obtained. C×T loc = {loc1, loc2, ..., loc} T}), loc is the feature sequence of the current historical trajectory of length T in the vector space, where the C channels of each node contain relevant information about the spatial features of that node.

[0024] Secondly, a parameter size of W is used. conv ∈R k×C A one-dimensional convolutional neural network is used, where k is the kernel size and C is the dimension of the feature vector corresponding to each trajectory point. Convolution is performed on each GPS trajectory point and its neighboring trajectory points. Through this convolution operation, the local spatial correlation of each path consisting of k neighboring trajectory points is extracted. local =relu(W conv *(loc i:i+k-1 )+b), where path local ∈R C×(T-k+1) , From loci to loc i+k-1 The length of the local trajectory segment depends on the size of the convolution kernel of the geographic convolution module, b is the bias value, and * indicates the convolution operation;

[0025] Then, add a column to the previously obtained matrix that will contain data from the local path. local The range of values ​​from R C×(T-k+1) Convert to R (C+1)×(T-k+1) This yields a new matrix path. local ∈R (C+1)×(T-k+1) The i-th element in the added column is the distance of the i-th local path, i.e.

[0026] The spatial correlation and temporal dependency extraction module consists of two parts: a global spatial correlation extraction module and a temporal dependency extraction module. The spatial correlation extraction module captures global features in the historical trajectory, combines the spatial correlations between different road segments in the historical trajectory, and generates a global spatial feature vector. The temporal dependency extraction module learns the temporal dependencies in the historical trajectory. By modeling the travel time of different road segments in the historical trajectory, the temporal dependency extraction module can effectively capture the temporal correlations between different road segments and generate a temporal feature vector. Finally, the spatial feature vector and the temporal feature vector are concatenated to obtain the hidden state of the travel time.

[0027] The spatial correlation extraction module is based on an improvement of the self-attention mechanism. First, it extracts the correlation between all nodes in a local spatial feature sequence through a simple self-attention mechanism. Then, it learns the key trajectory points that have the most significant impact on the global spatial correlation of the sequence by focusing on the weight distribution matrix. Finally, it obtains the global spatial correlation by dynamically fusing external information.

[0028] Specifically, three different learnable matrices are used. Perform a multiplication operation on each node in the sequence to obtain the query matrix Q of the node. local Key matrix K local Sum matrix V local This is used to represent the global spatial dependence of a node:

[0029] The query matrix of each node in the sequence is multiplied by the key matrices of all other nodes, and then multiplied by the value matrix after passing through the softmax activation function to obtain the attention weight distribution matrix: Furthermore, by using the Sigmoid activation function to generate a fuzzy attention assignment matrix, the influence of key segments on other segments in the trajectory sequence can be extracted.

[0030] Through the activation function Tanh and the learnable matrix W a , d v The output dimension calculated by the self-attention mechanism will include the sequence attention of each vertex, which contains the global spatial correlation of the trajectory. i Activated as state a i ;

[0031] Subsequently, the Sigmoid activation function and the query matrix Q were used. local and key matrix K local Generate fuzzy attention assignment matrix W fuzzy This is then multiplied by the trajectory state 'a' to learn key node features on the trajectory sequence and obtain the feature. part : feature part =W fuzzy ·a T Where a = (a0, a1...a2) T-k+1 );

[0032] To achieve dynamic fusion of external information, the attribute feature vector attr, attr∈R 1×E and feature part feature part ∈R (T-k+1)×C Connecting each node in the sequence yields the hidden state of the input. d hidden d ∈R (T-k+1)×(C+E) ,

[0033] To model the change of external information over driving time, it is input into a recurrent neural network (RNN) to obtain the output of a disturbance term. When processing each node in the sequence, the RNN dynamically fuses the external information: disturbance = LSTM(hidden) d ), where disturb is a feature of the attribute information that changes with the nodes of the trajectory sequence, disturb∈R (T-k+1)×C ;

[0034] Finally, through three learnable matrices W fs W at W fd The hidden state feature that learns the trajectory space relationship is obtained. s : Among them, feature s ∈R C×(T-k+1) .

[0035] The time dependency extraction module aims to extract time dependencies contained in the individual sequences of each trajectory segment within the complete trajectory sequence, i.e., the existence of paths. local In this process, a two-layer connected LSTM will be used to extract time dependencies from the sequence processed by the local spatial correlation extraction module, resulting in a time-dependent sequence: feature. t =LSTM(path) local Furthermore, spatial correlation and temporal dependence are fused into the hidden state using two learnable matrices: feature st =W s ·feature s +W t ·feature t .

[0036] The multi-task learning module combines individual and global predictions to train the model and generate the final prediction. Specifically, it uses a self-attention mechanism and L2-norm numerical calculation to obtain the contribution of each node to the hidden state of the entire sequence, thereby capturing the correlation and importance between nodes in the sequence. Subsequently, by performing a weighted summation on the feature sequences, the final trajectory feature hidden state is obtained: Finally, the trajectory hidden feature state input is passed through multiple fully connected layers, which are connected by a residual network structure. At the end of the residual network, a fully connected layer with an output dimension of 1 is added to generate the ensemble prediction time t. collective .

[0037] The technical effects to be achieved by this invention are as follows:

[0038] This paper proposes a novel self-attention mechanism to address the problem of extracting global spatial correlation of trajectories, which is impossible with previous methods. It also proposes a weighted attribute fusion method based on the L2 norm to model the mutual influence between external information and the process of external information changing over time, and to provide a more accurate travel time prediction service. Attached Figure Description

[0039] Figure 1 Correlation between sub-segments;

[0040] Figure 2 The main structure of Attention TTE;

[0041] Figure 3 Self-attention in the spatial correlation extraction module; Detailed Implementation

[0042] The following are preferred embodiments of the present invention, which are described in conjunction with the accompanying drawings. However, the present invention is not limited to these embodiments.

[0043] This invention proposes a travel time prediction method. It addresses the problem of extracting global spatial correlation of trajectories, a problem that previous methods could not solve, by designing a novel self-attention mechanism. Furthermore, it models the mutual influence between external information and the process of external information changing over time by designing a weighted attribute fusion method based on the L2 norm, thus providing a more accurate travel time prediction service.

[0044] First, the relevant definitions are given:

[0045] Historical Tracks: Historical tracks are samples of each driver's past driving routes. A historical track sequence P is defined, containing T consecutive historical GPS coordinate points, i.e., P = {p1, ..., pT}. Each GPS coordinate point contains a longitude (pi.lng), a latitude (pi.lat), and a timestamp (pi.ts). For each track, the driver's ID, trip start time, week start date, and current weather conditions will be recorded.

[0046] Individual prediction: Individual prediction divides the complete trajectory into multiple road segment blocks based on conditions such as the actual road segment length, and predicts the travel time of each sub-path. In the task, the complete trajectory is divided into multiple sub-road segment blocks according to the size of the one-dimensional convolution kernel in the local spatial correlation extraction module.

[0047] Collective prediction: Collective prediction directly predicts the travel time of the entire trajectory. In this task, the travel time of the entire trajectory is predicted by generating a fixed-length feature vector.

[0048] Local spatial correlation and global spatial correlation: Local spatial correlation is the spatial correlation between each sub-segment in the complete trajectory and its adjacent sub-segments. Global spatial correlation is the spatial correlation between each sub-segment in the entire trajectory and any other sub-segment within the same trajectory. Based on local spatial correlation, the potential spatial correlation between trajectory segments that are far apart on the trajectory is further considered.

[0049] Complete method steps:

[0050] AttentionTTE mainly consists of four parts: a weighted attribute fusion module for processing external information of the current trajectory (such as driver ID and weather); a local spatial correlation extraction module for mapping GPS coordinates to vector space, extracting local spatial correlation, and generating feature maps for subsequent processing; a spatial correlation and temporal dependency extraction module, which is the main module of the model, mainly used to learn the temporal dependency of the trajectory and the global spatial correlation of the trajectory, and to fuse external information items into the trajectory; and a multi-task learning module, which is mainly used to predict the travel time of the provided trajectory and balance individual predictions and collective predictions.

[0051] Weighted attribute fusion module:

[0052] The travel time of historical trajectories depends not only on the coordinate distribution and length of the trajectory in geographic space, but also on various factors such as driver information, weather conditions, and departure time. These external factors, as attributes of each trajectory, influence travel time prediction by affecting temporal and spatial characteristics; therefore, it is necessary to appropriately consider the impact of external factors on temporal and spatial characteristics. Since each trajectory in the dataset corresponds to a unique set of external factors, these external factors can be considered as inherent attributes of each trajectory.

[0053] In previous work, most researchers used word embedding techniques to fuse attribute information into the trajectory. This technique embeds attribute information that may affect the trajectory's travel time into the feature vector and fuses it with the trajectory's feature vector. In a specific implementation, researchers identified four types of values—driver ID, weather conditions, date, and departure time—as four attributes of the attribute information. Since these four values ​​cannot be directly input into the neural network, they used embedding techniques to convert these four types into low-dimensional vectors.

[0054] First, driver ID, weather conditions, date, and departure time are used as four distinct original categorical variables. The departure time is used to divide the day into 86,400 categorical values ​​in minute intervals. Word embedding techniques are then used to embed each value v, v∈V, belonging to the i-th original categorical variable. i Projected onto vector space (E i (This refers to the dimension of the i-th original categorical variable embedded into the feature vector). Specifically, it involves embedding the original categorical variable values ​​of each attribute, after one-hot encoding, into a series of learnable matrices W of the same dimension. i The multiplication calculation yields a low-dimensional vector corresponding to each attribute information, where each matrix W... i , Where N iis the total number of category values ​​for the i-th original category value. Compared to one-hot encoding, embedding can identify each type of value with fewer dimensions and is more computationally efficient when the number of category values ​​is too large. Furthermore, after embedding encoding, similar type values ​​are distributed adjacently in the embedding space, which effectively captures the relationships between each type of value.

[0055] This approach has certain limitations. In the process of concatenating the feature matrices generated by the embedding method for each attribute and transmitting them to the model, each attribute is independent of the others. Previous studies primarily considered the impact of attribute information on temporal and spatial features, but did not consider the influence of each attribute on other information. For example, in real life, weather conditions negatively affect a driver's mood; some more experienced drivers may drive in adverse weather conditions in a manner similar to less experienced drivers. The projected vectors of different drivers in the vector space will be more similar. Therefore, weather conditions will affect the driver's feature values ​​in the vector space. This indicates that when using attribute information to improve model performance, the interactions between these information components need to be considered. If these interactions can be captured, we can better understand how attribute information affects the model's output and more accurately predict the value of the target variable. Therefore, researchers need to explore more refined methods to fully utilize attribute information and maximize model performance.

[0056] To address the aforementioned issues, a weighted fusion attribute module is proposed. This module maps all attribute information values ​​to a feature space of the same dimension and dynamically constructs attribute information features based on the contribution of each attribute value. Specifically, for each attribute, it is mapped to a low-dimensional space using word embedding and its vector representation in that space is computed. Then, an L2 norm-based method is used to calculate the weight of each attribute, representing its influence on the final vector. By multiplying the weight of each attribute by its vector representation, the weighted attribute information features are obtained. Finally, the weighted features are fused with other features of the model to achieve accurate prediction of the target variable.

[0057] First, word embedding technology is used to convert all attribute information corresponding to a trajectory into a feature vector of the same dimension, which serves as the trajectory's attribute feature vector (Attr). Word embedding technology treats driver ID, weather conditions, date, and departure time as four different original categorical variables. The departure time is used to divide the time of day into 86,400 categorical values ​​at minute intervals. Each value v, v∈V, belongs to the i-th original categorical variable. i Projected onto vector space (E i(This is the dimension of the i-th original categorical variable embedded into the feature vector).

[0058]

[0059] Then, through a learnable matrix W env ∈R E×E To obtain the attribute feature vectors corresponding to each attribute information under the current external environment conditions.

[0060]

[0061] Secondly, to obtain the corresponding weights of each attribute feature vector, the L2 norm of each attribute feature vector is calculated. The L2 norm of each attribute feature vector is the magnitude of that vector, and the proportion of the magnitude of each attribute in the total magnitude is the weight of that attribute. Here, represents the L2 norm of all attribute feature vectors, and represents the L2 norm of each attribute feature vector.

[0062]

[0063] The weights corresponding to each attribute feature vector are as follows:

[0064]

[0065] Finally, the feature vectors of all attributes are summed using weights to obtain a weighted attribute feature vector. Specifically, for each trajectory, the attribute feature vector corresponding to its attribute information is multiplied by its corresponding weight and summed to obtain the weighted feature vector of that trajectory. This allows for the dynamic construction of attribute information features based on different external environmental conditions and their application in trajectory prediction.

[0066]

[0067] Compared to directly fusing the values ​​of each attribute information through word embedding encoding, the weighted attribute fusion module can better learn the differences in the impact of each attribute on the target path under different times and conditions. By calculating the weights of the feature vectors of each attribute information, attribute information features can be dynamically constructed according to the importance of different attribute information.

[0068] Local spatial correlation extraction module:

[0069] A relevant deep learning method is employed, utilizing a neural network based on a one-dimensional convolutional kernel as a local spatial feature extraction module to learn the local spatial correlation of multiple adjacent trajectory points in historical trajectories. As mentioned earlier, each historical trajectory consists of a series of continuous GPS trajectory points (including latitude and longitude information and sampling timestamps) P = {p1,...,pT}, where each trajectory point p iIncluding longitude (p i .lng), latitude (p i .lat) and timestamp (p i (.ts). The latitude and longitude information in each trajectory point contains the local spatial features and correlations around that point. Therefore, a local geographic convolutional neural network is used to learn the local spatial correlations of each trajectory point and its surrounding area.

[0070] Local geospatial convolutional neural networks (LTCNNs) are deep learning models designed for geographic information. They utilize one-dimensional convolutional kernels to extract local features around each trajectory point, thereby learning the spatial correlations between these points. Since trajectory points are typically time-series data, LTCNNs employ one-dimensional convolutional kernels to preserve the temporal information of the data. These kernels are applied to each trajectory point and its neighboring points to capture their spatial correlations. In this way, the spatial correlations of each trajectory point in a historical trajectory can be extracted, forming a feature vector.

[0071] Before inputting the data, the raw data needs to be processed to adapt to the input format of the neural network. Specifically, the longitude and latitude coordinates of each trajectory point are concatenated to form a pair (longitude, latitude). These pairs are then concatenated to form a sequence containing the geographical features of the trajectory, which serves as the input to the neural network. This processing method preserves the spatial relationships between trajectory points while facilitating data processing by the neural network. The specific process is described in the following formula:

[0072]

[0073] Where represents the concatenation operation of the longitude and latitude of a single trajectory point, and p i ∈R 2×1 p i ∈traj, traj={p1, p2...p T}

[0074] For each GPS trajectory coordinate point p i First, through a learnable matrix W local Project it onto a low-dimensional space, where W local ∈R C×2 Then we get loc i .

[0075] loc i =tanh(W local ·(p i ))#(7)

[0076] Therefore, the output sequence loc (loc∈R) can be obtained.C×T loc = {loc1, loc2, ..., loc} T}), loc is the feature sequence of the current historical trajectory of length T in the vector space, where the C channels of each node contain relevant information about the spatial features of that node.

[0077] Secondly, a parameter size of W is used. conv ∈R k×C A one-dimensional convolutional neural network (where k is the kernel size, usually an odd number) is used to convolve each GPS trajectory point and its neighboring trajectory points. Through this convolution operation, the local spatial correlation of each group of k neighboring trajectory points is extracted. This method can capture the spatial dependencies between trajectory points, thus better describing the spatial characteristics of GPS trajectory data.

[0078] path local =relu(W conv *(loc i:i+k-1 )+b)#(8)

[0079] Where path local ∈R C×(T-k+1) , From loc i to loc i+k-1 The length of the local trajectory segment depends on the size of the convolution kernel of the geographic convolution module, b is the bias value, and * indicates the convolution operation.

[0080] Then, add a column to the previously obtained matrix that will contain data from the local path. local The range of values ​​from R C×(T-k+1) Convert to R (C+1)×(T-k+1) This yields a new matrix path. local ∈R (C+1)×(T-k+1) The i-th element in the newly added column is the distance of the i-th local path, i.e. To facilitate the extraction of global spatial correlations through a self-attention mechanism, the order of the entire sequence is marked.

[0081] Global spatial correlation and temporal dependency extraction module

[0082] This module consists of two main parts: a global spatial correlation extraction module and a time dependency extraction module.

[0083] Based on the results of local spatial correlation extraction, the global spatial correlation extraction module is used to extract global spatial features from historical trajectories. Specifically, the global spatial correlation extraction module aims to capture global features in historical trajectories, such as the overall topology of roads and the spatial layout relationships between road segments. Through a self-attention mechanism, the global spatial correlation extraction module can effectively combine the spatial correlations between different road segments in historical trajectories and generate a global spatial feature vector.

[0084] The time dependency extraction module aims to learn the time dependencies in historical trajectories. By modeling the travel time of different road segments in the historical trajectory, the time dependency extraction module can effectively capture the time correlation between different road segments and generate time feature vectors.

[0085] Finally, the global spatial feature vector and the temporal feature vector are concatenated to obtain the hidden state of the journey time. This hidden state contains both spatial and temporal information from the historical trajectory, thus enabling better prediction of future journey times.

[0086] Global Spatial Correlation Extraction Module

[0087] First, a global spatial correlation extraction module was proposed, such as... Figure 3 As shown, this module is based on an improvement of the self-attention mechanism, enabling it to better learn the potential relationships between each node in the same sequence within a time series. It can dynamically fuse the influence of external information on the sequence. The module first extracts the correlation between all nodes in a local spatial feature sequence using a simple self-attention mechanism. Then, it learns the key trajectory points that have the most significant impact on the global spatial correlation of the sequence by focusing on the weight distribution matrix. Finally, it obtains the global spatial correlation by dynamically fusing external information.

[0088] A new sequence of length T-k+1 is obtained by calculating using formula (12) in the local spatial correlation extraction module, where each node of the sequence contains the local spatial correlation of the local trajectory. It is worth noting that if the traditional method of previous work is followed, the spatial feature extraction of the trajectory will be completed. However, the spatial correlation of the trajectory depends on the spatial features of all trajectory points on the trajectory, while this method obtains the local spatial correlation of each trajectory point. It does not consider the correlation between sub-trajectory segments in the complete trajectory, i.e., the global spatial correlation. To solve this problem, a self-attention mechanism is used to learn the sequence containing local spatial features and correlations. The self-attention mechanism plays an important role in handling the relationship between nodes in the complete sequence and has been partially applied in traffic prediction. In other fields such as natural language processing, feature extraction of keywords or nodes in text or sequences is mainly accomplished by increasing the dimension of the feature vector of each word or node in the text or sequence and increasing the number of layers of the self-attention mechanism. However, this process requires a large number of trainable model parameters. In addition, in the process of this study, it was found that assigning higher dimensions to each trajectory point in the GPS trajectory dataset and using more layers of the self-attention mechanism leads to the difficulty in model convergence. In contrast, when the feature dimension of each node is small, the self-attention mechanism's ability to extract features from key nodes decreases. Therefore, directly using the self-attention mechanism is insufficient.

[0089] The proposed method addresses the shortcomings of traditional approaches by learning sequences of local spatial features and correlations through a self-attention mechanism, taking into account the global spatial correlations between segments within the complete trajectory. Furthermore, by controlling the feature dimension and refining the self-attention mechanism, the number of model parameters is reduced, improving training efficiency and accuracy. This method achieves good results in experiments and can be applied to the analysis and prediction of GPS trajectory data.

[0090] Specifically, three different learnable matrices are used. Perform a multiplication operation on each node in the sequence to obtain the query matrix (Q) of the node. local ), bond matrix (K local ) and value matrix (V local The feature matrix () is used to represent the global spatial correlation of nodes. Generally, to enhance the self-attention mechanism's ability to learn the relationships between each node in the sequence, a one-dimensional convolutional neural network with a kernel size of 1 can also be used to generate the above feature matrix.

[0091]

[0092]

[0093]

[0094] The query matrix of each node in the sequence is multiplied by the key matrices of all other nodes, and then multiplied by the value matrix after passing through the softmax activation function to obtain the attention weight distribution matrix (as shown in the formula below).

[0095]

[0096] To extract the influence of key segments (such as road segments with traffic lights) on other segments in a trajectory sequence, the relationships between different segments in the same trajectory are mapped to the interval [0, 1]. The closer the relationship value between segments is to 1, the stronger their correlation. This is achieved by generating a fuzzy attention assignment matrix using the Sigmoid activation function.

[0097] Through the activation function Tanh and the learnable matrix W a , Each vertex attention of the sequence attention, which includes the global spatial correlation of the trajectory. i Activated as state a i .

[0098] Subsequently, the Sigmoid activation function and the query matrix Q were used. local and key matrix K local Generate fuzzy attention assignment matrix W fuzzy This is then multiplied by the trajectory state 'a' to learn key node features on the trajectory sequence and obtain the feature. part .

[0099]

[0100] feature part =W fuzzy ·a T #(14)

[0101] Where, a = (a0, a1...a...) T-k+1 ).

[0102] When fusing external information as attributes, traditional methods often treat it as a supplement to GPS points in the feature vector space. However, some external information changes over time, such as weather and driver information, which can influence driving style. Therefore, using static external information as a supplement to GPS points fails to adequately capture current external information.

[0103] To achieve dynamic fusion of external information, the attribute feature vector attr, attr∈R 1×E and feature part featurepart ∈R (T-k+1)×C Connecting each node in the sequence yields the hidden state of the input. d hidden d ∈R (T-k+1)×(C+E) .

[0104] In the real world, external information changes constantly over time; for example, a driver's driving style, weather conditions, and other information all change over time. To model this change in external information over driving time, it is input into a recurrent neural network (recall that LSTM is typically very effective at handling time series problems), resulting in a perturbation term as the output. The recurrent neural network dynamically fuses external information as it processes each node in the sequence. The advantage of this approach is that it can capture the trends and patterns of external information changing over time, thus better reflecting the current external environment and improving the model's predictive and generalization abilities. For example, in traffic forecasting, dynamically fusing external information based on factors such as weather forecasts and time can more accurately predict road congestion and improve the accuracy of traffic predictions.

[0105] disturb = LSTM(hidden) d )#(15)

[0106] Among them, the disturb is a feature of the attribute information that changes with the nodes of the trajectory sequence, where disturb∈R (T-k+1)=C .

[0107] Finally, through three learnable matrices W fs W at W fd The hidden state feature that learns the trajectory space relationship is obtained. s .

[0108]

[0109] Among them, feature s ∈R C×(T-k+1) .

[0110] Time dependency extraction module:

[0111] A recurrent neural network is introduced into the model to extract the temporal dependencies of historical trajectories. These temporal dependencies are contained in the individual sequences of each trajectory segment within the complete trajectory sequence; that is, paths exist. local Recurrent neural networks (RNNs) are a type of deep learning model widely used to capture dependencies in time series data.

[0112] The temporal dependencies are extracted from the sequence processed by the local spatial correlation extraction module by a two-layer connected LSTM, resulting in a temporally dependent sequence.

[0113] feature t =LSTM(path) local )#(17)

[0114] Spatial correlation and temporal dependence are fused into the hidden state using two learnable matrices.

[0115] feature st =W s ·feature s +W t ·feature t #(18)

[0116] Multi-task learning module

[0117] Finally, a multi-task learning module is introduced. Previously, arrival time prediction work was mainly divided into individual and collective prediction. Individual prediction divides the historical trajectory into multiple sub-trajectory segments, predicts each segment sequentially, and then sums them. Collective prediction directly predicts the travel time of the entire historical trajectory. Generally, individual prediction is more accurate than collective prediction. Individual prediction cannot model the complex traffic environment of the entire trajectory, such as the impact of traffic lights and intersections on travel time, and therefore cannot accurately predict the travel time of long trajectory sequences. Therefore, an ideal model should possess both the accuracy of individual prediction and the ability to model complex traffic conditions as in collective prediction. In the experimental phase, the model is trained by combining individual and global predictions to improve the accuracy of the model's predictions.

[0118] A multi-task learning module is used to generate the final prediction. In a single prediction stage, reviewing previous data allows for the generation of hidden state sequence features. st =hidden=h1,h2..,h T-k+1 Each hidden state represents a spatiotemporal feature of a local trajectory. A single prediction unit was constructed using a two-layer fully connected neural network, yielding T-k+1 scalar t values. i , representing the transit time of each local trajectory, yields the local predicted time series t. individual ={t1, t2, ..., t} T-k+1}

[0119] Due to the feature sequence stThe hidden state is still of length T-k+1, its length depending on the length of the initial trajectory. Therefore, before performing collective prediction, we need to convert it into a fixed-length hidden state. A common approach is to sum and average the T-k+1 hidden states, i.e., average pooling. However, this method cannot effectively determine the contribution of the spatiotemporal features of each local trajectory to the overall trajectory.

[0120] Recalling the self-attention mechanism, we know that the hidden state of a sequence processed by self-attention contains the relationships between nodes. In self-attention, each node performs a weighted sum of the hidden states of other nodes in the sequence to generate its own hidden state. To quantify the contribution of each node to the hidden state of the entire sequence, we calculate the sequence feature. st The L2 norm value of the hidden state of each node is calculated. The L2 norm is the square of the Euclidean distance, which measures the length or size of a vector. Here, the L2 norm value reflects the importance or contribution of the node's hidden state to the complete sequence; a larger value indicates a greater contribution of the node's hidden state to the entire sequence. Finally, based on the position of each node in the sequence modulo, mod∈R, the L2 norm value is calculated. 1×(T-k+1) The weight α is generated by the proportion of the L2 norm value to the sum of the L2 norm values ​​of the total sequence. i This weight generation method ensures that nodes with larger vector magnitudes in the sequence contribute more to the entire sequence, while also taking into account the contributions of all nodes in the sequence.

[0121] In summary, by using the self-attention mechanism and L2-norm numerical calculation, we can obtain the contribution of each node to the hidden state of the entire sequence, thereby better capturing the correlation and importance between nodes in the sequence.

[0122]

[0123] Subsequently, the final trajectory feature hidden state is obtained by weighted summation of the feature sequences.

[0124]

[0125] Finally, the trajectory hidden feature states are input through multiple fully connected layers (in the experiments, the hidden state dimension of the fully connected layers is 128), and these layers are connected by a residual network structure. The residual network can avoid model degradation caused by increasing depth. At the end of the residual network, a fully connected layer with an output dimension of 1 is added to generate the set prediction time t. collective .

[0126] This invention uses MAE, MAPE, and RMSE as evaluation metrics for the algorithm. These metrics are commonly used to evaluate the performance of machine learning models in prediction tasks.

[0127] MAE (Mean Absolute Error) is the average of the absolute errors between predicted and actual values. It measures the average difference between predicted and true values, and therefore can be used to measure the average prediction error of a model. For example, an MAE of 2 means that the model's average prediction error is 2 units.

[0128] MAPE (Mean Absolute Percentage Error) is a relative measure used to gauge the magnitude of the error between predicted and true values. Unlike MAE, it uses percentage error, allowing comparison of prediction performance across different datasets. For example, a MAPE of 10% means the model's average error is 10% of the true value.

[0129] RMSE (Root Mean Square Error) is the square root of the square of the deviation between the predicted and actual values, divided by the average of the number of observations, n. Similar to MAE, RMSE measures the difference between model predictions and actual values; however, because it is a square root, it can amplify larger errors.

[0130] This invention uses the following two existing algorithms for comparative experiments:

[0131] MLP-LSTM: This model uses a multilayer perceptron and a two-layer LSTM connected model as one of the baseline models. The input of this model is consistent with the model input, and the hidden layer size of the model is 128.

[0132] DeepTTE: The DeepTTE model is currently one of the most accurate time-of-arrival (TOA) prediction models based on GPS trajectory datasets. This model introduces, for the first time, a geographic convolution module and a multi-task learning module based on attribute fusion. High-precision predictions are achieved by extracting spatial and temporal features and balancing the model's global and local predictive capabilities. However, in the spatial feature extraction module, DeepTTE only considers the spatial features of a few adjacent path nodes and does not establish the correlation between global spatial features. Furthermore, it does not consider the temporal changes in attributes during attribute fusion. In our experiments, the dimension of its hidden state was set to the same as the model's.

[0133] The effectiveness of the algorithm is demonstrated through the following experiments:

[0134] 1. Use the dataset from the first 1 to 20 days as the training set, the dataset from the next 3 days as the validation set, and the dataset from the last 7 days as the test set to test the model’s predictive ability under a full training cycle (one week).

[0135] 2. To determine the predictive ability of a model trained on datasets with shorter time spans, experiments were conducted on datasets with time spans of 24 hours and one week. First, the dataset period was set to 24 hours. Data from two consecutive days were used as the training and test sets, respectively. To mitigate the interference of human time planning (such as weekends and holidays), datasets from weekends, Mondays, and Fridays were excluded, and Tuesday was used as the training set, and Wednesday as the test set. In the model's attribute fusion module, the date attribute of the target trajectory was excluded. Second, all datasets from the previous week were selected as the training set, and Wednesday of the current week was selected as the test set. The model was then tested on these datasets.

[0136] 3. To test whether the model’s ability to predict arrival time decreases as the time interval between training and prediction increases, an experiment was conducted using the first week of August dataset for one location as the training set and the last week dataset as the test set.

[0137] The experimental results are as follows:

[0138]

[0139] Furthermore, the total trainable parameters of the entire model are approximately 0.56 MB. The trainable parameters for the weighted attribute fusion module are approximately 0.21 MB, for the spatial correlation and temporal dependency extraction modules (including the local spatial correlation extraction module) they are approximately 0.27 MB, and for the multi-task learning module they are approximately 0.08 MB. Compared to DeepTTE, DeepTTE is a deep learning model with higher prediction accuracy (the model's trainable parameters are approximately 0.71 MB, and the attribute fusion module's are approximately 0.40 MB), but with fewer trainable parameters. The model has fewer trainable parameters because the latent space encoded by each attribute during attribute embedding is limited to lower values.

Claims

1. A method for predicting travel time, characterized in that: Travel time prediction is achieved by establishing an AttentionTTE model, which mainly consists of four parts: a weighted attribute fusion module for processing external information of the current trajectory; a local spatial correlation extraction module for mapping GPS coordinates to vector space, extracting local spatial correlation, and generating feature maps for subsequent processing; a spatial correlation and temporal dependency extraction module, which is the main module of the model, for learning the temporal dependency and global spatial correlation of the trajectory, and fusing external information items into the trajectory; and a multi-task learning module for predicting the travel time of the provided trajectory and balancing individual and collective predictions to generate a predicted value for travel time. The weighted fusion attribute module maps all attribute information values ​​to a feature space of the same dimension, and dynamically constructs attribute information features based on the contribution of each attribute information value. Specifically, for each attribute information, it maps it to a low-dimensional space using word embedding and calculates its vector representation in that space, converting all attribute information corresponding to a trajectory into a feature vector of the same dimension. The word embedding technique uses driver ID, weather conditions, date, and departure time as four different original category variables. Among them, the departure time divides the time of day into 86,400 category values ​​at minute intervals, belonging to the [missing information] category. Each value of the original categorical variables , Projected onto vector space , It is the first The original categorical variables are embedded into the dimension of the feature vector; specifically, this is achieved by embedding the original categorical variable values ​​of each attribute, after being encoded using one-hot codes, with a series of learnable matrices of the same dimension. The multiplication calculation yields a low-dimensional vector corresponding to each attribute information, where each matrix... , ,in It is the first The total number of category values ​​for each original category value; This yields the attribute feature vector of the trajectory. : Then through a learnable matrix To obtain the attribute feature vectors corresponding to each attribute information under the current external environment conditions: ; Then, an L2 norm-based method is used to calculate the weight of each attribute. To obtain the corresponding weight of each attribute feature vector, the L2 norm of each attribute feature vector is calculated. The L2 norm of each attribute feature vector is the magnitude of that vector, and the proportion of the magnitude of each attribute in the total magnitude is the weight of that attribute. Here, represents the L2 norm of all attribute feature vectors, and represents the L2 norm of each attribute feature vector. The weights corresponding to each attribute feature vector are as follows: ; We obtain the weighted attribute information features by multiplying the weight of each attribute information with its vector representation. Finally, the weighted features are fused with other features of the model to achieve accurate prediction of the target variable.

2. The travel time prediction method as described in claim 1, characterized in that: The local spatial correlation extraction module employs a correlation deep learning method, utilizing a neural network based on a one-dimensional convolutional kernel as the local spatial feature extraction module to learn the local spatial correlation of multiple adjacent trajectory points in a historical trajectory: each historical trajectory consists of a series of continuous GPS trajectory points. Composition, in which each trajectory point Including longitude ( ),latitude( ) and timestamp It utilizes a local geographic convolutional neural network to learn the local spatial correlation of each trajectory point and its surrounding area.

3. The travel time prediction method as described in claim 2, characterized in that: The local geographic convolutional neural network uses a one-dimensional convolutional kernel to extract local features around each trajectory point. The kernel is applied to each trajectory point and its neighboring points to capture their spatial correlations. The spatial correlations of each trajectory point in the historical trajectory are extracted to form a feature vector. Before inputting the data, the raw data is processed by concatenating the longitude and latitude coordinates of each trajectory point to form a tuple. These tuples are then concatenated to form a sequence containing the trajectory's geographic features, which serves as the input to the neural network. The specific process is described in the following formula: in This represents the concatenation operation of longitude and latitude for a single trajectory point, and , , For each GPS trajectory coordinate point First, through a learnable matrix Project it into a low-dimensional space, where Subsequently obtained : The output sequence is then obtained. ( , ), It is the feature sequence of the current historical trajectory of length T in the vector space, where the C channels of each node contain relevant information about the spatial features of that node; Secondly, the parameter size is adopted. A one-dimensional convolutional neural network, where k is the kernel size. To extract the local spatial correlation of each GPS trajectory point and its neighboring trajectory points, convolution is performed on the feature vector corresponding to each trajectory point, taking into account its dimension. ,in , from to The length of the local trajectory segment depends on the size of the convolution kernel of the geographic convolution module. This is the deviation value. Convolution operation; Then, add a column to the previously obtained matrix that will contain data from the local path. The range of values ​​from Switch to A new matrix is ​​obtained. The i-th element in the added column is the distance of the i-th local path, i.e. .

4. The travel time prediction method as described in claim 3, characterized in that: The spatial correlation and temporal dependency extraction module consists of two parts: a global spatial correlation extraction module and a temporal dependency extraction module. The spatial correlation extraction module captures global features in the historical trajectory, combines the spatial correlations between different road segments in the historical trajectory, and generates a global spatial feature vector. The temporal dependency extraction module learns the temporal dependencies in the historical trajectory. By modeling the travel time of different road segments in the historical trajectory, the temporal dependency extraction module can effectively capture the temporal correlations between different road segments and generate a temporal feature vector. Finally, the spatial feature vector and the temporal feature vector are concatenated to obtain the hidden state of the travel time.

5. The travel time prediction method as described in claim 4, characterized in that: The spatial correlation extraction module is based on an improvement of the self-attention mechanism. First, it extracts the correlation between all nodes in a local spatial feature sequence through a simple self-attention mechanism. Then, it learns the key trajectory points that have the most significant impact on the global spatial correlation of the sequence by focusing on the weight distribution matrix. Finally, it obtains the global spatial correlation by dynamically fusing external information. Specifically, three different learnable matrices are used. Perform a multiplication operation on each node in the sequence to obtain the node's query matrix. Key matrix Sum matrix This is used to represent the global spatial dependence of a node: , , , The query matrix of each node in the sequence is multiplied by the key matrices of all other nodes, and then multiplied by the value matrix after passing through the softmax activation function to obtain the attention weight distribution matrix: Furthermore, by using the Sigmoid activation function to generate a fuzzy attention assignment matrix, the influence of key segments on other segments in the trajectory sequence can be extracted. Through the activation function Tanh and the learnable matrix , , The output dimension calculated by the self-attention mechanism will include sequences of global spatial correlations of the trajectory. Each vertex Activated as state ; Subsequently, the Sigmoid activation function and query matrix were used. and key matrix Generate a fuzzy attention assignment matrix and correlate it with the trajectory state Multiplication is performed to learn key node features on the trajectory sequence and obtain... : ,in, , This indicates transposition; To achieve dynamic fusion of external information, attribute feature vectors , and , Connecting each node in the sequence yields the hidden state of the input. , , To model the change of external information over driving time, it is input into a recurrent neural network (RNN) to obtain a perturbation term as the output. The RNN dynamically fuses external information as it processes each node in the sequence. ,in, The characteristics of attribute information that change with the nodes of the trajectory sequence. ; Finally, through three learnable matrices , , The hidden states that have learned the trajectory space relationship are obtained. : ,in, .

6. The travel time prediction method as described in claim 5, characterized in that: The time dependency extraction module aims to extract time dependencies contained in the individual sequences of each trajectory segment within the complete trajectory sequence, i.e., they exist. In this process, a two-layer connected LSTM will be used to extract time dependencies from the sequence processed by the local spatial correlation extraction module, resulting in a sequence with time dependencies: Furthermore, spatial correlation and temporal dependency are fused into the hidden state using two learnable matrices: .

7. The travel time prediction method as described in claim 6, characterized in that: The multi-task learning module combines individual and global predictions to train the model and generate the final prediction. Specifically, it uses a self-attention mechanism and L2-norm numerical calculation to obtain the contribution of each node to the hidden state of the entire sequence, thereby capturing the correlation and importance between nodes in the sequence. Subsequently, by performing a weighted summation of the feature sequences, the final trajectory feature hidden state is obtained: Finally, the trajectory hidden feature state is input through multiple fully connected layers, which are connected by a residual network structure. At the end of the residual network, a fully connected layer with an output dimension of 1 is added to generate the ensemble prediction time. .