A vehicle trajectory reconstruction method considering physical constraints
By combining the data sets of fixed detectors and virtual detectors, introducing overtaking behavior and shock wave theory, fusing the following model and the GRU model, and performing vehicle trajectory correction, the smooth operation of traffic flow and the importance of monitoring vehicle exhaust emissions are solved, providing higher accuracy of vehicle trajectory reconstruction, ensuring the smooth operation of traffic flow, important conditions for monitoring vehicle exhaust emissions, and refining the evaluation of traffic status.
Patent Information
- Application Number
- CN202411786653.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-12-06
AI Technical Summary
Existing technologies have the problem of fragmented data when using connected autonomous vehicles to reconstruct vehicle trajectories, resulting in insufficient reconstruction accuracy. In addition, methods based on data-driven and traffic flow theory each have their own shortcomings and cannot fully reconstruct complete traffic trajectory information.
A dataset based on fixed detectors and virtual detectors was constructed, and the overtaking behavior and shock wave theory were combined. The car-following model and the GRU model were fused, and the trajectory was corrected using the time consumption curve and the spatiotemporal speed distribution map. The vehicle trajectory was reconstructed by smoothing with the Savitzky-Golay filter.
The accuracy of vehicle trajectory reconstruction is improved, and the MAPE error is reduced by about 45% and 37%, ensuring the smooth operation of traffic flow and providing a higher level of vehicle trajectory. It is an important condition for monitoring vehicle exhaust emissions and an important condition for refining traffic state evaluation, and has important academic significance and application value for the refined evaluation of traffic state.
Smart Images

Figure CN119863922B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of traffic perception and big data analysis, and specifically relates to a vehicle trajectory reconstruction method considering physical constraints. Background Art
[0002] Vehicle trajectories contain rich spatiotemporal information about traffic flows, which is crucial for traffic flow simulation modeling, traffic signal optimization, and traffic status assessment. Obtaining complete vehicle trajectories and analyzing their spatiotemporal information plays a key role in describing traffic flow status. Therefore, supplementing limited and partially continuous trajectory data with more trajectory information has become a research hotspot in recent years.
[0003] Current vehicle trajectory detection equipment can be divided into two categories based on their motion characteristics: fixed detectors (such as automatic vehicle identification and loop detectors) and mobile detectors (such as probe vehicles and connected autonomous vehicles). Fixed detectors are installed at specific locations and can perform highly accurate point detection of vehicles, but they cannot record the motion information of vehicle trajectories. Mobile detectors, using sensing and positioning equipment mounted on vehicles, can acquire motion data of vehicles and other traffic participants within a certain range. Probe vehicles can provide their own position, acceleration, and velocity characteristics; however, due to their low penetration rate, they struggle to fully reconstruct missing trajectories of other vehicles. In contrast, connected autonomous vehicles can collect information about vehicles within their detection range, generating several times the amount of trajectory data as probe vehicles. Leveraging this information facilitates high-precision vehicle trajectory reconstruction. Leveraging these advantages, connected autonomous vehicles have made progress in vehicle-following behavior simulation, basic graph construction, and overtaking behavior research. However, due to their low penetration rate, connected autonomous vehicles can only provide fragmented observation data rather than complete traffic trajectory information.
[0004] Current trajectory reconstruction methods are primarily categorized as data-driven and traffic flow theory-based. Data-driven methods focus on inferring the spatiotemporal distribution patterns of trajectory points based on the characteristics of trajectory data. Within trajectory reconstruction research, data-driven methods can be divided into several categories: statistical models (e.g., maximum likelihood estimation and particle filtering), interpolation methods (e.g., linear interpolation, Hermite interpolation, Lagrange interpolation, adaptive smoothing splines, and locally weighted polynomial regression), and machine learning-based methods. Although machine learning-based methods perform well in short-term trajectory prediction, their prediction error tends to increase with the length of the trajectory segment to be reconstructed. Data-driven methods do not consider traffic flow effects, while traffic flow theory-based methods utilize traffic flow models to estimate the spatiotemporal distribution of vehicle trajectories. Traffic flow theory encompasses a variety of methods, such as variational theory, safety-based theories, car-following models, overtaking behavior, and the construction of fundamental graphs. Traffic flow theory-based methods offer better interpretability of driving behavior, but the reconstruction accuracy is not as high as data-driven methods. Summary of the Invention
[0005] In response to the problems existing in the prior art, the present invention provides a vehicle trajectory reconstruction method considering physical constraints. Taking highways as the research object, the vehicle number, speed, position and passing time of vehicles passing through fixed detectors are extracted, and the physical constraints of the overtaking point of the vehicle trajectory are calculated based on the time consumption curve. Considering the impact of traffic flow operation status on vehicle trajectory, a linear assumption is adopted in shock wave theory to simplify the shock wave model and calculate the spatiotemporal distribution constraints of vehicle speed. According to the two major physical constraints, the trajectory reconstruction results of the hybrid model are adjusted, and the reconstructed results are smoothed by using a Savitzky-Golay filter, so that the reconstructed vehicle trajectory is not only more accurate but also more reasonable.
[0006] To solve the above technical problems, the present invention provides the following technical solution: a vehicle trajectory reconstruction method considering physical constraints, comprising the following steps:
[0007] S1. Based on the observation records of the upstream fixed detector and the downstream virtual detector, a vehicle trajectory dataset is constructed, including the target vehicle number, as well as the target vehicle's location information, speed, acceleration, and time information;
[0008] S2. Process the trajectory data of each vehicle in the vehicle trajectory dataset of step S1 into time series data according to the sequence length and the predicted length, and divide it into a training set, a test set, and a validation set;
[0009] S3. Introducing overtaking behavior as a physical constraint, estimating the vehicle's overtaking point information through the time consumption curve, and obtaining the target vehicle's overtaking behavior constraint;
[0010] S4. Introducing the speed spatiotemporal distribution diagram based on shock wave theory as physical information to characterize the running state of the traffic flow where the target vehicle is located, and obtaining the speed spatiotemporal distribution constraint conditions of the target vehicle;
[0011] S5. Construct and train a fusion model based on the car-following model and the GRU model. Specifically, the original vehicle trajectory data is input into the car-following model and the GRU model, and the reconstruction results of the car-following model and the GRU model are fused to obtain a reconstructed vehicle trajectory. The reconstructed trajectory is corrected using the overtaking behavior constraints of the target vehicle and the spatiotemporal speed distribution constraints of the target vehicle.
[0012] S6. Smoothing the corrected vehicle trajectory to eliminate the influence of abnormal speed and acceleration points, and obtaining the final reconstructed vehicle trajectory.
[0013] Furthermore, the aforementioned step S1 constructs a vehicle trajectory dataset, specifically: through the upstream detector, the license plate number of the vehicle passing the target road section is used as the vehicle ID, and the time when vehicle n passes the upstream detector position of road section k is recorded as a k,n , the time to pass the end of the target section is a k+1,n , the observation set of vehicle n upstream of road segment k is {s(a k,n ),v(a k,n ),a k,n}, the observation set of vehicle n downstream of road section k is {s(a k+1,n ),v(a k+1,n ),a k+1,n}, where s(a k,n ) is the longitudinal position of vehicle n passing the upstream detector of road section k, v(a k,n ) is the speed of vehicle n passing the upstream detector of road section k, s(a k+1,n ) is the longitudinal position of vehicle n passing the virtual detector downstream of road section k, v(a k+1,n ) is the speed of vehicle n passing the virtual detector downstream of section k.
[0014] Furthermore, the aforementioned step S2 includes the following sub-steps:
[0015] S2.1, using the sliding window method to divide the vehicle trajectory, the selected historical sequence length is l h , the reconstruction length is l p The time segments of the historical sequence Seq(i) and the reconstructed sequence P(i) of the i-th sample are as shown in formulas (1) and (2) respectively; the vehicle's position, speed, acceleration, lane and other information are all within this segment, that is, the time series data Tra:
[0016] Seq(i)∈[t start ,tstart +l h ](26)
[0017] P(i)∈[t start +l h +1,t start +l h +l p ](27)
[0018] where t start is the start time of each sample;
[0019] S2.2. Based on the stratified sampling principle, the time series data is divided into a training set, a validation set, and a test set according to a preset ratio. Train_set, Val_set, and Test_set represent the training set, the validation set, and the test set, respectively. Tra represents all vehicle trajectory samples obtained in step S2.1:
[0020] Train_set=m1*Tra (28)
[0021] Val_set=m2*Tra (29)
[0022] Test_set=m3*Tra (30)
[0023] m1, m2, m3 are preset scaling factors.
[0024] Furthermore, the aforementioned step S3 includes the following sub-steps:
[0025] S3.1. Calculate the travel time t of each vehicle passing through the target road segment k based on the time it takes for vehicle n to pass through the upstream detector and the downstream virtual detector. k,n , and then obtain the travel time observation set of n vehicles on the target road section in the dataset:
[0026] S3.2. Draw a distribution diagram of the observation time and perform a Kolmogorov-Smirnov test. Then, based on the assumption that the travel time of a vehicle on section k conforms to the normal distribution when the traffic flow is stable, obtain the expected travel time of the vehicle passing through section k. As follows:
[0027] t k,n =a k+1,n -a k,n (31)
[0028]
[0029] Among them, t k,n is the travel time of vehicle n through road segment k, is the variance of the travel time of vehicle n through road segment k, a k,n is the time when vehicle n passes the upstream detector position of road segment k, a k+1,n is the time when vehicle n passes the end of the target road section;
[0030] S3.3. Based on the calculated expected travel time Based on the vehicle n traveling at a constant speed, the time it takes for vehicle n to pass the end of the study section k is: Then calculate the vehicle's position and time as shown in formula (9),
[0031]
[0032] in, is the average speed of vehicle n passing through road section k, l k is the length of road section k, s′ k,n,t is the longitudinal distance traveled by vehicle n on road section k,
[0033] S3.4. Obtain the estimated overtaking point based on the trajectory position and time expressions of different vehicles The reconstructed vehicle trajectory is adjusted according to formulas (11)-(12):
[0034]
[0035] Where (t k ″ ,n ,s′ k ' ,n,t ) represents the actual overtaking point position, s k ″′ ,n,t is the position of the vehicle trajectory point after adjustment. Further, the aforementioned step S4 includes the following sub-steps:
[0036] S4.1. Based on the linear assumption introduced by shock wave theory, calculate the spatiotemporal distribution of speed in each lane:
[0037]
[0038] Among them, v fv represents the velocity at the intersection A of the shock wave path and the preceding vehicle trajectory, v r ' efer represents the speed at any reference point between the front and rear vehicles, v nfv represents the velocity at the intersection point B of the following vehicle trajectory and the shock wave path, l1 and l2 represent the distances between the reference point and A and B, respectively;
[0039] S4.2. Adjust the reconstructed vehicle trajectory based on the spatiotemporal distribution of vehicle speed calculated in step S4.1: Consider the influence of speed fluctuations,
[0040] The upper and lower speed thresholds of the vehicle trajectory points are calculated by formula (14). If the speed exceeds the lower and upper limits of the speed fluctuation, the vehicle trajectory is adjusted, as shown in formula (15).
[0041]
[0042] v lower =v r ' efer -u*v r ' efer (41)
[0043] v upper =v r ' efer +u*v r ' efer (42)
[0044] where v lower ,v upper They represent the lower and upper limits of speed fluctuation respectively, and u is the speed fluctuation factor.
[0045] Furthermore, the aforementioned step S5 includes the following sub-steps:
[0046] S5.1. Input the corrected vehicle trajectory data into the car-following model and output the result s IDM,i ;
[0047] S5.2. Input the corrected vehicle trajectory data into the GRU model for training. The GRU model includes two gate structures: reset gate and update gate. The core expressions of the GRU model are as follows: Formula (18) to Formula (21).
[0048] r t =σ(W r ·[h t-1 ,x t ]+b r ) (43)
[0049] z t =σ(W z ·[h t-1 ,x t ]+b z ) (44)
[0050]
[0051] Among them, h t is the current hidden state, is the candidate hidden state, x t Represents the input data, W r is the weight matrix of the reset gate, W z is the weight matrix of the update gate, W h is the weight matrix of the candidate state, b r is the bias term of the reset gate, b z is the bias term of the update gate, b h is the bias term of the candidate state, z t is the update gate vector, σ is the sigmoid activation function, r t is the reset gate vector;
[0052] S5.3. Output result of car-following model s IDM,i The reconstruction result of the GRU model is fused, and the average MAE loss of the GRU model is calculated to enhance the training process of the GRU model. The process of model fusion is shown in expression (22).
[0053]
[0054] w IDM,i +w GRU,i =1 (49)
[0055] where s GRU,i Represents the trajectory points i, w reconstructed by the GRU model IDM,i ,w GRU,i They represent the weight coefficients of the car-following model and the GRU model, respectively, characterizing the credibility of different models. The sum of the two is 1, and loss is the training MAE loss of the GRU model.
[0056] Furthermore, the aforementioned step S6 includes the following sub-steps:
[0057] S6.1, the vehicle trajectory data reconstructed by the hybrid model is input into the Savitzky-Golay filter. Based on the local polynomial least squares fitting in the time domain, the noise in the velocity and acceleration is filtered out while keeping the shape and width of the signal unchanged. Different filtering results are obtained by selecting different window widths.
[0058] S6.2, using the speed and acceleration obtained in step S6.1, further adjust the reconstructed vehicle trajectory position as shown in formula (25) to obtain the final reconstructed vehicle trajectory, making the reconstructed vehicle trajectory more reasonable.
[0059]
[0060] in represents the position of the vehicle at time t after adjustment, v f,t ,v f,t-1They represent the speed of the vehicle at time t or time t-1 after passing through the Savitzky-Golay filter.
[0061] Compared with the prior art, the beneficial technical effects of the present invention using the above technical solution are as follows:
[0062] This method fully exploits key data such as vehicle license plates, speed, time, and acceleration recorded by fixed detectors on road sections, introduces two physical constraints: overtaking behavior and spatiotemporal velocity distribution, and adjusts the vehicle trajectories reconstructed by the trajectory reconstruction model. A time consumption curve is used to calculate the distribution constraints of overtaking points between different vehicles, providing additional information for reconstructing vehicle trajectories. Based on shock wave theory, a linear constraint is introduced to calculate the spatiotemporal velocity distribution between the leading and trailing floating vehicles, adjusting for speed fluctuations in the vehicle trajectory. A car-following model is integrated with a GRU model, combining the two physical constraints, and finally, trajectory smoothing is performed using a Savitzky-Golay filter, resulting in a reconstructed vehicle trajectory that is closer to the actual situation. The proposed vehicle trajectory reconstruction method, which considers physical constraints, achieves higher reconstruction accuracy, with a MAPE error of only 3.33%, which is approximately 45% and 37% lower than the estimation errors of two classic trajectory reconstruction models, respectively. In summary, the method can accurately control traffic flow status, which is an important condition for further ensuring the smooth operation of highways and monitoring vehicle exhaust emissions. It has important academic significance and application value for refining traffic state evaluation. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 is a schematic diagram of travel time distribution; (a) is a schematic diagram of travel time distribution under low traffic density conditions; (b) is a schematic diagram of travel time distribution under high traffic density conditions;
[0064] Figure 2 is a spatiotemporal velocity distribution diagram under an embodiment;
[0065] Figure 3 is a spatiotemporal distribution diagram of vehicle trajectories according to an embodiment of the present invention;
[0066] Figure 4 Figures 1 and 2 show the reconstruction results of three types of vehicle trajectories. (a) shows the reconstruction result of the vehicle trajectory using the car-following model; (b) shows the reconstruction result of the vehicle trajectory using the GRU model; and (c) shows the reconstruction result of the vehicle trajectory using the method of the present invention that takes physical constraints into account.
[0067] Figure 5 It is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0068] In order to better understand the technical content of the present invention, specific embodiments are given and described below with reference to the accompanying drawings.
[0069] Various aspects of the present invention are described herein with reference to the accompanying drawings, which show a number of illustrative embodiments. The embodiments of the present invention are not limited to those described in the accompanying drawings. It should be understood that the present invention can be implemented by any of the various concepts and embodiments described above, as well as the concepts and implementations described in detail below, because the concepts and embodiments disclosed herein are not limited to any particular implementation. In addition, some aspects disclosed herein may be used alone or in any appropriate combination with other aspects disclosed herein.
[0070] Figure 1 The travel time distribution diagram for the road section studied in this study is shown in Figure (a) for low traffic density and (b) for high traffic density. The diagram shows that the travel time for vehicles traveling through the target road section conforms to a normal distribution under both low and high traffic density conditions. The overtaking points calculated based on the time consumption curve can be used as spatiotemporal constraints for vehicle trajectory reconstruction. Figure 2 The figure below shows an example of calculating the spatiotemporal speed distribution of a road. Using two floating vehicles, the spatiotemporal speed distribution between the two vehicles can be calculated, and the vehicle trajectories can be corrected to account for speed fluctuations. By applying two physical constraints, the proposed method significantly reduces trajectory reconstruction errors.
[0071] refer to Figure 5 The present invention provides a vehicle trajectory reconstruction method considering physical constraints, comprising the following steps:
[0072] S1. Based on the observation records of the upstream fixed detector and the downstream virtual detector, a vehicle trajectory dataset is constructed, including the target vehicle number, as well as the target vehicle's location information, speed, acceleration, and time information;
[0073] S2. Process the trajectory data of each vehicle in the vehicle trajectory dataset of step S1 into time series data according to the sequence length and the predicted length, and divide it into a training set, a test set, and a validation set;
[0074] S3. Introducing overtaking behavior as a physical constraint, estimating the vehicle's overtaking point information through the time consumption curve, and obtaining the target vehicle's overtaking behavior constraint;
[0075] S4. Introducing the speed spatiotemporal distribution diagram based on shock wave theory as physical information to characterize the running state of the traffic flow where the target vehicle is located, and obtaining the speed spatiotemporal distribution constraint conditions of the target vehicle;
[0076] S5. Construct and train a fusion model based on the car-following model and the GRU model. Specifically, the original vehicle trajectory data is input into the car-following model and the GRU model, and the reconstruction results of the car-following model and the GRU model are fused to obtain a reconstructed vehicle trajectory. The reconstructed trajectory is corrected using the overtaking behavior constraints of the target vehicle and the spatiotemporal speed distribution constraints of the target vehicle.
[0077] S6. Smoothing the corrected vehicle trajectory to eliminate the influence of abnormal speed and acceleration points, and obtaining the final reconstructed vehicle trajectory.
[0078] As a preferred embodiment of the present invention, step S1 constructs a vehicle trajectory dataset, specifically: through the upstream detector, the license plate number of the vehicle passing through the study section is used as the vehicle ID, and the time when vehicle n passes the upstream detector position of section k is recorded as a k,n , the time to pass the end of the target section is a k+1,n , the observation set of vehicle n upstream of road segment k is {s(a k,n ),v( , a kn )}, , a, the observation set of vehicle n downstream of road segment k is {s(a k+1,n ),v(a k+1,n ),a k+1,n}, where s(a k,n ) is the longitudinal position of vehicle n passing the upstream detector of road section k, v(a k,n ) is the speed of vehicle n passing the upstream detector of road section k, s(a k+1,n ) is the longitudinal position of vehicle n passing the virtual detector downstream of road section k, v(a k+1,n ) is the speed of vehicle n passing the virtual detector downstream of section k.
[0079] As a preferred embodiment of the present invention, step S2 includes the following sub-steps:
[0080] S2.1, using the sliding window method to divide the vehicle trajectory, the selected historical sequence length is l h , the reconstruction length is l p The time segments of the historical sequence Seq(i) and the reconstructed sequence P(i) of the i-th sample are as shown in formulas (1) and (2) respectively; the vehicle's position, speed, acceleration, lane and other information are all within this segment, that is, the time series data Tra:
[0081] Seq(i)∈[t start ,t start +l h ](51)
[0082] P(i)∈[tstart +l h +1,t start +l h +l p ] (52)
[0083] where t start is the start time of each sample;
[0084] S2.2. According to the stratified sampling principle, the time series data is divided into training set, validation set and test set in a ratio of 7:1:2, where Train_set, Val_set and Test_set represent the training set, validation set and test set respectively, and Tra is the total number of vehicle trajectory samples obtained in step S2.1:
[0085] Train_set=0.7*Tra (53)
[0086] Val_set=0.1*Tra (54)
[0087] Test_set=0.2*Tra (55)
[0088] As a preferred embodiment of the present invention, step S3 includes the following sub-steps:
[0089] S3.1. Calculate the travel time t of each vehicle passing through the target road segment k based on the time it takes for vehicle n to pass through the upstream detector and the downstream virtual detector. k,n , and then obtain the travel time observation set of n vehicles on the target road section in the data set: T k ={t k,1 ,t k,2 ,t k,3 ,t k,4 ,…t k,n-2 ,t k,n-1 ,t k,n}.
[0090] S3.2. Draw a distribution diagram of the observation time and perform a Kolmogorov-Smirnov test. Then, based on the assumption that the travel time of a vehicle on section k conforms to the normal distribution when the traffic flow is stable, obtain the expected travel time of the vehicle passing through section k. As follows:
[0091] t k,n =a k+1,n -a k,n (56)
[0092]
[0093] Among them, t k,nis the travel time of vehicle n through road segment k, is the variance of the travel time of vehicle n through road segment k, a k,n is the time when vehicle n passes the upstream detector position of road segment k, a k+1,n is the time when vehicle n passes the end of the target section.
[0094] S3.3. Based on the calculated expected travel time Based on the vehicle n traveling at a constant speed, the time it takes for vehicle n to pass the end of the study section k is: Then calculate the vehicle's position and time as shown in formula (9),
[0095]
[0096]
[0097] in, is the average speed of vehicle n passing through road section k, l k is the length of road section k, s′ k,n,t is the longitudinal distance traveled by vehicle n on road section k,
[0098] S3.4. Obtain the estimated overtaking point based on the trajectory position and time expressions of different vehicles The reconstructed vehicle trajectory is adjusted according to formulas (11)-(12):
[0099]
[0100] Where (t k ″ ,n ,s′ k ' ,n,t ) represents the actual overtaking point position, s k ″′ ,n,t is the position of the vehicle trajectory point after adjustment.
[0101] As a preferred embodiment of the present invention, step S4 includes the following sub-steps:
[0102] S4.1. Based on the linear assumption introduced by shock wave theory, calculate the spatiotemporal distribution of speed in each lane:
[0103]
[0104] Among them, v fv represents the velocity at the intersection A of the shock wave path and the preceding vehicle trajectory, v r ' efer represents the speed at any reference point between the front and rear vehicles, v nfvrepresents the velocity at the intersection point B of the following vehicle trajectory and the shock wave path, l1 and l2 represent the distances between the reference point and A and B, respectively;
[0105] S4.2. Adjust the reconstructed vehicle trajectory based on the spatiotemporal distribution of vehicle speed calculated in step S4.1: Consider the influence of speed fluctuations,
[0106] The upper and lower speed thresholds of the vehicle trajectory points are calculated by formula (14). If the speed exceeds the lower and upper limits of the speed fluctuation, the vehicle trajectory is adjusted, as shown in formula (15).
[0107]
[0108] v lower =v r ' efer -u*v r ' efer (66)
[0109] v upper =v r ' efer +u*v r ' efer (67)
[0110] where v lower ,v upper They represent the lower and upper limits of speed fluctuation respectively, and u is the speed fluctuation factor.
[0111] As a preferred embodiment of the present invention, step S4 includes the following sub-steps:
[0112] S5.1. Input the corrected vehicle trajectory data into the car-following model and output the result s IDM,i ;
[0113] S5.2. Input the corrected vehicle trajectory data into the GRU model for training. The GRU model can consider the long-term dependency problem. The GRU model includes two gate structures: reset gate and update gate. The core expression of the GRU model is as shown in formula (18) to formula (21).
[0114] r t =σ(W r ·[h t-1 ,x t ]+b r ) (68)
[0115] z t =σ(W z ·[h t-1 ,x t ]+b z ) (69)
[0116]
[0117] Among them, h t is the current hidden state, is the candidate hidden state, x t Represents the input data, W r is the weight matrix of the reset gate, W z is the weight matrix of the update gate, W h is the weight matrix of the candidate state, b r is the bias term of the reset gate, b z is the bias term of the update gate, b h is the bias term of the candidate state, z t is the update gate vector, σ is the sigmoid activation function, r t is the reset gate vector;
[0118] S5.3. Output result of car-following model s IDM,i The reconstruction result of the GRU model is fused, and the average MAE loss of the GRU model is calculated to enhance the training process of the GRU model. The process of model fusion is shown in expression (22).
[0119]
[0120] w IDM,i +w GRU,i =1 (74)
[0121] where s GRU,i Represents the trajectory points i, w reconstructed by the GRU model IDM,i ,w GRU,i They represent the weight coefficients of the car-following model and the GRU model, respectively, characterizing the credibility of different models. The sum of the two is 1, and loss is the training MAE loss of the GRU model.
[0122] As a preferred embodiment of the present invention, step S6 includes the following sub-steps:
[0123] S6.1, the vehicle trajectory data reconstructed by the hybrid model is input into the Savitzky-Golay filter. Based on the local polynomial least squares fitting in the time domain, the noise in the velocity and acceleration is filtered out while keeping the shape and width of the signal unchanged. Different filtering results are obtained by selecting different window widths.
[0124] S6.2, using the speed and acceleration obtained in step S6.1, further adjust the reconstructed vehicle trajectory position as shown in formula (25) to obtain the final reconstructed vehicle trajectory, making the reconstructed vehicle trajectory more reasonable.
[0125]
[0126] in represents the position of the vehicle at time t after adjustment, v f,t ,v f,t-1 They represent the speed of the vehicle at time t or time t-1 after passing through the Savitzky-Golay filter.
[0127] The data collected in this embodiment of the present invention was collected from a section of U.S. Highway 101 (Hollywood Freeway) in Los Angeles, California. The camera's detection direction was from south to north. The section was approximately 640 meters long, with five lanes on the main road. The data sampling interval was 1 Hz. In this study, a genetic algorithm was used to calibrate the car-following model based on real data.
[0128] First, the trajectory data is processed and analyzed. The data is pre-processed, including the processing of missing values and outliers. The fragments with outliers are deleted, and the missing values are filled by interpolation. The sampling interval of the original data is 1Hz. The present invention downsamples it to 10Hz to improve the efficiency of the model operation. Based on the data processing, the vehicle trajectory map is drawn. The vehicle trajectory map is as follows Figure 3 As shown, it can be found that there is a shock wave path in the vehicle trajectory, which also shows that it is reasonable to use shock waves to calculate the spatiotemporal distribution of velocity in the present invention.
[0129] Then the sliding window is used to process the time series data, and the data set is divided into training set, validation set and test set.
[0130] Based on the constructed data set and input parameters, the overtaking point distribution of each sample is calculated based on the time consumption curve and the speed space-time distribution is calculated based on the shock wave theory. Figure 1 It can be found that when the traffic operation state is stable, the travel time intuitively conforms to the normal distribution. The Kolmogorov-Smirnov (KS) non-parametric test is used to test the observed data to determine whether the population obeys the normal distribution. Since the p value is greater than 0.05, the travel time in this case also obeys the normal distribution empirically. This provides theoretical support for the subsequent calculation of overtaking points. Figure 2 In this paper, two floating vehicles are used to calculate the spatiotemporal distribution of the speed between the two vehicles. Taking into account that speed may fluctuate within a certain range, a speed fluctuation factor is introduced to adjust the speed of the reconstructed vehicle trajectory. The two physical constraints proposed in this paper facilitate the reconstruction of vehicle trajectories with high accuracy.
[0131] The vehicle trajectories on the study section were reconstructed using a hybrid trajectory reconstruction algorithm based on physical constraints according to the present invention. The accuracy of vehicle trajectory reconstruction was comprehensively evaluated using the MAE, MAPE, and RMSE metrics. Generally, smaller values for the three metrics indicate higher overall algorithm accuracy. The trajectory reconstruction results for three algorithms based on the car-following model, the GRU model, and the present invention's hybrid method based on physical constraints, at a 5%-15% autonomous vehicle penetration rate, are shown in Table 1, a comparison of the trajectory reconstruction results of the present invention and traditional methods.
[0132] Table 1
[0133]
[0134] As shown in Table 1, the vehicle trajectory reconstructed using the proposed method has lower errors. At a 5% penetration rate, the MAE index is 37.01% and 40.59% higher than that of the GRU and car-following models, respectively. This shows that even at low penetration rates, the proposed model considering physical constraints still performs well and will play an important role in the reconstruction of connected vehicle trajectories at low penetration rates in the future.
[0135] Further, Figure 4 Figures (a), (b), and (c) show a comparison of the trajectories reconstructed by the three algorithms. The reconstructed vehicle trajectory points using our method are closer to reality. Both the car-following model and the GRU model exhibit significant deviations to varying degrees, with localized clustering and sudden changes in vehicle trajectories that are inconsistent with actual driving behavior. These results further demonstrate the superiority of our proposed algorithm and confirm the necessity of considering physical constraints in trajectory estimation.
[0136] Finally, the present invention explores the relationship between sequence length and reconstruction length and finds that when the sequence length is close to the reconstruction length, the reconstructed vehicle trajectory is more accurate. The corresponding error is shown in Table 2, which tests the relationship between reconstruction length and sequence length.
[0137] Table 2
[0138]
[0139]
[0140] While the present invention has been described above with reference to preferred embodiments, this is not intended to limit the present invention. Persons skilled in the art will readily appreciate that various modifications and variations can be made without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A vehicle trajectory reconstruction method considering physical constraints, characterized by: The steps include: S1. Based on the observation records of the upstream fixed detector and the downstream virtual detector, a vehicle trajectory dataset is constructed, including the target vehicle number, as well as the target vehicle's location information, speed, acceleration, and time information; S2. Process the trajectory data of each vehicle in the vehicle trajectory dataset of step S1 into time series data according to the sequence length and the predicted length, and divide it into a training set, a test set, and a validation set; S3. Introducing overtaking behavior as a physical constraint, estimating the vehicle's overtaking point information through the time consumption curve, and obtaining the target vehicle's overtaking behavior constraint; S4. Introducing the speed spatiotemporal distribution diagram based on shock wave theory as physical information to characterize the running state of the traffic flow where the target vehicle is located, and obtaining the speed spatiotemporal distribution constraint conditions of the target vehicle; S5. Construct and train a fusion model based on the car-following model and the GRU model. Specifically, the original vehicle trajectory data is input into the car-following model and the GRU model, and the reconstruction results of the car-following model and the GRU model are fused to obtain a reconstructed vehicle trajectory. The reconstructed trajectory is corrected using the overtaking behavior constraints of the target vehicle and the spatiotemporal speed distribution constraints of the target vehicle. S6. Smoothing the corrected vehicle trajectory to eliminate the influence of abnormal speed and acceleration points, and obtaining the final reconstructed vehicle trajectory.
2. The vehicle trajectory reconstruction method considering physical constraints according to claim 1 is characterized in that: Step S1 constructs a vehicle trajectory dataset, specifically: through the upstream detector, the license plate number of the vehicle passing through the target road section is used as the vehicle ID, and the time when vehicle n passes the upstream detector position of road section k is recorded as a k,n , the time to pass the end of the target section is a k+1,n , the observation set of vehicle n upstream of road segment k is {s(a k,n ),v(a k,n ),a k,n }, the observation set of vehicle n downstream of road section k is {s(a k+1,n ),v(a k+1,n ),a k+1,n }, where s(a k,n ) is the longitudinal position of vehicle n passing the upstream detector of road section k, v(a k,n ) is the speed of vehicle n passing the upstream detector of road section k, s(a k+1,n ) is the longitudinal position of vehicle n passing the virtual detector downstream of road section k, v(a k+1,n ) is the speed of vehicle n passing the virtual detector downstream of section k.
3. The vehicle trajectory reconstruction method considering physical constraints according to claim 1, characterized in that: Step S2 includes the following sub-steps: S2.1, using the sliding window method to divide the vehicle trajectory, the selected historical sequence length is l h , the reconstruction length is l p The time segments of the historical sequence Seq(i) and the reconstructed sequence P(i) of the i-th sample are as shown in formulas (1) and (2) respectively; the vehicle's position, speed, acceleration, lane and other information are all within this segment, that is, the time series data Tra: Seq(i)∈[t start ,t start +l h ](1) P(i)∈[t start +l h +1,t start +l h +l p ](2) Where t start is the start time of each sample; S2.
2. Based on the stratified sampling principle, the time series data is divided into a training set, a validation set, and a test set according to a preset ratio. Train_set, Val_set, and Test_set represent the training set, the validation set, and the test set, respectively. Tra represents all vehicle trajectory samples obtained in step S2.1: Train_set=m1*Tra (3) Val_set=m2*Tra (4) Test_set=m3*Tra (5) m1, m2, m3 are preset scaling factors.
4. The vehicle trajectory reconstruction method considering physical constraints according to claim 2, characterized in that: Step S3 includes the following sub-steps: S3.
1. Calculate the travel time t of each vehicle passing through the target road segment k based on the time it takes for vehicle n to pass through the upstream detector and the downstream virtual detector. k,n , and then obtain the travel time observation set of n vehicles on the target road section in the data set: T k ={t k,1 ,t k,2 ,t k,3 ,t k,4 ,…t k,n-2 ,t k,n-1 ,t k,n }; S3.
2. Draw a distribution diagram of the observation time and perform a Kolmogorov-Smirnov test. Then, based on the assumption that the travel time of a vehicle on section k conforms to the normal distribution when the traffic flow is stable, obtain the expected travel time of the vehicle passing through section k. As follows: t k,n =a k+1,n -a k,n (6) Among them, t k,n is the travel time of vehicle n through road segment k, is the variance of the travel time of vehicle n through road segment k, a k,n is the time when vehicle n passes the upstream detector position of road segment k, a k+1,n is the time when vehicle n passes the end of the target road section; S3.
3. Based on the calculated expected travel time Based on the vehicle n traveling at a constant speed, the time it takes for vehicle n to pass the end of the study section k is: Then calculate the vehicle's position and time as shown in formula (9), in, is the average speed of vehicle n passing through road section k, l k is the length of road section k, s′ k,n,t is the longitudinal distance traveled by vehicle n on road section k, S3.
4. Obtain the estimated overtaking point based on the trajectory position and time expressions of different vehicles The reconstructed vehicle trajectory is adjusted according to formulas (11)-(12): Where (t k ″ ,n ,s′ k ' ,n,t ) represents the actual overtaking point position, s k ″′ ,n,t is the position of the vehicle trajectory point after adjustment.
5. The vehicle trajectory reconstruction method considering physical constraints according to claim 2, characterized in that: Step S4 includes the following sub-steps: S4.
1. Based on the linear assumption introduced by shock wave theory, calculate the spatiotemporal distribution of speed in each lane: Among them, v fv represents the velocity at the intersection A of the shock wave path and the preceding vehicle trajectory, v r ' efer represents the speed at any reference point between the front and rear vehicles, v nfv represents the velocity at the intersection point B of the following vehicle trajectory and the shock wave path, l1 and l2 represent the distances between the reference point and A and B, respectively; S4.
2. Adjust the reconstructed vehicle trajectory based on the spatiotemporal distribution of vehicle speed calculated in step S4.1: Considering the influence of speed fluctuation, the upper and lower speed thresholds of the vehicle trajectory points are calculated using formula (14). If the lower and upper speed fluctuation limits are exceeded, the vehicle trajectory is adjusted, as shown in formula (15). v lower =v r ′ efer -u*v r ′ efer (16) v upper =v r ′ efer +u*v r ′ efer (17) where v lower ,v upper They represent the lower and upper limits of speed fluctuation respectively, and u is the speed fluctuation factor.
6. The vehicle trajectory reconstruction method considering physical constraints according to claim 2, characterized in that: Step S5 includes the following sub-steps: S5.
1. Input the corrected vehicle trajectory data into the car-following model and output the result s IDM,i ; S5.
2. Input the corrected vehicle trajectory data into the GRU model for training. The GRU model includes two gate structures: reset gate and update gate. The core expressions of the GRU model are as follows: Formula (18) to Formula (21). r t =σ(W r ·[h t-1 ,x t ]+b r ) (18) z t =σ(W z ·[h t-1 ,x t ]+b z ) (19) Among them, h t is the current hidden state, is the candidate hidden state, x t Represents the input data, W r is the weight matrix of the reset gate, W z is the weight matrix of the update gate, W h is the weight matrix of the candidate state, b r is the bias term of the reset gate, b z is the bias term of the update gate, b h is the bias term of the candidate state, z t is the update gate vector, σ is the sigmoid activation function, r t is the reset gate vector; S5.
3. Output result of car-following model s IDM,i The reconstruction result of the GRU model is fused, and the average MAE loss of the GRU model is calculated to enhance the training process of the GRU model. The process of model fusion is shown in expression (22). In IDM,i +in GRU,i =1 (24) where s GRU,i Represents the trajectory points i, w reconstructed by the GRU model IDM,i ,w GRU,i They represent the weight coefficients of the car-following model and the GRU model, respectively, characterizing the credibility of different models. The sum of the two is 1, and loss is the training MAE loss of the GRU model.
7. The vehicle trajectory reconstruction method considering physical constraints according to claim 6, characterized in that: Step S6 includes the following sub-steps: S6.1, the vehicle trajectory data reconstructed by the hybrid model is input into the Savitzky-Golay filter. Based on the local polynomial least squares fitting in the time domain, the noise in the velocity and acceleration is filtered out while keeping the shape and width of the signal unchanged. Different filtering results are obtained by selecting different window widths. S6.2, using the speed and acceleration obtained in step S6.1, further adjust the reconstructed vehicle trajectory position as shown in formula (25) to obtain the final reconstructed vehicle trajectory, making the reconstructed vehicle trajectory more reasonable. in represents the position of the vehicle at time t after adjustment, v f,t ,v f,t-1 They represent the speed of the vehicle at time t or time t-1 after passing through the Savitzky-Golay filter.
Citation Information
Patent Citations
Vehicle following method based on fusion of GRU network model and Gipps model
CN111338385A
Network connection vehicle track reconstruction method and device based on bayonet detection, and medium
CN118197042A