A traffic flow simulation method and system considering traffic safety and efficiency

CN122551576APending Publication Date: 2026-08-11JILIN JIANZHU UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-16
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0005]本发明缓解了现有交通流仿真技术存在加减速与换道行为失真和混行场景下的换道动机预测精度低的问题

Benefits of technology

[0020]本发明所述的一种兼顾交通安全和效率的交通流仿真方法及系统,有效缓解了现有交通流仿真技术存在加减速与换道行为失真和混行场景下的换道动机预测精度低的问题。具体有益效果包括:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122551576A_ABST
    Figure CN122551576A_ABST
Patent Text Reader

Abstract

A traffic flow simulation method and system that balances traffic safety and efficiency, relating to the field of traffic control, alleviates the problems of distortion in acceleration / deceleration and lane-changing behavior and low prediction accuracy of lane-changing motivation in mixed traffic scenarios in existing technologies. The traffic flow simulation method includes: Step S1, obtaining the corresponding lane direction position based on vehicle type and vehicle information; Step S2, if the vehicle meets safety constraints and lane-changing conditions, obtaining the lane-changing probability through a random forest lane-changing prediction model and executing Step S21; otherwise, executing Step S22; Step S21, if the lane-changing probability is greater than the lane-changing threshold, obtaining the target lane based on vehicle information; updating the vehicle's position based on the lane direction position and the target lane, completing the current update; otherwise, executing Step S22; Step S22, updating the vehicle's position based on the lane direction position, completing the current update. This invention is applicable to fields such as intelligent road network planning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic control, and more specifically to the field of traffic simulation. Background Technology

[0002] With the acceleration of urbanization and the increase in the number of connected autonomous vehicles (CAVs) and human-driven vehicles (HVs), traffic congestion and frequent accidents are becoming increasingly prominent problems. Traffic flow simulation can evaluate road design, signal control strategies, and autonomous driving algorithms in a safe and low-cost virtual environment, providing a scientific basis for traffic planning, operation, and optimization. However, existing traffic flow simulations have the following limitations: First, traditional cellular automata only use fixed rules to describe driving behavior, which cannot learn the real driving time sequence characteristics, resulting in distortion of acceleration, deceleration and lane changing behaviors. Second, most models only optimize the car-following method and acceleration. Lane-changing models use fixed rules, making it difficult to uncover the hidden features of lane-changing decisions. This leads to distortion in the simulation of lane-changing behavior and makes it impossible to capture the dynamic decision-making logic of drivers in complex environments. Third, in mixed traffic scenarios, the complex lane-changing motivations (speed, spacing, adjacent lane status, driving habits) of manually driven vehicles (HVs) cannot be accurately characterized by simple threshold conditions.

[0003] In the prior art, Chinese patent document CN120748253A discloses "a method, system and storage medium for traffic flow control of CAV and HV mixed traffic". This technical solution obtains the queuing situation of CAV vehicles in front and behind based on road conditions, and further considers the aggregation of homogeneous vehicles when making lane change decisions, which further improves the efficiency of road traffic flow and road safety, and reduces the mutual interference between CAV and HAV vehicles. However, this method is only based on simulation characterization under fixed rules and lacks the mining of driving behavior characteristics in time series data, and cannot capture dynamic changes and trends, resulting in insufficient accuracy of simulation.

[0004] In summary, existing traffic flow simulation technologies suffer from distortions in acceleration / deceleration and lane-changing behaviors, as well as low accuracy in predicting lane-changing motivations in mixed traffic scenarios. Summary of the Invention

[0005] This invention alleviates the problems of distortion in acceleration / deceleration and lane-changing behavior, and low prediction accuracy of lane-changing motivations in mixed-traffic scenarios, existing traffic flow simulation technologies. This invention provides the following solution: Option 1: A traffic flow simulation method that balances traffic safety and efficiency, wherein the simulation object includes all vehicles to be simulated in the simulated road segment; the simulation method is as follows: Real-time collection of driving data for each vehicle; The location of the corresponding vehicle is updated based on the currently collected driving data, including: Step S1: Based on the vehicle type and vehicle information, obtain the corresponding lane direction position; Step S2: If the vehicle meets the safety constraints and lane-changing conditions, then the random forest lane-changing prediction model is used. If the lane-changing probability is obtained, proceed to step S21; otherwise, proceed to step S22. Step S21: If the lane-changing probability is greater than the lane-changing threshold, then obtain the target lane based on the vehicle information; update the vehicle's position based on the lane direction position and the target lane to complete the current update; Otherwise, proceed to step S22; Step S22: Update the vehicle's position based on the lane direction position to complete the current update.

[0006] Furthermore, in one embodiment of the present invention, the method for obtaining the corresponding lane direction position based on the vehicle type and vehicle information is to adopt a corresponding method according to the vehicle type: When the vehicle type is a manually driven vehicle (HV): based on the vehicle information, an LSTM acceleration prediction model is used. The vehicle's acceleration is obtained; based on the HV acceleration and the vehicle information, the lane direction position is obtained; When the vehicle type is a connected autonomous driving CAV, the corresponding method shall be adopted according to the vehicle type of the following vehicle: If the vehicle type of the following vehicle is a manually driven vehicle (HV), then based on the vehicle information, the lane direction position is obtained through the CAV cellular automata method. Otherwise, based on the vehicle information, the lane direction position is obtained using the CAV following position method.

[0007] Furthermore, in one embodiment of the present invention, the method for obtaining the target lane in step S21 is as follows: Step S211: Based on the vehicle information, obtain the lane score for each lane. The lane score The formula is:

[0008] in, This represents the distance of the current vehicle relative to the vehicle in front in the lane. This represents the distance between the current vehicle and the vehicle behind it in the lane. Step S212: Select the lane with the highest lane score as the target lane.

[0009] Furthermore, in one embodiment of the present invention, the random forest lane-changing prediction model for

[0010] in, For lane-changing probability, subscript Indicates the current vehicle, underlined Indicates the current vehicle The car in front, For driving speed, For acceleration, For the current vehicle Distance to the car in front, For the current vehicle Distance between the front and rear of the vehicle in front For the current vehicle Relative speed to the vehicle in front, For the collision time, subscript Indicates the left lane, subscript Indicates the right lane, upper corner mark Indicates the current vehicle's position relative to the vehicle in front, indicated by the superscript. This indicates the current vehicle relative to the vehicle behind it.

[0011] Furthermore, in one embodiment of the present invention, the LSTM acceleration prediction model for:

[0012] in, For the acceleration of the manually driven vehicle (HV), subscript Indicates the length of the time series. The current speed of the vehicle. This represents the speed of the vehicle ahead. This represents the distance between the current vehicle and the vehicle in front. This represents the relative distance between the current vehicle and the vehicle in front. This represents the time difference between the current vehicle and the vehicle in front. Let be the rate of change of acceleration between the current vehicle and the vehicle in front. This represents the acceleration of the vehicle in front.

[0013] Furthermore, in one embodiment of the present invention, the CAV cellular automaton method includes Gipps safety rules, acceleration rules, deceleration rules, constant speed rules, and position update rules.

[0014] Furthermore, in one embodiment of the present invention, the CAV following position method is as follows: At time t, the current vehicle Distance to the car in front Greater than the safe distance At that time, through

[0015] get Current vehicle driving speed ,in, for Current vehicle driving speed, for The car in front The speed of travel; At time t, the current vehicle Distance to the car in front equal to safe distance At that time, through

[0016] get Current vehicle The driving speed, of which, For the car in front The speed of travel; At time t, the current vehicle Distance to the car in front Less than the safe distance hour, Based on the driving speed, the lane direction position is obtained through the position update rule.

[0017] Option 2: A traffic flow simulation system that balances traffic safety and efficiency, wherein the simulation system includes all vehicles in the simulated road segment; the simulation system includes the following modules: The data acquisition module is used to collect driving data for each vehicle in real time. The location update module is used to update the location of the corresponding vehicle based on the currently collected driving data, and includes the following units: Unit 1 is used to obtain the corresponding lane direction position based on the vehicle type and vehicle information of the vehicle; Unit 2 is used to predict lane changes using a random forest lane-changing model if the vehicle meets safety constraints and lane-changing conditions. If the lane-changing probability is obtained, sub-unit one is executed; otherwise, sub-unit two is executed. Subunit 1 is used to obtain a target lane based on the vehicle information if the lane-changing probability is greater than the lane-changing threshold; and to update the vehicle's position based on the lane direction position and the target lane to complete the current update. Otherwise, execute subunit two; Subunit two is used to update the vehicle's position based on the lane direction position to complete the current update.

[0018] Option 3: An electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; Memory, used to store computer programs; When a processor executes a computer program stored in memory, it implements the method described in Scheme 1.

[0019] Option 4: A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method described in Option 1.

[0020] The traffic flow simulation method and system described in this invention, which balances traffic safety and efficiency, effectively alleviates the problems of distortion in acceleration / deceleration and lane-changing behavior, and low prediction accuracy of lane-changing motivations in mixed-traffic scenarios, inherent in existing traffic flow simulation technologies. Specific beneficial effects include: This invention provides a traffic flow simulation method that balances traffic safety and efficiency. It utilizes LSTM to learn driving time-series data to predict the acceleration of manually driven vehicles and random forests to learn multi-dimensional driving features to predict lane-changing decisions. By embedding these two models into a cellular automata to construct an integrated simulation model, it achieves data-driven car-following and lane-changing behaviors, thereby improving simulation accuracy.

[0021] It can accurately reproduce the phase transition of three-phase traffic flow, significantly reduce sudden acceleration and deceleration and unreasonable lane changes, support different penetration rates of connected autonomous vehicles, different densities and complex mixed traffic scenarios including large vehicles, and can accurately output indicators such as traffic capacity, congestion coefficient, lane change frequency, and spatiotemporal congestion evolution.

[0022] This invention is applicable to the fields of intelligent road network planning, optimization of autonomous driving control strategies, and basic theoretical research on traffic flow. Attached Figure Description

[0023] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 It is the LSTM acceleration prediction model described in Implementation Method 5. Structural diagram; Figure 2 It is the loss curve diagram described in Implementation Method 8; Figure 3 It is the RMSE curve diagram described in Implementation Method 8; Figure 4 This is the performance test graph of the validation set described in Implementation Method 8; Figure 5 It is the bag external error curve diagram described in Embodiment 8; Figure 6 It is the confusion matrix diagram described in Implementation Method 8; Figure 7 This is a comparison chart of flow density under six CAV penetration rates as described in Implementation Method 8; Figure 8 This is a comparison chart of the penetration rate, velocity, and density of the six CAVs described in Implementation Method 8; Figure 9 This is the spatiotemporal congestion diagram under a CAVs penetration rate of 0% as described in Implementation Method 8; Figure 10 This is the spatiotemporal congestion diagram under a CAVs penetration rate of 20% as described in Implementation Method 8; Figure 11 This is the spatiotemporal congestion diagram under a CAVs penetration rate of 40% as described in Implementation Method 8; Figure 12 This is the spatiotemporal congestion diagram under a CAVs penetration rate of 60% as described in Implementation Method 8; Figure 13 This is the spatiotemporal congestion diagram under a CAVs penetration rate of 80% as described in Implementation Method 8; Figure 14 This is the spatiotemporal congestion diagram under 100% CAVs penetration rate as described in Implementation Method 8; Figure 15 This is a traffic flow lane-changing frequency diagram of the six CAV penetration rates described in Implementation Method 8. Detailed Implementation

[0024] Various embodiments of the present invention will now be clearly and completely described with reference to the accompanying drawings. The embodiments described with reference to the drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0025] Implementation Method 1: This implementation method provides a traffic flow simulation method that balances traffic safety and efficiency. The simulation method includes all vehicles to be simulated in the simulated road segment. The simulation method is as follows: Real-time collection of driving data for each vehicle; The location of the corresponding vehicle is updated based on the currently collected driving data, including: Step S1: Based on the vehicle type and vehicle information, obtain the corresponding lane direction position; Step S2: If the vehicle meets the safety constraints and lane-changing conditions, then the random forest lane-changing prediction model is used. If the lane-changing probability is obtained, proceed to step S21; otherwise, proceed to step S22. Step S21: If the lane-changing probability is greater than the lane-changing threshold, then obtain the target lane based on the vehicle information; update the vehicle's position based on the lane direction position and the target lane to complete the current update; Otherwise, proceed to step S22; Step S22: Update the vehicle's position based on the lane direction position to complete the current update.

[0026] In this embodiment, the traffic flow simulation method is preheated.

[0027] In this embodiment, the security constraint mentioned in step S2 is

[0028] Subscript Indicates the current vehicle , For the current vehicle Vehicle in front distance, For driving speed, For acceleration, The maximum speed of the vehicle. The distance between the target lane and the vehicle in front and the target vehicle. The distance between the target vehicle and the vehicle behind it in the target lane. The speed relative to the vehicle behind. This is the acceleration relative to the following vehicle.

[0029] The traffic flow simulation method described in this embodiment supports mixed traffic of HVs / CAVs / large vehicles, and can quantify the improvement of traffic efficiency, congestion, and lane-changing behavior by CAVs. The complete mixed traffic simulation system can reproduce the phase transition of three-phase traffic flow, which is closer to the synchronous flow, free flow, and congested flow transition of real road networks.

[0030] Furthermore, when driving conditions in the lane a vehicle is in are restricted, while driving conditions in adjacent lanes are better, the vehicle may intend to change lanes. Therefore, step S2 employs a two-tiered lane-changing mechanism combining safety rules and data-driven decision-making. Safety constraints are satisfied first, and then the model makes the decision, balancing safety and realism.

[0031] Implementation Method Two: This implementation method further defines the traffic flow simulation method described in Implementation Method One. In this implementation method, the method for obtaining the corresponding lane direction position based on the vehicle type and vehicle information is to adopt appropriate methods according to the vehicle type: When the vehicle type is a manually driven vehicle (HV): based on the vehicle information, an LSTM acceleration prediction model is used. The vehicle's acceleration is obtained; based on the HV acceleration and the vehicle information, the lane direction position is obtained; When the vehicle type is a connected autonomous driving CAV, the corresponding method shall be adopted according to the vehicle type of the following vehicle: If the vehicle type of the following vehicle is a manually driven vehicle (HV), then based on the vehicle information, the lane direction position is obtained through the CAV cellular automata method. Otherwise, based on the vehicle information, the lane direction position is obtained using the CAV following position method.

[0032] In this embodiment, the lane direction position is updated using a position update rule, which is as follows:

[0033] in, For vehicles exist The lane direction position at that time. For vehicles exist Location at any given moment For vehicles exist The speed at any given moment.

[0034] In this embodiment, the HV acceleration It is used for speed updates, specifically: .

[0035] In this embodiment, before the simulation officially begins, the simulation environment needs to be preheated. During the preheating stage, for the vehicle type being a manually driven vehicle (HV), the lane direction position is obtained based on the vehicle information using the HV cellular automata method.

[0036] The HV cellular automata method includes Gipps safety rules, acceleration rules, deceleration rules, uniform speed rules, random slowing rules, and position update rules. The Gipps security rules are as follows:

[0037] Subscript Indicates the current vehicle , express Time, subscript Indicates the current vehicle The vehicle in front , For a safe distance, For driving speed, For driver reaction time, This is the maximum acceleration.

[0038]

[0039] in, For the current vehicle Vehicle in front distance, Let these be the coordinates of the front of the vehicle. This refers to the vehicle's length.

[0040] The acceleration rule is:

[0041] in, For acceleration, For the current vehicle The maximum speed at which the vehicle is permitted to travel.

[0042] The acceleration rule states that a vehicle will tend to travel at its maximum speed under safe conditions.

[0043] The deceleration rule is as follows:

[0044] in, For deceleration.

[0045] The deceleration rule states that when a vehicle is too close to the vehicle in front, it will decelerate to ensure sufficient safety space.

[0046] The uniform speed rule is as follows: .

[0047] The constant speed rule means that when the distance between a vehicle and the vehicle in front is a safe distance, the vehicle will follow the vehicle in front at a constant speed.

[0048] The random slowing rule is as follows:

[0049] in, This represents the random slowing probability.

[0050] The random slowdown rule is designed to map human driving habits in real-world driving scenarios.

[0051] In this embodiment, when the traffic flow simulation method is preheated, the HV of the manually driven vehicle is preheated using the HV cellular automata method.

[0052] This implementation further defines the traffic flow simulation method. Because CAVs (Car-on Vehicles) have a high degree of interconnectivity when following other CAVs, their performance is superior. However, when following HVs (Hardware Vehicles), this high degree of interconnectivity cannot be established. Therefore, this implementation employs differentiated processing. A hybrid traffic flow simulation method is provided, using LSTM for acceleration prediction, random forest for lane-changing decisions, and cellular automata for vehicle motion updates. This achieves dual data-driven processing of both car-following and lane-changing behaviors, accurately reproducing the characteristics of real traffic flow. Specifically, LSTM captures temporal dependencies, restoring realistic acceleration and deceleration; random forest mines multi-dimensional features, learning the patterns of real lane-changing decisions.

[0053] Implementation Method 3: This implementation method further defines the traffic flow simulation method described in Implementation Method 1. In this implementation method, the method for obtaining the target lane in step S21 is as follows: Step S211: Based on the vehicle information, obtain the lane score for each lane. The lane score The formula is:

[0054] in, This represents the distance of the current vehicle relative to the vehicle in front in the lane. This represents the distance between the current vehicle and the vehicle behind it in the lane. Step S212: Select the lane with the highest lane score as the target lane.

[0055] Implementation Method Four: This implementation method further defines the traffic flow simulation method described in Implementation Method One. In this implementation method, the random forest lane-changing prediction model... for

[0056] in, For lane-changing probability, subscript Indicates the current vehicle subscript Indicates the current vehicle The car in front, For driving speed, For acceleration, For the current vehicle Distance to the car in front, For the current vehicle Distance between the front and rear of the vehicle in front For the current vehicle Relative speed to the vehicle in front, For the collision time, subscript Indicates the left lane, subscript Indicates the right lane, upper corner mark Indicates the current vehicle's position relative to the vehicle in front, indicated by the superscript. This indicates the current vehicle relative to the vehicle behind it.

[0057] In this embodiment, the random forest lane-changing prediction model The evaluation metrics include accuracy, precision, recall, and F1 score.

[0058] In this embodiment, grid search is used to optimize the core hyperparameters, and the optimal parameters are determined by traversing and combining them: number of trees numTrees=500, minimum leaf size MinLeafSize=10, and number of features sampled each time NumVariablesToSample=4. The above fixed optimal values ​​can avoid the problems of underfitting or overfitting due to improper parameters.

[0059] This implementation further defines the traffic flow simulation method and applies it to the random forest lane-change prediction model. As explained, the random forest lane-changing prediction model used in this implementation has the following advantages: First, it adapts to the problem of imbalanced lane-changing samples. Vehicles keeping their lanes have far more samples than changing lanes, making it a typical imbalanced classification task. Random forests, through sample weights and a multi-tree voting mechanism, do not favor the larger number of straight-moving samples and can accurately identify a small number of lane-changing behaviors. This is the core reason why this model was chosen in this paper.

[0060] Second, it is noise-resistant and adaptable to multi-dimensional environmental features. The input includes more than a dozen state variables, including the vehicle itself, the vehicle in front, and vehicles in the left, right, and adjacent lanes, and the data contains trajectory acquisition noise. RF does not require feature standardization, can automatically mine multi-variable interaction relationships, and has strong robustness.

[0061] Third, it offers stable training, strong interpretability, and convenient parameter tuning. Compared to deep learning, RF training is faster, and its generalization ability can be evaluated through out-of-bag (OOB) error. It outputs lane-changing probabilities, and thresholds can be set to distinguish between lane-changing and straight-through, facilitating the embedding of cellular automata lane-changing rules.

[0062] Fourth, the output probability value is adapted to the simulation decision logic. The model outputs the probability of continuous lane changes, which, when combined with a fixed threshold of 0.80, can determine whether to change lanes. This can be directly combined with the CA simulation model to achieve data-driven lane change decision-making.

[0063] The shallow models in the existing technology, such as SVM and logistic regression, lack the ability to mine time-series and multi-feature interaction. They are poor at recognizing imbalanced lane-changing samples, and a small number of lane-changing samples are seriously missed. The PR-AUC drops significantly and cannot reflect the real lane-changing patterns.

[0064] Implementation Method Five: This implementation method further defines the traffic flow simulation method described in Implementation Method Two. In this implementation method, the LSTM acceleration prediction model... for:

[0065] in, For the acceleration of the manually driven vehicle (HV), subscript Indicates the length of the time series. The current speed of the vehicle. This represents the speed of the vehicle ahead. This represents the distance between the current vehicle and the vehicle in front. This represents the relative distance between the current vehicle and the vehicle in front. This represents the time difference between the current vehicle and the vehicle in front. Let be the rate of change of acceleration between the current vehicle and the vehicle in front. This represents the acceleration of the vehicle in front.

[0066] In this embodiment, the LSTM acceleration prediction model Structure such as Figure 1 As shown, the LSTM acceleration prediction model It includes an input layer, a hidden layer, and an output layer, wherein the hidden layer includes a first layer, a second layer, and a full-connectivity layer.

[0067] In this embodiment, the LSTM acceleration prediction model During training, the dataset is divided into a 6:2:2 ratio, and MSE is used as the loss function and optimized using Adam to achieve early stopping and prevent overfitting.

[0068] This embodiment further defines the traffic flow simulation method and explains the LSTM acceleration prediction model. In this embodiment, the LSTM acceleration prediction model can capture the long-term temporal dependence of vehicle driving, fit multivariate nonlinear car-following behavior, and restore the real dynamic driving style. The simulation results closely match the measured traffic flow and can be combined with cellular automata to achieve data-driven traffic simulation. This is because it relies on a gating mechanism to solve the gradient vanishing problem of RNNs, and can utilize historical driving time-series data to compensate for the shortcomings of traditional fixed-rule models in depicting driving behavior. Traditional shallow models have weak fitting capabilities, struggle to capture the complex coupling relationships of multiple driving features, and cannot reproduce the phase transition of three-phase traffic flow, resulting in large deviations between speed fluctuations and real traffic flow.

[0069] Implementation Method Six: This implementation method further defines the traffic flow simulation method described in Implementation Method Two. In this implementation method, the CAV cellular automaton method includes Gipps safety rules, acceleration rules, deceleration rules, constant speed rules, and position update rules.

[0070] This embodiment further defines the traffic flow simulation method and explains the CAV cellular automaton method. The CAV cellular automaton method is used to obtain lane direction and position when connected autonomous vehicles (CAVs) follow human-driven vehicles (HVs). Compared with the traditional cellular automaton method, the CAV cellular automaton method omits the random slowing rule. The random slowing rule itself is proposed to describe the driving habits of human drivers. Omitting the random slowing rule is consistent with the characteristic that CAV vehicles are controlled by intelligent agents.

[0071] Implementation Method Seven: This implementation method further defines the traffic flow simulation method described in Implementation Method Two. In this implementation method, the CAV following position method is... At time t, the current vehicle Distance to the car in front Greater than the safe distance At that time, through

[0072] get Current vehicle driving speed ,in, for Current vehicle driving speed, for The car in front The speed of travel; At time t, the current vehicle Distance to the car in front equal to safe distance At that time, through

[0073] get Current vehicle The driving speed, of which, For the car in front The speed of travel; At time t, the current vehicle Distance to the car in front Less than the safe distance hour, Based on the driving speed, the lane direction position is obtained through the position update rule.

[0074] This embodiment further defines the traffic flow simulation method and describes the CAV following position method. This method is used to obtain the lane direction position when the connected autonomous driving CAV does not follow the manually driven HV, but rather CAVs follow each other. The principle of this method is that when the vehicle is a CAV, compared to a human driver, the CAV controlled by the intelligent agent is superior to the HV in terms of information communication and execution efficiency. When CAVs follow each other, their efficient interconnectivity will form a more efficient CACC following mode. Therefore, in order to fully utilize this characteristic of CAVs, this method means that when the distance between vehicles is too far, the target vehicle will try to catch up with the vehicle in front, and when the distance between CAVs reaches a safe distance, a queue will be formed, and the driving speed and acceleration will be consistent with the vehicle in front. In addition, to prevent the distance from being too close, ( Safety thresholds serve as a safety guarantee.

[0075] Implementation Method Eight: The traffic flow simulation method used in this implementation method is based on the traffic flow simulation method that balances traffic safety and efficiency described in Implementation Method One, combined with the lane direction and position acquisition method optimized in Implementation Method Two, the target lane acquisition method optimized in Implementation Method Three, and the random forest lane change prediction model optimized in Implementation Method Four. Implementation Method 5: Optimized LSTM Acceleration Prediction Model Implementation method six is ​​an optimized CAV cellular automaton method, and implementation method seven is an optimized CAV car-following position method.

[0076] This implementation method utilizes the NGSIM database, which employs multi-camera synchronous high-definition video and the NG-VIDEO self-developed trajectory extraction algorithm, covering all vehicles on the road segment. Its sampling accuracy reaches 10Hz, comprehensively recording the coordinates, speed, acceleration, vehicle length, vehicle type, lane number, following distance of vehicles in front and behind, longitudinal and lateral positions of each vehicle. It accurately identifies vehicle acceleration and deceleration, and details of emergency braking and lane-changing maneuvers. The vehicle data in the 8:05~8:20 data group of the US-101 database represents the transition period of traffic congestion formation, simultaneously exhibiting both free-flow and congested flow states, making it highly suitable for studying vehicle driving characteristics under different road conditions.

[0077] In this implementation, cars with v_Class 2 (i.e., small cars) are selected from the us-101 database. Simultaneously, the preceding vehicle type is restricted, selecting data where the preceding vehicle has no other vehicles or is also a small car. Missing value handling and smoothing are then performed to improve data quality and reduce noise. To ensure a consistent dataset format and meet the needs of subsequent model training, missing value handling is performed first. Since the selected dataset has an extremely low missing value rate (<5%), and to minimize errors caused by missing values, this paper directly uses deletion to handle missing values.

[0078] The LSTM model used in this implementation requires the data to maintain a continuous temporal sequence. Therefore, the continuity of the collected vehicle information frames is filtered. If a breakpoint is encountered, the subsequent data at the breakpoint is labeled as data from another new vehicle. This paper sets the minimum historical time step required for model learning to 20. Therefore, the total number of frames of the selected vehicles is filtered to select vehicles that meet the data scale. After the above processing, a total of 1268 continuous trajectory segments with a time step greater than 20 were selected.

[0079] To address extreme biases in the data that deviate from the overall distribution, this implementation uses the z-score method to process such outliers in v_vel and v_Acc. In an approximately normally distributed dataset, about 99.7% of the data points will fall within the mean ± 3 standard deviations, i.e., 3... Therefore, when the absolute value of a data point's z-score exceeds 3, it is considered to deviate too far from the overall distribution and is thus identified as an outlier. The formula for calculating the z-score is:

[0080] in It is the value of the data point. This represents the overall mean of the variable to which this data point belongs. This represents the overall standard deviation of the variable. This represents the z-score value of the data point. The z-score method was used to examine the vehicle v_vel and v_Acc data. The outlier rate in the v_vel data was 0.14%, less than 0.3%, while no outliers were detected in the v_Acc data. Therefore, the data can be considered to conform to the distribution pattern. To reduce the impact of high-frequency noise on the LSTM model's prediction of the core trend, the vehicle v_vel and v_Acc data were smoothed. The Savitzky-Golay filtering method, with its multinomial fitting, can smooth high-frequency noise while preserving key micro-dynamic features such as velocity abrupt changes and acceleration inflection points.

[0081] This implementation method, through analysis of the simulation data, demonstrates, compared to traditional models, that it can effectively reproduce traffic flow collapse. Traditional rule-driven models are too coarse to effectively describe vehicle driving decisions, but this implementation method, utilizing LSTM and random forest models, can effectively capture the potential relationship between vehicle driving decisions and surrounding information.

[0082] In this embodiment, the LSTM acceleration prediction model The acceleration feature set was used for training, and the training effect was as follows: Figures 2 to 3 As shown, Figure 2 This is a loss curve graph, where the lines represent Training Loss and the dotted curves represent Validation Loss. Figure 3 This is an RMSE curve chart, where the line represents Train RMSE and the dotted curve represents Validation RMSE. According to... Figure 2 and Figure 3 It can be seen that the validation curve and the training curve have a highly consistent trend and the difference between them is very small. They remain stable in the later stage. At the same time, the loss and RMSE are both at a very low level, indicating that the model did not have overfitting or underfitting during the training process and the fitting effect on the data is good.

[0083] Figure 4 To validate the performance test graph, the blue line represents the Actual value, and the red dotted curve represents the Predicted value. Analysis of the comparative curves shows that the model can accurately capture the core temporal patterns (trends, inflection points, extreme values) of car-following behavior while maintaining extremely low prediction error. This further demonstrates the model's good generalization ability.

[0084] In this embodiment, the random forest lane-changing prediction model The training was conducted using a lane-changing decision feature set, and the training results are as follows: Figure 5 and Figure 6 As shown, Figure 5 The graph shows the out-of-bag (OOB) error curve. The blue line represents the OOB error, and the red dotted curve represents the final error (the value after stabilization). The curve shows no continuous fluctuations or divergence, indicating a very robust training process. The OOB error rapidly decreases from 0.26 between the first 0-50 trees, then stabilizes around 50 trees, ultimately settling at a low level of approximately 0.02. At the final 500 trees, the OOB error shows almost no fluctuation, indicating that the model has fully converged. This also demonstrates that the model performs excellently on unseen samples, exhibits no overfitting on the training set, and demonstrates strong generalization ability.

[0085] Figure 6 The confusion matrix diagram shows that the model achieves an accuracy of 0.9925, a precision of 0.9833, a recall of 0.9833, and an F1 score of 0.9833 on the test set, with extremely low numbers of false positives and false negatives. This demonstrates that the model makes correct predictions in the vast majority of cases, performs exceptionally well in identifying minority classes, and exhibits high performance even when dealing with imbalanced classes.

[0086] Based on vehicle trajectory data of road segment US101 in the NGSIM database, the lane-changing decision feature set and the acceleration feature set are obtained, specifically as follows: Continuous trajectory segments were filtered using vehicle trajectory data from the US101 section of the NGSIM database. Linear interpolation is performed on missing values, outliers are removed by 3σ, and SavitzkyGolay filtering is used for smoothing. Construct acceleration feature sets and lane change decision feature sets respectively.

[0087] In this embodiment, 10% large vehicles can be mixed in to simulate the impact of large vehicles at low and high densities on congestion.

[0088] In this embodiment, simulations can be performed under different CAV penetration rates, traffic density, and large vehicle scenarios to output key traffic flow indicators.

[0089] In this embodiment, the parameter settings include a safety distance of 2 units for HVs and a reaction time of 1s; a safety distance of 1 unit for CAVs and a reaction time of 0.1s.

[0090] In this embodiment, the multi-scenario simulation includes different CAVs penetration rates (0%~100%) and different traffic flow densities.

[0091] In this implementation, the output metrics include flow-density, speed-density, congestion coefficient, congestion duration, spatiotemporal congestion map, and lane-changing frequency.

[0092] like Figure 7 The chart shows a comparison of traffic density at six CAV penetration rates. It demonstrates that when traffic density is high, the maximum traffic flow increases with increasing CAV penetration at the same traffic density. When the CAV penetration rate reaches 80%, the maximum traffic flow is approximately 26.4% higher than that of traffic with a penetration rate of 0%. It is also noteworthy that traffic flows with higher CAV penetration rates experience greater traffic density at the point of traffic flow collapse. Traffic flow collapse only occurs when the traffic density reaches 70 veh / km for a CAV penetration rate of 80%, proving that CAV vehicles can effectively improve road utilization efficiency.

[0093] like Figure 8 The chart shows a comparison of six CAV penetration rates and speed densities, demonstrating that under the same traffic density, traffic speed increases with increasing CAV penetration. This is because, compared to vehicles driven by human drivers, CAVs controlled by intelligent agents have significantly better reaction time and execution efficiency. Furthermore, the CACC (Continuous Acceleration and Adaptive Cruise Control) following mode between CAVs is far more efficient than that of following HV (Hardware Vehicles), thus greatly improving traffic stability and speed.

[0094] like Figures 9 to 14 As shown, the spatiotemporal congestion maps correspond to six CAV penetration rates: 0%, 20%, 40%, 60%, 80%, and 100%. Comparing these six maps reveals that as the CAV penetration rate increases, road congestion gradually decreases, and the impact, range, and duration of congestion waves are effectively suppressed. This further demonstrates that CAV vehicles play a significant role in alleviating road congestion and improving road utilization efficiency.

[0095] like Figure 15 The diagram shows the lane-changing frequency for six different CAV penetration rates. It demonstrates that within a traffic density range of 40-90 (veh / km), the lane-changing frequency decreases with increasing CAV penetration. This indicates that as CAV penetration increases, lane-changing behavior gradually decreases, effectively reducing the risk of conflicts between vehicles and thus enhancing road safety and stability.

Claims

1. A traffic flow simulation method that balances traffic safety and efficiency, characterized in that, The simulation method targets all vehicles to be simulated in the simulated road segment; the simulation method is as follows: Real-time collection of driving data for each vehicle; The location of the corresponding vehicle is updated based on the currently collected driving data, including: Step S1: Based on the vehicle type and vehicle information, obtain the corresponding lane direction position; Step S2: If the vehicle meets the safety constraints and lane-changing conditions, then the random forest lane-changing prediction model is used. If the lane-changing probability is obtained, proceed to step S21; otherwise, proceed to step S22. Step S21: If the lane-changing probability is greater than the lane-changing threshold, then obtain the target lane based on the vehicle information; update the vehicle's position based on the lane direction position and the target lane to complete the current update; Otherwise, proceed to step S22; Step S22: Update the vehicle's position based on the lane direction position to complete the current update.

2. The traffic flow simulation method according to claim 1, characterized in that, The method for obtaining the corresponding lane direction position based on the vehicle type and vehicle information is to adopt an appropriate method according to the vehicle type: When the vehicle type is a manually driven vehicle (HV): based on the vehicle information, an LSTM acceleration prediction model is used. The acceleration of the vehicle is obtained. Based on the HV acceleration and the vehicle information, the lane direction position is obtained; When the vehicle type is a connected autonomous driving CAV, the corresponding method shall be adopted according to the vehicle type of the following vehicle: If the vehicle type of the following vehicle is a manually driven vehicle (HV), then based on the vehicle information, the lane direction position is obtained through the CAV cellular automata method. Otherwise, based on the vehicle information, the lane direction position is obtained using the CAV following position method.

3. The traffic flow simulation method according to claim 1, characterized in that, The method for obtaining the target lane in step S21 is as follows: Step S211: Based on the vehicle information, obtain the lane score for each lane. The lane score The formula is: in, This represents the distance of the current vehicle relative to the vehicle in front in the lane. This represents the distance between the current vehicle and the vehicle behind it in the lane. Step S212: Select the lane with the highest lane score as the target lane.

4. The traffic flow simulation method according to claim 1, characterized in that, The random forest lane-changing prediction model for in, For lane-changing probability, subscript Indicates the current vehicle, underlined Indicates the current vehicle The car in front, For driving speed, For acceleration, For the current vehicle Distance to the car in front, For the current vehicle Distance between the front and rear of the vehicle in front For the current vehicle Relative speed to the vehicle in front, For the collision time, subscript Indicates the left lane, subscript Indicates the right lane, upper corner mark Indicates the current vehicle's position relative to the vehicle in front, indicated by the superscript. This indicates the current vehicle relative to the vehicle behind it.

5. The traffic flow simulation method according to claim 2, characterized in that, The LSTM acceleration prediction model for: in, For the acceleration of the manually driven vehicle (HV), subscript Indicates the length of the time series. The current speed of the vehicle. This represents the speed of the vehicle ahead. This represents the distance between the current vehicle and the vehicle in front. This represents the relative distance between the current vehicle and the vehicle in front. This represents the time difference between the current vehicle and the vehicle in front. Let be the rate of change of acceleration between the current vehicle and the vehicle in front. This represents the acceleration of the vehicle in front.

6. The traffic flow simulation method according to claim 2, characterized in that, The CAV cellular automaton method includes Gipps safety rules, acceleration rules, deceleration rules, constant speed rules, and position update rules.

7. The traffic flow simulation method according to claim 2, characterized in that, The CAV following position method is as follows: At time t, the current vehicle Distance to the car in front Greater than the safe distance At that time, through get Current vehicle driving speed ,in, for Current vehicle driving speed, for The car in front The speed of travel; At time t, the current vehicle Distance to the car in front equal to safe distance At that time, through get Current vehicle The driving speed, of which, For the car in front The speed of travel; At time t, the current vehicle Distance to the car in front Less than the safe distance hour, Based on the driving speed, the lane direction position is obtained through the position update rule.

8. A traffic flow simulation system that balances traffic safety and efficiency, characterized in that, The simulation system targets all vehicles within the simulated road segment; the simulation system includes the following modules: The data acquisition module is used to collect driving data for each vehicle in real time. The location update module is used to update the location of the corresponding vehicle based on the currently collected driving data, and includes the following units: Unit 1 is used to obtain the corresponding lane direction position based on the vehicle type and vehicle information of the vehicle; Unit 2 is used to predict lane changes using a random forest lane-changing model if the vehicle meets safety constraints and lane-changing conditions. Obtain the lane-changing probability and execute subunit one; Otherwise, execute subunit two; Subunit 1 is used to obtain the target lane based on the vehicle information if the lane-changing probability is greater than the lane-changing threshold. Based on the lane direction position and the target lane, the vehicle's position is updated to complete the current update; Otherwise, execute subunit two; Subunit two is used to update the vehicle's position based on the lane direction position to complete the current update.

9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a computer program stored in memory, implements the method of any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1-7.

Citation Information

Patent Citations

  • CAV and HV mixed traffic flow control method and system and storage medium

    CN120748253A