Vehicle trajectory data completion method based on spatio-temporal graph embedding
By combining LSTM and GCN in a spatiotemporal graph embedding method, the problems of inaccurate trajectory data completion and poor real-time performance in existing technologies are solved, achieving high-precision trajectory data completion and adapting to complex traffic environments.
Patent Information
- Application Number
- CN202411251999.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2044-09-09
AI Technical Summary
Existing methods struggle to effectively capture the contextual dependencies and dynamic traffic network information of complex trajectory sequences, resulting in inaccurate vehicle trajectory data completion and poor real-time performance.
A spatiotemporal graph embedding method based on LSTM model and GCN is adopted. The temporal correlation information of vehicle trajectory data is extracted through attention mechanism, and real-time traffic information is learned to construct trajectory flow graph for trajectory point completion.
It improves the accuracy and real-time performance of trajectory data completion, can adapt to different types of trajectory missing, provides stable completion results, and ensures the consistency and feasibility of completed trajectories in time and space.
Smart Images

Figure CN118779595B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method for completing vehicle trajectory data based on spatiotemporal graph embedding. Background Technology
[0002] With the rapid development of IoT and GPS positioning technologies, the transportation industry has accumulated a vast amount of vehicle trajectory data, containing rich temporal and spatial information, which can be widely applied in areas such as vehicle destination analysis, urban traffic planning, and urban traffic congestion management. However, in practice, complete vehicle trajectory data is difficult to obtain due to limitations in the data collection environment and financial resources. By leveraging existing data and combining it with deep learning algorithms, vehicle trajectory data can be supplemented, improving the accuracy and efficiency of traffic management and significantly enhancing the overall performance of intelligent transportation systems.
[0003] Early methods primarily used interpolation algorithms to complete vehicle trajectory data. However, these methods were overly simplistic and failed to capture real-time traffic flow and road condition changes, leading to significant discrepancies between the completed trajectories and the actual driving paths. While trajectory playback methods based on membership data utilized historical trajectory data for matching, they were affected by noise and missing information in historical trajectories and could not complete unknown new paths, making them ill-suited for new traffic patterns and unforeseen events, resulting in unstable completion performance. Trajectory completion methods based on graph neural networks represented the road network as a graph structure, but suffered from high computational costs and poor real-time performance. Methods using generative adversarial networks (GANs) to generate missing trajectory data were complex, prone to crashing, and unable to handle different types of missing trajectory data. In summary, existing methods failed to effectively capture the complex contextual dependencies of trajectory sequences, mine dynamic traffic network information, and provide reasonable and accurate trajectory data completion. Therefore, a trajectory data completion method that integrates dynamic spatiotemporal information is needed. Summary of the Invention
[0004] To address the shortcomings of the aforementioned methods, this invention proposes a vehicle trajectory data completion method based on spatiotemporal graph embedding. Based on an LSTM model, the method fully extracts the temporal correlation information between vehicle trajectory data through an attention mechanism, and learns the trajectory flow graph embedding of real-time traffic information through a GCN module to obtain the spatial information of the traffic network. The two are then combined to complete the trajectory points and obtain accurate vehicle trajectory data.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] A method for vehicle trajectory data completion based on spatiotemporal graph embedding includes the following steps:
[0007] S1. Data Acquisition: Obtain precise latitude and longitude information of each location point of the vehicle through vehicle positioning equipment and road monitoring equipment to obtain vehicle location data at different times;
[0008] S2. Data Processing: The obtained vehicle location data is divided into days, that is, the vehicle location data of each day is taken as a trajectory, and the trajectory data is masked at a certain ratio to form a low sampling rate trajectory, thus obtaining trajectory data.
[0009] S3. Trajectory Flow Graph Construction: The trajectory data is divided into a trajectory set, and a trajectory flow graph is constructed.
[0010] S4. GCN Spatial Information Embedding: The transformation mode and attributes of trajectory points are encoded using the GCN graph convolutional network to obtain the GCN embedding representation of the trajectory points;
[0011] S5. Spatiotemporal information embedding: The trajectory points are embedded and represented, and combined with the GCN embedding representation of the trajectory points, the spatiotemporal information embedding representation is obtained;
[0012] S6, LSTM Spatiotemporal Trajectory Completion: The embedded trajectory points are input into the LSTM model to complete the trajectory data and obtain the predicted trajectory that matches the current traffic network.
[0013] As a further technical solution of the present invention, the trajectory flow graph constructed in step S3 is an attribute-weighted directed graph, where nodes represent location points, edges represent the adjacent visit relationships between location points, the weight of the edges represents the frequency of occurrence, and the attributes of each location point consist of longitude, latitude, and visit frequency. Specifically, for the trajectory set... A trajectory flow graph is an attribute-weighted directed graph. Where the node set V is the set of position points p, and the edge set is... This indicates the adjacent access relationship between location points. For the attribute functions of the location points, the attributes of each location point p It consists of longitude, latitude, and access frequency. If If a trajectory Si appears in the trajectory set S, then there exists an edge from p1 to p2, meaning they are visited consecutively. Let w be the weight function of the edge. weight This indicates that it appears in the S-track. The number of times.
[0014] As a further technical solution of the present invention, the specific process of step S4 is as follows:
[0015] S41. For the constructed trajectory flow graph G, its adjacency matrix is A∈R. N×N Calculate the normalized Laplace matrix: Where D is the degree matrix, G is an N×N identity matrix;
[0016] S42, Input node feature matrix H (0) =X∈R N×C C represents the feature dimension of the input node feature matrix. The GCN layer aggregates the neighborhood information and the node's own embedding information to update the node's embedding information. ,in Indicates the first The input signal of the layer, Indicates the first The model weight matrix of the layer, This is the corresponding deviation term. It is the ReLU activation function; For the first The dimension of the layer output features;
[0017] S43. By stacking multiple GCN modules, the representational power of the model is enhanced. The final GCN output is the GCN embedding representation of the trajectory points: , For the first The node feature matrix of the layer, that is, after processing in the GCN module Node feature representation after layer processing For the first The node feature matrix of the layer, that is, after processing in the GCN module Node feature representation after layer processing For the first The layer's bias term is used to introduce bias.
[0018] As a further technical solution of the present invention, the specific process of step S5 is as follows:
[0019] S51, Set the trajectory S={S i} is used for embedding representation, a trajectory point m=<x,y,s> Let x, y, and s represent longitude, latitude, and time information, respectively. After embedding, they are represented as follows:
[0020] ;
[0021] ;
[0022] ;
[0023] in This is an embedding function used to convert input data x and y into a fixed-dimensional vector representation; For frequency parameters, where time information is used to adjust. The periodic characteristics, This is time information, representing trajectory points. timestamp, This is a phase parameter used to adjust time information. The phase;
[0024] S52. Combine the trajectory representation with the GCN embedding representation of the trajectory points to obtain the spatiotemporal information embedding. ,in, For splicing operations, These are the weighting coefficients for the spatial information map.
[0025] As a further technical solution of the present invention, the specific process of step S6 is as follows:
[0026] S61, Spatiotemporal Embedding Information of Trajectory Points The input vector is fed into the encoder of the LSTM model. The encoder uses LSTM units to obtain the spatiotemporal dependencies in the trajectory sequence and continuously updates the hidden layer state of the LSTM units through the input vector. Obtain the hidden state of spacetime The hidden layer state is updated at time t as follows:
[0027] ;
[0028] ;
[0029] ;
[0030] ;
[0031] ;
[0032] in, It is the input vector at time t, that is, the spatiotemporal embedding information of the trajectory points; It is the hidden layer state at time t, which is determined by the LSTM unit based on the current input. The hidden layer state at the previous moment Calculated; It is the input gate at time t, which determines the current input. Cell state The degree of impact; The forgetting gate at time t determines the cell state at the previous time step. Current cell state The degree of impact; The output gate at time t determines the current cell state. For hidden layer states The degree of impact; It is the candidate cell state at time t, based on the current input. The hidden layer state at the previous moment Calculated; It is the cell state at time t, obtained through the forgetting gate. and input gate Cell state at the previous moment and candidate cell status The result is obtained by weighting and updating. These are the weight matrix, recursive weight matrix, and bias vector of the input gate; These are the weight matrix, recursive weight matrix, and bias vector of the forget gate; These are the weight matrix, recursive weight matrix, and bias vector of the output gate; It consists of the weight matrix, recursive weight matrix, and bias vector of the candidate cell states; is the sigmoid activation function, used for gating mechanisms to compress the input to between 0 and 1; tanh is the hyperbolic tangent activation function, used to calculate candidate cell states to compress the input to between -1 and 1; ⊙ represents element-wise multiplication (Hadamard product).
[0033] S62. Obtain the spatiotemporal hidden state from the encoder. The decoder input to the LSTM model is used for high-sampling trajectory completion. The decoder is composed of LSTM units, and an attention layer is added to the decoder. The spatiotemporal hidden states of the encoder output are weighted and combined by introducing attention weights. Context vector at time step The input to the attention layer is the spatiotemporal hidden state of the encoder. The hidden layer state of the decoder at the previous time step The output is a context vector. : ,in , For the first Attention weights for each encoder hidden state at each time step. It is a scoring function used to calculate the correlation between the encoder's hidden layer state and the decoder's hidden layer state at the previous time step. The decoder LSTM unit hidden layer state update calculation process is as follows: ,in, and This refers to the segment ID and movement ratio predicted at the previous time step;
[0034] S63. Obtain the hidden state from the encoder. The input is fed into a fully connected layer, where the Softmax function is used to classify the predicted road segment IDs, resulting in a probability matrix of all road segment IDs. The one with the highest probability is selected as the final predicted road segment ID. A Sigmoid activation function is then used to predict the movement ratio.
[0035] S64, combined with the segment ID and movement ratio, yields the predicted trajectory matched to the current traffic network.
[0036] Compared with the prior art, the beneficial effects of the present invention are:
[0037] This invention addresses the problem that existing methods cannot fully capture the contextual dependencies and dynamic traffic network information of complex trajectory sequences. By combining an LSTM model and GCN, it can more accurately capture the spatiotemporal dependencies of complex trajectory data, improving the accuracy of trajectory data completion. Furthermore, the optimized model design improves computational efficiency, enhances real-time performance, and can handle different types of trajectory missing data, providing stable completion results. Specific advantages are as follows:
[0038] (1) Through the LSTM model, it is possible to learn the contextual dependencies of each trajectory point in depth. It not only captures the temporal order of the trajectory points, but also understands the complex dynamic changes in the trajectory, ensuring the rationality and consistency in time. Moreover, the long short-term memory characteristic of LSTM enables it to retain important historical information, so that when the trajectory points are completed, it can better predict the position of future points.
[0039] (2) By establishing a trajectory flow graph of location points and using graph convolutional networks (GCN) to obtain the embedded information of dynamic traffic networks, the spatial characteristics of traffic networks can be captured, including the connectivity of roads and the dynamic changes of traffic flow. The characteristics of GCN enable it to effectively integrate neighborhood information, thereby achieving high-precision trajectory point completion in space and ensuring the rationality and accessibility of trajectory points in space.
[0040] (3) By organically combining time information and spatial information, the completed trajectory is not only continuous in time, but also feasible in space. The fused trajectory points can more accurately reflect the actual movement path of the vehicle, thereby achieving high-precision trajectory data completion in complex traffic environments. It can not only adapt to different types of trajectory missing, but also perform well in real time. Attached Figure Description
[0041] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain this disclosure and do not constitute an undue limitation of the invention.
[0042] Figure 1This is a schematic diagram of a vehicle trajectory data completion method based on spatiotemporal graph embedding provided by the present invention. Detailed Implementation
[0043] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0044] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0045] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments of the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. Furthermore, it should be understood that the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0046] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0047] Example:
[0048] like Figure 1 As shown, this embodiment provides a vehicle trajectory data completion method based on spatiotemporal graph embedding, including the following steps:
[0049] S1. Data Acquisition:
[0050] When a vehicle passes through the monitored area, the monitoring equipment takes photos at fixed time intervals, and the vehicle positioning equipment obtains the precise latitude and longitude information of each location point to obtain vehicle location data at different times.
[0051] S2, Data Processing:
[0052] The obtained vehicle location data is divided into days, with each day's vehicle location data being treated as a trajectory. The trajectory data is then masked at a certain ratio to form a low-sampling-rate trajectory, thus obtaining the trajectory data.
[0053] S3. Trajectory Flow Graph Construction:
[0054] The trajectory data is organized into a trajectory set, and a trajectory flow graph is constructed. The constructed trajectory flow graph is an attribute-weighted directed graph, where nodes represent location points, edges represent the adjacency relationships between location points, and the weight of the edges represents the frequency of occurrence. The attributes of each location point consist of longitude, latitude, and frequency of occurrence. Specifically, for the trajectory set... A trajectory flow graph is an attribute-weighted directed graph. Where the node set V is the set of position points p, and the edge set is... This indicates the adjacent access relationship between location points. For the attribute functions of the location points, the attributes of each location point p It consists of longitude, latitude, and access frequency. If If a trajectory Si appears in the trajectory set S, then there exists an edge from p1 to p2, meaning they are visited consecutively. Let w be the weight function of the edge. weight This indicates that it appears in the S-track. The number of times.
[0055] S4 and GCN spatial information embedding:
[0056] The transformation patterns and attributes of trajectory points are encoded using a GCN graph convolutional network to obtain the GCN embedding representation of the trajectory points; the specific process is as follows:
[0057] S41. For the trajectory flow graph G constructed, its adjacency matrix is A∈R. N×N Calculate the normalized Laplace matrix: Where D is the degree matrix, G is an N×N identity matrix;
[0058] S42, Input node feature matrix H (0) =X∈R N×C C represents the feature dimension of the input node feature matrix. The GCN layer aggregates the neighborhood information and the node's own embedding information to update the node's embedding information. ,in Indicates the first The input signal of the layer, Indicates the first The model weight matrix of the layer, This is the corresponding deviation term. It is the ReLU activation function; For the first The dimension of the layer output features;
[0059] S43. By stacking multiple GCN modules, the representational power of the model is enhanced. The final GCN output is the GCN embedding representation of the trajectory points: , For the first The node feature matrix of the layer, that is, after processing in the GCN module Node feature representation after layer processing For the first The node feature matrix of the layer, that is, after processing in the GCN module Node feature representation after layer processing For the first The layer's bias term is used to introduce bias.
[0060] S5, Spatiotemporal Information Embedding:
[0061] The trajectory points are embedded and represented, and combined with the GCN embedding representation of the trajectory points, a spatiotemporal information embedding representation is obtained. Through this embedding representation, temporal and spatial information is fully integrated, providing a foundation for subsequent trajectory completion. The specific process is as follows:
[0062] S51, Set the trajectory S={S i} is used for embedding representation, a trajectory point m=<x,y,s> Let x, y, and s represent longitude, latitude, and time information, respectively. After embedding, they are represented as follows:
[0063] ;
[0064] ;
[0065] ;
[0066] in This is an embedding function used to convert input data x and y into a fixed-dimensional vector representation; This is a frequency parameter used to adjust time information. The periodic characteristics, This is time information, representing trajectory points. timestamp, This is a phase parameter used to adjust time information. The phase;
[0067] S52. Combine the trajectory representation with the GCN embedding representation of the trajectory points to obtain the spatiotemporal information embedding. ,in, For splicing operations, These are the weighting coefficients for the spatial information map.
[0068] S6, LSTM spatiotemporal trajectory completion:
[0069] The embedded trajectory points are input into the encoder of the LSTM model. The LSTM unit is used to obtain the spatiotemporal dependencies of the trajectory sequence. The spatiotemporal hidden states output by the encoder are used as the input to the decoder. The hidden states are weighted and combined through an attention layer. The decoder LSTM unit updates the hidden layer states with the context vector. The road segment ID and movement ratio are predicted through a fully connected layer and an activation function. The results are combined to obtain the predicted trajectory matching the current traffic network. The specific process is as follows:
[0070] S61, Spatiotemporal Embedding Information of Trajectory Points The input vector is fed into the encoder of the LSTM model. The encoder uses LSTM units to obtain the spatiotemporal dependencies in the trajectory sequence and continuously updates the hidden layer state of the LSTM units through the input vector. Obtain the hidden state of spacetime The hidden layer state is updated at time t as follows:
[0071] ;
[0072] ;
[0073] ;
[0074] ;
[0075] ;
[0076] in, It is the input vector at time t, that is, the spatiotemporal embedding information of the trajectory points; It is the hidden layer state at time t, which is determined by the LSTM unit based on the current input. The hidden layer state at the previous moment Calculated; It is the input gate at time t, which determines the current input. Cell state The degree of impact; The forgetting gate at time t determines the cell state at the previous time step. Current cell state The degree of impact; The output gate at time t determines the current cell state. For hidden layer states The degree of impact; It is the candidate cell state at time t, based on the current input. The hidden layer state at the previous moment Calculated; It is the cell state at time t, obtained through the forgetting gate. and input gate Cell state at the previous moment and candidate cell status The result is obtained by weighting and updating. These are the weight matrix, recursive weight matrix, and bias vector of the input gate; These are the weight matrix, recursive weight matrix, and bias vector of the forget gate; These are the weight matrix, recursive weight matrix, and bias vector of the output gate; It consists of the weight matrix, recursive weight matrix, and bias vector of the candidate cell states; is the sigmoid activation function, used for gating mechanisms to compress the input to between 0 and 1; tanh is the hyperbolic tangent activation function, used to calculate candidate cell states to compress the input to between -1 and 1; ⊙ represents element-wise multiplication (Hadamard product).
[0077] S62. Obtain the spatiotemporal hidden state from the encoder. The decoder input to the LSTM model is used for high-sampling trajectory completion. The decoder is composed of LSTM units, and an attention layer is added to the decoder. The spatiotemporal hidden states of the encoder output are weighted and combined by introducing attention weights. Context vector at time step The input to the attention layer is the spatiotemporal hidden state of the encoder. The hidden layer state of the decoder at the previous time step The output is a context vector. : ,in , For the first Attention weights for each encoder hidden state at each time step. It is a scoring function used to calculate the correlation between the encoder's hidden layer state and the decoder's hidden layer state at the previous time step. The decoder LSTM unit hidden layer state update calculation process is as follows: ,in, and This refers to the segment ID and movement ratio predicted at the previous time step;
[0078] S63. Obtain the hidden state from the encoder. The input is fed into a fully connected layer, where the Softmax function is used to classify the predicted road segment IDs, resulting in a probability matrix of all road segment IDs. The one with the highest probability is selected as the final predicted road segment ID. A Sigmoid activation function is then used to predict the movement ratio.
[0079] S64, combined with the segment ID and movement ratio, yields the predicted trajectory matched to the current traffic network.
[0080] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0081] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A method for vehicle trajectory data completion based on spatiotemporal graph embedding, characterized in that, Includes the following steps: S1. Data Acquisition: Obtain precise latitude and longitude information of each location point of the vehicle through vehicle positioning equipment and road monitoring equipment to obtain vehicle location data at different times; S2. Data Processing: The obtained vehicle location data is divided into days, that is, the vehicle location data of each day is taken as a trajectory, and the trajectory data is masked at a certain ratio to form a low sampling rate trajectory, thus obtaining trajectory data. S3. Trajectory Flow Graph Construction: The trajectory data is divided into a trajectory set, and a trajectory flow graph is constructed. S4. GCN Spatial Information Embedding: The transformation mode and attributes of trajectory points are encoded using the GCN graph convolutional network to obtain the GCN embedding representation of the trajectory points; The specific process is as follows: S41. For the constructed trajectory flow graph G, its adjacency matrix is A∈R. N×N Calculate the normalized Laplace matrix: Where D is the degree matrix, G is an N×N identity matrix; S42, Input node feature matrix H (0) =X∈R N×C C represents the feature dimension of the input node feature matrix. The GCN layer aggregates the neighborhood information and the node's own embedding information to update the node's embedding information. ,in Indicates the first The input signal of the layer, This represents the model weight matrix of the l-th layer. This is the corresponding deviation term. It is the ReLU activation function; For the first The dimension of the layer output features; S43. By stacking multiple GCN modules, the representational power of the model is enhanced. The final GCN output is the GCN embedding representation of the trajectory points: , For the first The node feature matrix of the layer, that is, after processing in the GCN module Node feature representation after layer processing For the first The node feature matrix of the layer, that is, after processing in the GCN module Node feature representation after layer processing For the first The layer's bias term is used to introduce bias; S5. Spatiotemporal Information Embedding: The trajectory points are embedded and represented, and combined with the GCN embedding representation of the trajectory points, the spatiotemporal information embedding representation is obtained; the specific process is as follows: S51, Set the trajectory S={S i } is used for embedding representation, a trajectory point m=<x,y,s> Let x, y, and s represent longitude, latitude, and time information, respectively. After embedding, they are represented as follows: ; ; ; in This is an embedding function used to convert input data x and y into a fixed-dimensional vector representation; For frequency parameters, where time information is used to adjust. The periodic characteristics, This is time information, representing trajectory points. timestamp, This is a phase parameter used to adjust time information. The phase; S52. Combine the trajectory representation with the GCN embedding representation of the trajectory points to obtain the spatiotemporal information embedding. ,in, For splicing operations, These are the weighting coefficients for the spatial information map; S6. LSTM Spatiotemporal Trajectory Completion: The embedded trajectory points are input into the LSTM model to complete the trajectory data, obtaining a predicted trajectory that matches the current traffic network; the specific process is as follows: S61, Spatiotemporal Embedding Information of Trajectory Points The input vector is fed into the encoder of the LSTM model. The encoder uses LSTM units to obtain the spatiotemporal dependencies in the trajectory sequence and continuously updates the hidden layer state of the LSTM units through the input vector. Obtain the hidden state of spacetime The hidden layer state is updated at time t as follows: ; ; ; ; ; in, It is the input vector at time t, that is, the spatiotemporal embedding information of the trajectory points; It is the hidden layer state at time t, which is determined by the LSTM unit based on the current input. The hidden layer state at the previous moment Calculated; It is the input gate at time t, which determines the current input. Cell state The degree of impact; The forgetting gate at time t determines the cell state at the previous time step. Current cell state The degree of impact; The output gate at time t determines the current cell state. For hidden layer states The degree of impact; It is the candidate cell state at time t, based on the current input. The hidden layer state at the previous moment Calculated; It represents the cell state at time t, obtained through the forgetting gate. and input gate Cell state at the previous moment and candidate cell status The result is obtained by weighting and updating. These are the weight matrix, recursive weight matrix, and bias vector of the input gate; These are the weight matrix, recursive weight matrix, and bias vector of the forget gate; These are the weight matrix, recursive weight matrix, and bias vector of the output gate; It consists of the weight matrix, recursive weight matrix, and bias vector of the candidate cell states; is the sigmoid activation function, used for gating mechanisms to compress the input to between 0 and 1; tanh is the hyperbolic tangent activation function, used to calculate candidate cell states to compress the input to between -1 and 1; ⊙ represents element-wise multiplication; S62. Obtain the spatiotemporal hidden state from the encoder. The decoder input to the LSTM model is used for high-sampling trajectory completion. The decoder is composed of LSTM units, and an attention layer is added to the decoder. The spatiotemporal hidden states of the encoder output are weighted and combined by introducing attention weights. Context vector at time step The input to the attention layer is the spatiotemporal hidden state of the encoder. The hidden layer state of the decoder at the previous time step The output is a context vector. : ,in ,middle For the first Attention weights for each encoder hidden state at each time step. This is a scoring function used to calculate the correlation between the encoder's hidden layer state and the decoder's hidden layer state at the previous time step. The decoder LSTM unit hidden layer state update calculation process is as follows: ,in, and This refers to the segment ID and movement ratio predicted at the previous time step; S63. Obtain the hidden state from the encoder. The input is fed into a fully connected layer, and the Softmax function is used to classify the predicted road segment IDs to obtain a probability matrix of all road segment IDs. The one with the highest probability is selected as the final predicted road segment ID. The Sigmoid activation function is then used to predict the movement ratio. S64, combined with the segment ID and movement ratio, yields the predicted trajectory matched to the current traffic network.
2. The vehicle trajectory data completion method based on spatiotemporal graph embedding according to claim 1, characterized in that, The trajectory flow graph constructed in step S3 is an attribute-weighted directed graph, where nodes represent location points, edges represent adjacency relationships between location points, and edge weights represent the frequency of occurrence. The attributes of each location point consist of longitude, latitude, and frequency of occurrence. Specifically, for the trajectory set... A trajectory flow graph is an attribute-weighted directed graph. Where the node set V is the set of position points p, and the edge set is... This indicates the adjacent access relationship between location points. The attribute functions of the location points, the attributes of each location point p. It consists of longitude, latitude, and access frequency. If If a trajectory Si appears in the trajectory set S, then there exists an edge from p1 to p2, meaning they are visited consecutively. Let w be the weight function of the edge. weight This indicates that it appears in the S-track. The number of times.
Citation Information
Patent Citations
Sparse trajectory data recovery system and method based on deep learning
CN115017250A
Short-term traffic flow prediction method and system, storage medium, equipment and terminal
CN117612369A
Recommendation method and device based on multi-attention mechanism and readable storage medium
CN117633371A