Roundabout traffic flow modeling method based on attention mechanism and application thereof
By adopting an attention-based traffic flow modeling method for roundabouts, the self-driving force, boundary force, and repulsive force are dynamically adjusted, which solves the problems of model accuracy and safety in the testing of autonomous driving at roundabouts in existing technologies and improves the performance of autonomous vehicles in complex scenarios.
Patent Information
- Application Number
- CN202510155561.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-02-12
AI Technical Summary
Existing technologies for autonomous driving testing at roundabouts neglect the importance of dynamic interactions within traffic flow, resulting in low model prediction accuracy and difficulty in adapting to complex, multi-interaction scenarios. This may lead to decision-making errors and reduced driving safety.
A traffic flow modeling method based on attention mechanism is adopted for roundabout backgrounds. The model is constructed to include self-driving force, boundary force and repulsive force. The direction of self-driving force, attention of boundary force and weight of repulsive force are dynamically adjusted through attention mechanism. Priority is given to key traffic flows to improve the performance of autonomous driving tests.
It improves the performance of autonomous driving tests in complex scenarios, reduces visual fatigue, enhances reaction speed and risk avoidance capabilities, and ensures the safety and path accuracy of vehicles at roundabouts.
Smart Images

Figure CN120087045B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of automatic driving test and traffic flow modeling, in particular to a roundabout background traffic flow modeling method based on attention mechanism and its application in automatic driving test. BACKGROUND
[0002] With the continuous development of automatic driving technology, as a complex traffic scene, the roundabout becomes one of the key scenes for automatic driving test due to its large vehicle flow, complex path selection, and frequent interaction. Current roundabout test methods mainly focus on idealized test environments or simple rule simulation scenarios, which often fail to accurately reflect the performance of automatic driving vehicles in complex traffic flow environments. This difference may lead to decision-making errors or reduced driving safety in actual road applications of automatic driving technology.
[0003] In the roundabout, automatic driving vehicles need to consider their own driving trajectory, the behavior dynamics of surrounding vehicles, and the constraint conditions of the intersection boundary. However, existing technologies generally use fixed rules or simple mathematical models when generating background traffic flow, ignoring the importance of dynamic interaction in traffic flow. This not only reduces the prediction accuracy of the model, but also limits the applicability of automatic driving test in complex multi-interaction scenarios. SUMMARY
[0004] To solve the problems in the prior art, the present application proposes a roundabout background traffic flow modeling method based on attention mechanism and its application. The present application constructs a dynamic interaction model of vehicles based on attention mechanism to distinguish the influence of surrounding vehicles and prioritize key traffic flows related to driving paths, thereby improving the performance of automatic driving test in complex scenarios. It can provide technical support for automatic driving test in complex multi-interaction scenarios.
[0005] The technical solutions adopted by the present application are as follows:
[0006] A roundabout background traffic flow modeling method based on attention mechanism includes the following steps:
[0007] Step 1: According to the force relationship of the test vehicle in the roundabout and the viscoelastic plastic constitutive model, self-driving force model, boundary force model, and repulsion force model are constructed respectively.
[0008] The self-driving force model is represented as:
[0009]
[0010] The boundary force model is represented as:
[0011] a' t+1 =F bk1(D min -α1v t+1 )
[0012] The repulsion force model is represented as:
[0013]
[0014] Where a t+1 is the acceleration of the test vehicle under the self-driving force at the t+1 moment, F z is the direction of the self-driving force, M i is the mass of the test vehicle i, v t is the expected speed of the test vehicle at the t moment, v t+1 is the driving speed of the test vehicle at the t+1 moment, A and B are constants, a' t+1 represents the acceleration of the test vehicle under the boundary force at the t+1 moment, D min is the minimum safety distance between the test vehicle and the boundary of the roundabout, F b is the direction of the boundary force, a” t+1 represents the acceleration of the test vehicle under the repulsion force at the t+1 moment, F c is the direction of the repulsion force; H(θ ij ) is an attention angle weighting function; d(Δx) is a distance attenuation function; θ ij is the angle between the line connecting the test vehicle i and the surrounding vehicle j and the x-axis; Δx is the distance between the test vehicle and the surrounding vehicle; v' t is the driving speed of a certain surrounding vehicle at the t moment; M j is the mass of a certain surrounding vehicle j; η1, k1, α1, k2, α2, η3 are all model parameters in the viscoelastic-plastic constitutive model;
[0015] Step 2, based on the self-driving force model, boundary force model and repulsion force model constructed in step 1, a dynamic interaction model of the vehicle in the roundabout is established; the dynamic interaction model is decomposed to obtain the lateral force and longitudinal force of the test vehicle in the roundabout respectively;
[0016] Step 3, the lateral force and longitudinal force are respectively fitted by using the vehicle driving data set in the roundabout to determine the parameter values, and then the construction of the background traffic flow model of the vehicle in the roundabout is completed.
[0017] Further, the self-driving force direction F z is determined according to the direction vectors of the driver's gaze point and the test vehicle position point, as follows:
[0018] S1, the coordinate position of the transfer process of the gaze point is represented by a linear interpolation method:
[0019]
[0020] wherein x t is the X coordinate of the driver's gaze point on the test vehicle at time t, y t is the Y coordinate of the driver's gaze point on the test vehicle at time t, x init is the X coordinate of the test vehicle at the distance from the exit of the roundabout, x final is the X coordinate of the test vehicle when exiting the roundabout, T is the total time before and after the shift of the gaze point, y init is the Y coordinate of the test vehicle at the distance from the exit of the roundabout, y final is the Y coordinate of the test vehicle when exiting the roundabout.
[0021] S2, calculate the direction of the self-driving force based on the coordinates of the shift of the driver's gaze point, the formula is as follows:
[0022]
[0023] wherein x car , y car are the X coordinate and Y coordinate of the test vehicle respectively, is the length of the direction vector F Z .
[0024] Further, the minimum safety distance D min of the test vehicle to the inner and outer boundaries of the roundabout is calculated by the attention mechanism, the specific process is as follows:
[0025] S1, analyze the distance between the test vehicle and the inner and outer boundaries of the roundabout by the attention mechanism, and take the side with shorter distance as the boundary direction that needs to be paid attention to first;
[0026] S2, calculate the minimum safety distance of the test vehicle to the inner and outer boundaries of the roundabout:
[0027]
[0028] wherein, is the inner boundary distance, is the outer boundary distance, R in is the radius of the inner boundary, r is the turning radius of the vehicle, δ is the radius of the width of the vehicle, R out is the radius of the outer boundary.
[0029] Further, the calculation method of the direction F b of the boundary force is as follows:
[0030] S1, connect the position of the test vehicle with the center of the roundabout to obtain the connecting line equation;
[0031] S2, construct the circle equations of the inner and outer circular boundaries respectively;
[0032] S3, based on the minimum safe distance D min First, determine whether the boundary of priority is the inner or outer boundary; then, by solving the equations of the connecting line and the circle of the boundary of priority, obtain the coordinates (x, y) of the boundary of priority. boundary y boundary );
[0033] S4. Based on the coordinates of the test vehicle and the boundary coordinates, calculate the direction from the boundary point to the vehicle:
[0034]
[0035] Where, x car y car These are the X and Y coordinates of the test vehicle, respectively; x boundary y boundary These are the X and Y coordinates of the determined boundary point of the roundabout, respectively. Let F be the direction vector. b The length of the module.
[0036] Furthermore, the distance decay function is defined as:
[0037] d(Δx)=e -pΔx
[0038] Where △x represents the distance between the surrounding vehicles and the test vehicle; p is the attenuation rate parameter.
[0039] Furthermore, the attention angle weighting function is:
[0040]
[0041] Where, k angle It is an adjustment parameter; θ ij θ is the angle between test vehicle i and surrounding vehicle j; θ0 is the angle for adjusting the weights.
[0042] Furthermore, the direction of the repulsive force is calculated by using the coordinates of the test vehicle and surrounding vehicles to determine the direction in which the surrounding vehicles point towards the test vehicle.
[0043]
[0044] Where, x car y car These are the X and Y coordinates of the test vehicle's position, respectively; x othercar y othercar These are the X and Y coordinates of the surrounding vehicles, respectively. Let F be the direction vector. c The length of the module.
[0045] Further, in step 3, the least square method is used to perform data fitting in Matlab for the lateral force and the longitudinal force respectively.
[0046] Further, the viscoelastic plastic constitutive model selected by the self-driving force is a series damper of the test vehicle; the constitutive model selected by the boundary force is a series spring of the test vehicle; and the constitutive model selected by the repulsion force model is the test vehicle in series connection of the damper and the spring.
[0047] An automatic driving test method for a roundabout, wherein a roundabout background traffic flow constructed by the above-mentioned roundabout background traffic flow modeling method based on an attention mechanism is used in the test process.
[0048] The beneficial effects of the present application are:
[0049] (1) The present application introduces the shift process of the driver's gaze point, and the self-driving force direction can flexibly adapt to the changes of the entrances and exits of the roundabout. This dynamically adjusted self-driving force direction not only ensures the accuracy of the driving path, but also reduces visual fatigue and improves the driver's attention concentration, which helps to improve the performance of automatic driving tests in complex scenarios.
[0050] (2) The present application uses the boundary force model, and the test vehicle can adjust the direction of the boundary force according to the distance from the boundary of the roundabout. This model dynamically adjusts the attention to the vehicles near the boundary using the attention mechanism, and prioritizes ensuring that the vehicle always maintains a safe distance to prevent crossing the boundary or colliding, thereby ensuring the safety of the vehicle driving on the roundabout road.
[0051] (3) The repulsion force model based on the attention mechanism of the present application can prioritize the surrounding vehicles and adjust the weight according to the distance and angle, and prioritize the surrounding vehicles that pose a risk to the driving path. This mechanism improves the reaction speed and risk avoidance ability of the test vehicle in crowded and complex traffic environments. BRIEF DESCRIPTION OF DRAWINGS
[0052] Figure 1 The figure is a flowchart of the method of the present application.
[0053] Figure 2 The figure is a longitudinal acceleration fitting effect diagram of the model based on the attention mechanism of the present application.
[0054] Figure 3 The figure is a longitudinal acceleration fitting effect diagram of the model without introducing the attention mechanism.
[0055] Figure 4 The figure is a comparison of the longitudinal acceleration of the test vehicle in the embodiment of the present application.
[0056] Figure 5 The figure is a comparison of the longitudinal speed of the test vehicle in the embodiment of the present application.
[0057] Figure 6 For the displacement of the test vehicle in the longitudinal direction in the embodiment of the present application.
[0058] Figure 7 For the acceleration of the test vehicle in the lateral direction in the embodiment of the present application.
[0059] Figure 8 For the speed of the test vehicle in the lateral direction in the embodiment of the present application.
[0060] Figure 9 For the displacement of the test vehicle in the lateral direction in the embodiment of the present application.
[0061] Figure 10 For the heading angle of the test vehicle in the embodiment of the present application. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical scheme and advantages of the present application more clear, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0063] As shown in Figure 1 , the present application is a roundabout background traffic flow modeling method based on attention mechanism, and the specific steps are as follows:
[0064] Step 1, since the test vehicle drives in the roundabout, it will be affected by the self-driving force, the boundary force of the lane and the repulsion force of the surrounding vehicles, therefore, according to the viscoelastic plastic constitutive model, the self-driving force model, the boundary force model and the repulsion force model are respectively constructed; the directions of the self-driving force, the boundary force and the repulsion force in the self-driving force model, the boundary force model and the repulsion force model are respectively determined by using the attention mechanism.
[0065] In this embodiment, the viscoelastic plastic constitutive model selected for the self-driving force is a series damper of the test vehicle, so the self-driving force model constructed can be expressed as:
[0066]
[0067] Where, a t+1 is the acceleration of the test vehicle at the t+1 moment under the action of the self-driving force, M i is the mass of the test vehicle i, v t is the expected speed of the test vehicle at the t moment, v t+1 is the driving speed of the test vehicle at the t+1 moment, η1 is the constitutive model parameter of the series damper of the test vehicle, F z is the direction of the self-driving force, A and B are constants.
[0068] More specifically, since the direction of the self-driving force F zThe self-driving force direction F can be determined by the direction vector of the driver's gaze point and the test vehicle position point z For example, during the driving of the vehicle in the roundabout, the initial gaze point is set as the tangent point of the roundabout inner circle, and when the test vehicle approaches the roundabout exit, the driver's gaze point starts to gradually shift to the roundabout exit position, so as to dynamically adjust the self-driving force direction. Therefore, in the present application, the attention mechanism is added to construct the driver's gaze point, and the self-driving force direction is dynamically adjusted according to the shift of the driver's gaze point, as follows:
[0069] S1, the coordinate position of the shift process of the gaze point is represented by a linear interpolation method, and the formula is as follows:
[0070] The change of the X coordinate is:
[0071]
[0072] The change of the Y coordinate is:
[0073]
[0074] Wherein, x t is the X coordinate of the driver's gaze point on the test vehicle at time t, y t is the Y coordinate of the driver's gaze point on the test vehicle at time t, x init is the X coordinate of the test vehicle at the distance from the roundabout exit, x final is the X coordinate of the test vehicle when driving out of the roundabout, T is the total time before and after the shift of the gaze point, y init is the Y coordinate of the test vehicle at the distance from the roundabout exit, y final is the Y coordinate of the test vehicle when driving out of the roundabout.
[0075] S2, the direction of the self-driving force is calculated based on the coordinates of the shift of the driver's gaze point, and the formula is as follows:
[0076]
[0077] Wherein, x car , y car are the X coordinate and Y coordinate of the test vehicle, respectively, is the module of the direction vector F z .
[0078] In this embodiment, the constitutive model of the boundary force selected is a test vehicle in series spring, and the boundary force model can be represented as:
[0079] a' t+1 = F b *k1*(D min -α1v t+1 ) (5)
[0080] wherein a' t+1 represents the acceleration of the test vehicle under the action of the boundary force at the t+1 time, D min is the minimum safety distance of the test vehicle from the boundary of the roundabout; k1, a1 are model parameters in the viscoelastic-plastic constitutive model, F b is the direction of the boundary force.
[0081] More specifically, for the minimum safety distance D min in the above boundary force model, the present application obtains the minimum safety distance of the test vehicle from the inner and outer boundaries of the roundabout through the attention mechanism; the specific process is as follows:
[0082] S1, analyze the distance of the test vehicle from the inner and outer boundaries of the roundabout through the attention mechanism, and determine the boundary direction that needs to be paid attention to preferentially. When the test vehicle is closer to a boundary on one side (for example, the inner boundary), the boundary force should increase the attention degree in that direction, so that the test vehicle can respond preferentially to the boundary with a closer distance. In this way, the direction of the boundary force will tend to be farther away from the closer boundary, avoiding the vehicle crossing the boundary or colliding with the boundary.
[0083] S2, calculate the minimum safety distance of the test vehicle from the inner and outer boundaries of the roundabout. In this embodiment, in order to determine the minimum safety distance D min of the test vehicle from the boundary of the roundabout, the present application adopts the following distance calculation method:
[0084] For the inner boundary distance:
[0085]
[0086] wherein R in is the radius of the inner boundary, r is the turning radius of the vehicle, and d is the radius of the vehicle width.
[0087] For the outer boundary distance:
[0088]
[0089] wherein R out is the radius of the outer boundary, r is the turning radius of the vehicle, and d is the radius of the vehicle width.
[0090] Select the smaller value between D and D as the distance of the test vehicle from the boundary of the roundabout, that is:
[0091]
[0092] In this way, it can be ensured that whether the test vehicle is close to the inner boundary or the outer boundary, the test vehicle can always maintain a safe distance.
[0093] More specifically, the boundary force direction F b is always directed away from the boundary, and is determined by the direction vector of the ring intersection boundary point and the test vehicle position point, ensuring that the test vehicle can gradually deviate from the boundary to maintain a safe distance when approaching the boundary; therefore, the calculation method of the boundary force direction F b in the boundary force model in the present application is as follows:
[0094] S1, connecting the test vehicle position and the center of the ring intersection to obtain a connecting line equation; the connecting line equation between the test vehicle and the center can be represented by a straight line equation, and the straight line equation is:
[0095] y=k(x-x center )+y center (9)
[0096] wherein the slope k is calculated from the difference between the test vehicle coordinates and the center coordinates; x center ,y center are the X coordinate and Y coordinate of the center of the ring intersection, respectively.
[0097] S2, the equations of the inner and outer circle boundaries and the outer circle boundary are constructed respectively, which are:
[0098] Inner circle equation:
[0099]
[0100] Outer circle equation:
[0101]
[0102] S3, the minimum safety distance D min can be determined to determine which of the inner and outer boundaries is closer to the test vehicle, if the distance to the outer boundary is smaller, then the straight line equation and the outer circle equation are solved to obtain the coordinates (x boundary , y boundary ) of the outer circle boundary point; if the distance to the inner circle boundary is smaller, the same as above, the inner circle boundary coordinates are obtained.
[0103] S4, the direction from the boundary point to the vehicle is calculated by the obtained coordinates:
[0104]
[0105] wherein x car , y car are the X coordinate and Y coordinate of the test vehicle, respectively; X boundary , y boundary are the X coordinate and Y coordinate of the determined ring intersection boundary point, respectively; is the direction vector F bthe length of the module.
[0106] In this embodiment, the repulsive force model selects the constitutive model of the damper in parallel with the spring and then in series with the test vehicle, and adds an attention angle weighting function and a distance function. The repulsive force model can be expressed as:
[0107]
[0108] where a t+1 represents the acceleration of the test vehicle under the action of the repulsive force at the t+1 time, F c is the direction of the repulsive force; H(θ ij ) is the attention angle weighting function; d(Δx) is the distance decay function; θ ij is the angle between the test vehicle i and the surrounding vehicle j; Δx is the distance between the test vehicle and the surrounding vehicle; v t is the driving speed of a certain surrounding vehicle at time t; M j is the mass of a certain surrounding vehicle j; k2, α2, η3 are model parameters in the viscoelastic-plastic constitutive model.
[0109] More specifically, the distance decay function in the repulsive force model is used to adjust the influence of the distance of the surrounding vehicle on the test vehicle; the distance decay function is defined as:
[0110] d(Δx)=e -pΔx (14)
[0111] where Δx represents the distance between the surrounding vehicle and the test vehicle; p is the decay rate parameter, which is used to control the decay speed of the influence with distance. The distance decay function is based on the core idea of the attention mechanism, that is, the test vehicle pays more attention to the surrounding vehicles that have a greater influence on driving decisions and are closer, and reduces the attention to vehicles that are farther away. Thus, the attention of the test vehicle is focused on the target with higher potential risk, so that the characteristics of giving priority to close obstacles in complex scenarios such as roundabouts are obtained.
[0112] More specifically, the attention angle weighting function in the repulsive force model can dynamically adjust the influence weight according to the angle of the surrounding vehicle relative to the test vehicle. The smoothness of the modified hyperbolic tangent function is used to make the target weight value in the attention area of the test vehicle close to 1, and the weight in other areas gradually decreases. The attention angle weighting function is as follows:
[0113]
[0114] where k angle is a regulation parameter, which is used to control the smoothness of the weighting function; θ ijis the angle between the test vehicle i and the surrounding vehicle j; θ0 is the angle of the adjustment weight, the angle θ0 adjustment range is 30°-150°, so that the test vehicle gradually increases the target weight in the 30 degrees to 150 degrees field of view in front, thereby enhancing the test vehicle's perception of potential risks in front. While in the rear or beyond the front view range of vehicles, the influence weight gradually decreases.
[0115] More specifically, the direction of the repulsive force refers to the direction in which the vehicle wants to avoid a collision with the surrounding vehicle, so the direction of the repulsive force of the surrounding vehicle on the test vehicle can be determined by calculating the relative position between the surrounding vehicle and the test vehicle. The calculation method is:
[0116] The direction of the surrounding vehicle pointing to the test vehicle is calculated by the coordinates of the test vehicle and the surrounding vehicle:
[0117]
[0118] wherein x car , y car are the X coordinate and Y coordinate of the test vehicle position respectively; x othercar , y othercar are the X coordinate and Y coordinate of the surrounding vehicle position respectively, is the length of the direction vector F c .
[0119] Step 2, based on the self-driving force model, boundary force model and repulsive force model constructed in step 1, a dynamic interaction model of the vehicle in the roundabout can be established, which is represented as:
[0120]
[0121] F i (t)=M i *(a t+1 +a' t+1 +a” t+1 ) (18)
[0122] wherein F i (t) represents the resultant force of the test vehicle i in the roundabout, represents the self-driving force of the test vehicle i; F iw (t) represents the boundary force generated by the test vehicle i and the boundary of the roundabout w; F ij (t) represents the repulsive force of the test vehicle i and its surrounding vehicle j.
[0123] In order to facilitate calculation, the resultant force of the test vehicle in the roundabout can be divided into lateral force and longitudinal force, with the vehicle driving direction as the lateral direction and the direction perpendicular to the vehicle driving direction as the longitudinal direction, a rectangular coordinate system is established, so the lateral resultant force and the longitudinal resultant force of the test vehicle are represented as follows:
[0124] (1) Lateral resultant force is expressed as:
[0125]
[0126] wherein, is the self-driving lateral force, F iwy (t) is the boundary lateral force, F ijy (t) is the repulsion lateral force.
[0127] Further, the self-driving lateral force calculation formula is:
[0128]
[0129] wherein, is the self-driving lateral force; M n+1 is the test vehicle mass; is the self-driving force direction in the lateral direction; is the expected speed of the test vehicle in the lateral direction; is the speed of the test vehicle in the lateral direction.
[0130] Further, the boundary lateral calculation formula is:
[0131]
[0132] wherein, F iwy (t) is the boundary lateral force; is the boundary force direction in the lateral direction; is the minimum lateral safety distance of the test vehicle and the ring intersection boundary.
[0133] Further, the repulsion lateral calculation formula is:
[0134]
[0135] wherein, F ijy (t) is the repulsion lateral force; is the repulsion force direction in the lateral direction; Δx y is the distance between the test vehicle and the surrounding vehicle in the lateral direction; is the speed of the surrounding vehicle in the lateral direction.
[0136] Further, according to the formula (18), (19), (20), the test vehicle mass M n+1 is regarded as 1, and the above lateral forces are added to obtain the lateral resultant force:
[0137]
[0138] (2) Longitudinal resultant force is expressed as:
[0139]
[0140] wherein, is the self-driving longitudinal force; F ijx (t) is the repulsive force longitudinal force.
[0141] Further, the self-driving longitudinal calculation formula is:
[0142]
[0143] wherein, is the self-driving longitudinal force; M n+1 is the test vehicle mass; is the self-driving force direction in the longitudinal direction; is the expected speed of the test vehicle in the longitudinal direction; is the speed of the test vehicle in the longitudinal direction.
[0144] Further, the repulsive force longitudinal calculation formula is:
[0145]
[0146] wherein, F ijx (t) is the repulsive force longitudinal force; is the repulsive force direction in the longitudinal direction; Δx x is the distance between the test vehicle and the surrounding vehicle in the longitudinal direction; is the speed of the surrounding vehicle in the longitudinal direction.
[0147] Further, according to the formula (22), (23), the test vehicle mass M n+1 is regarded as 1, and the above longitudinal forces are added to obtain the longitudinal resultant force:
[0148]
[0149]
[0150] Step 3, using the vehicle driving data set in the roundabout to perform data fitting on the lateral force and the longitudinal force respectively, determining the parameter value, and further completing the construction of the vehicle background traffic flow model in the roundabout.
[0151] In this embodiment, the vehicle driving data set in the roundabout is obtained from the driving data of the test vehicle and its surrounding vehicles, and the driving data includes the position, speed, displacement and acceleration of the vehicle.
[0152] In this embodiment, the vehicle driving dataset can be formed through actual data collection or extracted from a database, such as the rounD dataset.
[0153] In this embodiment, the least squares method is used to fit formulas (23) and (27) in Matlab to obtain the parameter values in the expressions of the resultant lateral force and the resultant longitudinal force, such as η1, k1, α1, k2, α2, η3.
[0154] In this embodiment, the parameter value in the expression for the resultant lateral force is: η 1y =0.9137, A y =0.2166, B y =3.5824 k 1y =0.6628, α 1y =0.8139, k angley =0.5528, p y =0.6188, k 2y =3.7409, α 2y =7.8360, η 3y =0.4967.
[0155] The parameter value in the expression for longitudinal resultant force is: η 1x =0.8683, A x =2.6935, B x =6.7492 k anglex =0.7922, p x =0.5939, k 2x =4.7204, α 2x =9.6691, η 3x =0.5238.
[0156] To verify the effectiveness of the background traffic flow constructed by the method of this invention, this model is compared with the longitudinal acceleration fitting of a dynamic model without an attention mechanism. The comparison is shown in the figure below. Figures 2-10 By fitting parameters for both lateral and longitudinal forces, the magnitude of the forces acting on the test vehicle under the influence of surrounding traffic flow during its journey through a roundabout can be determined. The magnitude of the acceleration can then be derived from the magnitude of the forces, thereby identifying the vehicle's speed, displacement, and heading angle.
[0157] Compared with the original data, the root mean square error (RMSE) value is obtained, and the RMSE of the acceleration, speed and displacement in the horizontal direction is respectively 0.088058, 0.88174 and 0.20016; the RMSE of the acceleration, speed and displacement in the longitudinal direction is respectively 0.15889, 0.13835 and 0.11732; and the RMSE of the heading angle is 1.86110. Since the values of the root mean square error are all within a reasonable range, the parameters are extracted subsequently, a behavior scene for automatic driving test is generated, and the automatic driving vehicle is tested. The interaction model based on the attention mechanism can effectively describe the motion trend of the test vehicle and provide an accurate and real traffic flow background, thereby improving the efficiency and accuracy of the virtual acceleration test of the automatic driving at the roundabout intersection.
[0158] The background traffic flow model constructed based on the above-mentioned background traffic flow modeling method based on the attention mechanism can be used for automatic driving test in complex multi-interaction scenes such as roundabouts; specifically, the roundabout intersection scene can be automatically generated by using the automatic driving toolbox function of Matlab, and the dynamic background traffic flow with interactive behaviors can be generated by using the method.
[0159] The above embodiments are only used to illustrate the design idea and characteristics of the present application, and the purpose is to enable those skilled in the art to understand the content of the present application and to implement it, and the protection scope of the present application is not limited to the above-mentioned embodiments. Therefore, any equivalent changes or modifications made according to the principles and design ideas disclosed by the present application are within the protection scope of the present application.
Claims
1. A roundabout background traffic flow modeling method based on an attention mechanism, characterized in that, Comprising the following steps: Step 1, according to the force relationship of the test vehicle in the roundabout and the viscoelastic plastic constitutive model, respectively, the self-driving force model, the boundary force model and the repulsion force model are constructed; The self-driving force model is represented as: The boundary force model is represented as: a' t+1 = F b * k1*(D min - a1v t+1 ) The repulsion force model is represented as: wherein a t+1 is the acceleration of the test vehicle at the t+1 moment under the action of self-driving force, F z is the direction of the self-driving force, M i is the mass of the test vehicle i, v t is the expected speed of the test vehicle at the t moment, v t+1 is the driving speed of the test vehicle at the t+1 moment, A and B are constants, a' t+1 represents the acceleration of the test vehicle at the t+1 moment under the action of boundary force, D min is the minimum safety distance of the test vehicle from the boundary of the roundabout intersection, F b is the direction of the boundary force, a” t+1 represents the acceleration of the test vehicle at the t+1 moment under the action of repulsion force, F c is the repulsion force direction; H(θ ij ) is an attention angle weighting function; d(Δx) is a distance attenuation function; θ ij is the angle between the line connecting the test vehicle i and the surrounding vehicle j and the x-axis; Δx is the distance between the test vehicle and the surrounding vehicle; v' t is the driving speed of a certain surrounding vehicle at the t moment; M j is the mass of a certain surrounding vehicle j; η1, k1, α1, k2, α2, η3 are all model parameters in the viscoelastic-plastic constitutive model; Step 2, based on the self-driving force model, the boundary force model and the repulsion force model constructed in step 1, the dynamic interaction model of the vehicle in the roundabout is established; the dynamic interaction model is decomposed to obtain the lateral force and the longitudinal force of the test vehicle in the roundabout; Step 3, using the vehicle driving data set in the roundabout, the lateral force and the longitudinal force are respectively fitted by data, the parameter values are determined, and the construction of the background traffic flow model of the vehicle in the roundabout is completed.
2. The roundabout background traffic flow modeling method based on attention mechanism according to claim 1, characterized in that, The self-driving force direction F is determined from the direction vector of the driver's gaze point and the test vehicle position point z , as follows: S1, the coordinate position of the transfer process of the gaze point is represented by a linear interpolation method: wherein x t is the X coordinate of the driver's fixation point on the test vehicle at time t, y t is the Y coordinate of the driver's fixation point on the test vehicle at time t, x init is the X coordinate of the test vehicle at the distance to the exit of the roundabout, x final is the X coordinate of the test vehicle when exiting the roundabout, T is the total time before and after the shift of the fixation point, y init is the Y coordinate of the test vehicle at the distance to the exit of the roundabout, y final is the Y coordinate of the test vehicle when exiting the roundabout; S2, the direction of the self-driving force is calculated based on the coordinates of the driver's gaze point transfer, and the formula is as follows: where x car , y car are the X and Y coordinates of the test vehicle, respectively, is the length of the directional vector F Z .
3. The method of claim 1, wherein, The minimum safety distance D of the test vehicle to the inner and outer boundary of the roundabout is obtained through the attention mechanism min The specific process is as follows: S1, the distance between the test vehicle and the inner and outer boundaries of the roundabout is analyzed by the attention mechanism, and the side with a short distance is regarded as the boundary direction that needs to be paid attention to first; S2, the minimum safety distance of the test vehicle to the inner and outer boundaries of the roundabout is calculated: wherein, is the inner boundary distance, is the outer boundary distance, R in is the radius of the inner boundary, r is the turning radius of the vehicle, δ is the radius of the vehicle width, R out is the radius of the outer boundary.
4. The roundabout background traffic flow modeling method based on attention mechanism according to claim 3, characterized in that, The direction of the boundary force F b The calculation method is as follows: S1, the position of the test vehicle is connected with the center of the roundabout to obtain the connecting line equation; S2, the circle equations of the inner and outer circular boundaries and the outer circular boundary are respectively constructed; S3、According to the minimum safety distance D min , determine whether the priority boundary is an inner boundary or an outer boundary; by simultaneously solving the line equation and the circle equation of the priority boundary, the coordinates (x boundary , y boundary ) of the priority boundary are obtained; S4, based on the coordinates of the test vehicle and the coordinates of the boundary, the direction from the boundary point to the vehicle is calculated: wherein x car , y car are the test vehicle X and Y coordinates, respectively; x boundary , y boundary are the determined roundabout boundary point X and Y coordinates, respectively; is the modulus of the directional vector F b .
5. The method of claim 1, wherein, The distance attenuation function is defined as: d (Δx) = e -pΔx Where, △x represents the distance between the surrounding vehicle and the test vehicle; p is the attenuation rate parameter.
6. The method of claim 1, wherein, The attention angle weighting function is: where k angle is a tuning parameter; θ ij is the angle between the test vehicle i and the surrounding vehicle j; θ0is the angle of the adjustment weight.
7. The method of claim 1, wherein, The direction of the repulsion force is calculated by the coordinates of the test vehicle and the surrounding vehicle, and the direction of the surrounding vehicle to the test vehicle is calculated: where x car , y car are the X and Y coordinates of the position of the test vehicle, respectively; x othercar , y othercar are the X and Y coordinates of the position of the surrounding vehicle, respectively, is the modulus of the directional vector F c .
8. The roundabout background traffic flow modeling method based on attention mechanism according to claim 1, characterized in that, In step 3, the least square method is used to fit the data of the lateral force and the longitudinal force in Matlab.
9. The roundabout background traffic flow modeling method based on attention mechanism according to claim 1, characterized in that, The viscoelastic plastic constitutive model selected for the self-driving force is a series damper of the test vehicle; the constitutive model selected for the boundary force is a series spring of the test vehicle; the constitutive model selected for the repulsion force model is a series test vehicle connected in parallel with the damper and the spring.
10. An automatic driving test method for roundabouts, characterized by, In the test process, the roundabout background traffic flow is constructed by using the roundabout background traffic flow modeling method based on the attention mechanism of claim 1.
Citation Information
Patent Citations
Special vehicle avoidance method and system based on repulsive force field model
CN113788014A
Modular scene construction method and system for automatic driving test
CN118690465A