Automatic driving behavior simulation method and device
By unified vectorization and Transformer neural network processing of the autonomous driving simulation environment, combining routing information and signal light information, high-precision future trajectory of the vehicle is generated, the safety and stability problems of existing autonomous driving testing methods are solved, and high stability and authenticity of urban-level long-term simulation are achieved.
Patent Information
- Application Number
- CN202510627587.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-08-22
AI Technical Summary
The existing autonomous driving testing methods have problems such as poor safety, high cost and low efficiency, which are difficult to meet the needs of large-scale verification. The existing simulation environment cannot accurately simulate the complexity and diversity of human driving behavior, resulting in significant deviations from the test results and real road performance.
By uniformly vectorizing the vehicle information and environmental information in the autonomous driving simulation environment, building a unified format vector, using the encoder and decoder of the Transformer neural network structure to predict the trajectory, combining routing information and signal light information, generating the vehicle's future trajectory, and optimizing the model parameters through the negative log-likelihood loss function, security and signal compliance constraint correction are carried out, and closed-loop call is realized.
It realizes high stability and authenticity of long-term simulation of large urban areas, improves simulation accuracy and continuity, avoids illegal and unrealistic trajectory behavior, provides a stable simulation environment, and provides guarantees for subsequent closed-loop simulation and real system deployment.
Smart Images

Figure CN120524685A_ABST
Abstract
Description
Technical Field
[0001] This application relates to, but is not limited to, autonomous driving technology, and in particular to an autonomous driving behavior simulation method and device. Background Art
[0002] Pilot operations of autonomous vehicles both domestically and internationally are facing significant safety issues, which have become a major obstacle to the large-scale application of autonomous driving technology. To ensure the stable operation of autonomous driving systems in complex road environments, comprehensive and reliable safety testing must be completed before they are officially put into use.
[0003] Currently, the widely used open-road testing method suffers from numerous problems. First, system failures during real-vehicle testing can easily lead to traffic accidents, posing significant safety risks. Second, real-vehicle testing methods are inefficient and costly, making them difficult to support large-scale algorithm verification and system iteration. Limited by the uncertainty and poor repeatability of the testing environment, open-road testing struggles to meet the growing demand for autonomous driving verification.
[0004] Therefore, how to meet the safety verification requirements of autonomous driving systems is a technical issue that continues to be resolved. Summary of the Invention
[0005] This application provides an autonomous driving behavior simulation method and device, which can ensure high stability of long-term city-level simulation and meet the high-intensity requirements of autonomous driving systems in terms of safety verification and algorithm iteration.
[0006] An embodiment of the present invention provides an autonomous driving behavior simulation method, comprising:
[0007] Unify vehicle information and environmental information in the autonomous driving simulation environment into a unified vector format.
[0008] According to the unified format vector, the pre-set trajectory prediction model is used to process it and obtain the future trajectory of the vehicle;
[0009] The parameters of the trajectory prediction model are optimized based on the generated trajectory distribution, and the trajectory prediction model used to predict the future trajectory of the vehicle is updated.
[0010] In one exemplary embodiment, the present invention further comprises:
[0011] The generated future trajectory of the vehicle is modified according to safety and signal compliance constraints.
[0012] In an exemplary embodiment, after the environmental information at the current moment is uniformly vectorized, it is returned to the step of using the preset trajectory prediction model for processing as the input of the trajectory prediction model for the next time to obtain the future trajectory of the vehicle.
[0013] In an exemplary embodiment, the trajectory prediction model is composed of an encoder and a decoder of a Transformer neural network structure;
[0014] The method of using a preset trajectory prediction model to process and obtain the future trajectory of the vehicle includes:
[0015] Performing feature extraction on the unified format vector using an encoder to obtain a latent space feature representation;
[0016] The decoder processes the obtained latent space feature representation to generate a probability distribution of the future trajectory of the target vehicle to obtain the future trajectory of the vehicle.
[0017] In an exemplary embodiment, the step of extracting features from the unified format vector using the encoder to obtain a latent space feature representation includes:
[0018] The unified format vector is input into the encoder, and the encoder jointly models the unified format vector, extracts its semantic features, and obtains the latent space feature representation Z representing the comprehensive environmental semantics and behavioral intention.
[0019] In an exemplary embodiment, generating a probability distribution of a future trajectory of a target vehicle to obtain the future trajectory of the vehicle includes:
[0020] The decoder generates a probability distribution of the target vehicle's future trajectory based on the input latent space representation Z and the dynamic interaction between the target vehicle and other traffic participants using a cross-attention mechanism; and samples the probability distribution of the target vehicle's future trajectory to obtain the vehicle's future trajectory.
[0021] In an exemplary embodiment, updating a trajectory prediction model for predicting a future trajectory of a vehicle includes:
[0022] Based on the probability distribution of the target vehicle's future trajectory and the actual trajectory data, the prediction error is calculated using a negative log-likelihood loss function, and the parameters of the trajectory prediction model are optimized using a back-propagation algorithm.
[0023] In an exemplary embodiment, the step of modifying the generated future trajectory of the vehicle to meet safety and signal compliance constraints includes:
[0024] Sampling from the generated probability distribution of the future trajectory of the target vehicle to obtain one or more trajectory samples;
[0025] The sampled trajectory samples are subjected to trajectory-level collision detection and traffic light compliance detection to obtain a safe trajectory that meets the requirements of the rules.
[0026] In an exemplary embodiment, the vehicle information and environmental information include: vehicle status information, map information, traffic light information, and routing information.
[0027] An embodiment of the present application also provides an autonomous driving behavior simulation device, comprising a memory and a processor, wherein the memory stores the following instructions that can be executed by the processor: for executing the steps of any of the above-mentioned autonomous driving behavior simulation methods.
[0028] The autonomous driving behavior simulation method provided in the embodiment of the present application constructs a trajectory prediction model by uniformly vectorizing the driving environment, performing vehicle-centric behavior learning, introducing routing guidance, and achieving a high-precision simulation model that is consistent with the real world at the driving behavior distribution level, thereby ensuring high stability in long-term simulations of large areas such as city-level areas.
[0029] Furthermore, through the post-processing compensation mechanism of rules and safety, the rationality of the operation of autonomous driving vehicles in the simulation environment is significantly enhanced, illegal and unrealistic trajectory behaviors are avoided, and a stable guarantee is provided for subsequent closed-loop simulation and real system deployment.
[0030] Furthermore, a closed-loop invocation mechanism enables continuous simulation of target vehicle behavior over time, from any initial state, over tens of seconds, minutes, or even longer periods, while ensuring trajectory rationality and compliance with regulations within each time period. This closed-loop invocation approach overcomes the long-term stability limitations of traditional single-step inference methods, while also encompassing the complex behavioral patterns experienced by vehicles on urban road networks, significantly enhancing the realism and continuity of the simulation.
[0031] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purposes and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings are used to provide a further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0033] Figure 1 Schematic diagram of the process of the autonomous driving behavior simulation method in an embodiment of the present application;
[0034] Figure 2 This is an example diagram of the basic structure of the encoder in the embodiment of the present application;
[0035] Figure 3 The figure shows a schematic diagram of the decoder structure and trajectory distribution modeling process in an embodiment of the present application;
[0036] Figure 4 This is a schematic diagram of the structure of the autonomous driving behavior simulation device in an embodiment of the present application;
[0037] Figure 5 This is a process diagram of an embodiment of the autonomous driving behavior simulation method in the embodiment of the present application;
[0038] Figure 6 This is a schematic diagram of a simulation example in the embodiment of this application;
[0039] Figure 7 This is a schematic diagram of a typical strong interaction scenario simulation in an embodiment of the present application. DETAILED DESCRIPTION
[0040] To make the purpose, technical solutions and advantages of this application more clear, the embodiments of this application will be described in detail below with reference to the accompanying drawings. It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of this application can be combined with each other in any way.
[0041] In a typical configuration of the present application, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0042] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0043] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0044] The steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. Also, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be performed in an order different from that shown here.
[0045] To improve testing efficiency and controllability, the industry has gradually developed autonomous driving testing technology based on simulation environments. Simulation testing has the advantages of safety, efficiency, low cost, and repeatability, and is an important means to support the large-scale implementation of autonomous driving technology. Among them, a common type of simulation environment is based on rule-based or physical models. It relies on preset traffic rules, dynamic equations, scenario templates and other mechanisms to simulate basic traffic behaviors and road environments through model-driven simulation. This type of simulation method has good stability and can repeatedly test the same scenario. However, its biggest problem is that it cannot accurately simulate the complexity and diversity of human driving behavior in reality. Therefore, the test results deviate significantly from the performance of real-world road tests. This kind of simulation environment lacks behavioral realism and can hardly serve as a sufficient means of verifying the safety of autonomous driving systems.
[0046] To compensate for the limitations of model-driven simulation, data-driven simulation environments trained on real human driving data have emerged in recent years. Through artificial intelligence methods such as deep learning, this type of simulation system can simulate the decision-making logic and interactive behavior of human drivers, thereby achieving more realistic and complex dynamic responses of participants in traffic scenarios. This method has significantly improved accuracy and realism compared to model-driven simulation solutions, and can more effectively restore the game and adaptation between people and vehicles on actual roads. However, data-driven simulation environments still face severe challenges in practical applications, especially in large-scale urban areas or simulation tasks that run continuously for a long time. Problems such as error accumulation and data distribution drift are prone to occur, which in turn lead to simulation model failure or system crash, affecting the stability and reliability of the test.
[0047] In summary, current autonomous driving testing methods all have varying degrees of problems. For example, open road testing is unsafe, costly, and inefficient, making it difficult to scale up. Another example is that rule-based / model-driven simulation environments are stable but unrealistic, making it difficult to capture diverse human driving behaviors. Finally, data-driven simulation technology, while highly realistic, lacks stability in large-scale, long-term simulations. Therefore, a more realistic, stable, and scalable test environment solution is urgently needed to meet the demanding safety verification and algorithm iteration requirements of autonomous driving systems.
[0048] In order to meet the high-intensity requirements of the autonomous driving system in terms of safety verification and algorithm iteration, the embodiment of the present application proposes an autonomous driving behavior simulation method, which can ensure high stability of long-term simulation of large areas such as city-level. Figure 1 As shown, this may include:
[0049] Step 100: Vectorize the vehicle information and environment information in the autonomous driving simulation environment to construct a unified format vector.
[0050] In an exemplary embodiment, vehicle information and environmental information may include, but are not limited to: vehicle status information (such as position, speed, acceleration, and vehicle heading), map information M (such as lane type, direction, and intersection structure), signal light information L (such as position, color, and status), and vehicle history trajectory information X. 0:t That is, the state sequence of the vehicle from time 0 to time t.
[0051] In one exemplary embodiment, before step 100, the process may further include acquiring multi-source information data in the autonomous driving simulation environment. Vehicle and environmental information is derived from multi-source data in the autonomous driving simulation environment, including vehicle trajectories, maps, traffic lights, and routes. The format conversion in step 100 provides a unified representation of this multi-source data, enabling it to be processed by the neural network.
[0052] Through step 100, a fusion foundation of vehicle state information and environmental constraints is established, providing input data support for the subsequent generation of a future state distribution model.
[0053] In the embodiment of the present application, the basic goal of modeling the natural driving environment and performing driving simulation is to model the probability distribution of the vehicle's future state based on the historical state of the vehicle in the environment, as shown in formula (1):
[0054] p(X t+1:t+dt |X 0:t )(1)
[0055] In formula (1), X t+1:t+dt represents the vehicle state sequence from time t+1 to t+dt; The vehicle status information of all vehicles in the environment from time t1 to time t2, including but not limited to vehicle position, vehicle heading, vehicle speed, acceleration, etc. represents the environment at time t k v The set of vehicle states. Considering the current time t, the meaning of formula (1) is: predict the vehicle state distribution at the next time dt based on the current time t and the state at the previous time t. In other words, formula (1) is used to predict the behavior of a vehicle in the future (i.e., from time t+1 to t+Δt) after knowing the behavior of the vehicle from time 0 to time t.
[0056] In an exemplary embodiment, in order to achieve long-term city-level simulation and improve the generalization ability of maps and traffic lights, the model shown in formula (1) further unifies the map information and traffic light information to achieve learning of various types of map and traffic light information and improve generalization. The improved model is shown in formula (2):
[0057] p(X t+1:t+dt |X 0:t ,M,L 0:t ) (2)
[0058] In the model shown in formula (2), M represents the unified vectorized representation of map information, which can include multiple map segments, each of which describes structural information such as lane line coordinates and lane types within a certain location range; L represents the set of traffic light states, which represents the color, on / off status of the traffic light at the current moment. In the embodiment of the present application, the map is divided into map segments, each of which is encoded as a vector, and the map information is uniformly modeled as k m A collection of map fragments Among them, m1 is the segmented map segment information, including lane line position coordinates, lane line type and other information. The traffic light status is attached to the vehicle vector as conditional information, and the traffic light signal at time t is modeled as That is k l Traffic light states (light color, etc.). Thus, Formula (2) represents the conditional probability modeling that jointly considers vehicle history, map, and traffic lights to generate future state distribution.
[0059] The model shown in formula (2) constructed in step 100 is used when the historical trajectory X of a vehicle is known. 0:t , and the map information M of the vehicle's environment and the signal light status L, predict the vehicle state distribution in the future (from t+1 to t+Δt). Formula (2) shows that the model input is not only the historical trajectory X of the vehicle itself 0:t , also including map information M and traffic light status L, so that the encoder of the subsequent model needs to extract features from three types of information; and the decoder also needs to use three types of information when predicting future trajectories: historical trajectory + map information + traffic light information.
[0060] In an exemplary embodiment, in order to solve the problems of prediction deviation, behavior divergence and simulation crash that are prone to occur in the long-term closed-loop call process of the driving behavior simulation model based on deep learning, the embodiment of the present application proposes: by assigning a reasonable expected driving path to each vehicle in the simulation environment, thereby providing a priori constraints on the direction, the stability and rationality of the model in long-term simulation are significantly improved. The model shown in formula (2) further introduces a route for each vehicle in the environment, denoted as R = f R (X 0:t ,M), routing function f R Based on the historical status and map information of each vehicle in the environment, a subset of all map fragments is extracted and assigned to each vehicle. Assume that the historical state of a vehicle is The routing algorithm calculates the vehicle's current lane as And based on the lane topology relationship, search the future lane to obtain the vehicle route r k By integrating routing information, formula (2) can be transformed into formula (3) or formula (4):
[0061] p(X t+1:t+dt |X 0:t ,M,L 0:t ,f R (X 0:t ,M)) (3)
[0062] p(X t+1:t+dt |X 0:t ,M,L 0:t ,R) (4)
[0063] As can be seen from formula (3), the vectorization processing performed in step 100 includes not only the vehicle's historical trajectory, map information, and traffic light information, but also the routing information R or its function representation R=f derived based on the vehicle's historical status and map information. R (X 0:t ,M). Therefore, the final modeling target corresponding to the constructed unified vector structure is the conditional probability model as shown in Formula (3) or Formula (4). This input structure provides a complete and unified information foundation for subsequent encoder feature extraction, behavior generation modeling, and closed-loop simulation prediction.
[0064] In the embodiment of the present application, by introducing routing, the long-term stability of the vehicle will be significantly improved, and all information will be vectorized to carry out the model network structure design. In one embodiment, assuming that the historical state (trajectory) of a vehicle in the environment is X 0:t , that is, the state sequence from time 0 to the current time t (including vehicle position, speed, direction, lane, etc.). Based on the known historical state of the vehicle, the route allocation function R = fR (X 0:t ,M), the route allocation function is based on the vehicle state X 0:t and global map information M as input, extracting a subset of map segments related to the vehicle's current location from the complete map as candidate road segments. The route allocation function first determines the lane number (such as lane A) in which the vehicle is currently located, and based on the lane topology structure encoded in the map (i.e., information about which subsequent lanes a lane can lead to), performs a series of topological searches in the map to find one or more reasonable paths that can be traveled from the current lane (such as lanes that can lead to lanes B, C, D, etc. in sequence). These paths constitute the vehicle's expected route (denoted as R), that is, the future driving direction and path sequence that the vehicle should prioritize from its current location. Finally, the route information R will be vectorized and integrated into the model input shown in formula (3) as an important feature data source alongside historical trajectories, map information, and traffic light status. In the embodiment of the present application, the introduction of routes can not only provide a target behavior reference in the training phase, but also constrain the trajectory generation direction in the prediction phase, thereby effectively avoiding unreasonable behaviors such as vehicle trajectory drift, wrong lane changes, or U-turns, thereby providing technical support for achieving a more stable and realistic urban-level long-term autonomous driving simulation.
[0065] Step 101: Based on the unified format vector, a preset trajectory prediction model is used to process the vector to obtain the future trajectory of the vehicle.
[0066] In an exemplary embodiment, the trajectory prediction model is composed of an encoder and a decoder of a Transformer neural network structure. Step 101 may include:
[0067] The encoder in the Transformer neural network structure in the trajectory prediction model is used to extract features from the unified format vector to obtain the latent space feature representation;
[0068] The decoder in the Transformer neural network structure in the trajectory prediction model processes the obtained latent space feature representation to generate a probability distribution of the target vehicle's future trajectory to obtain the vehicle's future trajectory.
[0069] In one exemplary embodiment, the unified format vector includes:
[0070] Vehicle historical state sequence X 0:t , record the target vehicle's position, speed, acceleration, heading angle and other continuous time series information at the previous t moments;
[0071] Map information M, where the map is divided into multiple map segments. Each segment contains lane line coordinates, lane type (main road / branch road / one-way / U-turn), lane connection relationships, etc.
[0072] Traffic light information 0:t , including the status of all relevant traffic lights in the environment at the current time t (color, open or not, associated lane);
[0073] The routing information R is the expected driving path for a period of time in the future, derived based on the vehicle's current lane and lane topology, including the future lane sequence or target heading vector.
[0074] Accordingly, the obtained latent space representation contains vehicle historical status, map information, traffic light information, and routing intention information.
[0075] In one embodiment, step 101 of extracting features from the uniform format vector using an encoder in a Transformer neural network structure to obtain a latent space feature representation may include:
[0076] Input the unified format vector including various types of information into the preset encoder, including the vehicle historical state sequence X 0:t , map information M, traffic light information L 0:t And routing information R. The encoder jointly models the above multimodal information, extracts its semantic features, and obtains the latent space feature representation Z that represents the comprehensive environmental semantics and behavioral intentions, that is, Among them, Enc θ Represents the neural network structure of the encoder, whose parameter is θ. The input is the four types of information after unified vectorization, that is, the unified format vector. The output latent vector Z will serve as the input basis of the subsequent trajectory generation module.
[0077] In an exemplary embodiment, the encoder in step 101 adopts an encoder based on the Transformer architecture, combined with Figure 2 As shown, in one embodiment, its basic structure may include:
[0078] The input information received by the encoder includes: vehicle historical state sequence X 0:t (such as historical trajectory), map information M (road topology, lane structure), signal light information L 0:t The information is converted into a unified format vector through vectorization (signal status, control rules) and routing information R (target driving path). Time sequence features are added to the input time series information (such as vehicle trajectory) to enable the trajectory prediction model to perceive the causal relationship between different time points and effectively capture trajectory change trends. The multi-head attention mechanism is used to extract the interaction semantics between input modalities, including but not limited to: Different attention heads can focus on different modal interactions, enabling the trajectory prediction model to understand the context of behavioral decisions from multiple perspectives. The feedforward neural network layer performs nonlinear mapping and dimensionality expansion on the fused features, improving feature representation. Residual connections and layer normalization (Residual+LayerNorm) improve network training stability, accelerate convergence, and mitigate the vanishing gradient problem, ensuring effective information transfer within the multi-layer stacked structure. Finally, the latent space feature representation Z is output.
[0079] In step 101, unified vector modeling and the Transformer encoder architecture efficiently integrate the vehicle's own information with external environmental constraints (maps, traffic lights, and routing), outputting a latent vector representing the complete behavioral semantics. This latent vector provides a solid representation foundation for generating high-fidelity, highly compliant trajectory sequences, resolving the issues of unclear behavioral direction and weak environmental responsiveness in traditional modeling.
[0080] In the encoding phase of this application, routing information is introduced as a high-level semantic prior to form a directional attention mechanism with vehicle state features. This means that routing information is not only added to the input sequence as an additional feature vector but also serves as a query source in the multi-head attention calculation, guiding the trajectory prediction model to focus on the direction in which the vehicle's trajectory should evolve. This improves the trajectory prediction model's ability to explicitly perceive behavioral targets.
[0081] In one embodiment, the processing of the latent space feature representation obtained by the decoder in the Transformer neural network structure in step 101 to generate a probability distribution of the future trajectory of the target vehicle may include:
[0082] The latent space representation Z is input into the decoder. The decoder further combines the dynamic interaction between the target vehicle and other traffic participants and adopts a cross-attention mechanism to guide the trajectory prediction model to focus on environmental factors related to the target behavior, such as the lane to be passed, the position of adjacent vehicles, the status of traffic lights, etc. On this basis, the trajectory prediction model generates the predicted distribution of the future vehicle state of the target vehicle from t+1 to t+Δt That is, the probability distribution of the vehicle's possible trajectories. The future trajectory of the vehicle can be obtained by sampling the probability distribution of the target vehicle's future trajectory.
[0083] Step 102: Optimize the parameters of the trajectory prediction model based on the generated trajectory distribution, and update the trajectory prediction model used to predict the future trajectory of the vehicle.
[0084] In one exemplary embodiment, step 102 may include:
[0085] Based on the generated trajectory distribution and the actual trajectory data, the prediction error is calculated using the negative log-likelihood loss function, and the parameters of the trajectory prediction model are optimized using the backpropagation algorithm. In this way, in the embodiment of the present application, by continuously iterating the above process, the trajectory prediction model for predicting the future trajectory of the vehicle is continuously trained and optimized.
[0086] In one embodiment, in order to improve the modeling capability of driving behavior diversity and uncertainty, the trajectory prediction model models the future state prediction result as a Gaussian mixture model (GMM), that is, the predicted trajectory is regarded as a weighted combination of multiple Gaussian distributions, expressed as: θ (X t+1:t+dt |X 0:t ,M,L 0:t ,R), where all the parameters of the encoder and decoder are θ=θ e ∪θ d This modeling method can cover a variety of possible driving intentions and behavior paths (such as going straight, turning left, turning right, parking, etc.), enhancing the diversity and realism of trajectory generation. Assume that the real future trajectory of the target vehicle is X t +1:t+Δt , then, the embodiment of the present application can use the negative log-likelihood loss function (NLL) to measure the difference between the predicted distribution and the true trajectory. Its loss function is shown in formula (5):
[0087]
[0088] In formula (5), θ represents the trajectory prediction model parameter set, that is, θ = θ e ∪θ d , p(·) represents the predicted probability distribution based on the mixed Gaussian model, that is, p θ (X t+1:t+dt |X 0:t ,M,L 0:t , R). In the embodiment of the present application, by minimizing the loss function shown in formula (5), the trajectory prediction model parameter θ can be optimized, so that the trajectory distribution generated by the trajectory prediction model is closer to the real data, thereby improving the accuracy and reliability of the trajectory prediction.
[0089] Figure 3 The following is a schematic diagram of the decoder structure and trajectory distribution modeling process in the embodiment of the present application. Figure 3As shown in the figure, it shows how the decoder combines the cross-attention mechanism to extract the interaction features between the vehicle and the environment, and in the process of generating the trajectory distribution, fuses the routing guidance distribution with the original prediction distribution, generates the final trajectory distribution through optimization, and then models the prediction results in the form of a Gaussian mixture model, and uses negative log-likelihood loss for training optimization.
[0090] The trajectory prediction model in the embodiment of the present application is used to predict the trajectory distribution of the target vehicle in several future time steps under the conditions of inputting the historical status of the target vehicle, map information, traffic light information and routing information, and is trained and optimized through the negative log-likelihood loss function.
[0091] The autonomous driving behavior simulation method provided in the embodiment of the present application constructs a trajectory prediction model by uniformly vectorizing the driving environment, performing vehicle-centric behavior learning, introducing routing guidance, and achieving a high-precision simulation model that is consistent with the real world at the driving behavior distribution level, thereby ensuring high stability in long-term simulations of large areas such as city-level areas.
[0092] The trajectory prediction model obtained in the embodiments of the present application can perform highly stable future trajectory prediction and simulation. To further improve the stability and compliance of the model, in an exemplary embodiment, the autonomous driving behavior simulation method provided in the embodiments of the present application may further include:
[0093] Step 103: Correct the generated future trajectory of the vehicle based on safety and signal compliance constraints.
[0094] In an exemplary embodiment, step 103 may include:
[0095] From the generated probability distribution p(X t+1:t+dt |X 0:t ,M,L 0:t ,R) to obtain one or more trajectory samples, represented by X t+1:t+dt ,This trajectory sample is the original predicted trajectory without rule judgment, and may not meet safety or compliance in complex traffic scenarios, such as rear-end collision, illegal passing, etc.;
[0096] Perform trajectory-level collision detection and signal light compliance detection on the sampled trajectory samples to obtain a safe trajectory that meets the requirements of the rules In one embodiment, the trajectory sample X t+1:t+dt Input the trajectory correction function shown in formula (6) to obtain the safe trajectory
[0097]
[0098] In formula (6), gsafe (·) represents the trajectory correction function based on collision detection and rule judgment. g safe (·) The original uncorrected predicted trajectory is converted into a corrected trajectory that meets the constraints of collision safety and traffic regulations.
[0099] Through step 103, a post-processing compensation mechanism for rules and safety is implemented without changing the core prediction structure of the trajectory prediction model, which significantly enhances the rationality of the operation of the autonomous driving vehicle in the simulation environment, avoids illegal and unrealistic trajectory behaviors, and provides stable guarantees for subsequent closed-loop simulation and real system deployment.
[0100] In one embodiment, performing trajectory-level collision detection and traffic light compliance detection on the sampled trajectory samples may include:
[0101] Determine whether the trajectory conflicts with other traffic participants, road boundaries or obstacles in space. If there is a potential collision risk, then adjust the trajectory sample by speed reduction, path offset and other operations. Also, determine whether the vehicle violates the current signal light status (such as red light, failure to give way, etc.) when passing through the intersection. If there is a violation, then correct the action in the corresponding time period in the trajectory sample, such as stopping, slowing down and waiting, etc. After performing trajectory-level collision detection and signal light compliance detection on the sampled trajectory samples, the rule constraint correction of the generated vehicle future trajectory is realized, and a corrected trajectory that meets traffic rules and collision safety constraints is obtained. A safe and compliant future trajectory, namely a safe trajectory, is obtained, which is recorded as
[0102] In an exemplary embodiment, in order to achieve long-term continuous simulation capabilities in a complex urban traffic environment, after completing trajectory prediction and safety correction, the autonomous driving behavior simulation method provided in the embodiment of the present application may further include:
[0103] Step 104: The vehicle state information corresponding to the corrected safe trajectory and the current environmental information are uniformly vectorized and used as input for the next trajectory prediction model and returned to step 101.
[0104] In an exemplary embodiment, during a single inference process, the trajectory prediction model generates the vehicle trajectory distribution within a short period of time in the future based on the vehicle's historical status, map information, traffic light status, and routing information. For example, the predicted vehicle status distribution from the current time t to t+Δt is shown in formula (4), where X 0:t Represents the historical status information of the vehicle from time 0 to the current time t;
[0105] After completing this future trajectory prediction, the system samples the new vehicle state from the predicted distribution and passes it through the safety function gsafe (·) Correction, obtain the corrected safety trajectory
[0106] The vehicle state at the last moment (i.e., time t+Δt) is input into the trajectory prediction model as the new historical state to predict the trajectory for the next period of time. 0,t+Δt As a new input, predict the next step p(X t+Δt+1,t+2Δt |X 0,t+Δt ,M,L 0,t+Δt ,R);
[0107] This cycle repeats, each time predicting a period of time, updating the input history, and continuing to predict the next period. After the nth closed-loop call, the simulation state distribution obtained is shown in formula (7):
[0108]
[0109] Based on formula (7), the historical vehicle status, i.e., X 0:t Predict the status distribution of each vehicle at any time in the future.
[0110] In step 104, a closed-loop call mechanism is further implemented, allowing the trajectory prediction model to simulate the vehicle's state evolution at any point in the future until the simulation conditions are met. Simulation conditions may include, but are not limited to, reaching the target simulation duration, the target vehicle successfully arriving at its destination along the preset route, the simulation being interrupted due to an irreversible collision or rule violation on the predicted trajectory, or reaching a preset maximum number of simulation iterations.
[0111] Through the closed-loop invocation mechanism of step 104, it is possible to continuously simulate the target vehicle's behavior over the next several tens of seconds, minutes, or even longer periods, starting from any initial state, while ensuring the rationality and compliance of the trajectory within each period. This closed-loop invocation method avoids the problem of traditional single-step reasoning methods that prevent stable simulation over long periods of time. It also covers the complex behavior patterns experienced by vehicles in urban road networks (such as going straight, turning, changing lanes, waiting at traffic lights, entering roundabouts, etc.), greatly improving the realism and continuity of the simulation.
[0112] The autonomous driving behavior simulation provided in the embodiments of this application is a method for simulating long-term continuous driving over a large area, such as at the city level. In some embodiments of this application, a Transformer-based generative driving behavior model, namely a trajectory prediction model, is constructed by uniformly vectorizing the driving environment, conducting vehicle-centric behavior learning, introducing routing guidance, and further introducing safety and traffic signal compliance modules. This achieves a high-precision simulation model that is consistent with the real world at the driving behavior distribution level, ensuring high stability for long-term city-level simulations. The autonomous driving behavior simulation provided in the embodiments of this application can be applied to large-scale autonomous driving simulation tests. While ensuring the accuracy and stability of long-term tests, it significantly improves efficiency compared to open road tests, promoting the large-scale application of autonomous driving.
[0113] The present application also provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute any of the above-mentioned autonomous driving behavior simulation methods.
[0114] The present application further provides a computer device, comprising a memory and a processor, wherein the memory stores the following instructions that can be executed by the processor: for executing the steps of any of the above-mentioned autonomous driving behavior simulation methods.
[0115] The present application further provides an autonomous driving behavior simulation device, comprising a memory and a processor, wherein the memory stores the following instructions that can be executed by the processor: for executing the steps of any of the above-mentioned autonomous driving behavior simulation methods.
[0116] Figure 4 This is a schematic diagram of the structure of the autonomous driving behavior simulation device in the embodiment of the present application. Figure 4 As shown, it can include: pre-processing module, prediction module, training module,
[0117] The preprocessing module is used to uniformly vectorize vehicle information and environmental information in the autonomous driving simulation environment and construct a unified format vector;
[0118] The prediction module is used to process the unified format vector using a preset trajectory prediction model to obtain the vehicle's future trajectory;
[0119] The training module is used to optimize the parameters of the trajectory prediction model based on the generated trajectory distribution and update the trajectory prediction model used to predict the future trajectory of the vehicle.
[0120] In one embodiment, the trajectory prediction model consists of an encoder and a decoder of a Transformer neural network structure. The prediction module can be used to:
[0121] The encoder in the Transformer neural network structure in the trajectory prediction model is used to extract features from the unified format vector to obtain the latent space feature representation; the decoder in the Transformer neural network structure in the trajectory prediction model processes the obtained latent space feature representation to generate the probability distribution of the target vehicle's future trajectory to obtain the vehicle's future trajectory.
[0122] In one embodiment, the training module can be used to:
[0123] Based on the generated trajectory distribution and the actual trajectory data, the prediction error is calculated using the negative log-likelihood loss function, and the parameters of the trajectory prediction model are optimized using the backpropagation algorithm. In this way, in the embodiment of the present application, by continuously iterating the above process, the trajectory prediction model for predicting the future trajectory of the vehicle is continuously trained and optimized.
[0124] The autonomous driving behavior simulation device provided in the embodiment of the present application constructs a trajectory prediction model through unified vectorization to represent the driving environment, conducts vehicle-centric behavior learning, introduces routing guidance, and implements a high-precision simulation model that is consistent with the real world in terms of driving behavior distribution, thereby ensuring high stability in long-term simulations of large areas such as city-level areas.
[0125] In an exemplary embodiment, the autonomous driving behavior simulation device provided in an embodiment of the present application further includes a detection module for:
[0126] The generated future trajectory of the vehicle is modified to meet safety and signal compliance constraints.
[0127] In one embodiment, the detection module may be used to:
[0128] Sampling is performed from the probability distribution of the generated target vehicle's future trajectory to obtain one or more trajectory samples. Trajectory-level collision detection and traffic light compliance detection are performed on the sampled trajectory samples to obtain a safe trajectory that meets the requirements of the regulations.
[0129] Through the processing of the detection module, a post-processing compensation mechanism for rules and safety is realized without changing the core prediction structure of the trajectory prediction model. This significantly enhances the rationality of the operation of autonomous driving vehicles in the simulation environment, avoids illegal and unrealistic trajectory behaviors, and provides stable guarantees for subsequent closed-loop simulation and real system deployment.
[0130] In an exemplary embodiment, the autonomous driving behavior simulation device provided in an embodiment of the present application further includes an optimization module for:
[0131] The vehicle status information corresponding to the corrected safe trajectory and the current environmental information are uniformly vectorized and used as the input prediction module of the next trajectory prediction model.
[0132] The optimization module further adopts a closed-loop calling mechanism, which enables the trajectory prediction model to simulate the state evolution process of the vehicle at any time in the future until the simulation conditions are met. Through the closed-loop calling mechanism, it is possible to continuously simulate the behavior changes of the target vehicle in the next tens of seconds, minutes or even longer time range starting from any initial state, and ensure the rationality and rule compliance of the trajectory in each time period. This closed-loop calling method avoids the problem that traditional single-step reasoning methods cannot simulate stably for a long time. At the same time, it covers the complex behavior patterns experienced by vehicles in urban road networks (such as going straight, turning, changing lanes, waiting for traffic lights, entering roundabouts, etc.), greatly improving the authenticity and continuity of the simulation.
[0133] Figure 5 This is a process diagram of an embodiment of the autonomous driving behavior simulation method in the embodiment of the present application. Figure 5 As shown, taking the construction of a city-level long-term continuous traffic world model as an example, in one embodiment, in order to achieve high-precision, long-term continuous driving simulation within a large area of the city, Figure 5 A generative traffic world modeling method based on the Transformer architecture is presented, which roughly includes:
[0134] First, historical turntable information is recorded, that is, multi-source environmental information within the target simulation area is collected, including vehicle information, map information, traffic light information, and routing information of each vehicle. Vehicle information includes but is not limited to dynamic states such as vehicle position, speed, acceleration, and heading angle; map information includes but is not limited to lane geometry, lane type, and intersection structure; traffic light information records the time-series change state of each traffic light; routing information is derived based on the relationship between the vehicle's current position and the road topology, indicating the vehicle's expected driving path;
[0135] The collected multi-source data is then vectorized and modeled in a unified format. This unified vectorization process encodes vehicle status sequences, map segments, traffic light status, and routing intent into a unified data structure, providing standardized input for subsequent deep learning model processing.
[0136] After completing the above data preprocessing, the unified format vector is input into the pre-designed trajectory prediction model based on the Transformer architecture (such as Figure 5The trajectory prediction model uses an encoder to extract the spatiotemporal features of the input information. The decoder combines traffic participant interactions, routing guidance, map structure, and signal constraints to generate a predicted distribution of the target vehicle's behavior over several future time steps. The trajectory prediction model outputs a probability distribution of future trajectories, accurately simulating the diversity and uncertainty of human driving behavior.
[0137] According to actual application requirements, it can be divided into two operating modes: First, Figure 5 As shown in the data-based model training in , during the model training phase, based on real-world driving trajectory data, the negative log-likelihood loss between the predicted distribution and the actual trajectory is calculated, and the parameters of the encoder and decoder are optimized through back propagation to gradually train a trajectory prediction model that can truly simulate driving behavior. Figure 5 As shown in the distribution-based trajectory sampling in the simulation application stage, sampling is performed based on the trajectory distribution output by the trajectory prediction model to obtain a preliminary predicted future trajectory.
[0138] Subsequently, the preliminary trajectory, i.e., the future trajectory of the vehicle, is processed for safety and traffic regulations compliance (e.g. Figure 5 The corrected safe trajectory is used as the new historical state input and the trajectory prediction model is called through a closed loop (such as Figure 5 The closed-loop call in the simulation is used to realize long-term simulation (as shown in the figure), and multiple time steps in the future are continuously deduced until the simulation time reaches the set length or the vehicle completes the preset task.
[0139] The proposed autonomous driving behavior simulation method provided in the embodiment of the present application constructs a Transformer-based generative driving behavior model, namely a trajectory prediction model, by uniformly vectorizing the representation of complex traffic environments, conducting vehicle-centric behavior learning, and introducing routing guidance and safety compliance modules. Compared with traditional rule modeling or single-step prediction methods, the embodiment of the present application maintains a high degree of consistency with the real world in terms of the statistical distribution of driving behavior, and has the ability to perform long-term, highly stable city-level simulations. Its application can significantly improve the efficiency and safety of large-scale autonomous driving system testing, and promote the large-scale implementation and application of autonomous driving technology.
[0140] In order to verify the effectiveness of the proposed autonomous driving behavior simulation method provided in the embodiment of the present application, a training test was conducted based on the public data set Nuplan. First, the trajectory prediction model was trained using the vehicle trajectory, map structure and traffic light configuration information in the real urban traffic environment, and the trained trajectory prediction model was used for simulation evaluation, focusing on the similarity and behavioral consistency between the generated trajectory and the real trajectory at the statistical distribution level. In order to quantitatively evaluate the authenticity and accuracy of the simulation results, this embodiment statistically analyzed the probability distribution of typical indicators such as vehicle speed, relative distance, and collision time (Time-to-collision), and compared them with the real data distribution and the data distribution generated by the traditional rule-based method (Waymax simulator). The comparison results are as follows: Figure 6 shown.
[0141] like Figure 6 As shown, the left column is a distribution comparison between the autonomous driving behavior simulation method proposed in this application and real data, and the right column is a comparison between the Waymax method and real data. Through the comparison, it can be seen that the vehicle speed distribution, relative distance distribution, and collision time distribution generated by the autonomous driving behavior simulation method proposed in this application are highly consistent with the real data. While ensuring long-term stability, the autonomous driving behavior simulation method proposed in this application has significantly lower simulation distribution consistency indicators KL divergence and Hellinger distance than the rule-based Waymax method, indicating that the autonomous driving behavior simulation method proposed in this application achieves high-fidelity long-term continuous simulation and is very close to the statistical characteristics of real urban driving data.
[0142] In addition to distribution consistency, the autonomous driving behavior simulation method proposed in this application also has significant advantages in generating driving behavior diversity and interaction rationality. In order to verify the behavior authenticity in complex traffic interaction scenarios, this embodiment selects typical strong interaction scenarios such as unprotected left turn and roundabout interaction for analysis. For example, Figure 7 shown.
[0143] like Figure 7 As shown, the upper part shows the dynamic process of vehicle 1 giving way to vehicle 2 before turning left in the unprotected left turn scenario, and the times correspond to 0 seconds, 4 seconds, 8 seconds and 12 seconds respectively. It can be observed that the giving way and turning behaviors are highly consistent with the real driving logic. The lower part shows the dynamic process of vehicle 1 actively giving way to vehicle 2 before entering the roundabout in the roundabout scenario, and then safely following the vehicle into the roundabout, which also shows a reasonable giving way and following strategy. The simulated vehicle trajectory and behavior logic are highly consistent with the behavior of real traffic participants, verifying the simulation authenticity and sophistication of the embodiment of the present application in complex interactive scenarios.
[0144] In summary, through quantitative distribution evaluation and typical behavior verification, the embodiments of the present application not only maintain high consistency with the real world in terms of overall behavior distribution, but also can generate natural driving behaviors that conform to traffic logic, which is particularly suitable for simulation testing and safety verification of large-scale autonomous driving systems.
[0145] Although the embodiments disclosed in this application are as described above, the contents described are merely embodiments adopted to facilitate understanding of this application and are not intended to limit this application. Any person skilled in the art to which this application belongs may make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed in this application. However, the scope of patent protection of this application shall still be based on the scope defined by the attached claims.
Claims
1. A method for simulating autonomous driving behavior, characterized in that: include: Unify vehicle information and environmental information in the autonomous driving simulation environment into a unified vector format. According to the unified format vector, the pre-set trajectory prediction model is used to process it and obtain the future trajectory of the vehicle; The parameters of the trajectory prediction model are optimized based on the generated trajectory distribution, and the trajectory prediction model used to predict the future trajectory of the vehicle is updated.
2. The autonomous driving behavior simulation method according to claim 1, further comprising: The generated future trajectory of the vehicle is modified according to safety and signal compliance constraints.
3. The autonomous driving behavior simulation method according to claim 2, further comprising: The vehicle state information corresponding to the corrected safety trajectory and the current environmental information are uniformly vectorized and returned as input to the next trajectory prediction model to be processed using the preset trajectory prediction model to obtain the vehicle's future trajectory.
4. The autonomous driving behavior simulation method according to claim 1, 2 or 3, wherein: The trajectory prediction model is composed of an encoder and a decoder of a Transformer neural network structure; The method of using a preset trajectory prediction model to process and obtain the future trajectory of the vehicle includes: Performing feature extraction on the unified format vector using an encoder to obtain a latent space feature representation; The decoder processes the obtained latent space feature representation to generate a probability distribution of the future trajectory of the target vehicle to obtain the future trajectory of the vehicle.
5. The autonomous driving behavior simulation method according to claim 4, wherein: The using the encoder to perform feature extraction on the unified format vector to obtain a latent space feature representation includes: The unified format vector is input into the encoder, and the encoder jointly models the unified format vector, extracts its semantic features, and obtains the latent space feature representation Z representing the comprehensive environmental semantics and behavioral intention.
6. The autonomous driving behavior simulation method according to claim 4, wherein: Generating a probability distribution of the future trajectory of the target vehicle to obtain the future trajectory of the vehicle includes: The decoder generates a probability distribution of the target vehicle's future trajectory based on the input latent space representation Z and the dynamic interaction between the target vehicle and other traffic participants using a cross-attention mechanism; and samples the probability distribution of the target vehicle's future trajectory to obtain the vehicle's future trajectory.
7. The autonomous driving behavior simulation method according to claim 4, wherein: The updating of the trajectory prediction model for predicting the future trajectory of the vehicle includes: Based on the probability distribution of the target vehicle's future trajectory and the actual trajectory data, the prediction error is calculated using a negative log-likelihood loss function, and the parameters of the trajectory prediction model are optimized using a back-propagation algorithm.
8. The autonomous driving behavior simulation method according to claim 2, wherein: The correction of the safety and signal compliance constraints on the generated future trajectory of the vehicle includes: Sampling from the generated probability distribution of the future trajectory of the target vehicle to obtain one or more trajectory samples; The sampled trajectory samples are subjected to trajectory-level collision detection and traffic light compliance detection to obtain a safe trajectory that meets the requirements of the rules.
9. The autonomous driving behavior simulation method according to claim 1, 2 or 3, wherein: The vehicle information and environmental information include: vehicle status information, map information, traffic light information, and routing information.
10. An autonomous driving behavior simulation device, comprising a memory and a processor, wherein: The memory stores the following instructions that can be executed by the processor: used to execute the steps of the autonomous driving behavior simulation method described in any one of claims 1-9.
Citation Information
Cited By
Optimization method and device of automobile collision simulation model, medium and equipment
CN120911002A
