A traffic simulation method and device based on time-space key frame control

By constructing a state-time space graph and a social force model to optimize traffic simulation trajectories, the problem of low efficiency in vehicle behavior constraint control of existing traffic simulators is solved, and flexible and controllable simulation results and rapid feedback are achieved.

CN115495890BActive Publication Date: 2026-05-12ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG UNIV
Filing Date
2022-08-31
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing traffic simulators are inefficient at constraining and controlling the behavior of an individual in traffic flow. Users need to repeatedly try and fail to get the parameters to approximate the expected results. Furthermore, they cannot effectively constrain in the time and space dimensions, resulting in slow feedback speed of autonomous driving, especially in accident-prone areas.

Method used

A traffic simulation method based on spatiotemporal keyframe control is adopted. By constructing a three-dimensional meshed state-time space graph, combined with a social force model and the A* algorithm, the simulation trajectory of the traffic scene is optimized to achieve coarse-to-fine optimization. The adjoint method is used to calculate the gradient for stable convergence.

Benefits of technology

It achieves flexibility and controllability in the traffic simulation process and stability in the simulation results, reduces the human cost of generating specific simulation scenarios, and improves the simulation feedback speed, especially with a significant improvement in simulation effects in accident-prone areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115495890B_ABST
    Figure CN115495890B_ABST
Patent Text Reader

Abstract

The application discloses a traffic simulation method based on time-space key frame control, comprising the following steps: step 1, obtaining key frames in original traffic simulation data and user editing information; step 2, constructing a three-dimensional grid state-time space graph along a vehicle reference path, and calculating a corresponding state-time directed graph; step 3, constructing a trajectory value function with a minimum target function based on the state-time directed graph, and solving the trajectory value function to obtain a coarse-grained trajectory composed of multiple state-time directed graph nodes; step 4, extracting an expected speed set along a coarse-grained trajectory as an initial value to be optimized, and performing fine-grained optimization on the traffic scene simulation result based on the initial value to be optimized, so as to obtain a traffic scene simulation trajectory satisfying constraint control. The application further provides a traffic simulation device. The method can realize flexible control of a traffic simulation trajectory while ensuring the authenticity of a simulation result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic simulation technology, and in particular to a traffic simulation method and apparatus based on spatiotemporal keyframe control. Background Technology

[0002] With the booming development of fields such as autonomous driving, urban planning, and film and games, traffic simulation technology has attracted much attention, and a reliable vehicle that can produce high-fidelity results has become increasingly important.

[0003] While existing traffic simulators can generate realistic traffic flows, there is a lack of research on constraining and controlling the behavior of individual vehicles within the flow. Specifically, if a user wants to simulate a predefined traffic scenario or make a vehicle exhibit special traffic behavior, they need to repeatedly try different parameters and run the simulation program from scratch until the final result gradually approaches the expectation. This is a very tedious and time-consuming process.

[0004] Interactive editing technology has been proposed in the field of crowd animation to make the simulation process more intuitive and controllable, reduce the human cost of generating specific simulation scenes, and improve its production efficiency.

[0005] Patent document CN114021334A discloses a traffic communication simulation method and system based on data-driven and user-edited approaches. The method includes: encoding a two-dimensional grid map based on traffic flow road information to obtain a road map; obtaining a set of edit locations based on user-edited information, and using the grids corresponding to the edit locations in the road map as edit nodes; searching the road map from a set of edit nodes to obtain the set of road map grids with the minimum value function as the edit trajectory; the edit trajectory passes through the edit nodes, and the simulated traffic flow is obtained based on the edit trajectory; the value function includes distance parameters and lane parameters. This method does not support using keyframes to constrain vehicles in the spatiotemporal dimension, such as requiring a vehicle to arrive at a specific location at a specific time, which limits the flexibility of user editing. Furthermore, the data-driven simulation method used in this framework is not differentiable, which prevents the introduction of gradient learning methods for constrained optimization.

[0006] Patent document CN114117889A discloses a method and system for editing simulated traffic flow based on a time-series network. The method includes: acquiring basic traffic data streams; obtaining the tendency speed and tendency method of the vehicle to be edited according to editing requirements; inputting the vehicle information, interactive vehicle information, the tendency speed of the vehicle to be edited, and the tendency method of the vehicle to be edited into a time-series network to obtain the proposed editing acceleration of the vehicle to be edited; adjusting the basic traffic flow data according to the proposed editing acceleration of the vehicle to be edited to obtain the edited simulated traffic flow. This method can only simplify the construction process of similar simulation scenarios, but repeated simulations are still required to obtain the final result for specific traffic conditions.

[0007] The aforementioned issues result in slow feedback speeds for autonomous driving systems, making them unsuitable for accident-prone areas with high traffic or pedestrian flow. Summary of the Invention

[0008] To address the aforementioned issues, this invention provides a traffic simulation method that is user-friendly and allows for on-the-go operation while maintaining accurate simulation results. The original traffic simulation results are optimized from coarse to fine to obtain a stable traffic simulation trajectory that meets the requirements of spatiotemporal keyframe control.

[0009] A traffic simulation method based on spatiotemporal keyframe control includes:

[0010] Step 1: Obtain raw traffic simulation data, which includes user-edited information, reference paths, and traffic scenario simulation results based on the reference paths;

[0011] Step 2: Construct a three-dimensional meshed state-time space graph based on the reference path, calculate the connectable child nodes corresponding to all nodes in the state-time space graph, and obtain the corresponding state-time directed graph;

[0012] Step 3: Extract keyframes from the user's edit information and set them as the starting point for the search. Construct a trajectory value function with the objective function as the minimum value based on the state-time directed graph. Solve the trajectory value function to obtain a coarse-grained trajectory composed of multiple state-time directed graph nodes.

[0013] Step 4: Extract the expected velocity set along the trajectory corresponding to the coarse-grained trajectory as the initial value to be optimized, and perform fine-grained optimization on the traffic scene simulation results based on the initial value to be optimized to obtain a traffic scene simulation trajectory that satisfies the spatiotemporal keyframe control.

[0014] This invention updates vehicle states simultaneously in both Cartesian and Frenet coordinate systems based on a social force model. It combines the adjoint method and state-time space search to optimize keyframe constraints from coarse to fine, thereby achieving stable convergence and obtaining a stable traffic simulation trajectory that satisfies spatiotemporal keyframe control.

[0015] Specifically, the traffic scene simulation trajectory that satisfies spatiotemporal keyframe control is used to make the simulation process more intuitive and controllable, reduce the human cost of generating specific simulation scenarios, and thus accelerate the simulation feedback speed.

[0016] Specifically, in step 1, the process of obtaining the traffic scenario simulation results is as follows:

[0017] Step 1-1: Based on the road information of the traffic scene to be simulated, construct a two-dimensional gridded road map, which includes non-drivable areas, drivable areas, and lane center areas.

[0018] Steps 1-2: Search based on the editing location in the user's edit information as the starting point, construct a path value function with the objective function as the minimum value based on the road map, and solve to obtain the user's reference path;

[0019] Steps 1-3: Calculate the forces acting on the vehicles in the reference path based on the social force model, and update the vehicle states in the Cartesian and Frenet coordinate systems to obtain traffic scenario simulation results.

[0020] Specifically, the grid nodes of the non-drivable area, drivable area, and lane center area are identified as 0, 1, and 2, respectively, and the identification variable is denoted as sign.

[0021] Specifically, the search uses the A* algorithm, and the specific process is as follows:

[0022] First, determine the starting point of the editing process and the ending point of the editing process. Then, repeatedly add the neighboring nodes of the grid node with the lowest value function evaluation to the current graph node set until the ending point of the editing process is added to the current graph node set, and backtrack to obtain the user-defined trajectory.

[0023] Specifically, in steps 1-2, the expression for the path value function is as follows:

[0024]

[0025] Where n is the current network node in the search process, n goal For the editing endpoint, ||nn goal || represents the distance metric between the current grid node and the editing endpoint; μ a and μ bHere, `sign` is a preset parameter, and it is the identifier variable for the current grid node `n`. This represents the distance metric between the current network node and the center of the lane.

[0026] Specifically, the detailed processes in steps 1-3 are as follows:

[0027] At any time t, the vehicle state includes in Let v be the velocity and position of the vehicle in the Frenet coordinate system. t ,p t Let θ be the velocity and position of the vehicle in the Cartesian coordinate system. t For the vehicle's orientation, Let P be the vehicle's desired speed in the Frenet coordinate system. k The reference path followed by the vehicle is numbered k;

[0028] The vehicle status update expression is as follows:

[0029]

[0030]

[0031]

[0032]

[0033] For a given vehicle at time t, This indicates the net force acting on it. This indicates the self-driving force it experiences. This indicates the road-holding force acting on it, f j,t N represents the set of adjacent vehicles it receives. t The repulsive force S of a certain individual j k This represents the cubic spline interpolation function applied to the reference path, where Δt is the simulation time step.

[0034] The vehicle is subjected to self-driving force In the Frenet coordinate system, this represents the speed and direction of the vehicle at a given moment under the influence of the desired travel speed, expressed as follows:

[0035]

[0036] Where, ω o Here are the preset parameters, and m is the mass of the vehicle. This represents the maximum acceleration of the vehicle in the Frenet coordinate system. Let this be the vehicle's expected speed in the Frenet coordinate system. This represents the vehicle's current velocity in the Frenet coordinate system.

[0037] The vehicle experiences a repulsive force f from adjacent vehicles. j,t In a Cartesian coordinate system, this represents the psychological characteristic that a vehicle tends to maintain a certain distance from other vehicles during its movement to avoid collisions. Its expression is as follows:

[0038]

[0039] Where, ω c These are preset parameters, where a is the viewpoint coefficient, b and c are parameterization coefficients, and u... c Let p be the unit vector pointing from neighboring vehicle j to this vehicle. j,t Let j and p be the adjacent vehicles at the current time. t Let this be the position of the vehicle in the Cartesian coordinate system;

[0040] The expression for the viewpoint coefficient is as follows:

[0041]

[0042] Where φ is the angle between the direction in which the vehicle is traveling and the direction in which the vehicle points to the adjacent vehicle j;

[0043] The expression for the parameterized coefficients is as follows:

[0044]

[0045]

[0046] Where s0 is the desired safe distance between the vehicle and other adjacent vehicles, T0 is the reaction time required for the vehicle to brake, and v j,t For adjacent vehicles j and v t Let V be the vehicle's current velocity in the Cartesian coordinate system. This represents the maximum acceleration of the vehicle in the Frenet coordinate system.

[0047] Specifically, in step 2, the state-time directed graph is composed of discrete state-time space nodes, nodes that reach child nodes after acceleration, nodes that reach child nodes after constant speed, and nodes that reach child nodes after deceleration.

[0048] After acceleration, the child node is reached:

[0049] After reaching a constant speed, it arrives at the child node:

[0050] After deceleration, reach the child node:

[0051] in, The coordinates v after spatial discretization s The interval step size on the axis, The interval step size on the s-axis after spatial discretization. The interval step size on the t-axis after spatial discretization.

[0052] Specifically, the expression for the trajectory value function is as follows:

[0053]

[0054]

[0055]

[0056] Where, ω d and ω a These are preset parameters. For grid nodes in a state-time directed graph, for The velocity components in the parent node, As the editing endpoint, for The distance metric between the edit endpoint and the endpoint. for The measure of velocity change between the node and its corresponding parent node.

[0057] Specifically, the fine-grained optimization employs a social force model and the adjoint method, and the specific process is as follows:

[0058] Based on the initial value to be optimized, a fine-grained trajectory is generated using the social force model. The fine-grained trajectory is then compared with keyframes, and the gradient of the expected velocity set is calculated using the adjoint method. Gradient descent is then performed to update the expected velocity set. The process is repeated until the maximum preset number of repetitions is reached.

[0059] Specifically, the objective function expression of the adjoint method is as follows:

[0060]

[0061] Where, ω t ,ω v T is a preset parameter. o To utilize the fine-grained trajectory generated from the initial values ​​to be optimized, For the expected velocity set, Q t Let T be the keyframe at time t, G be the vehicle state update expression, and T be the value of the keyframe at time t.o,t =[s,v s ]| t Trajectory T at time t o Includes the vehicle's status.

[0062] Specifically, the gradient calculation expression for the adjoint method is as follows:

[0063]

[0064] Where φ is the angle between the vehicle's direction of travel and the direction the vehicle points towards the adjacent vehicle j, V is the expected speed set, and G is the vehicle state update expression. Let λ be the expected velocity at time t. t Let be the accompanying state at time t.

[0065] Specifically, the accompanying state λ t The expression is as follows:

[0066]

[0067] Where Φ is the objective function of the adjoint method, and T o,t =[s,v s ]| t Trajectory T at time t o The vehicle state is included, and G is the vehicle state update expression.

[0068] The present invention also provides a traffic simulation device, including a memory and one or more processors. The memory stores executable code. When the one or more processors execute the executable code, they are used to implement the above-mentioned traffic simulation method based on spatiotemporal keyframe control. The specific steps are as follows: acquiring raw traffic simulation data, optimizing it through the traffic simulation method, and outputting a traffic scene simulation trajectory that satisfies spatiotemporal keyframe control.

[0069] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0070] (1) The traffic simulation results are optimized by using the time-space keyframe control method, so that the optimized traffic simulation trajectory is flexible and controllable, and the authenticity of the simulation results is guaranteed.

[0071] (2) The adjoint method and state-time space search are combined to optimize the key frame constraints from coarse to fine, so as to achieve stable convergence of the final simulation results. Attached Figure Description

[0072] Figure 1 A flowchart illustrating the framework of a traffic simulation method based on spatiotemporal keyframe control provided by this invention.

[0073] Figure 2 This is a locally two-dimensional gridded road map provided in this embodiment;

[0074] Figure 3 This is a force diagram of the vehicle during driving provided in this embodiment;

[0075] Figure 4 This is a local three-dimensional meshed state-time space diagram provided in this embodiment. Detailed Implementation

[0076] like Figure 1 As shown, a traffic simulation method based on spatiotemporal keyframe control includes:

[0077] Step 1: Obtain raw traffic simulation data:

[0078] Step 1-1: Construct a two-dimensional gridded road map based on the road information of the traffic scene, and mark all grid nodes in the road map as non-drivable areas, drivable areas and lane center areas, respectively marked as 0, 1 and 2, where the marking variable is denoted as sign;

[0079] like Figure 2 As shown, the different identifiers of the grid nodes in the non-drivable area, drivable area, and lane center area are distinguished by different colors.

[0080] Steps 1-2: Search based on the editing location in the user's edit information as the starting point, construct a path value function with the objective function as the minimum value based on the road map, and solve to obtain the user's reference path;

[0081] The road map search uses the A* algorithm, and the specific process is as follows:

[0082] First, determine the starting point of the editing process and the ending point of the editing process. Then, repeatedly add the neighboring nodes of the grid node with the lowest value function evaluation to the current graph node set until the ending point of the editing process is added to the current graph node set, and backtrack to obtain the user-defined trajectory.

[0083] Steps 1-3: At any time t, the vehicle state includes... in Let v be the velocity and position of the vehicle in the Frenet coordinate system. t ,p t Let θ be the velocity and position of the vehicle in the Cartesian coordinate system. t For the vehicle's orientation, Let P be the vehicle's desired speed in the Frenet coordinate system. k The reference path followed by the vehicle is numbered k.

[0084] like Figure 3 As shown, the social force model, for any vehicle, calculates the following: the vehicle's self-driving force, which enables the vehicle to move at the expected speed; the attractive force of the reference path followed by the vehicle, which ensures that the distance the vehicle deviates from the reference path during its movement is minimized; and the repulsive force of other adjacent vehicles, which ensures that collisions between vehicles are avoided.

[0085] Finally, the vehicle state is updated in both the Cartesian and Frenet coordinate systems to obtain the traffic scene simulation results.

[0086] Step 2: Construct a three-dimensional meshed state-time space graph based on the reference path, calculate the connectable child nodes corresponding to all nodes in the state-time space graph, and obtain the corresponding state-time directed graph;

[0087] The three axes of the state-time space diagram are [s, v]. s ,t], where Let be the longitudinal component of the vehicle's position in the Frenet coordinate system. Let t be the longitudinal component of the vehicle's velocity in the Frenet coordinate system, and t be time.

[0088] The term from a certain node [s,v] s All child nodes reachable by [t], with maximum longitudinal acceleration. The three nodes after accelerating, decelerating, or maintaining a constant speed are respectively represented as follows:

[0089] 1) Reaching the child node after acceleration:

[0090] 2) Reaching the child node after maintaining a constant speed:

[0091] 3) Reach the child node after deceleration:

[0092] Where, Δv s The coordinates v after spatial discretization s The interval step size on the axis is calculated using the following expression:

[0093] Δs is the step size on the s-axis after spatial discretization, and its calculation expression is:

[0094] This is the interval step size on the t-axis after spatial discretization. The preset value is slightly larger than the original simulation time step size to reduce computation and memory overhead.

[0095] like Figure 4As shown, the state-time space diagram is divided into several grid nodes at the aforementioned interval step size. For simplicity, the division along the time t axis in the diagram is represented as several v... s The -s plane only shows the v at time t=0. s A discrete grid in the -s plane. To illustrate the state-time directed graph, starting from the origin of the coordinate system, arrowed line segments point to their reachable child nodes, and the reachable child nodes of each child node are repeatedly marked until... Some child nodes on the time plane no longer extend.

[0096] Step 3: Extract keyframes from the user's edit information and set them as the starting point for the search. Construct a trajectory value function with the objective function as the minimum value based on the state-time directed graph. Solve the trajectory value function to obtain a coarse-grained trajectory composed of multiple state-time directed graph nodes.

[0097] Step 4: Extract the expected velocity set along the trajectory corresponding to the coarse-grained trajectory as the initial value to be optimized, and perform fine-grained optimization on the traffic scene simulation results based on the initial value to be optimized to obtain a traffic scene simulation trajectory that satisfies the spatiotemporal keyframe control.

[0098] This embodiment also provides a traffic simulation device, including a memory and one or more processors. The memory stores executable code, and when the one or more processors execute the executable code, they are used to implement the traffic simulation method based on time-space keyframe control described above.

[0099] The specific steps are as follows: acquire the original traffic simulation data, optimize it through the traffic simulation method, and output the traffic scene simulation trajectory that meets the time-space keyframe control.

[0100] The preset parameter values ​​mentioned in the above steps are set in this embodiment as shown in Table 1.

[0101] Table 1

[0102]

Claims

1. A traffic simulation method based on spatiotemporal keyframe control, characterized in that, include: Step 1: Obtain raw traffic simulation data, which includes user-edited information, reference paths, and traffic scenario simulation results based on the reference paths. The process of obtaining the traffic scenario simulation results is as follows: Step 1-1: Based on the road information of the traffic scene to be simulated, construct a two-dimensional gridded road map, which includes non-drivable areas, drivable areas, and lane center areas. Steps 1-2: Search based on the editing location in the user's edit information as the starting point, construct a path value function with the objective function as the minimum value based on the road map, and solve to obtain the user's reference path; Steps 1-3: Calculate the forces acting on the vehicles in the reference path based on the social force model, and update the vehicle states in the Cartesian and Frenet coordinate systems to obtain traffic scenario simulation results; Step 2: Construct a three-dimensional meshed state-time space graph based on the reference path, calculate the connectable child nodes corresponding to all nodes in the state-time space graph, and obtain the corresponding state-time directed graph; Step 3: Extract keyframes from the user's edit information and set them as the starting point for the search. Construct a trajectory value function with the objective function as the minimum based on the state-time directed graph. Solve the trajectory value function to obtain a coarse-grained trajectory composed of multiple state-time directed graph nodes. The expression of the trajectory value function is as follows: ;in, and These are preset parameters. For grid nodes in a state-time directed graph, for The velocity components in the parent node, As the editing endpoint, for The distance metric between the edit endpoint and the endpoint. for Step 4: Extract the expected velocity set along the trajectory corresponding to the coarse-grained trajectory as the initial value to be optimized, and perform fine-grained optimization on the traffic scene simulation results based on the initial value to be optimized to obtain a traffic scene simulation trajectory that meets the time-space keyframe control.

2. The traffic simulation method based on spatiotemporal keyframe control according to claim 1, characterized in that, The search uses the A* algorithm, and the specific process is as follows: First, determine the editing start point as the starting point and the editing end point as the ending point. Then, repeatedly add the neighboring nodes of the grid node with the smallest value function evaluation to the current graph node set until the editing end point is added to the current graph node set, and backtrack to obtain the user-defined trajectory.

3. The traffic simulation method based on spatiotemporal keyframe control according to claim 1, characterized in that, In steps 1-2, the expression for the path value function is as follows: ;in, For the current network node in the search process, To be the end point of editing, This represents the distance metric between the current grid node and the editing endpoint; and These are preset parameters. For the current grid node The identifier variable, This represents the distance metric between the current network node and the center of the lane.

4. The traffic simulation method based on spatiotemporal keyframe control according to claim 1, characterized in that, In step 2, the state-time directed graph is composed of discrete state-time spatial nodes, child nodes reached after acceleration, child nodes reached after constant speed, and child nodes reached after deceleration.

5. The traffic simulation method based on spatiotemporal keyframe control according to claim 1, characterized in that, In step 4, the fine-grained optimization employs a social force model and the adjoint method, and the specific process is as follows: Based on the initial value to be optimized, a fine-grained trajectory is generated using the social force model. The fine-grained trajectory is then compared with keyframes, and the gradient of the expected velocity set is calculated using the adjoint method. Gradient descent is then performed to update the expected velocity set. The process is repeated until the maximum preset number of repetitions is reached.

6. The traffic simulation method based on spatiotemporal keyframe control according to claim 5, characterized in that, The objective function expression of the adjoint method is as follows: ; , ;in, These are preset parameters. To utilize the fine-grained trajectory generated from the initial values ​​to be optimized, For the expected velocity set, for t Keyframes at any given moment Update the vehicle status expression. for t Trajectory at any time Includes the vehicle's status.

7. The traffic simulation method based on spatiotemporal keyframe control according to claim 5, characterized in that, The gradient calculation expression for the adjoint method is as follows: ;in, The vehicle's direction of travel and the vehicle's direction of direction to adjacent vehicles. j The angle between the directions, For the expected velocity set, Update the vehicle status expression. for t Expected speed at any moment for t The accompanying state at a given moment.

8. A traffic simulation device, characterized in that, The system includes a memory and one or more processors. The memory stores executable code. When the one or more processors execute the executable code, they are used to implement the traffic simulation method based on spatiotemporal keyframe control as described in any one of claims 1-7. The specific steps are as follows: acquiring raw traffic simulation data, optimizing it through the traffic simulation method, and outputting a traffic scene simulation trajectory that satisfies spatiotemporal keyframe control.