A Simulation Method for Heterogeneous Traffic Flow with Mixed Passenger and Freight Vehicles Considering Road Constraints
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
第一,换道模型多采用固定阈值规则,未通过真实数据挖掘车辆换道意图与自身状态、周围车辆状态、车道属性之间的潜在关联,换道行为失真;
Smart Images

Figure CN122551575A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traffic flow simulation, and more specifically to the field of intelligent transportation. Background Technology
[0002] With the rapid development of connected autonomous vehicles (CAVs), the future road network will long be characterized by a heterogeneous traffic state where manually driven vehicles, CAVs, and large trucks coexist. Existing traffic flow simulation and characteristic analysis methods have the following shortcomings: First, lane-changing models often use fixed threshold rules and fail to mine the potential correlation between a vehicle's lane-changing intention and its own state, the state of surrounding vehicles, and lane attributes through real data, resulting in distorted lane-changing behavior. Second, most models only focus on the mixed traffic of HV and CAV, ignoring the key impact of large trucks on traffic flow stability, congestion propagation and traffic efficiency. Third, the simulation did not distinguish the different effects of different lane speed limit attributes on traffic flow distribution, lane changing preferences, and congestion evolution, and the simulation scenario did not match the actual road network.
[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-changing decisions, thereby resulting in more CACC following modes on the road, which further improves the efficiency of road traffic flow. At the same time, due to the high interconnectivity of CAV vehicles, road safety is also further improved, and the mutual interference between CAV and HAV vehicles is reduced. However, this solution does not take into account the different reactions of different types of vehicles to different lane attributes during lane changing, nor does it consider the special circumstances of large trucks compared to other types of vehicles in actual road conditions, such as the impact of acceleration performance, maneuverability, and potential driving style on traffic flow.
[0004] In summary, existing simulation technologies for heterogeneous traffic flow suffer from problems such as neglecting lane attributes and the impact of large trucks on lane changing, as well as distortion of lane changing behavior. Summary of the Invention
[0005] This invention alleviates the problems of existing heterogeneous traffic flow simulation techniques, such as neglecting lane attributes and the impact of large trucks on lane changing, as well as the distortion of lane changing behavior. This invention provides the following solution: A simulation method for heterogeneous traffic flow involving mixed passenger and freight traffic, considering road constraints, comprising the following steps: Real-time acquisition of lane information and vehicle information for several vehicles; processing of each acquisition result as follows to achieve simulation of heterogeneous traffic flow: Step S1: For each vehicle, perform steps S11 to S12 to obtain its vehicle status, which includes lane change information and vehicle position status. Step S11: Based on the lane information and vehicle information, obtain the corresponding lane change information through a random forest lane change model while meeting safety constraints; Step S12: Based on the vehicle information, update the vehicle's location status to obtain the vehicle's location status; Step S2: Combine the vehicle states of the plurality of vehicles into a lane-specific traffic flow spatiotemporal evolution diagram, and update the current lane-specific traffic flow spatiotemporal evolution diagram.
[0006] Furthermore, in one embodiment of the present invention, the vehicle position status update includes the vehicle position status update of a manually driven vehicle (HV / TRK) and the vehicle position status update of a connected autonomous vehicle (CAV). The vehicle position status update of the manually driven vehicle HV / TRK includes the manually driven vehicle following mode; The vehicle position status update of the connected autonomous vehicle (CAV) includes CACC following mode and ACC mode. The manual driving vehicle following mode includes acceleration rules, deceleration rules, and random slowdown rules.
[0007] Furthermore, in one embodiment of the present invention, the lane information includes the number of lanes and the lane speed limit.
[0008] Furthermore, in one embodiment of the present invention, under the acceleration rule, the vehicle The velocity at the next moment is:
[0009] in, Indicates the current moment. This indicates the vehicle serial number, representing the current vehicle. Indicates the vehicle The car in front, For a moment vehicle The speed of the car, For vehicles The acceleration of the vehicle. For vehicles Maximum speed, For vehicles Starting acceleration, For a moment The status of the brake lights of the car in front. For the headway, For vehicles With the car in front The impact value.
[0010] Furthermore, in one embodiment of the present invention, under the deceleration rule, the vehicle The velocity at the next moment is:
[0011] in, For vehicles Effective distance considering the speed of the vehicle in front.
[0012] Furthermore, in one embodiment of the present invention, the random slowing rule refers to when random numbers... Less than the random slowing probability At that time, the vehicle The velocity at the next moment is:
[0013] Otherwise, the vehicle The speed remains constant; The random slowdown probability for:
[0014] in, For vehicle parking time, The threshold for vehicle parking time. The probability of random slowing down due to the influence of the preceding vehicle. To stop the random slowing of probabilities, For the probability of random slowdown during driving, .
[0015] Furthermore, in one embodiment of the present invention, in the CACC following mode, the vehicle The velocity at the next moment is:
[0016] in, For vehicles acceleration, subscript Indicates vehicle For connected autonomous vehicles (CAVs), The distance between vehicles. To maintain a safe distance between vehicles.
[0017] Furthermore, in one embodiment of the present invention, the method for constructing the random forest lane-changing model includes the following stages: Data acquisition phase: Acquire the training set, which includes input features and output features; The input features include vehicle type, speed, acceleration, headway, headway, speed of the vehicle in front, acceleration of the vehicle in front, relative speed, collision time, and distance and speed of vehicles in the left and right lanes. The output features include no lane change, left lane change, and right lane change; Training phase: The training set is sampled to obtain a sample set; the random forest model is trained based on the sample set to obtain the random forest lane-changing model.
[0018] Furthermore, in one embodiment of the present invention, the sampling during the training phase involves full sampling of lane-changing samples in the training set and downsampling of non-lane-changing samples.
[0019] The present invention provides a simulation method for heterogeneous traffic flow involving mixed passenger and freight traffic that considers road constraints. This method is a safety-efficiency collaborative control simulation method for heterogeneous traffic flow that considers lane-changing tendency and road attributes. It effectively alleviates the problems of existing heterogeneous traffic flow simulation techniques that neglect lane attributes and the impact of large trucks on lane changing, as well as the distortion of lane-changing behavior. Specific beneficial effects include: 1. The passenger-freight mixed heterogeneous traffic flow simulation method described in this invention relates to the fields of intelligent transportation, heterogeneous traffic flow simulation, machine learning and cellular automata fusion technology. It is a high-precision simulation framework that integrates data-driven lane-changing models, lane attribute classification, multi-vehicle mixed traffic, and CAV collaborative control. Through random forest lane-changing intention mining, lane attribute constraints, and multi-vehicle collaborative evolution, it can accurately reproduce traffic flow characteristics and congestion patterns under different penetration rates, densities, and lanes.
[0020] 2. The mixed passenger and freight heterogeneous traffic flow simulation method described in this invention has been improved for large trucks. By using vehicle type as the core feature of the RF lane-changing model, it learns the conservative lane-changing preference of trucks; lane changing is linked to vehicle type dynamic parameters, preserving the driving characteristics of trucks throughout the process; differentiated evolution rules are designed according to traffic density to reproduce the dual characteristics of trucks: "stable flow at low density, congestion at high density". In addition, the method optimizes the manual vehicle following judgment logic, designs a CAV dual-mode following mechanism, a two-stage lane-changing architecture, and optimizes RF imbalance data, comprehensively improving the accuracy and realism of mixed traffic flow simulation.
[0021] The method described in this invention enables data-driven lane-changing behavior, precise traffic flow evolution rules, and quantifiable multi-factor influence. It is applicable to intelligent road network planning, autonomous driving control, and traffic engineering design. Attached Figure Description
[0022] 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 This is the verification set error curve diagram described in Implementation Method 10; Figure 2 It is the bag external error curve diagram described in Implementation Method 10; Figure 3 It is the confusion matrix diagram described in Implementation Method 10; Figure 4 This is the flow density curve of the three lanes when the CAV penetration rate is 0, as described in Implementation Method 10. Figure 5 This is the speed-density curve of the three lanes when the CAV penetration rate is 0, as described in Implementation Method 10. Figure 6 This is the spatiotemporal diagram of the three lanes when the traffic flow density is 25veh / km, as described in Implementation Method 10. Figure 7 This is the spatiotemporal diagram of the three lanes when the traffic flow density is 35veh / km, as described in Implementation Method 10; Figure 8 This is the spatiotemporal diagram of the three lanes when the traffic flow density is 45veh / km, as described in Implementation Method 10. Figure 9 This is a flow density curve diagram of lane 1 with different CAV penetration rates as described in Implementation Method 10; Figure 10 This is a flow density curve diagram of lane 2 under different CAV penetration rates as described in Implementation Method 10; Figure 11 This is a flow density curve diagram of lane 3 under different CAV penetration rates as described in Implementation Method 10; Figure 12 This is a flow density curve diagram for all lanes under different CAV penetration rates as described in Implementation Method 10; Figure 13 This is a velocity-density curve diagram of lane 1 with different CAV penetration rates as described in Implementation Method 10; Figure 14 This is a velocity-density curve diagram of lane 2 with different CAV penetration rates as described in Implementation Method 10; Figure 15 This is a velocity-density curve diagram of lane 3 under different CAV penetration rates as described in Implementation Method 10; Figure 16 This is a velocity-density curve diagram for all lanes with different CAV penetration rates as described in Implementation Method 10; Figure 17 This is a spatiotemporal diagram of lane 1 as described in Implementation Method 10 under three CAV permeability levels; Figure 18 This is a spatiotemporal diagram of lane 2 as described in Implementation Method 10 under three CAV permeability levels; Figure 19 This is a spatiotemporal diagram of lane 3 as described in Implementation Method 10 under three CAV permeability levels; Figure 20 This is a road congestion coefficient diagram with a CAV penetration rate of 0%, as described in Implementation Method 10. Figure 21 This is a road congestion coefficient diagram with a CAV penetration rate of 20%, as described in Implementation Method 10. Figure 22 This is a road congestion coefficient diagram under a CAV penetration rate of 60%, as described in Implementation Method 10. Detailed Implementation
[0023] 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.
[0024] Implementation Method 1: This implementation method provides a simulation method for heterogeneous traffic flow involving mixed passenger and freight traffic, considering road constraints. The simulation method includes the following steps: Real-time acquisition of lane information and vehicle information for several vehicles; processing of each acquisition result as follows to achieve simulation of heterogeneous traffic flow: Step S1: For each vehicle, perform steps S11 to S12 to obtain its vehicle status, which includes lane change information and vehicle position status. Step S11: Based on the lane information and vehicle information, obtain the corresponding lane change information through a random forest lane change model while meeting safety constraints; Step S12: Based on the vehicle information, update the vehicle's location status to obtain the vehicle's location status; Step S2: Combine the vehicle states of the plurality of vehicles into a lane-specific traffic flow spatiotemporal evolution diagram, and update the current lane-specific traffic flow spatiotemporal evolution diagram.
[0025] In this embodiment, the vehicle information includes vehicle type; the vehicle type includes manually driven vehicles (HV / TRK) and connected autonomous vehicles (CAV), and the manually driven vehicles include automobiles (HV) and large trucks (TRK).
[0026] In this embodiment, the heterogeneous traffic flow simulation method is preheated beforehand. The preheating adopts traditional lane-changing rules, and lane changing can be performed as long as the safe distance and driving requirements are met.
[0027] In this embodiment, the security constraint is
[0028] in, Let n be the distance between vehicle n and the vehicle ahead in the target lane. Let n be the distance between vehicle n and the vehicle behind in the target lane.
[0029] The traditional lane-changing rule can be understood as follows: when the driving conditions in the current lane are poor, while other lanes meet the needs of vehicles to travel at higher speeds, vehicles will request to change lanes.
[0030] In this embodiment, the variables in the heterogeneous traffic flow simulation method include CAV penetration rate (0%~100%), the proportion of large trucks (0%~20%), and traffic density.
[0031] The output of the heterogeneous traffic flow simulation method also includes flow-density, speed-density basic graphs, lane-specific traffic flow spatiotemporal evolution graphs, congestion coefficient, congestion duration, congestion spread, traffic efficiency, traffic flow stability, and lane-changing frequency.
[0032] Furthermore, this method can quantify lane-specific traffic flow characteristics, the effect of CAV penetration improvement, and the positive and negative impacts of large trucks at different densities, accurately outputting indicators such as traffic flow, speed, congestion coefficient, and spatiotemporal evolution. The congestion coefficient pass
[0033] Obtain, among which, For trains that are experiencing congestion, This represents the total number of vehicles on the road.
[0034] The heterogeneous traffic flow simulation method described in this embodiment is a traffic flow characteristic analysis and simulation method that integrates random forest lane-changing decision-making, distinguishes lane speed limit attributes, and supports mixed traffic of multiple vehicle types, as detailed below: This implementation method is a data-driven lane-changing decision-making method. It is based on random forest to mine potential lane-changing patterns, overcomes the distortion problem of fixed rules, and has strong generalization ability and high prediction accuracy after optimization of unbalanced lane-changing samples.
[0035] This implementation performs lane-specific attribute-based differential simulation, updating vehicle states in parallel according to lane speed limits, vehicle type restrictions, and car-following and lane-changing rules. Lane attributes (speed limits, vehicle type restrictions) are set as top-level hard constraints, while car-following and lane-changing behaviors of vehicle types (HV / TRK / CAV) are the bottom-level behavioral rules. The superposition of these two layers of rules achieves differentiation and attribute layering. Multiple lanes simultaneously complete car-following state updates and lane-changing decision execution within the same simulation step, eliminating sequential execution and achieving parallel computation. Lane-changing behavior is not only predicted by the RF model but also blocked by lane and vehicle type restrictions. After a vehicle changes lanes, it automatically adapts to all the operating rules of the new lane, ensuring lane attributes are effective throughout the simulation and achieving rule linkage. A CA cellular automata is used to carry out lane-specific and vehicle-type-specific vehicle state iterations, while the RF model refines the lane-changing behavior under each lane. The combination of these two methods completes the entire differential simulation. This further distinguishes between speed limits and no-entry rules for fast, medium, and slow lanes, restoring the real-world lane traffic flow distribution and stability differences.
[0036] This implementation supports a complete multi-vehicle mixed driving system. Through pre-configuration, initial vehicle deployment, parallel iteration at each time step, and continuous evolution, it achieves multi-vehicle mixed driving simulation.
[0037] The pre-configuration includes defining the speed limit for the three lanes, vehicle type restrictions, and setting the mixed traffic ratio of HV / TRK / CAV and vehicle parameters; The initial vehicle deployment includes deploying vehicle models proportionally, strictly adhering to lane restriction requirements, and generating an initial traffic flow; The time-step parallel iteration includes: Step 1: Implement car-following rules according to vehicle type, calculate vehicle speed / position, and enforce speed limits for lanes; Step 2: Call the lane-changing model (traditional rules / RF model) to generate lane-changing intentions, and intercept illegal lane changes in conjunction with lane prohibition rules; Step 3: Execute the lane change, and automatically adapt to the new lane speed limit and traffic rules after the vehicle switches lanes; The continuous evolution includes: iterative looping, outputting traffic flow, vehicle speed, and spatiotemporal distribution data for each lane, ultimately restoring the real differences in lane speed, traffic flow, and stability, while fully supporting large-scale mixed-traffic simulation of three types of vehicle types.
[0038] This further supports the mixed traffic of human-driven vehicles (HV), connected autonomous vehicles (CAV), and large trucks (TRK), and can be used to quantify the positive and negative impacts of CAV penetration rate and truck proportion at different densities.
[0039] Implementation Method 2: This implementation method further defines the heterogeneous traffic flow simulation method for mixed passenger and freight traffic that considers road constraints as described in Implementation Method 1. In this implementation method, the vehicle position status update includes the vehicle position status update of manually driven vehicles (HV / TRK) and the vehicle position status update of connected autonomous vehicles (CAV). The vehicle position status update of the manually driven vehicle HV / TRK includes the manually driven vehicle following mode; The vehicle position status update of the connected autonomous vehicle (CAV) includes CACC following mode and ACC mode. The manual driving vehicle following mode includes acceleration rules, deceleration rules, and random slowdown rules.
[0040] In this embodiment, the CACC following mode represents CAV following CAV, where vehicles are interconnected, there is no random slowdown, and precise coordination; vehicle n can obtain the exact speed of the vehicle in front at the next moment. Compared with human-driven vehicles, CAV vehicles can achieve efficient information interconnection, and CAV vehicles do not exhibit the random slowdown phenomenon seen in human-driven vehicles.
[0041] The ACC mode refers to CAV following HV / TRK, recognizing the braking signal of the vehicle ahead and following it safely. When a CAV follows a conventional vehicle, due to the lack of information interconnection between them, the following mode will switch to ACC following mode. The CAV will then, like a conventional vehicle, determine whether the vehicle ahead is decelerating by recognizing the brake light signal. Therefore, in ACC mode, the CAV follows the acceleration, deceleration, and position update rules of conventional vehicles during following. The brake light mode switching of the CAV during driving is consistent with that of conventional vehicles.
[0042] In this embodiment, the vehicle location status is updated to .
[0043] This embodiment further defines the simulation method and explains the vehicle state update. This embodiment divides the connected autonomous vehicle (CAV) into CACC car-following mode and manual driving vehicle car-following mode, namely CACC / ACC mode. The manual driving vehicle (HV / TRK) is distinguished between random slowing and acceleration, and the phase transitions of synchronous flow, free flow, and congested flow are reproduced.
[0044] Implementation Method 3: This implementation method further defines the heterogeneous traffic flow simulation method for mixed passenger and freight traffic that considers road constraints as described in Implementation Method 1. In this implementation method, the lane information includes the number of lanes and the lane speed limit.
[0045] In this embodiment, the number of lanes is 3, including a left lane, a middle lane, and a right lane; The left lane is a fast lane with a maximum speed limit of 33 m / s, and large trucks are prohibited from using it. The middle lane is a medium-speed lane with a maximum speed limit of 30 m / s; The right lane is a slow lane with a maximum speed limit of 25 m / s.
[0046] In this implementation, multi-layered differentiated processing is applied to the three lanes: left fast, middle, and right slow. Setting speed limits for different lanes and clearly prohibiting large trucks from entering the left lane, through The formula uniformly constrains the final speed of all vehicles. Regarding the car-following rules, the acceleration formula remains unchanged, only differentiating acceleration and random deceleration probabilities based on vehicle type (trucks have lower acceleration and random deceleration probabilities than small cars, and autonomous vehicles have no random deceleration). The deceleration formula and safety distance parameters are completely unified across all lanes and vehicle types. Lanes only indirectly affect vehicle operation through speed limits. Lane changing is divided into two modes: a traditional rule in the warm-up phase and a random forest model in the formal phase. In the warm-up phase, the tendency for vehicles to change lanes into the fast lane is formed based on lane speed limits, and the behavior of trucks changing lanes to the left is strictly blocked. The forest model uses vehicle type and the operating status of adjacent vehicles in each lane as core input features to fully learn the lane-changing preferences of different lanes, large trucks and other vehicle types. At the same time, after the model outputs a decision, it performs lane prohibition verification again to prevent trucks from entering the fast lane. In addition, the model also conducts differential analysis based on traffic flow density, which reproduces the differentiation characteristics of traffic flow and stability in different lanes, as well as the different impacts of large trucks on traffic flow in high and low density traffic. Overall, through a combination of top-level lane constraints, bottom-level vehicle parameters and data-driven lane-changing decisions, it fully realizes differentiated simulation of three lanes and mixed traffic of multiple vehicle types.
[0047] Implementation Method Four: This implementation method further defines the heterogeneous traffic flow simulation method for mixed passenger and freight traffic that considers road constraints described in Implementation Method Two. In this implementation method, under the acceleration rule, vehicles... The velocity at the next moment is:
[0048] in, Indicates the current moment. This indicates the vehicle serial number, representing the current vehicle. Indicates the vehicle The car in front, For a moment vehicle The speed of the car, For vehicles The acceleration of the vehicle. For vehicles Maximum speed, For vehicles Starting acceleration, For a moment The status of the brake lights of the car in front. For the headway, For vehicles With the car in front The impact value.
[0049] In this embodiment, the vehicle With the car in front The influence value is: when the headway is greater than this value, it indicates that the influence between vehicles can be ignored, but when it is less than this value, the influence between vehicles cannot be ignored.
[0050] In this embodiment, the brake light status pass
[0051] The indicator shows that 1 means the vehicle in front is braking and slowing down, while 0 means the vehicle in front is not braking.
[0052] In this embodiment, the headway This indicates the time distance to the front of the vehicle in front. pass
[0053] Obtain, among which, For vehicles Distance to the vehicle in front.
[0054] In this embodiment, the vehicle acceleration pass
[0055] Obtain, among which, For manually driven vehicles, including cars (HV), the vehicle acceleration. This refers to the vehicle acceleration of the TRK large truck.
[0056] In this embodiment, the vehicle's starting acceleration pass
[0057] Obtain, among which, For manually driven vehicles, including automobiles (HV), the vehicle's starting acceleration; This refers to the starting acceleration of the TRK large truck.
[0058] In this embodiment, the maximum speed of the vehicle pass
[0059] Obtain, among which, The maximum speed limit for the corresponding lane. This is the vehicle's maximum speed.
[0060] This implementation further defines the simulation method and explains the acceleration rules. The method is designed based on the premise that vehicles will travel at their maximum speed whenever possible under favorable conditions. The formula employs a dual-layer coupling constraint approach of lane speed limits and the vehicle's inherent maximum speed. Differential assignments are made based on the different speed limits of the three lanes and the inherent speed differences between passenger and freight vehicles: dedicated speed limits are set for the left, middle, and right lanes; the inherent maximum speed for small cars and autonomous vehicles is 33 m / s, and for large trucks it is 25 m / s; the actual maximum speed of the vehicle is the minimum of these two values. Simultaneously, a control rule prohibiting trucks from the left lane ensures that even if a truck enters a high-speed-limit lane, its performance limitations prevent it from accelerating. Compared to traditional single speed limit models, this design decouples road control rules from vehicle dynamics attributes. After a vehicle changes lanes, the speed limit can be adaptively updated to achieve a smooth transition. It can also work with lane restriction rules to achieve implicit vehicle type diversion. After application, it not only accurately reproduces the speed gradient of left-fast, middle-level, and right-slow in the three lanes, as well as the speed difference between passenger and freight vehicles in the same lane, avoiding the problem of unreasonable simulated speed of freight vehicles, but also further amplifies the differentiation effect of traffic flow stability and operation characteristics in each lane. Moreover, as a pre-constraint, it is deeply linked with rules such as acceleration, lane changing, and random forest lane changing models, comprehensively improving the realism and rationality of multi-vehicle heterogeneous traffic flow simulation.
[0061] Implementation Method 5: This implementation method further defines the heterogeneous traffic flow simulation method for mixed passenger and freight traffic considering road constraints described in Implementation Method 2. In this implementation method, under the deceleration rule, vehicles... The velocity at the next moment is:
[0062] in, For vehicles Effective distance considering the speed of the vehicle in front.
[0063] In this embodiment, the It represents the distance per unit of time.
[0064] In this embodiment, the vehicle Effective distance considering the speed of the vehicle in front pass
[0065] get, For vehicles to the vehicle in front +1 Estimated speed for the next moment This refers to the safe distance between vehicles.
[0066] The estimated speed pass
[0067] Obtain, among which, This is the distance between the vehicle in front and the vehicle in front of it relative to the vehicle in front.
[0068] This implementation further defines the simulation method and explains the deceleration rules. If the vehicle speed exceeds the safe range considering the speed of the vehicle in front, the vehicle will decelerate.
[0069] Implementation Method Six: This implementation method further defines the heterogeneous traffic flow simulation method for mixed passenger and freight traffic considering road constraints described in Implementation Method Two. In this implementation method, the random slowdown rule refers to the rule that when random numbers... Less than the random slowing probability At that time, the vehicle The velocity at the next moment is:
[0070] Otherwise, the vehicle The speed remains constant; The random slowdown probability for:
[0071] in, For vehicle parking time, The threshold for vehicle parking time. The probability of random slowing down due to the influence of the preceding vehicle. To stop the random slowing of probabilities, For the probability of random slowdown during driving, .
[0072] In this embodiment, the probability of random slowdown due to the influence of the preceding vehicle is described. This represents the random slowdown probability of vehicle n when it is too close to the vehicle in front and the vehicle in front brakes to slow down. The probability of stopping random slowing This represents the random probability of a vehicle slowing down after it has been stationary for a period of time, thus simulating the slow start phenomenon of a vehicle. The probability of random slowdown in driving This refers to the random slowing down of a vehicle during its journey.
[0073] In this embodiment, when the vehicle When the vehicle is an HV vehicle, the random slowing probability For HV vehicles, the probability of random slowdown is given. When the vehicle When it is a TRK vehicle, the random slowing probability For TRK vehicles, the probability of random slowdown is given. , .
[0074] In this embodiment, the vehicle parking time pass
[0075] get.
[0076] In this embodiment, the vehicle parking time threshold The threshold for determining whether the parking time is too long is preferably 10 seconds.
[0077] This implementation further defines the simulation method and explains the random slowdown rule, which reflects the deterioration of driver alertness when the vehicle stops for more than a certain period of time.
[0078] Implementation Method Seven: This implementation method further defines the heterogeneous traffic flow simulation method for mixed passenger and freight traffic that considers road constraints described in Implementation Method Two. In this implementation method, under the CACC car-following mode, vehicles... The velocity at the next moment is:
[0079] in, For vehicles acceleration, subscript Indicates vehicle For connected autonomous vehicles (CAVs), For vehicles Distance to the car in front, This refers to the safe distance between vehicles.
[0080] Implementation Method Eight: This implementation method further defines the simulation method for heterogeneous traffic flow with mixed passenger and freight traffic considering road constraints described in Implementation Method One. In this implementation method, the construction method of the random forest lane-changing model includes the following stages: Data acquisition phase: Acquire the training set, which includes input features and output features; The input features include vehicle type, speed, acceleration, headway, headway, speed of the vehicle in front, acceleration of the vehicle in front, relative speed, collision time, and distance and speed of vehicles in the left and right lanes. The output features include no lane change, left lane change, and right lane change; Training phase: The training set is sampled to obtain a sample set; the random forest model is trained based on the sample set to obtain the random forest lane-changing model.
[0081] In this embodiment, the random forest lane-changing model Represented as
[0082] in, To inform the next lane-changing decision for vehicles. According to vehicle type, The headway between the target vehicle and the vehicle in front. The relative speed between the target vehicle and the vehicle in front. For the collision time, subscript Indicates the left lane, underlined Indicates the right lane, upper corner mark Indicates relative to the vehicle in front, superscript mark Indicates relative to the following vehicle, For distance, This refers to the driving speed.
[0083] In this embodiment, during the training phase, grid search is used to optimize the random forest parameters.
[0084] In this embodiment, the performance of the random forest lane-changing model is evaluated using accuracy, precision, recall, F1 score, confusion matrix, validation set error, and out-of-bag error.
[0085] In this embodiment, category weights are set for the categories obtained based on lane change prediction results, thereby improving lane change recall.
[0086] In this implementation, a data class imbalance problem exists when building the model. This implementation addresses the class imbalance problem in traffic flow data by combining measures from three levels: data sampling, model weighting, and model selection. Specifically, it solves the problem that the number of non-lane-changing samples in traffic flow data is far greater than the number of lane-changing samples, while the proportion of truck lane-changing samples is extremely low. Manual balanced sampling: Based on the original data of the NGIM database, all lane-changing behavior samples are retained, and then 3,500 samples are randomly selected from the large number of non-lane-changing samples. Finally, 4,256 total samples are obtained, which reduces the difference in the number of samples between the two types from the data source level.
[0087] Set category cost weights: Add a weight matrix to the random forest model to increase the penalty coefficient for missed lane change behavior (set the cost of "actually changing lanes but predicting not to change lanes" to 3, and the cost of reverse misjudgment to 1), forcing the model to pay attention to the less common lane change samples and avoid the model being biased towards the majority class.
[0088] Leveraging the inherent characteristics of random forests: Random forests are chosen instead of support vector machines or other models that are susceptible to imbalanced data. By utilizing the collective voting mechanism of multiple independent decision trees, the dominant role of the majority class samples in the prediction results is weakened.
[0089] Multi-dimensional performance verification: The model performance is comprehensively evaluated by using validation set error, out-of-bag error, confusion matrix, precision, recall, and F1 score to ensure the recognition accuracy of lane changing, especially for niche lane changing behaviors such as trucks, and to verify the effectiveness of the imbalance problem.
[0090] This implementation further defines the random forest lane-changing model and explains its construction. Based on the random forest model, this implementation predicts lane-changing intentions and makes targeted improvements in six key areas: input feature selection, output label setting, imbalanced data optimization, model weight configuration, model-traffic rule linkage, and vehicle / lane attribute adaptation. It also differs from traditional lane-changing judgment logic, as detailed below: Input feature optimization: Breaking through the limitations of traditional models that rely solely on single vehicle spacing, a multi-dimensional feature set is constructed. In addition to incorporating vehicle state parameters such as vehicle type, vehicle speed, acceleration, headway, and collision time, it also adds adjacent lane operation data such as the speed, acceleration, and relative speed of the vehicle in front, as well as the distance and speed of vehicles in the left and right adjacent lanes. This fully covers the operation information of the vehicle itself, surrounding vehicles, and different lanes. At the same time, vehicle type is used as a core feature to specifically capture the differentiated lane-changing behavior preferences of large trucks, small cars, and autonomous vehicles, adapting to three-lane and multi-vehicle mixed traffic scenarios.
[0091] Output label standardization: Based on actual driving behavior, three types of discrete output labels are defined, corresponding to keeping the original lane, changing lanes to the left, and changing lanes to the right, respectively. The classification logic fits the three-lane traffic scenario on highways, and the output results can be directly connected to the lane change execution stage of subsequent simulations.
[0092] Improving the handling of imbalanced data: To address the issue that there are far more non-lane-changing samples than lane-changing samples in real traffic flow, and that the proportion of truck lane-changing samples is extremely low, we manually screen the balanced dataset, extract a sufficient number of non-lane-changing samples, and retain all lane-changing samples to prevent minority class samples from being ignored by the model.
[0093] Model loss weight configuration: Add class cost weights to random forests to increase the penalty coefficient for missed lane-changing behavior, prioritize the recognition accuracy of lane-changing intentions (especially lane-changing behavior with few trucks), and solve the defect of traditional machine learning models that are biased towards the majority class.
[0094] Model parameter optimization: The grid search algorithm is used to traverse the core parameters such as the number of decision trees, the minimum number of leaf nodes, and the number of feature samples to determine the optimal model combination. The training is verified by combining the validation set error and the out-of-bag error to ensure the model's generalization ability and prevent overfitting.
[0095] Improved by linking prediction results with traffic rules: After the model outputs lane-changing decisions, it overlays hard rules such as lane speed limits and prohibition of large trucks from entering the left lane for secondary verification, automatically blocking illegal requests from trucks to change lanes to the left, so that the data-driven prediction results are combined with real-world lane control and vehicle type restrictions; at the same time, the prediction results are seamlessly integrated with the cellular automata simulation framework, and after lane changing, the vehicle automatically adapts to the target lane speed limit and driving rules, realizing a closed loop of lane-changing prediction, behavior execution and lane attribute constraints, which greatly improves the realism of lane-changing behavior simulation in mixed traffic flow.
[0096] Implementation Method Nine: This implementation method further defines the heterogeneous traffic flow simulation method for mixed passenger and freight traffic considering road constraints described in Implementation Method Eight. In this implementation method, the sampling is to perform full sampling of lane-changing samples in the training set and downsampling of non-lane-changing samples.
[0097] This embodiment further defines the training phase and explains the sampling method to handle class imbalance. If full sampling of all lane-changing samples in the training set is not performed, and downsampling of non-lane-changing samples is instead performed, the following drawbacks will occur: First, the model tends to favor the majority class: in traffic flow data, staying in the same lane (not changing lanes) is the majority of the samples, while lane-changing samples are the minority. When the data is imbalanced, the model tends to directly predict "not changing lanes," significantly reducing its ability to recognize lane-changing intentions, especially since rare samples such as truck lane changes are easily overlooked.
[0098] Second, the indicators are inflated and the evaluation is distorted: the overall accuracy rate seems very high, but this is only because the model guessed the majority class with the largest number of cases correctly; key indicators such as recall rate and F1 score will be seriously low, which cannot truly reflect the model's ability to predict lane-changing behavior and make it difficult to judge the actual effect of the model.
[0099] Third, the simulation behavior is seriously distorted: Since the model output results of this implementation method are directly connected to traffic simulation, if the lane change intention recognition fails, the frequency, timing and behavior of vehicle lane changes in the simulation will deviate from the real road conditions, and the characteristics of mixed passenger and freight traffic and lane separation will not be accurately reproduced. The conclusions of subsequent traffic flow efficiency, stability and congestion analysis will also lose their reliability.
[0100] Fourth, insufficient learning of niche behavioral characteristics: The number of lane-changing samples of large trucks is already smaller, and it is further diluted on the basis of the overall imbalanced data. The model cannot effectively learn the conservative and cautious lane-changing preferences of trucks, and ultimately the simulation of lane-changing behavior of passenger and freight vehicles completely fails.
[0101] Implementation Method 10: The simulation method for heterogeneous passenger and freight traffic flow considering road constraints adopted in this implementation method is based on the simulation method for heterogeneous passenger and freight traffic flow considering road constraints described in Implementation Method 1, combined with the simulation methods optimized in Implementation Methods 2 to 9.
[0102] In this embodiment, during the construction of the random forest lane-changing model, the training set is selected from the vehicle trajectory data of the US101 road segment in the NGSIM database, and the driving information of small cars and large cars is extracted.
[0103] The random forest lane-changing model was evaluated, and the validation set error curve is shown in the figure below. Figure 1 As shown, the error curve outside the bag is as follows: Figure 2 As shown, the confusion matrix is as follows Figure 3 As shown in Table 1, the performance parameters for each category are as follows. It can be concluded that this embodiment exhibits the best performance: Table 1
[0104] In this embodiment, the effectiveness of the simulation method for heterogeneous traffic flow is tested, such as... Figure 4 and Figure 5 The figures show the flow density curves and speed density curves for the three lanes when CAV penetration is 0, respectively. Figure 4 The graphs, from top to bottom, show the traffic density curves for lanes 1, 2, and 3. The flow density graphs conform to the three-phase traffic flow theory. Lane 2, the middle lane, has the highest flow rate, reaching 1700 pcu / h. Lanes 1 and 2 have similar maximum flow rates, with lane 1 having a relatively higher flow rate. Further analysis reveals that lane 3 reaches its maximum flow rate later than the other two lanes, at 35 veh / km, while lanes 1 and 2 reach their maximum flow rates at 25 veh / km.
[0105] Figure 5 In the figure, from top to bottom, are the speed density curves of lane 1, lane 2 and lane 3. It can be seen from the figure that lane 3 travels at a free flow speed before reaching 35 veh / km, lane 2 is at 25 veh / km, and lane 1 is at 20 veh / km.
[0106] like Figure 6 , Figure 7 and Figure 8 The figures shown are spatiotemporal diagrams of a three-lane road with traffic densities of 25veh / km, 35veh / km, and 45veh / km, respectively. Figure 6 In the middle, from left to right, are the spatiotemporal diagrams of lane 1, lane 2, and lane 3 under the condition of a traffic flow density of 25veh / km. It can be seen from the diagram that when the traffic flow density is 25veh / km, lane 1 shows more obvious fluctuations, lane 2 has slight fluctuations, and lane 3 is completely in a free flow state.
[0107] Figure 7 In the image, from left to right, are the spatiotemporal diagrams of lane 1, lane 2, and lane 3 under a traffic density of 35veh / km. It can be seen from the diagram that when the traffic density reaches 35veh / km, lane 1 and lane 2 already show obvious congestion, while lane 3 shows slight fluctuations.
[0108] Figure 8 In the image, from left to right, are the spatiotemporal diagrams of lane 1, lane 2, and lane 3 under a traffic density of 45 veh / km. The diagram shows that lane 3 experiences congestion, but the congestion lasts for a short time and the congestion wave has a narrow range of influence. Lanes 1 and 2 experience significant congestion, but the congestion in lane 1 lasts longer and covers a wider area.
[0109] like Figures 9 to 12 The figures shown are flow density curves for lane 1 (left lane), lane 2 (middle lane), lane 3 (right lane), and all lanes under different CAV permeability rates. Figures 9 to 11 The data shows that as CAV penetration increases, the road vehicle density at the peak of traffic flow in the three lanes also gradually increases, proving that CAVs can effectively improve road utilization efficiency compared to traditional vehicles. Figure 12 As can be seen from the overall traffic density map analysis, as the CAV penetration rate increases, the road traffic flow also increases. When the CAV penetration rate reaches 80%, the maximum traffic flow can be increased by 87.5% compared to traffic flow consisting only of traditional vehicles. When the CAV penetration rate is 100%, the traffic flow and road vehicle density show a linear relationship. This is because the high interconnectivity and stable driving characteristics of CAV vehicles result in a high degree of coordination and consistency in road traffic, thereby avoiding traffic congestion.
[0110] like Figures 13 to 16 The figures shown are velocity-density curves at different CAV penetration rates for lane 1, lane 2, lane 3, and all lanes, respectively. Figures 13 to 16 It can be observed that under the same vehicle density, the higher the CAV penetration rate, the higher the road traffic speed. Simultaneously, it can be observed that as the CAV penetration rate increases, the inflection point between free-flow speed and metastable speed shifts later, indicating that CAV penetration rate can effectively improve road traffic stability.
[0111] like Figure 17 , Figure 18 and Figure 19 The figures shown are the spatiotemporal diagrams for lane 1, lane 2, and lane 3, respectively. Figure 17 In China, comprehensive Figures 17 to 19It can be seen that with the increase of CAV penetration rate, under the same traffic density, road congestion becomes less frequent, the duration of congestion is shorter, and the impact range of congestion waves is smaller. Simultaneously, it can be observed that at the same CAV penetration rate, lane 3 experiences less congestion than the other two lanes, with lane 1 being the most congested, further demonstrating that low-speed lanes are more conducive to traffic flow stability.
[0112] like Figures 20 to 22 The figures shown are road congestion coefficients at CAV penetration rates of 0%, 20%, and 60%, respectively. Figure 20 As can be seen, the congestion coefficient is highest at 2.84, decreasing to 2.71 when the penetration rate is 20%. From... Figure 22 This shows that the congestion coefficient is around 2.2. According to... Figures 20 to 22 The comparison shows that: With the same TRK ratio, the higher the CAV penetration rate, the lower the congestion coefficient, further proving that CAV vehicles have a significant effect on alleviating road congestion.
[0113] When vehicle density is low (below 50 veh / km), a higher proportion of TRKs (Traffic Traffic Kiosks) results in a lower congestion coefficient at the same vehicle density. However, when vehicle density is high (above 80 veh / km), the congestion coefficient increases with the increase in the proportion of TRKs. This is because in low-density road conditions, there is less interaction between vehicles. The slower acceleration and less agility of TRKs compared to smaller cars have a smaller impact. Instead, their smaller speed fluctuations and less tendency to accelerate, decelerate, or change lanes are more conducive to traffic flow stability in these conditions. However, when traffic density is high, conflicts between vehicles are more likely. When congestion occurs, the inflexibility of TRKs amplifies the impact of congestion, thus exacerbating road congestion.
Claims
1. A simulation method for heterogeneous traffic flow with mixed passenger and freight traffic considering road constraints, characterized in that, The simulation method includes the following steps: Real-time acquisition of lane information and vehicle information for several vehicles; processing of each acquisition result as follows to achieve simulation of heterogeneous traffic flow: Step S1: For each vehicle, perform steps S11 to S12 to obtain its vehicle status, which includes lane change information and vehicle position status. Step S11: Based on the lane information and vehicle information, obtain the corresponding lane change information through a random forest lane change model while meeting safety constraints; Step S12: Based on the vehicle information, update the vehicle's location status to obtain the vehicle's location status; Step S2: Combine the vehicle states of the plurality of vehicles into a lane-specific traffic flow spatiotemporal evolution diagram, and update the current lane-specific traffic flow spatiotemporal evolution diagram.
2. The simulation method for heterogeneous traffic flow with mixed passenger and freight traffic considering road constraints according to claim 1, characterized in that, The vehicle location status update includes the vehicle location status update of manually driven vehicles (HV / TRK) and the vehicle location status update of connected autonomous vehicles (CAV). The vehicle position status update of the manually driven vehicle HV / TRK includes the manually driven vehicle following mode; The vehicle position status update of the connected autonomous vehicle (CAV) includes CACC following mode and ACC mode. The manual driving vehicle following mode includes acceleration rules, deceleration rules, and random slowdown rules.
3. The simulation method for heterogeneous traffic flow with mixed passenger and freight traffic considering road constraints according to claim 1, characterized in that, The lane information includes the number of lanes and the lane speed limit.
4. The simulation method for heterogeneous traffic flow with mixed passenger and freight traffic considering road constraints according to claim 2, characterized in that, Under the aforementioned acceleration rules, the vehicle The velocity at the next moment is: in, Indicates the current moment. This indicates the vehicle serial number, representing the current vehicle. Indicates the vehicle The car in front, For a moment vehicle The speed of the car, For vehicles The acceleration of the vehicle. For vehicles Maximum speed, For vehicles Starting acceleration, For a moment The status of the brake lights of the car in front. For the headway, For vehicles With the car in front The impact value.
5. The simulation method for heterogeneous traffic flow with mixed passenger and freight traffic considering road constraints according to claim 2, characterized in that, Under the aforementioned deceleration rules, the vehicle The velocity at the next moment is: in, For vehicles Effective distance considering the speed of the vehicle in front.
6. The simulation method for heterogeneous traffic flow with mixed passenger and freight traffic considering road constraints according to claim 2, characterized in that, The aforementioned random slowing rule refers to the rule that when random numbers... Less than the random slowing probability At that time, the vehicle The velocity at the next moment is: Otherwise, the vehicle The speed remains constant; The random slowdown probability for: in, For vehicle parking time, The threshold for vehicle parking time. The probability of random slowing down due to the influence of the preceding vehicle. To stop the random slowing of probabilities, For the probability of random slowdown during driving, .
7. The simulation method for heterogeneous traffic flow considering road constraints for mixed passenger and freight traffic according to claim 2, characterized in that, In the CACC following mode, the vehicle The velocity at the next moment is: in, For vehicles acceleration, subscript Indicates vehicle For connected autonomous vehicles (CAVs), The distance between vehicles. To maintain a safe distance between vehicles.
8. The simulation method for heterogeneous traffic flow with mixed passenger and freight traffic considering road constraints according to claim 1, characterized in that, The construction method of the random forest lane-changing model includes the following stages: Data acquisition phase: Acquire the training set, which includes input features and output features; The input features include vehicle type, speed, acceleration, headway, headway, speed of the vehicle in front, acceleration of the vehicle in front, relative speed, collision time, and distance and speed of vehicles in the left and right lanes. The output features include no lane change, left lane change, and right lane change; Training phase: The training set is sampled to obtain a sample set; the random forest model is trained based on the sample set to obtain the random forest lane-changing model.
9. The simulation method for heterogeneous traffic flow with mixed passenger and freight traffic considering road constraints according to claim 8, characterized in that, During the training phase, the sampling involves fully sampling all lane-changing samples in the training set and downsampling the non-lane-changing samples.
Citation Information
Patent Citations
CAV and HV mixed traffic flow control method and system and storage medium
CN120748253A