Vehicle trajectory and driving state reconstruction method, device and medium

Through the Transformer model, the vehicle trajectory is combined with the matching of the road network, abnormal point detection and data mask are performed, which solves the problem of driving state correction in vehicle trajectory reconstruction and realizes a more realistic trajectory reconstruction.

CN117312470BActive Publication Date: 2025-08-15GUANGZHOU URBAN PLANNING & DESIGN SURVEY RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311247923.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-26
Publication Date
2025-08-15
Estimated Expiration
2043-09-26

AI Technical Summary

Technical Problem

When handling incomplete trajectories, the existing vehicle GPS trajectory reconstruction technology ignores the correction and recovery of the vehicle's driving state, affecting the authenticity of trajectory reconstruction.

Method used

The Transformer model is used to combine vehicle trajectory data to match the road network, abnormal point detection and data mask are performed, and the complete trajectory and driving state are reconstructed through the mean square variance loss optimization model.

Benefits of technology

It improves the authenticity of the reconstruction of the vehicle's incomplete trajectory, fully considers the dynamic and static attributes and environmental impacts, and enhances the reliability and comprehensiveness of trajectory reconstruction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117312470B_ABST
    Figure CN117312470B_ABST
Patent Text Reader

Abstract

The present application relates to the field of automatic assisted driving technology, and in particular to a method, device, and medium for reconstructing vehicle trajectories and driving states. The method comprises: collecting vehicle trajectory data, matching the vehicle trajectory data with a road network, and obtaining a vehicle road segment trajectory library; obtaining dynamic and static attributes of all trajectories; extracting embedding vectors, dynamic attributes, and static attributes corresponding to trajectories in a training set and a validation set, performing random masking to form a mask matrix and a target matrix, and inputting the matrix into a Transformer model; calculating the mean square error loss of the masked trajectory and the target trajectory, and optimizing the Transformer model based on the mean square error loss; obtaining a reconstruction model after multiple rounds of training; and reconstructing the trajectory to be repaired and the attributes corresponding to the trajectory to be repaired based on the reconstruction model to obtain the reconstructed trajectory and the driving state of each road segment node, thereby improving the authenticity of the reconstructed incomplete vehicle trajectory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automatic assisted driving technology, and in particular to a method, device and medium for reconstructing vehicle trajectory and driving status. Background Art

[0002] Vehicle GPS trajectory and driving state reconstruction technology plays a vital role in intelligent transportation and autonomous driving. It aims to restore a vehicle's actual trajectory and driving state on the road using GPS sensor data, providing critical data support for applications such as intelligent driving decision-making, traffic management, and accident reconstruction. Advances in location tracking and storage technologies have made it possible to obtain large amounts of vehicle GPS trajectory data. However, due to equipment limitations, this data often contains incomplete trajectories, limiting subsequent data application and analysis.

[0003] Existing trajectory reconstruction technologies primarily encompass two approaches: traditional methods, represented by particle filtering, Bayesian filtering, and Kalman filtering, and emerging methods based on deep learning. Particle filtering algorithms estimate trajectories probabilistically through random sampling and weight updates, but suffer from high computational complexity when processing high-dimensional data. Bayesian filtering methods employ a Bayesian inference framework, combining prior and measurement information to estimate and predict trajectories, but require high accuracy in noise modeling and state transition modeling. In contrast, deep learning vehicle trajectory reconstruction models, based on a multi-layer neural network structure and self-attention mechanisms, can more effectively process and learn long-term time series features, improving the accuracy of vehicle trajectory reconstruction. However, these methods primarily focus on reconstructing the temporal and spatial information of incomplete vehicle trajectories, neglecting the correction and restoration of missing or abnormal vehicle driving states, impacting the authenticity of vehicle trajectory reconstruction. Summary of the Invention

[0004] The present application provides a vehicle trajectory and driving state reconstruction method, device and medium, which can reconstruct the complete vehicle trajectory and the driving state of each road section node, and improve the authenticity of the reconstructed incomplete vehicle trajectory.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] In a first aspect, the present invention provides a method for reconstructing a vehicle trajectory and driving state, the method comprising:

[0007] Collect vehicle trajectory data and match the vehicle trajectory data with the road network to obtain a vehicle section trajectory library;

[0008] Perform outlier detection on all trajectories in the vehicle section trajectory library, classify trajectories without outliers into the valid trajectory library, and classify trajectories with outliers into the trajectory library to be repaired;

[0009] Acquire attribute data of all trajectories, wherein the attribute data includes dynamic attributes and static attributes;

[0010] Divide the valid trajectory library into a training set and a validation set, determine the geographical range covered by the trajectories in the valid trajectory library, and assign a unique number to the section node of each trajectory;

[0011] The word embedding method is used to map each road node into an n-dimensional embedding vector, and the positional relationship information of the road node in the trajectory is added through the position encoding method;

[0012] The embedding vectors, dynamic attributes, and static attributes corresponding to the trajectories in the training set and the validation set are extracted and randomly masked to form a mask matrix. The mask matrix is:

[0013]

[0014] Among them, i is the sub-trajectory in the training set, k is the number of road segment nodes, is the mask embedding matrix, is the mask static attribute matrix, is the mask dynamic attribute matrix, M i ∈R k×(n+s+d) is the mask matrix;

[0015] Extract the embedding vectors, dynamic attributes, and static attributes corresponding to the trajectories in the training set and validation set to construct a target matrix. The target matrix is:

[0016]

[0017] in, is the target trajectory matrix, the current time is T, the speed is v, the acceleration is a, and the direction angle is The steering angle is τ, and the target state matrix is The target matrix is T i ∈R k×(n+5) ;

[0018] Inputting the mask matrix and the target matrix into a Transformer model, calculating the mean square error loss of the mask trajectory and the target trajectory, and optimizing the Transformer model based on the mean square error loss;

[0019] After multiple rounds of training, the reconstructed model is obtained until the average mean square error loss of the validation set converges;

[0020] The to-be-repaired track in the to-be-repaired track library and the attributes corresponding to the to-be-repaired track are reconstructed based on the reconstruction model to obtain the reconstructed track and the driving status of each road segment node.

[0021] In a preferred example of the present application, it can be further configured that the vehicle trajectory data is collected, and the vehicle trajectory data is matched with the road network to obtain a vehicle section trajectory library, including

[0022] The nearest neighbor search and path planning algorithm are used to generate matching paths for vehicle trajectory data on the road network, and a vehicle road segment trajectory library is obtained.

[0023] In a preferred example of the present application, it can be further configured that the abnormal point detection on all trajectories in the vehicle section trajectory library includes:

[0024] A sliding anomaly detection method is used to identify abnormal points of each road section trajectory in the vehicle trajectory data.

[0025] In a preferred example of the present application, it can be further configured that the step of classifying the trajectory without abnormal points into the valid trajectory library includes:

[0026] Among the trajectories without abnormal points, the trajectories with more than 30 road section nodes and a total mileage of more than 2 km are selected and included in the valid trajectory library.

[0027] In a preferred example of the present application, it can be further configured that the step of classifying the trajectory without abnormal points into the valid trajectory library includes:

[0028] Use the low speed threshold method to identify the road segment nodes of the trajectory without abnormal points, identify the road segment nodes with a speed lower than 1m / s as stop points, and segment the trajectory according to the stop points;

[0029] Trajectories with a cumulative mileage greater than or equal to 2 km and a cumulative number of road segment nodes between 15 and 30 after segmentation are included in the valid trajectory library.

[0030] In a preferred example of the present application, it can be further configured that the step of classifying the trajectory containing the abnormal point into the trajectory library to be repaired includes:

[0031] Among the trajectories containing abnormal points, the trajectories in which the missing mileage accounts for less than 50% of the total mileage are selected and included in the trajectory library to be repaired.

[0032] In a preferred example of the present application, it can be further configured that the random masking includes:

[0033] The nodes of the sections except the starting and ending points in the trajectories of the training set and the validation set are masked in the range of 25%-75%.

[0034] In a preferred example of the present application, it can be further configured that the reconstructing of the to-be-repaired trajectory in the to-be-repaired trajectory library and the attributes corresponding to the to-be-repaired trajectory based on the reconstruction model to obtain the reconstructed trajectory and the driving status of each road segment node includes:

[0035] S1: extracting a track from the track library to be repaired;

[0036] S2: Based on the shortest path algorithm, obtain the shortest path from the preceding road node A to the following road node B of the missing segment of the trajectory, determine the number of road nodes p that need to be passed, and mark p as missing;

[0037] S3: reconstructing the trajectory to be repaired after the missing mark using the reconstruction model to obtain the reconstructed trajectory and the driving status of each road segment node. When the reconstructed trajectory is longer than the shortest path, detecting abnormal points using sliding abnormal points and marking the abnormal points as missing;

[0038] S4: Take the trajectory that still has missing points after reconstruction as input and repeat steps S2-S3 until there are no abnormal points in the trajectory.

[0039] In a second aspect, the present application provides a vehicle trajectory and driving state reconstruction device, the device comprising:

[0040] The data acquisition module is used to collect vehicle trajectory data, match the vehicle trajectory data with the road network to obtain a vehicle section trajectory library; perform outlier detection on all trajectories in the vehicle section trajectory library, classify trajectories without outliers into the valid trajectory library, and classify trajectories with outliers into the trajectory library to be repaired; and obtain attribute data of all trajectories, including dynamic attributes and static attributes;

[0041] The training data preprocessing module is used to divide the valid trajectory library into a training set and a validation set, determine the geographical scope of the trajectories in the valid trajectory library, and assign unique numbers to the road segment nodes of each trajectory; map each road segment node into an n-dimensional embedding vector using a word embedding method, and add the positional relationship information of the road segment nodes in the trajectory using a position encoding method to map it into an n-dimensional embedding vector;

[0042] The matrix construction module is used to extract the embedding vectors, dynamic attributes, and static attributes corresponding to the trajectories in the training set and the validation set, and perform random masking to form a mask matrix. The mask matrix is:

[0043]

[0044] Among them, i is the sub-trajectory in the training set, k is the number of road segment nodes, is the mask embedding matrix, is the mask static attribute matrix, is the mask dynamic attribute matrix, M i ∈R k×(n+s+d) is the mask matrix;

[0045] Extract the embedding vectors, dynamic attributes, and static attributes corresponding to the trajectories in the training set and validation set to construct a target matrix. The target matrix is:

[0046]

[0047] in, is the target trajectory matrix, the current time is T, the speed is v, the acceleration is a, and the direction angle is The steering angle is τ, and the target state matrix is The target matrix is T i ∈R k×(n+5) ;

[0048] A model training module is configured to input the mask matrix and target matrix into a Transformer model, calculate the mean square error loss of the mask trajectory and the target trajectory, and optimize the Transformer model based on the mean square error loss; after multiple rounds of training, until the average mean square error loss of the validation set converges, a reconstructed model is obtained;

[0049] The trajectory reconstruction module is used to reconstruct the to-be-repaired trajectory in the to-be-repaired trajectory library and the attributes corresponding to the to-be-repaired trajectory based on the reconstruction model to obtain the reconstructed trajectory and the driving status of each road segment node.

[0050] In a third aspect, the present application provides a computer-readable storage medium having a program stored thereon, wherein when the program is executed by a processor, the vehicle trajectory and driving state reconstruction method as described in any one of the above items is implemented.

[0051] In summary, compared with the prior art, the technical solutions provided by the embodiments of the present application have at least the following beneficial effects:

[0052] The present application provides a method for reconstructing vehicle trajectories and driving states. The method collects vehicle trajectory data, matches the vehicle trajectory data with the road network, and obtains a vehicle section trajectory library; obtains all trajectory dynamic and static attributes; extracts the embedding vectors, dynamic attributes, and static attributes corresponding to the trajectories in the training set and the validation set, performs random masking, forms a mask matrix and a target matrix, and inputs them into the Transformer model; calculates the mean square error loss of the masked trajectory and the target trajectory, and optimizes the Transformer model based on the mean square error loss; obtains a reconstruction model after multiple rounds of training; reconstructs the trajectory to be repaired and the attributes corresponding to the trajectory to be repaired based on the reconstruction model to obtain the reconstructed trajectory and the driving state of each road section node. Based on the missing trajectory data of the vehicle, combined with its observable dynamic and static attributes, the present application fully considers the impact of the internal and external environment on the vehicle's driving trajectory, reconstructs the complete vehicle trajectory and the driving state of each road section node, and improves the authenticity of the reconstructed incomplete vehicle trajectory. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 A flowchart of a vehicle trajectory and driving state reconstruction method provided in one embodiment of the present application.

[0054] Figure 2 A diagram of a vehicle trajectory and driving state reconstruction device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0055] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0056] In one embodiment of the present application, a vehicle trajectory and driving state reconstruction method is provided. Figure 1 As shown, the method includes:

[0057] Step S100: Collect vehicle trajectory data, and obtain a vehicle section trajectory library after matching the vehicle trajectory data with the road network.

[0058] In specific implementation, the vehicle trajectory data used in this application comes from the desensitized GPS trajectory data recorded by driving users using electronic map navigation and smart connected cars. The trajectory data is expressed as the latitude and longitude coordinates and time information of the vehicle at a certain sampling frequency. The sampling frequency is affected by the positioning equipment and communication conditions and depends on the specific data situation. In general, the higher the sampling frequency, the more information the data carries, but there will also be higher requirements for data storage and transmission. This application uses road network map data that matches the time period and location of the vehicle trajectory data involved.

[0059] Step S200: performing outlier detection on all trajectories in the vehicle section trajectory library, classifying trajectories without outliers into the valid trajectory library, and classifying trajectories with outliers into the to-be-repaired trajectory library.

[0060] Step S300: Acquire attribute data of all trajectories, wherein the attribute data includes dynamic attributes and static attributes.

[0061] In practice, the dynamic attributes of a vehicle trajectory can be divided into two parts: vehicle dynamic attributes and environmental dynamic attributes. These respectively reflect the vehicle's driving state and the immediate conditions of the surrounding traffic environment at different times and locations in the trajectory. The dynamic attributes are assigned to the road nodes that the trajectory passes through. The dynamic attributes of each node passed by each trajectory in the valid trajectory library are calculated. The meaning and calculation method of the relevant indicators of vehicle trajectory dynamic attributes are as follows:

[0062] Speed: Indicates the vehicle's speed at each node, measured in meters per second. Calculated by dividing the length of the road section from the previous node to the current node by the interval time.

[0063] Acceleration: Indicates the acceleration or deceleration of a vehicle at a given moment, measured in meters per second squared. It is calculated by dividing the change in the vehicle's speed at that node relative to the previous node by the time it took to complete the route.

[0064] Bearing: Indicates the direction of the vehicle's travel, measured in degrees relative to true north. It is calculated as the inverse tangent of the ratio of the longitude difference to the latitude difference between the current node and the previous node the vehicle passed.

[0065] Steering Angle: This indicates the steering angle of the vehicle's current direction relative to its previous direction, measured in degrees (°). It is calculated as the difference between the heading angle at this node and the heading angle at the previous node the vehicle passed.

[0066] Current location: indicates the geographic location coordinates of the node where the vehicle is located at a certain moment, including two variables: longitude and latitude.

[0067] Current time: indicates the timestamp when the vehicle passes a certain node.

[0068] Cumulative time: indicates the cumulative driving time when the vehicle passes a certain node, in seconds.

[0069] Cumulative distance: indicates the cumulative distance traveled by the vehicle when it passes a certain node, in meters.

[0070] The meaning and calculation method of indicators related to environmental dynamic attributes are as follows:

[0071] Section Traffic: This represents the real-time traffic volume of a road, measured in vehicles per hour. It is calculated by taking the total number of vehicles that have passed through a node in the past 15 minutes and converting it into a one-hour traffic volume.

[0072] Section Speed: This indicates the real-time average speed of vehicles passing through the road, measured in meters per second. This speed is calculated as the average speed of vehicles passing through the node over the past 15 minutes.

[0073] Road speed limit: reflects the legal speed limit of the road the vehicle is currently traveling on, usually distributed from high to low based on road grade.

[0074] The static attributes of a vehicle trajectory represent the vehicle's own conditions and environmental characteristics that remain unchanged throughout the trajectory. They require the integration of external information sources other than the vehicle trajectory data. Static attributes are assigned to each trajectory, and the meaning and calculation methods of the relevant indicators are as follows:

[0075] Vehicle type: This includes vehicle model classification (small, medium, large) and usage classification (private, public transportation, freight), used to distinguish the driving characteristics of different types of vehicles. The calculation method is to classify and label the vehicle information, representing each vehicle type as a one-hot encoding.

[0076] Departure time: indicates the starting time of the vehicle trip. It is calculated based on the starting timestamp in the recorded trajectory data.

[0077] Weather conditions: Indicates the weather conditions in the area where the vehicle trip occurs (sunny, rainy, snowy, foggy, etc.). It is obtained through external meteorological observation data and represented as a one-hot code for each type of weather.

[0078] Holiday Status: This refers to whether the vehicle trip occurred during a holiday. It reflects potential differences in traffic behavior between holidays and weekdays. Holidays are marked as 1 based on the date of the holiday, and 0 otherwise.

[0079] According to the meaning and calculation method of dynamic and static attribute related indicators, the attribute data of all trajectories in the valid trajectory library are obtained, and the attribute data includes dynamic attributes and static attributes.

[0080] Step S400: Divide the valid trajectory library into a training set and a validation set, determine the geographical range covered by the trajectories in the valid trajectory library, and assign a unique number to the section node of each trajectory.

[0081] In practice, the data in the valid trajectory database is randomly sorted and divided into training, validation, and test sets in an 8:1:1 ratio. Each set is then divided into batches of a certain size. During training, a batch is extracted from the valid trajectory database sequentially or randomly for each round of training.

[0082] Next, determine the geographical scope covered by the trajectory reconstruction model, namely the region of interest. Unique numbers are assigned to each segment node in the region of interest, and a segment node code library for the region of interest is constructed. Trajectories in any valid trajectory library can be represented as a number sequence. In addition to segment node numbers, special numbers with specific meanings must be added to the code library, including <Start>, <End>, and <Missing>. <Start> marks the start of a trajectory and is placed before the first segment node of a valid trajectory; <End> marks the end of a trajectory and is placed after the last segment node of a valid trajectory; trajectories intercepted from the middle of a valid trajectory do not need to be marked with the <Start> and <End> codes; and <Missing> marks the missing portion of a trajectory.

[0083] Step S500: Map each road segment node into an n-dimensional embedding vector using a word embedding method, and add the position relationship information of the road segment node in the trajectory using a position encoding method.

[0084] In specific implementation, a word embedding method is used to map each segment node of the trajectory in the valid trajectory library into an n-dimensional embedding vector. The value of n can be determined based on the total number of segment nodes in the research scope and the complexity of the road network structure. The greater the total number of segment nodes and the more complex the road network structure, the larger the value of n should be. In this application, n is set to 200. The position information of the segment node is calculated through positional encoding and represented as an n-dimensional vector. The final segment node vector is then added to the word embedding segment node vector.

[0085] Step S600: extract the embedding vectors, dynamic attributes, and static attributes corresponding to the trajectories in the training set and the validation set, and perform random masking to form a mask matrix. The mask matrix is:

[0086]

[0087] Among them, i is the sub-trajectory in the training set, k is the number of road segment nodes, is the mask embedding matrix, is the mask static attribute matrix, is the mask dynamic attribute matrix, M i ∈R k×(n+s+d) is the mask matrix.

[0088] Step S700: extract the embedding vectors, dynamic attributes, and static attributes corresponding to the trajectories in the training set and the validation set to construct a target matrix. The target matrix is:

[0089]

[0090] in, is the target trajectory matrix, the current time is T, the speed is v, the acceleration is a, and the direction angle is The steering angle is τ, and the target state matrix is The target matrix is T i ∈R k×(n+5) .

[0091] In the specific implementation, first, the embedding vectors, dynamic attributes, and static attributes corresponding to the trajectories in the training set and the validation set are extracted and randomly masked. For any complete trajectory i, each node a it passes through has a series of dynamic attributes and static attributes. The static attribute set of a node is represented by the matrix A∈R 1×s , s is the number of static attributes in the matrix, and a static attribute is represented by The dynamic attribute set of a node is represented by the matrix B∈R 1×d , d is the number of dynamic attributes in the matrix, d is greater than or equal to 5, a dynamic attribute is represented by The dynamic attributes in the matrix must include the current time T, velocity v, acceleration a, and direction angle Steering angle τ. At the same time, the node a itself corresponds to the position matrix C∈R 1×n , n is the vector dimension of each section node according to its number mapping, a position variable is expressed as Let A∈R 1×s , B∈R 1×d , C∈R 1×n The matrix D∈R can be obtained by horizontally splicing the three matrices 1×(n+s+d) , which contains the position and dynamic and static properties of the trajectory at node a. Since a trajectory contains multiple nodes, each node corresponds to an embedding matrix D∈R 1×(n+s+d) , these embedded matrices are spliced vertically in node order to obtain a k-row 2D complete trajectory matrix C i , which contains the complete trajectory of trajectory i and the dynamic and static attribute information of each node; then, a certain proportion of the road segment nodes of trajectory i are randomly selected, and the positions and dynamic and static attributes of these nodes are hidden, so that the complete trajectory matrix C i The values of some rows in the vertical direction are all replaced with 0 to obtain the mask matrix M i The mask matrix erases part of the complete trajectory information to simulate the trajectory information that can be obtained in the state of missing trajectory. The specific construction steps are: for a trajectory i in the batch, the number of its segment nodes is k, and the segment nodes of the trajectory except the starting and ending points are replaced with <missing> in a certain proportion. After replacement, the matrix C∈R corresponding to each segment node and <missing> is constructed. 1×n Arrange and concatenate in order to form a mask embedding matrix At the same time, the mask static attribute matrix under the corresponding mask condition is obtained and mask dynamic attribute matrix Concatenate the three along the first dimension to obtain the mask matrix M i ∈R k×(n+s+d) , expressed as:

[0092]

[0093] The mask matrix example is:

[0094]

[0095] The target matrix represents the real trajectory information and the corresponding driving state information used as the benchmark in model training. For a trajectory i with k nodes on the same road segment, the matrix C∈R corresponding to each node of the road segment is 1×n Arrange and splice in order to form the target trajectory matrix Get the driving status of each track and each road node from the dynamic attribute library, including the current time T, speed v, acceleration a, direction angle Steering angle τ, forming the target state matrix Target trajectory matrix Concatenate with the target state matrix along the first dimension to obtain the target matrix T i ∈R k×(n+5) , expressed as:

[0096]

[0097] The target matrix example is:

[0098]

[0099] Step S800: Input the mask matrix and the target matrix into the Transformer model, calculate the mean square error loss of the mask trajectory and the target trajectory, and optimize the Transformer model based on the mean square error loss.

[0100] In specific implementation, this trajectory reconstruction model is composed of a multi-layer Transformer architecture. The key parameters such as the specific number of layers, the dimension of each layer of Transformer, and the number of attention heads can be determined according to the complexity of the road network in the area of interest. The higher the complexity of the road network, the more layers, dimensions, and the number of attention heads can be appropriately increased. In this application, the number of layers is 5, the dimension is 200, and the number of attention heads is 8. The model training task is to transform the mask matrix M i Input the model so that the fitting result is as close as possible to the target matrix T i In each round of training, the mask matrix and target matrix corresponding to the data in the training set are input into the model in batches, and the changes in the average mean square error loss of the validation set are observed.

[0101] Step S900: After multiple rounds of training, until the average mean square error loss of the validation set converges, a reconstructed model is obtained.

[0102] In practice, the model is trained over multiple rounds until the validation set average mean square error loss converges. The specific training parameters for achieving optimal model performance may vary across different road network conditions, so they need to be adjusted based on actual conditions.

[0103] Step S1000: reconstructing the to-be-repaired trajectory in the to-be-repaired trajectory library and the attributes corresponding to the to-be-repaired trajectory based on the reconstruction model to obtain the reconstructed trajectory and the driving status of each road segment node.

[0104] In this embodiment, the present application adopts a method based on the Transformer model, which can fully consider the importance of the vehicle's driving state. Through the training method of trajectory random mask self-recovery, it can correct and restore missing or abnormal vehicle driving states, such as speed, acceleration, and direction, thereby enhancing the reliability and comprehensiveness of trajectory reconstruction. In the trajectory reconstruction process, the static and dynamic properties of the journey are integrated, and the impact of the internal and external environment on the vehicle's driving trajectory is fully considered, thereby improving the authenticity and usability of the reconstruction results. The trajectory reconstruction model obtained after training is completed can reconstruct the complete vehicle trajectory and the driving state of each road node based on the missing trajectory data, combined with its observable static and dynamic properties, thereby improving the authenticity of the reconstruction of the missing trajectory.

[0105] In some embodiments, the collecting of vehicle trajectory data and matching the vehicle trajectory data with the road network to obtain a vehicle section trajectory library includes:

[0106] The nearest neighbor search and path planning algorithm are used to generate matching paths for vehicle trajectory data on the road network, and a vehicle road segment trajectory library is obtained.

[0107] In implementation, the road network data is first preprocessed to ensure that the lengths of the various road segments are as consistent as possible. Next, a nearest neighbor search and path planning algorithm are used to match GPS points in the trajectory data to road segment nodes, generating a matching path for the vehicle on the road network. Finally, the vehicle GPS trajectory is converted into a sequence of vehicle segment IDs and timestamps, also known as the vehicle segment trajectory. After the data in the vehicle GPS trajectory database is matched to the road network, the vehicle segment trajectory database is generated.

[0108] In this embodiment, the nearest neighbor search and path planning algorithm are used to improve the accuracy and efficiency of path matching.

[0109] In some embodiments, performing outlier detection on all trajectories in the vehicle section trajectory library includes:

[0110] A sliding anomaly detection method is used to identify abnormal points of each road section trajectory in the vehicle trajectory data.

[0111] In practice, a sliding anomaly detection method is used to identify outliers or discontinuities in a vehicle segment trajectory sequence. The method involves defining a sliding anomaly detector that slides from the starting point to the end point. Topological relationships are then used to determine whether the five adjacent segments traversed by the trajectory are spatially continuous, marking any discontinuous sections as outliers. After performing sliding anomaly detection on all trajectories in the vehicle segment trajectory database, the data is divided into trajectories without outliers and trajectories with outliers. Trajectories without outliers are assigned to the valid trajectory database, while those with outliers are assigned to the pending repair trajectory database.

[0112] In this embodiment, the accuracy of outlier detection is improved, an effective trajectory library suitable for model training is screened out, and the model training effect is improved.

[0113] In some embodiments, the step of classifying the trajectory without outliers into a valid trajectory library includes:

[0114] Among the trajectories without abnormal points, the trajectories with more than 30 road section nodes and a total mileage of more than 2 km are selected and included in the valid trajectory library.

[0115] In specific implementation, for trajectories without abnormal points, sampling points, that is, the number of road nodes passed through is greater than 30 and the total mileage of the trajectory is greater than 2km, are further classified as valid and complete trajectories and included in the valid trajectory library, and then used for trajectory reconstruction model training; trajectories that do not meet the above conditions are classified as invalid and complete trajectories. Although the trajectory itself is complete, the connotation information is too little and the uncertainty is large, and it is not suitable for model training.

[0116] In this embodiment, large-scale and long-distance trajectories suitable for Transformer model training are selected, which improves the model's reconstruction effect on large-scale and long-distance trajectories.

[0117] In some embodiments, the step of classifying the trajectory without outliers into a valid trajectory library includes:

[0118] Use the low speed threshold method to identify the road segment nodes of the trajectory without abnormal points, identify the road segment nodes with a speed lower than 1m / s as stop points, and segment the trajectory according to the stop points;

[0119] Trajectories with a cumulative mileage greater than or equal to 2 km and a cumulative number of road segment nodes between 15 and 30 after segmentation are included in the valid trajectory library.

[0120] During specific implementation, because a vehicle section trajectory may contain multiple segments of travel, it is necessary to screen the stop points. This application uses a low speed threshold method to identify the stop points in the trajectory. Specifically, a vehicle section trajectory is obtained from the valid trajectory library. When it is calculated that the speed of the vehicle passing through a certain section node is less than 1m / s, the node is identified as a stop point, and the original trajectory is divided into two sections accordingly, thereby obtaining a series of uninterrupted travel trajectories. Since the travel trajectories are of different lengths, in order to facilitate model training, each travel trajectory needs to be further divided into trajectories with a similar number of sections. The specific method is to traverse each node of the travel trajectory from the head in turn. When the cumulative mileage is ≥2km and the cumulative number of nodes is between 15-30 segments, the obtained trajectory segment is a qualified trajectory, included in the valid trajectory library, and the accumulation starts again, and so on; if the remaining part at the end of the travel trajectory does not meet the above conditions, it is classified as an invalid segment and excluded. Based on this method, a valid trajectory library for vehicle trajectory reconstruction model training is obtained.

[0121] In this embodiment, by segmenting the trajectory into stop points, filtering the mileage and nodes, an effective trajectory library that facilitates model training is obtained, thereby improving the training effect of the model.

[0122] In some embodiments, the step of adding the trajectory containing the abnormal point to the trajectory library to be repaired includes:

[0123] Among the trajectories containing abnormal points, the trajectories in which the missing mileage accounts for less than 50% of the total mileage are selected and included in the trajectory library to be repaired.

[0124] In this embodiment, the trajectories in the to-be-repaired trajectory library can be repaired by the trained trajectory reconstruction model. By screening out trajectories suitable for repair, the authenticity of the missing trajectories reconstructed by the model is improved.

[0125] In some embodiments, performing random masking includes:

[0126] The nodes of the sections except the starting and ending points in the training and validation sets are masked in the range of 25%-75%.

[0127] In specific implementation, when constructing the mask matrix, for a trajectory i in a batch, the number of its segment nodes is k, and the segment nodes of the trajectory except the starting and ending points are replaced with <missing> according to a certain ratio α. Each time the mask is obtained, α changes randomly in the range of 25%-75%.

[0128] In this embodiment, by controlling the change in the missing ratio of road section nodes, it adapts to the situation where there are different degrees of missing trajectories in reality, and improves the training effect of the model.

[0129] In some embodiments, reconstructing the to-be-repaired trajectory in the to-be-repaired trajectory library and the attributes corresponding to the to-be-repaired trajectory based on the reconstruction model to obtain the reconstructed trajectory and the driving status of each road segment node includes:

[0130] S1: extracting a trajectory from the to-be-patched trajectory library.

[0131] S2: Based on the shortest path algorithm, obtain the shortest path from the preceding road segment node A to the following road segment node B of the missing segment of the trajectory, determine the number of road segment nodes p that need to be passed, and mark p as missing.

[0132] S3: Reconstruct the trajectory to be repaired after the missing mark using the reconstruction model to obtain the reconstructed trajectory and the driving status of each road node. When the reconstructed trajectory is longer than the shortest path, use the sliding outlier point to detect the outlier and mark the outlier as missing.

[0133] S4: Take the trajectory that still has missing points after reconstruction as input and repeat steps S1-S3 until there are no abnormal points in the trajectory.

[0134] In specific implementation, the trajectories in the trajectory library to be repaired are reconstructed through an iterative reconstruction method. The steps are as follows:

[0135] S1: Extracting a track j0 to be repaired from the track library to be repaired.

[0136] S2: For any missing trajectory, let its nearest preceding node be A and the nearest succeeding node be B. Based on the shortest path algorithm, obtain the number of segment nodes p that the shortest path from node A to node B must pass through. Since this technical solution preprocesses each segment of the road network, the length of each segment is basically the same. The shortest path is the path with the least number of segment nodes. Insert p <missing> tags between the original trajectory nodes A and B.

[0137] S3: Input the missing-marked trajectory to be repaired into the reconstruction model to obtain the reconstructed trajectory j1. When the reconstruction model, based on multi-source information, determines that the true trajectory does not follow the shortest path, the number of involved road nodes exceeds p. Since only the minimum number of <missing> marks is provided, the trajectory must still contain missing points. Sliding outlier detection is used to determine whether there are outliers in the trajectory. If there are outliers, the outliers are marked as missing.

[0138] S4: Take the trajectory that still has missing points after reconstruction as input and repeat steps S2-S3 until there are no abnormal points in the trajectory, indicating that the reconstruction is complete and the process is terminated.

[0139] In this embodiment, to address the difficulty in determining the number of missing sections in a trajectory, an iterative trajectory reconstruction method is used to dynamically infer the number and location of missing sections through multiple iterations, thereby enhancing the ability to accurately reconstruct the missing parts of the trajectory and addressing the shortcomings of existing technologies in estimating the number of missing sections.

[0140] This application also provides a vehicle trajectory and driving state reconstruction device, please refer to Figure 2 As shown, the device includes:

[0141] The data acquisition module 101 is used to collect vehicle trajectory data, match the vehicle trajectory data with the road network to obtain a vehicle section trajectory library; perform outlier detection on all trajectories in the vehicle section trajectory library, classify trajectories without outliers into the valid trajectory library, and classify trajectories with outliers into the trajectory library to be repaired; and obtain attribute data of all trajectories, which includes dynamic attributes and static attributes.

[0142] The training data preprocessing module 102 is used to divide the valid trajectory library into a training set and a validation set, determine the geographical scope of the trajectories in the valid trajectory library, and assign unique numbers to the segment nodes of each trajectory; map each segment node into an n-dimensional embedding vector using a word embedding method, and add the positional relationship information of the segment node in the trajectory using a position encoding method.

[0143] The matrix construction module 103 is used to extract the embedding vectors, dynamic attributes, and static attributes corresponding to the trajectories in the training set and the validation set and perform random masking to form a mask matrix. The mask matrix is:

[0144]

[0145] Among them, i is the sub-trajectory in the training set, k is the number of road segment nodes, is the mask embedding matrix, is the mask static attribute matrix, is the mask dynamic attribute matrix, M i ∈R k×(n+s+d) is the mask matrix;

[0146] Extract the embedding vectors, dynamic attributes, and static attributes corresponding to the trajectories in the training set and validation set to construct a target matrix. The target matrix is:

[0147]

[0148] in, is the target trajectory matrix, the current time is T, the speed is v, the acceleration is a, and the direction angle is The steering angle is τ, and the target state matrix is The target matrix is T i ∈r k×(n+5) .

[0149] The model training module 104 is used to input the mask matrix and the target matrix into the Transformer model, calculate the mean square error loss of the mask trajectory and the target trajectory, and optimize the Transformer model based on the mean square error loss; after multiple rounds of training, until the average mean square error loss of the validation set converges, a reconstructed model is obtained.

[0150] The trajectory reconstruction module 105 is configured to reconstruct the to-be-repaired trajectory in the to-be-repaired trajectory library and the attributes corresponding to the to-be-repaired trajectory based on the reconstruction model, and obtain the reconstructed trajectory and the driving status of each road segment node.

[0151] The functional implementation of each module in the above-mentioned vehicle trajectory and driving state reconstruction device corresponds to the steps in the above-mentioned vehicle trajectory and driving state reconstruction method embodiment, and its functions and implementation processes are not repeated here one by one.

[0152] The present application also provides a computer-readable storage medium having a program stored thereon, wherein the computer-readable storage medium refers to a carrier for storing data, and may include, but is not limited to, a floppy disk, an optical disk, a hard disk, a flash memory, a USB flash drive, and / or a memory stick, and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The working process, working details, and technical effects of the computer-readable storage medium provided in this embodiment can be found in the above embodiment of a method for reconstructing vehicle trajectory and driving state, and will not be repeated here.

[0153] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0154] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above-mentioned embodiments only express several implementation methods of the present application. The description is relatively specific and detailed, but it cannot be understood as a limitation on the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several variations and improvements can be made, which all fall within the scope of protection of the present application. Therefore, the scope of protection of the patent of this application shall be based on the attached claims.

Claims

1. A vehicle trajectory and driving state reconstruction method, characterized in that: The method comprises: Collect vehicle trajectory data and match the vehicle trajectory data with the road network to obtain a vehicle section trajectory library; Perform outlier detection on all trajectories in the vehicle section trajectory library, classify trajectories without outliers into the valid trajectory library, and classify trajectories with outliers into the trajectory library to be repaired; Acquire attribute data of all trajectories, wherein the attribute data includes dynamic attributes and static attributes; Divide the valid trajectory library into a training set and a validation set, determine the geographical range covered by the trajectories in the valid trajectory library, and assign a unique number to the section node of each trajectory; The word embedding method is used to map each road node into an n-dimensional embedding vector, and the positional relationship information of the road node in the trajectory is added through the position encoding method; The embedding vectors, dynamic attributes, and static attributes corresponding to the trajectories in the training set and the validation set are extracted and randomly masked to form a mask matrix. The mask matrix is: Among them, i is the sub-trajectory in the training set, k is the number of road segment nodes, is the mask embedding matrix, is the mask static attribute matrix, is the mask dynamic attribute matrix, M i ∈R k×(n+s+d) is the mask matrix; Extract the embedding vectors, dynamic attributes, and static attributes corresponding to the trajectories in the training set and validation set to construct a target matrix. The target matrix is: in, is the target trajectory matrix, the current time is T, the speed is v, the acceleration is a, and the direction angle is The steering angle is τ, and the target state matrix is The target matrix is T i ∈R k×(n+5) ; Inputting the mask matrix and the target matrix into a Transformer model, calculating the mean square error loss of the mask trajectory and the target trajectory, and optimizing the Transformer model based on the mean square error loss; After multiple rounds of training, the reconstructed model is obtained until the average mean square error loss of the validation set converges; The to-be-repaired track in the to-be-repaired track library and the attributes corresponding to the to-be-repaired track are reconstructed based on the reconstruction model to obtain the reconstructed track and the driving status of each road segment node.

2. The vehicle trajectory and driving state reconstruction method according to claim 1, characterized in that: The vehicle trajectory data is collected and matched with the road network to obtain a vehicle section trajectory library, including The nearest neighbor search and path planning algorithm are used to generate matching paths for vehicle trajectory data on the road network, and a vehicle road segment trajectory library is obtained.

3. The vehicle trajectory and driving state reconstruction method according to claim 1, characterized in that: The abnormal point detection of all trajectories in the vehicle section trajectory library includes: A sliding anomaly detection method is used to identify abnormal points of each road section trajectory in the vehicle trajectory data.

4. The vehicle trajectory and driving state reconstruction method according to claim 1, characterized in that: The process of classifying the trajectory without abnormal points into the valid trajectory library includes: Among the trajectories without abnormal points, the trajectories with more than 30 road section nodes and a total mileage of more than 2 km are selected and included in the valid trajectory library.

5. The vehicle trajectory and driving state reconstruction method according to claim 4, characterized in that: The process of classifying the trajectory without abnormal points into the valid trajectory library includes: Use the low speed threshold method to identify the road segment nodes of the trajectory without abnormal points, identify the road segment nodes with a speed lower than 1m / s as stop points, and segment the trajectory according to the stop points; Trajectories with a cumulative mileage greater than or equal to 2 km and a cumulative number of road segment nodes between 15 and 30 after segmentation are included in the valid trajectory library.

6. The vehicle trajectory and driving state reconstruction method according to claim 1, characterized in that: The step of classifying the trajectory containing the abnormal point into the trajectory library to be repaired includes: Among the trajectories containing abnormal points, the trajectories in which the missing mileage accounts for less than 50% of the total mileage are selected and included in the trajectory library to be repaired.

7. The vehicle trajectory and driving state reconstruction method according to claim 1, characterized in that: The random masking comprises: The nodes of the sections except the starting and ending points in the training and validation sets are masked in the range of 25%-75%.

8. The vehicle trajectory and driving state reconstruction method according to claim 1, characterized in that: The step of reconstructing the to-be-repaired trajectory in the to-be-repaired trajectory library and the attributes corresponding to the to-be-repaired trajectory based on the reconstruction model to obtain the reconstructed trajectory and the driving status of each road segment node includes: S1: extracting a track from the track library to be repaired; S2: Based on the shortest path algorithm, obtain the shortest path from the preceding road node A to the following road node B of the missing segment of the trajectory, determine the number of road nodes p that need to be passed, and mark p as missing; S3: reconstructing the trajectory to be repaired after the missing mark using the reconstruction model to obtain the reconstructed trajectory and the driving status of each road segment node. When the reconstructed trajectory is longer than the shortest path, detecting abnormal points using sliding abnormal points and marking the abnormal points as missing; S4: Take the trajectory that still has missing points after reconstruction as input and repeat steps S2-S3 until there are no abnormal points in the trajectory.

9. A vehicle trajectory and driving state reconstruction device, characterized in that: include: The data acquisition module is used to collect vehicle trajectory data and match the vehicle trajectory data with the road network to obtain a vehicle section trajectory library; Perform outlier detection on all trajectories in the vehicle section trajectory library, classify trajectories without outliers into the valid trajectory library, and classify trajectories with outliers into the to-be-repaired trajectory library; obtain attribute data of all trajectories, the attribute data including dynamic attributes and static attributes; The training data preprocessing module is used to divide the valid trajectory library into a training set and a validation set, determine the geographical scope of the trajectories in the valid trajectory library, and assign unique numbers to the segment nodes of each trajectory; map each segment node into an n-dimensional embedding vector using a word embedding method, and add the position relationship information of the segment node in the trajectory using a position encoding method; The matrix construction module is used to extract the embedding vectors, dynamic attributes, and static attributes corresponding to the trajectories in the training set and the validation set, and perform random masking to form a mask matrix. The mask matrix is: Among them, i is the sub-trajectory in the training set, k is the number of road segment nodes, is the mask embedding matrix, is the mask static attribute matrix, is the mask dynamic attribute matrix, M i ∈R k×(n+s+d) is the mask matrix; Extract the embedding vectors, dynamic attributes, and static attributes corresponding to the trajectories in the training set and validation set to construct a target matrix. The target matrix is: in, is the target trajectory matrix, the current time is T, the speed is v, the acceleration is a, and the direction angle is The steering angle is τ, and the target state matrix is The target matrix is T i ∈R k×(n+5) ; A model training module is configured to input the mask matrix and target matrix into a Transformer model, calculate the mean square error loss of the mask trajectory and the target trajectory, and optimize the Transformer model based on the mean square error loss; after multiple rounds of training, until the average mean square error loss of the validation set converges, a reconstructed model is obtained; The trajectory reconstruction module is used to reconstruct the to-be-repaired trajectory in the to-be-repaired trajectory library and the attributes corresponding to the to-be-repaired trajectory based on the reconstruction model to obtain the reconstructed trajectory and the driving status of each road segment node.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a program, wherein when the program is executed by the processor, the vehicle trajectory and driving state reconstruction method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Trajectory anomaly detection method based on trajectory big data

    CN111949896A

  • Vehicle driving track reconstruction method and system under bayonet data loss

    CN112215427A