A method for reconstructing a longitudinal trajectory of a highway vehicle
By combining ETC and "two-passenger-one-dangerous-goods" GPS data, and using XGBoost and improved particle filter algorithms, the problems of data loss and noise processing in trajectory reconstruction methods on highways were solved, achieving higher accuracy and robust vehicle longitudinal trajectory reconstruction.
Patent Information
- Application Number
- CN202410934321.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-07-12
AI Technical Summary
Existing trajectory reconstruction methods have limitations in handling missing data and noise on highways, and lack adaptability and accuracy, especially when detectors are sparsely distributed or malfunctioning, resulting in low reconstruction accuracy.
By collecting ETC data and GPS data of "two passengers and one dangerous goods" vehicles, and combining the XGBoost algorithm and the improved particle filter algorithm, a vehicle instantaneous speed estimation model is constructed to estimate the vehicle instantaneous speed under specific spatiotemporal conditions. The improved particle filter algorithm is then used to reconstruct the vehicle's longitudinal trajectory.
It improves the accuracy and robustness of trajectory reconstruction, can adaptively handle different data missing situations, enhances the reliability of speed estimation and adaptability in complex traffic environments, and provides trajectory reconstruction results with higher accuracy and robustness.
Smart Images

Figure CN118918713B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent transportation information technology, and specifically relates to a method for reconstructing the longitudinal trajectory of vehicles on highways. Background Technology
[0002] Vehicle longitudinal trajectory data reflects the distance a vehicle travels at different times and its changes, and to a certain extent, it can reflect vehicle driving behavior patterns, which is of great significance for traffic management and monitoring of violations. Due to the limitations of traditional GPS data in terms of vehicle penetration and coverage, and the sparse distribution of ETC detection equipment on highways, highway traffic managers lack sufficiently accurate data to comprehensively capture vehicle dynamic behavior, leading to a reduction in the ability to monitor vehicle driving status. By integrating vehicle information from different data sources and exploring the differences in vehicle speeds under different spatiotemporal conditions, and further analyzing and estimating the evolution patterns of vehicle driving status in traffic flow, effective reconstruction of highway vehicle longitudinal trajectories can be achieved. This is of great significance for anomaly identification of individual vehicles and traffic flow, intelligent highway management, and improving traffic efficiency.
[0003] Although various vehicle trajectory reconstruction methods have been proposed, their primary purpose is to repair existing vehicle trajectory data, such as filling in or refining missing points in the trajectory. These methods are not suitable for the typical scenario of highways where sufficient trajectory data is lacking. Existing vehicle trajectory reconstruction methods for highways are mostly used to supplement information on vehicles missed at checkpoints, resulting in low reconstruction accuracy. Furthermore, traditional methods are typically based on traffic flow models and statistical models, which rely on large amounts of historical data and precise model parameters for trajectory reconstruction. These models often employ simple interpolation or filtering methods to handle missing data and noise, making them ill-suited to complex traffic environments and varying road conditions.
[0004] Patent document CN117334051B discloses a method for reconstructing vehicle trajectories on highways. This method completes the spatiotemporal velocity matrix using an adaptive smoothing method, and reconstructs a higher-resolution trajectory by combining the spatiotemporal velocity matrix generated by a macroscopic model with a car-following model, while using the spatiotemporal velocity matrix as a constraint. However, this method relies on data from multiple fixed detectors and connected vehicles, and data integrity is limited when detectors are sparsely distributed or malfunctioning, resulting in insufficient adaptability and robustness under different data scenarios. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a method for reconstructing the longitudinal trajectory of vehicles on highways. This invention aims to overcome the limitations of existing trajectory reconstruction methods in terms of data loss and noise handling, thereby improving adaptability and accuracy.
[0006] This invention provides a method for reconstructing the longitudinal trajectory of vehicles on highways, comprising the following steps:
[0007] S1. Collect ETC data and GPS data of "two passengers and one dangerous goods" on the target road section, preprocess the data, and extract vehicle speed characteristics under different spatiotemporal dimensions.
[0008] S2. To address the issue of missing data, a vehicle instantaneous speed estimation model is constructed based on the XGBoost algorithm to estimate the vehicle instantaneous speed under specific spatiotemporal conditions;
[0009] S3. Evaluate the error of the vehicle instantaneous speed estimation model and fit the probability distribution of the calculation error;
[0010] S4. Using the instantaneous vehicle speed estimation results and errors as observation values and observation noise, the improved particle filter algorithm is used to reconstruct the vehicle's longitudinal trajectory.
[0011] Furthermore, step S1 includes the following sub-steps:
[0012] S1.1 performs preliminary matching of heterogeneous datasets to filter out ETC data and "two-passenger-one-dangerous-goods" GPS data on the same highway segment, thus completing the spatiotemporal matching operation of the data;
[0013] S1.2 performs data cleaning on the ETC data, removes redundant data, and then extracts the travel speed of each vehicle on each highway segment, as well as the average travel speed of vehicles within a specified observation time range, i.e., traffic flow speed.
[0014] Individual vehicle travel speed:
[0015] Traffic flow speed:
[0016] In the formula, t in t out These represent the time a vehicle enters and leaves the road segment, respectively; L represents the road segment length, i.e., the distance between the upstream and downstream ETC gantry locations; N i Represents the number of vehicles that passed through within a specified observation period;
[0017] S1.3 Corrects the position of the offset trajectory points in the GPS data of "two passengers and one dangerous goods". After correction, the position information in the trajectory of "two passengers and one dangerous goods" vehicles is converted from latitude and longitude expression to driving mileage expression.
[0018] The driving distance between adjacent trajectory points is calculated as follows:
[0019]
[0020] d = R·c
[0021] In the formula, d represents the spherical distance between two trajectory points; R is the radius of the Earth; lat1 represents the latitude of the first point; lat2 represents the latitude of the second point; Δlat represents the difference between the latitudes of the first and second points; Δlon represents the difference between the longitudes of the first and second points; a and c represent two intermediate variables representing the spherical distance between the two trajectory points. The mileage of each trajectory point is obtained by accumulating the distance traveled from the vehicle's starting trajectory point to each trajectory point.
[0022]
[0023] In the formula, l i d represents the distance traveled to the trajectory point; i This represents the distance traveled in the i-th segment of the trajectory.
[0024] S1.4 Based on the current GPS data, obtain the desired velocity v at the current location. rd The average speed v of the surrounding passenger and hazardous materials vehicles sr ;
[0025] v rd =R(x)
[0026] v sr =avg(v p )
[0027] In the formula, R(x) is the fitted ridge regression function; x is the observation location; v p The GPS recorded speed of "two-passenger-one-dangerous-goods" vehicles.
[0028] Furthermore, step S2 includes the following sub-steps:
[0029] S2.1 Analyzes different missing cases;
[0030] When there are no passenger or hazardous materials vehicles within the observation range at the current moment, it is represented by the average speed v of the surrounding passenger or hazardous materials vehicles. sr The absence of GPS data within the current observation range, or when GPS data is invalid or completely uncovered, manifests as the expected velocity v at the current location. rd The average speed v of the surrounding passenger and hazardous materials vehicles sr All are missing;
[0031] S2.2 Empty the missing data under different conditions and use the XGBoost algorithm to estimate the instantaneous speed of the vehicle under specific spatiotemporal conditions. The four feature parameters extracted in step S1 are used as the input data of the XGBoost algorithm.
[0032] The objective function of the XGBoost algorithm is in the following form:
[0033]
[0034] In the formula, L(θ) is the loss function; Ω(θ) is the regularization term; n is the number of training data samples; y i It is the true value of the i-th sample; It is the value predicted by the model; f k It is the k-th decision tree; K is the total number of trees in the model;
[0035] In the regularization term Ω(f k The definition of ) is as follows:
[0036]
[0037] In the formula, T is the tree f k The number of leaf nodes; w j γ is the weight of the j-th leaf node; γ and λ are regularization coefficients used to balance the relationship between the loss function and the model complexity, where γ controls the number of trees and λ controls the L2 regularization of the leaf node weights.
[0038] S2.3 When XGBoost encounters a missing value, it assigns the missing data to the left or right subtree and then selects the direction that will bring the maximum gain after splitting.
[0039] The gain of the left and right subtrees is calculated as follows:
[0040]
[0041] In the formula, Gain L and Gain R These represent the gains from assigning missing values to the left or right subtree, respectively; G and H represent the sum of the gradient and the second derivative, respectively; G L G M G R G represents the gradient sum of the left subtree, the gradient sum of the missing values, the gradient sum of the right subtree, and the gradient sum of the current node, respectively; H L H M H R H represents the sum of the second derivatives of the left subtree, the sum of the second derivatives of the missing value part, the sum of the second derivatives of the right subtree, and the sum of the second derivatives of the current node, respectively; γ represents the regularization coefficient, which is used to control the number of trees.
[0042] Furthermore, step S3 includes the following sub-steps:
[0043] S3.1 evaluates the error of the vehicle instantaneous speed estimation model based on the XGBoost algorithm;
[0044] The expression for calculating the estimation error is: E = v est -v tr
[0045] In the formula, v est and v tr These represent the estimated and actual instantaneous velocity values, respectively.
[0046] S3.2 The mean absolute error (MAE) and root mean square error (RMSE) are used to evaluate the estimation error of the model;
[0047]
[0048] The probability distribution of the estimation error was fitted using the model's MAE and RMSE indices as the Gaussian distribution radius R, and the MAE was finally determined as the Gaussian distribution radius of the velocity estimation error.
[0049] The probability distribution expression for the velocity estimation error is as follows:
[0050]
[0051] Furthermore, the improved particle filter algorithm in step S4 includes an initialization module, a state estimation module, and a trajectory output module.
[0052] Furthermore, step S4 includes the following sub-steps:
[0053] S4.1 determines the number of trajectory points to be reconstructed for the target vehicle in the initialization module, and completes particle set initialization and particle weight initialization;
[0054] In the initialization of the particle set, the particle state space dimension is 2, representing the vehicle position and vehicle speed respectively. The number of particles in the particle set is determined, and all initial particles are assigned equal weights.
[0055] S4.2 In the state estimation module, a dynamic model is used to predict the state of the particle in the next time window;
[0056] For each particle i in the particle set, the dynamic model is represented as:
[0057]
[0058] In the formula, These represent the predicted velocity and predicted position of the i-th particle at time t, respectively. These represent the velocity and position of the i-th particle at time t-1, respectively. Let represent the change in velocity of the i-th particle at time t relative to the previous time. This change in velocity follows a uniform distribution. The lower limit is 0 km / h, and the upper limit is 140 km / h;
[0059] S4.3 uses the observation model to update the weights of each particle;
[0060] The likelihood d between the predicted value and the observed value within the corresponding time window is calculated by using the vehicle speed estimated by the XGBoost algorithm as the observation value and the error of the instantaneous speed estimation model as the observation noise.
[0061]
[0062] In the formula, v par Predicted velocity value for each particle; v obs These are the velocity observations within the corresponding time window;
[0063] S4.4 uses a residual-hierarchical hybrid resampling method to resample particle weights;
[0064] I. Calculate the number of valid particle samples and determine whether resampling is necessary;
[0065]
[0066] In the formula, N eff N represents the number of valid particle samples. eff If the sample size is less than half of the total number of particle samples N, then resampling is required.
[0067] II. Calculate the resampling exponent for each particle, which includes both integers and residuals;
[0068] n i =|N·w i |
[0069]
[0070] In the formula, n i The integer part represents the minimum number of times each particle is copied; For residuals;
[0071] III. Perform stratified resampling on the residuals to fill in the remaining data. The weights are obtained by renormalizing the residuals at each particle position.
[0072]
[0073] IV. The remaining... Each particle position is assigned to a particle, and a hierarchical resampling method is used based on residual weights. Sampling, i.e., generating Given a set of random numbers uniformly distributed in the interval [0,1), find the corresponding interval for each random number. The interval is determined by normalized residual weights. Definition: Select additional particles based on the distribution of the residual to complete the resampling operation;
[0074] S4.5 uses the updated and resampled particle set to calculate the final state estimate, and obtains the vehicle speed and position at the current moment;
[0075] In the trajectory output module, S4.6 uses a trajectory scaling strategy to adjust the length of the reconstructed trajectory. A threshold θ is set based on the difference between the reconstructed length and the actual length to determine whether to scale the reconstructed trajectory. The scaling factor α is calculated as follows:
[0076]
[0077] In the formula, L rec For reconstructing the trajectory length; L act This refers to the actual distance the vehicle traveled.
[0078] After determining the scaling requirements for the reconstructed trajectory, a scaling factor is applied to the estimation results within each time window to achieve the final output of the reconstructed trajectory.
[0079] Beneficial effects:
[0080] This invention proposes a method for reconstructing the longitudinal trajectory of vehicles on highways, considering instantaneous speed estimation errors. By integrating ETC data and GPS data from passenger and hazardous goods transport vehicles, and combining the XGBoost algorithm with an improved particle filter algorithm, the accuracy and robustness of trajectory reconstruction are improved. In the feature extraction stage, individual vehicle speed, traffic flow speed, road segment attributes, and surrounding vehicle information are fully utilized to achieve adaptive processing for different data loss scenarios. The XGBoost algorithm is used for instantaneous speed estimation, and the estimation error is treated as a Gaussian distribution, enhancing the reliability of speed estimation. By improving the particle filter algorithm and considering speed estimation errors, dynamic adjustment of the vehicle's longitudinal trajectory is achieved, improving adaptability and accuracy in complex traffic environments. This method effectively overcomes the limitations of existing trajectory reconstruction methods in terms of data loss and noise handling, providing trajectory reconstruction results with higher accuracy and robustness.
[0081] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0082] Figure 1 This is a flowchart of a method for reconstructing the longitudinal trajectory of vehicles on a highway according to the present invention;
[0083] Figure 2 This is a general framework diagram for the reconstruction model of the longitudinal trajectory of vehicles on highways. Detailed Implementation
[0084] To make the technical solutions, advantages, and objectives of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention without creative effort are within the protection scope of this application.
[0085] like Figure 1 As shown, the present invention provides a method for reconstructing the longitudinal trajectory of vehicles on highways, comprising the following steps:
[0086] S1. Collect ETC data and GPS data of "two passengers and one dangerous goods" on the target road section, preprocess the data, and extract vehicle speed characteristics under different spatiotemporal dimensions.
[0087] Spatiotemporal matching of multi-source heterogeneous data is performed, and vehicle speed information is extracted from four perspectives: individual vehicles, traffic flow, road segment attributes, and surrounding vehicles. ETC gantries are distributed at key nodes of the highway at certain distances, dividing the entire road into different segments.
[0088] S1.1 performs preliminary matching of heterogeneous datasets to filter out ETC data and "two-passenger-one-dangerous-goods" GPS data on the same highway segment, thus completing the spatiotemporal matching operation of the data;
[0089] S1.2 performs data cleaning on the ETC data, removes redundant data, and then extracts the travel speed of each vehicle on each highway segment, as well as the average travel speed of vehicles within a specified observation time range, i.e., traffic flow speed; the above two speed observation information can reflect the impact of individual vehicle and traffic flow differences on the estimation of instantaneous vehicle speed.
[0090] Individual vehicle travel speed:
[0091] Traffic flow speed:
[0092] In the formula, t in t out These represent the time a vehicle enters and leaves the road segment, respectively; L represents the road segment length, i.e., the distance between the upstream and downstream ETC gantry locations; N iThis represents the number of vehicles that passed through within 2 minutes;
[0093] S1.3 Corrects the position of trajectory points with significant offsets in the GPS data of "two passengers and one dangerous goods". After correction, the position information in the trajectory of "two passengers and one dangerous goods" vehicles is converted from latitude and longitude expression to driving mileage expression.
[0094] The driving distance between adjacent trajectory points is calculated as follows:
[0095]
[0096] d = R·c
[0097] In the formula, d represents the spherical distance between the two trajectory points; R is the radius of the Earth; lat1 represents the latitude of the first point; lat2 represents the latitude of the second point; Δlat represents the difference between the latitudes of the first and second points; Δlon represents the difference between the longitudes of the first and second points; and a and c represent two intermediate variables for the spherical distance between the two trajectory points.
[0098] The mileage at each trajectory point is obtained by accumulating the distance traveled from the vehicle's starting trajectory point to each trajectory point:
[0099]
[0100] In the formula, l i d represents the distance traveled to the trajectory point; i This represents the distance traveled in the i-th segment of the trajectory.
[0101] S1.4 Based on current GPS data, the speeds of passenger and hazardous goods transport vehicles surrounding the target vehicle can be obtained. These two types of speed observation information reflect the influence of road attributes and surrounding vehicles on the instantaneous speed estimation of the vehicle. Current location expected speed v rd The average speed v of the surrounding passenger and hazardous materials vehicles sr The extraction method is shown below;
[0102] v rd =R(x)
[0103] v sr =avg(v p )
[0104] In the formula, R(x) is the fitted ridge regression function; x is the observation location; v p The GPS recorded speed of "two-passenger-one-dangerous-goods" vehicles.
[0105] S2. Analyze the availability of the four feature parameters extracted in step S1 for different data missing situations, and construct a vehicle instantaneous speed estimation model based on the XGBoost algorithm to estimate the vehicle instantaneous speed under specific spatiotemporal conditions.
[0106] S2.1 Analyzes different missing cases;
[0107] When there are no passenger or hazardous materials vehicles within the observation range at the current moment, it is represented by the average speed v of the surrounding passenger or hazardous materials vehicles. sr The absence of GPS data within the current observation range, or when GPS data is invalid or completely uncovered, manifests as the expected velocity v at the current location. rd The average speed v of the surrounding passenger and hazardous materials vehicles sr All are missing;
[0108] S2.2 Empty the missing data under different conditions and use the XGBoost algorithm to estimate the instantaneous speed of the vehicle under specific spatiotemporal conditions. The four feature parameters extracted in step S1 are used as the input data of the XGBoost algorithm.
[0109] The objective function of the XGBoost algorithm is in the following form:
[0110]
[0111] In the formula, L(θ) is the loss function; Ω(θ) is the regularization term; n is the number of training data samples; y i It is the true value of the i-th sample; It is the value predicted by the model; f k It is the k-th decision tree; K is the total number of trees in the model;
[0112] In the regularization term Ω(f k The definition of ) is as follows:
[0113]
[0114] In the formula, T is the tree f k The number of leaf nodes; w j γ is the weight of the j-th leaf node; γ and λ are regularization coefficients used to balance the relationship between the loss function and the model complexity, where γ controls the number of trees and λ controls the L2 regularization of the leaf node weights.
[0115] S2.3 When XGBoost encounters a missing value, it assigns the missing data to the left or right subtree and then selects the direction that will bring the maximum gain after splitting.
[0116] The gain of the left and right subtrees is calculated as follows:
[0117]
[0118] In the formula, Gain L and Gain R These represent the gains from assigning missing values to the left or right subtree, respectively; G and H represent the sum of the gradient and the second derivative, respectively; G L G M G R G represents the gradient sum of the left subtree, the gradient sum of the missing values, the gradient sum of the right subtree, and the gradient sum of the current node, respectively; H L H M H R H represents the sum of the second derivatives of the left subtree, the sum of the second derivatives of the missing value part, the sum of the second derivatives of the right subtree, and the sum of the second derivatives of the current node, respectively; γ here represents the regularization coefficient, which is used to control the number of trees.
[0119] S3. Evaluate the error of the vehicle instantaneous speed estimation model and fit the probability distribution of the calculation error;
[0120] S3.1 evaluates the error of the vehicle instantaneous speed estimation model based on the XGBoost algorithm;
[0121] The expression for calculating the estimation error is: E = v est -v tr
[0122] In the formula, v est and v tr These represent the estimated and actual instantaneous velocity values, respectively.
[0123] S3.2 The mean absolute error (MAE) and root mean square error (RMSE) are used to evaluate the estimation error of the model.
[0124]
[0125] The probability distribution of the estimation error was fitted using the model's MAE and RMSE indices as the Gaussian distribution radius R, and the MAE was finally determined as the Gaussian distribution radius of the velocity estimation error.
[0126] The probability distribution expression for the velocity estimation error is as follows:
[0127]
[0128] S4. Using the instantaneous vehicle speed estimation results and errors as observation values and observation noise, the improved particle filter algorithm is used to reconstruct the vehicle's longitudinal trajectory;
[0129] Based on the improved particle filter algorithm, the vehicle speed is estimated in each time window by using the instantaneous vehicle speed estimation method in step S2, and the instantaneous speed estimation error in step S3 is taken into consideration, so as to complete the derivation of the target vehicle speed and position information in each time window and complete the reconstruction of the vehicle's longitudinal trajectory.
[0130] The improved particle filter algorithm consists of three parts: an initialization module, a state estimation module, and a trajectory output module.
[0131] S4.1 determines the number of trajectory points to be reconstructed for the target vehicle in the initialization module, and completes particle set initialization and particle weight initialization;
[0132] In the initialization of the particle set, the particle state space dimension is 2, representing the vehicle position and vehicle speed respectively. The number of particles in the set is determined. At the same time, all initial particles are set with equal weights to complete the particle weight initialization.
[0133] S4.2 In the state estimation module, a dynamic model is used to predict the state of the particle in the next time window;
[0134] For each particle i in the particle set, the dynamic model is represented as:
[0135]
[0136] In the formula, These represent the predicted velocity and predicted position of the i-th particle at time t, respectively. These represent the velocity and position of the i-th particle at time t-1, respectively. This represents the change in velocity of the i-th particle at time t relative to the previous time. Its main function is to maintain particle diversity and cover various changes in vehicle velocity. The velocity change is assumed to follow a uniform distribution. set up The lower limit is 0 km / h and the upper limit is 140 km / h, so that the predicted velocity of each particle is kept within a reasonable range;
[0137] S4.3 uses the observation model to update the weights of each particle;
[0138] The likelihood d between the predicted value and the observed value within the corresponding time window is calculated by using the vehicle speed estimated by the XGBoost algorithm as the observation value and the error of the instantaneous speed estimation model as the observation noise.
[0139]
[0140] In the formula, v par Predicted velocity value for each particle; v obsThese are the velocity observations within the corresponding time window;
[0141] S4.4 uses a residual-hierarchical hybrid resampling method to resample particle weights;
[0142] I. Calculate the number of valid particle samples and determine whether resampling is necessary;
[0143]
[0144] In the formula, N eff N represents the number of valid particle samples. eff If the sample size is less than half of the total number of particles N, then resampling is required. eff The larger the value, the higher the diversity and representativeness of the sample;
[0145] II. Calculate the resampling exponent for each particle, which includes both integers and residuals;
[0146] n i =|N·w i |
[0147]
[0148] In the formula, n i The integer part represents the minimum number of times each particle is copied; For residuals;
[0149] III. Perform stratified resampling on the residuals to fill in the remaining data. The weights are obtained by renormalizing the residuals at each particle position.
[0150]
[0151] IV. The remaining... Each particle position is assigned to a particle, and a hierarchical resampling method is used based on residual weights. Sampling, i.e., generating Given a set of random numbers uniformly distributed in the interval [0,1), for each random number, find a corresponding interval into which it falls. This interval is determined by normalized residual weights. Definition; This allows us to select additional particles based on the distribution of the residuals to complete the resampling operation;
[0152] S4.5 uses the updated and resampled particle set to calculate the final state estimate, and obtains the vehicle speed and position at the current moment;
[0153]
[0154] In the trajectory output module, S4.6 uses a trajectory scaling strategy to adjust the length of the reconstructed trajectory. A threshold θ is set based on the difference between the reconstructed length and the actual length to determine whether to scale the reconstructed trajectory. The scaling factor α is calculated as follows:
[0155]
[0156] In the formula, L rec For reconstructing the trajectory length; L act This represents the actual distance the vehicle traveled.
[0157] Once the scaling requirements for the reconstructed trajectory are determined, a scaling factor can be applied to the estimation results within each time window to achieve the final output of the reconstructed trajectory.
[0158] In this embodiment, the overall framework diagram of the vehicle longitudinal trajectory reconstruction model can be referred to Figure 2 .
[0159] It is hereby declared that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for reconstructing the longitudinal trajectory of vehicles on a highway, characterized in that, Includes the following steps: S1. Collect ETC data and "two-passenger-one-dangerous-goods" GPS data of the target road section, preprocess the data, and extract vehicle speed characteristics under different spatiotemporal dimensions. S2. To address the issue of missing data, a vehicle instantaneous speed estimation model is constructed based on the XGBoost algorithm to estimate the vehicle instantaneous speed under specific spatiotemporal conditions; S3. Evaluate the error of the vehicle instantaneous speed estimation model and fit the probability distribution of the error; S4. Using the instantaneous vehicle speed estimation results and errors as observation values and observation noise, the improved particle filter algorithm is used to reconstruct the vehicle's longitudinal trajectory; S4.1 determines the number of trajectory points to be reconstructed for the target vehicle in the initialization module, and completes particle set initialization and particle weight initialization; In the initialization of the particle set, the particle state space dimension is 2, representing the vehicle position and vehicle speed respectively. The number of particles in the particle set is determined, and all initial particles are assigned equal weights. S4.2 In the state estimation module, a dynamic model is used to predict the state of the particle in the next time window; For each particle i in the particle set, the dynamic model is represented as: In the formula, These represent the predicted velocity and predicted position of the i-th particle at time t, respectively. These represent the velocity and position of the i-th particle at time t-1, respectively. Let represent the change in velocity of the i-th particle at time t relative to the previous time. This change in velocity follows a uniform distribution. The upper limit is 140 km / h; Δt represents the time interval between two adjacent moments; S4.3 uses the observation model to update the weights of each particle; The likelihood d between the predicted value and the observed value within the corresponding time window is calculated by using the vehicle speed estimated by the XGBoost algorithm as the observation value and the error of the instantaneous speed estimation model as the observation noise. In the formula, v par Predicted velocity value for each particle; v obs These are the velocity observations within the corresponding time window; MAE represents the mean absolute error. S4.4 uses a residual-hierarchical hybrid resampling method to resample particle weights; I. Calculate the number of valid particle samples and determine whether resampling is necessary; In the formula, N eff N represents the number of valid particle samples. eff If the sample size is less than half of the total number of particle samples N, then resampling is required. II. Calculate the resampling exponent for each particle, which includes both integers and residuals; n i =|N·w i | In the formula, n i The integer part represents the minimum number of times each particle is copied; For residuals; III. Perform stratified resampling on the residuals to fill in the remaining data. The weights are obtained by renormalizing the residuals at each particle position. IV. The remaining... Each particle position is assigned to a particle, and a hierarchical resampling method is used based on residual weights. Sampling, i.e., generating Given a set of random numbers uniformly distributed in the interval [0,1), find the corresponding interval for each random number. The interval is determined by normalized residual weights. Definition: Select additional particles based on the distribution of the residual to complete the resampling operation; S4.5 uses the updated and resampled particle set to calculate the final state estimate, and obtains the vehicle speed and position at the current moment; In the trajectory output module, S4.6 uses a trajectory scaling strategy to adjust the length of the reconstructed trajectory. A threshold θ is set based on the difference between the reconstructed length and the actual length to determine whether to scale the reconstructed trajectory. The scaling factor α is calculated as follows: In the formula, L rec For reconstructing the trajectory length; L act This refers to the actual distance the vehicle traveled. After determining the scaling requirements for the reconstructed trajectory, a scaling factor is applied to the estimation results within each time window to achieve the final output of the reconstructed trajectory.
2. The method for reconstructing the longitudinal trajectory of a vehicle on a highway according to claim 1, characterized in that: Step S1 includes the following sub-steps: S1.1 performs preliminary matching of heterogeneous datasets to filter out ETC data and "two-passenger-one-dangerous-goods" GPS data on the same highway segment, thus completing the spatiotemporal matching operation of the data. S1.2 performs data cleaning on the ETC data, removes redundant data, and then extracts the travel speed of each vehicle on each highway segment, as well as the average travel speed of vehicles within a specified observation time range, i.e., traffic flow speed. Individual vehicle travel speed: Traffic flow speed: In the formula, t in t out These represent the time a vehicle enters and leaves the road segment, respectively; L represents the road segment length, i.e., the distance between the upstream and downstream ETC gantry locations; N i Represents the number of vehicles that passed through within a specified observation period; S1.3 Corrects the position of the offset trajectory points in the GPS data of "two passengers and one dangerous goods". After correction, the position information in the trajectory of "two passengers and one dangerous goods" vehicles is converted from latitude and longitude expression to driving mileage expression. The driving distance between adjacent trajectory points is calculated as follows: d = R·c In the formula, d represents the spherical distance between the two trajectory points; R is the radius of the Earth; lat1 represents the latitude of the first point; lat2 represents the latitude of the second point; Δlat represents the difference between the latitudes of the first and second points; Δlon represents the difference between the longitudes of the first and second points; a and c represent two intermediate variables for the spherical distance between the two trajectory points. The mileage at each trajectory point is obtained by accumulating the distance traveled from the vehicle's starting trajectory point to each trajectory point: In the formula, l i d represents the distance traveled to the trajectory point; i This represents the distance traveled in the i-th segment of the trajectory. S1.4 Based on the current GPS data, obtain the desired velocity v at the current location. rd The average speed v of the surrounding "two passengers and one dangerous goods" vehicles sr ; v rd =R(x) v sr =avg(v p ) In the formula, R(x) is the fitted ridge regression function; x is the observation location; v p The GPS recorded speed of "two passengers and one dangerous goods" vehicles.
3. The method for reconstructing the longitudinal trajectory of a vehicle on a highway according to claim 2, characterized in that: Step S2 includes the following sub-steps: S2.1 Analyzes different missing cases; When there are no passenger or hazardous materials vehicles within the observation range at the current moment, it is represented by the average speed v of the surrounding passenger or hazardous materials vehicles. sr The absence of GPS data within the current observation range, or when GPS data is invalid or completely uncovered, manifests as the expected velocity v at the current location. rd The average speed v of the surrounding "two passengers and one dangerous goods" vehicles sr All are missing; S2.2 Empty the missing data under different conditions and use the XGBoost algorithm to estimate the instantaneous speed of the vehicle under specific spatiotemporal conditions. The four feature parameters extracted in step S1 are used as the input data of the XGBoost algorithm. The objective function of the XGBoost algorithm is in the following form: In the formula, L(θ) is the loss function; Ω(θ) is the regularization term; n is the number of training data samples; y i It is the true value of the i-th sample; It is the value predicted by the model; f k It is the k-th decision tree; K is the total number of trees in the model; In the regularization term Ω(f k The definition of ) is as follows: In the formula, T is the tree f k The number of leaf nodes; w j γ is the weight of the j-th leaf node; γ and λ are regularization coefficients used to balance the relationship between the loss function and the model complexity, where γ controls the number of trees and λ controls the L2 regularization of the leaf node weights. S2.3 When XGBoost encounters a missing value, it assigns the missing data to the left or right subtree and then selects the direction that will bring the maximum gain after splitting. The gain of the left and right subtrees is calculated as follows: In the formula, Gain L Gain represents the gain of missing values being assigned to the left subtree. R G represents the gain of missing values being assigned to the right subtree; L G M G R G represents the gradient sum of the left subtree, the gradient sum of the missing values, the gradient sum of the right subtree, and the gradient sum of the current node, respectively; H L H M H R H represents the sum of the second derivatives of the left subtree, the sum of the second derivatives of the missing value part, the sum of the second derivatives of the right subtree, and the sum of the second derivatives of the current node, respectively; γ represents the regularization coefficient, which is used to control the number of trees.
4. The method for reconstructing the longitudinal trajectory of a vehicle on a highway according to claim 3, characterized in that: Step S3 includes the following sub-steps: S3.1 evaluates the error of the vehicle instantaneous speed estimation model based on the XGBoost algorithm; The expression for calculating the estimation error is: E = v est -v tr In the formula, v est and v tr These represent the estimated and actual instantaneous velocity values, respectively. S3.2 The mean absolute error (MAE) and root mean square error (RMSE) are used to evaluate the estimation error of the model; The probability distribution of the estimation error was fitted using the model's MAE and RMSE indices as the Gaussian distribution radius R, and the MAE was finally determined as the Gaussian distribution radius of the velocity estimation error. The probability distribution expression for the velocity estimation error is as follows:
5. The method for reconstructing the longitudinal trajectory of a vehicle on a highway according to claim 4, characterized in that: The improved particle filter algorithm in step S4 includes an initialization module, a state estimation module, and a trajectory output module.
Citation Information
Patent Citations
A method and system for reconstructing highway vehicle trajectories
CN117334051B
Vehicle space-time trajectory reconstruction method based on data fusion
CN115311854A
Non-motor vehicle track reconstruction method for non-motor vehicle shared space
CN116578879A