Test scene generation method and device, computer equipment and storage medium

By combining diffusion models and scenario-guided models, autonomous driving test scenarios that meet preset goals and rules are generated. This solves the problems of limited scenario generation and high resource consumption in reinforcement learning in existing technologies, and realizes diversified scenario generation and flexible adjustment, thereby improving the coverage and adaptability of testing.

CN121389705APending Publication Date: 2026-01-23TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511263764.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-05
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

Existing technologies have limitations in generating autonomous driving test scenarios. They struggle to generate test scenarios with high generalization and adaptability, and reinforcement learning methods require a large amount of training data and computing resources, which limits their flexibility and scalability.

Method used

A scene generation method based on a diffusion model is adopted. Initial scene information is generated by acquiring scene parameters, and the scene guidance model is used to optimize the behavior of vehicles and pedestrians to generate target scene information that meets preset goals and rules, including vehicle position, speed, orientation, and pedestrian position and speed.

Benefits of technology

It generates diverse real-world test scenarios, covering visual obstruction in complex traffic environments, improving scenario coverage, meeting the customization needs of different test scenarios, and enhancing the relevance and effectiveness of the tests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121389705A_ABST
    Figure CN121389705A_ABST
Patent Text Reader

Abstract

The invention relates to a test scene generation method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring scene parameters; generating initial scene information according to the scene parameters and a scene generation model; the initial scene information is optimized according to a scene guiding model, vehicle behaviors and pedestrian behaviors are adjusted, and target scene information meeting a preset target and a preset rule is generated; the scene generation model is obtained based on diffusion model training; the initial scene information comprises vehicle behaviors and pedestrian behaviors, the vehicle behaviors comprise the position, speed and orientation of a vehicle, and the pedestrian behaviors comprise the position, speed and orientation of a pedestrian; the scene parameters include the number of agents, location, speed, type and boundary information. The scene coverage degree is improved, vehicle and pedestrian behaviors in the scene can be flexibly adjusted, the test scene with the specific shielding relation is generated, and the customization requirements of different test scenes are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of autonomous driving technology, and in particular to a test scenario generation method, apparatus, computer device, and storage medium. Background Technology

[0002] Significant progress has been made in autonomous driving technology. Due to the high risks, low efficiency, and high costs of open road testing, autonomous driving simulation testing has become a common testing method in the industry. Therefore, it is crucial to generate autonomous driving test scenarios suitable for autonomous driving simulation testing.

[0003] In traditional technologies, autonomous driving test scenarios generated using training data have significant limitations. Summary of the Invention

[0004] Therefore, it is necessary to provide a test scenario generation method, apparatus, computer equipment, and storage medium that can reduce the limitations of autonomous driving test scenarios in addressing the aforementioned technical problems.

[0005] Firstly, this application provides a method for generating test scenarios, including:

[0006] Obtain scene parameters; the scene parameters include the number of agents, location, speed, type, and boundary information;

[0007] Initial scene information is generated based on the scene parameters and the scene generation model; the scene generation model is trained based on a diffusion model; the initial scene information includes vehicle behavior and pedestrian behavior, the vehicle behavior includes the vehicle's position, speed, and orientation, and the pedestrian behavior includes the pedestrian's position, speed, and orientation;

[0008] The initial scene information is optimized based on the scene guidance model, and the vehicle behavior and pedestrian behavior are adjusted to generate the target scene information that meets the preset goals and preset rules.

[0009] In one embodiment, generating initial scene information based on the scene parameters and the scene generation model includes:

[0010] The scene parameters are denoised using the scene generation model, and the initial scene information is predicted based on the denoised scene parameters.

[0011] In one embodiment, the training process of the scene generation model includes:

[0012] Gaussian noise is gradually added to the vehicle's trajectory in K steps to generate a noisy trajectory.

[0013] The noisy trajectory is converted into a denoised trajectory using a diffusion model;

[0014] The loss of the diffusion model is determined based on the denoised trajectory and the vehicle motion trajectory.

[0015] The diffusion model is optimized based on the loss to obtain the scene generation model.

[0016] In one embodiment, optimizing the initial scene information according to the scene guidance model, adjusting the vehicle behavior and the pedestrian behavior, and generating the target scene information that meets preset goals and preset rules includes:

[0017] Based on the scene guidance model, a guidance function for the initial scene information is determined; the guidance function includes at least one of the following: occlusion scene triangle area loss, occlusion distance-collision time loss, occlusion order loss, and collision loss;

[0018] The initial scene information is optimized according to the guidance function, and the vehicle behavior and pedestrian behavior are adjusted to generate the target scene information that meets the preset goals and preset rules.

[0019] In one embodiment, the method further includes:

[0020] The target scene information is standardized to obtain the processed scene information.

[0021] In one embodiment, the method further includes:

[0022] Autonomous driving tests are conducted based on the processed scene information, semantic map information, and initial vehicle model.

[0023] Secondly, this application also provides a test scenario generation apparatus, comprising:

[0024] The acquisition module is used to acquire scene parameters; the scene parameters include the number of agents, location, speed, type, and boundary information.

[0025] The generation module is used to generate initial scene information based on the scene parameters and the scene generation model; the scene generation model is obtained by training a diffusion model; the initial scene information includes vehicle behavior and pedestrian behavior, the vehicle behavior includes the vehicle's position, speed, and orientation, and the pedestrian behavior includes the pedestrian's position, speed, and orientation;

[0026] The optimization module is used to optimize the initial scene information according to the scene guidance model, adjust the vehicle behavior and the pedestrian behavior, and generate the target scene information that meets the preset goals and preset rules.

[0027] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0028] Obtain scene parameters; the scene parameters include the number of agents, location, speed, type, and boundary information;

[0029] Initial scene information is generated based on the scene parameters and the scene generation model; the scene generation model is trained based on a diffusion model; the initial scene information includes vehicle behavior and pedestrian behavior, the vehicle behavior includes the vehicle's position, speed, and orientation, and the pedestrian behavior includes the pedestrian's position, speed, and orientation;

[0030] The initial scene information is optimized based on the scene guidance model, and the vehicle behavior and pedestrian behavior are adjusted to generate the target scene information that meets the preset goals and preset rules.

[0031] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0032] Obtain scene parameters; the scene parameters include the number of agents, location, speed, type, and boundary information;

[0033] Initial scene information is generated based on the scene parameters and the scene generation model; the scene generation model is trained based on a diffusion model; the initial scene information includes vehicle behavior and pedestrian behavior, the vehicle behavior includes the vehicle's position, speed, and orientation, and the pedestrian behavior includes the pedestrian's position, speed, and orientation;

[0034] The initial scene information is optimized based on the scene guidance model, and the vehicle behavior and pedestrian behavior are adjusted to generate the target scene information that meets the preset goals and preset rules.

[0035] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0036] Obtain scene parameters; the scene parameters include the number of agents, location, speed, type, and boundary information;

[0037] Initial scene information is generated based on the scene parameters and the scene generation model; the scene generation model is trained based on a diffusion model; the initial scene information includes vehicle behavior and pedestrian behavior, the vehicle behavior includes the vehicle's position, speed, and orientation, and the pedestrian behavior includes the pedestrian's position, speed, and orientation;

[0038] The initial scene information is optimized based on the scene guidance model, and the vehicle behavior and pedestrian behavior are adjusted to generate the target scene information that meets the preset goals and preset rules.

[0039] The aforementioned test scenario generation method, apparatus, computer equipment, and storage medium acquire scene parameters; generate initial scene information based on scene parameters and a scene generation model; optimize the initial scene information using a scene guidance model, adjusting vehicle and pedestrian behaviors to generate target scene information that meets preset goals and rules; the scene generation model is trained based on a diffusion model; the initial scene information includes vehicle and pedestrian behaviors, with vehicle behaviors including vehicle position, speed, and orientation, and pedestrian behaviors including pedestrian position, speed, and orientation; scene parameters include the number of agents, their position, speed, type, and boundary information. Employing a diffusion model, it learns the natural driving data distribution of vehicles and pedestrians in a natural dataset, gradually generating complex scene data from random noise, unrestricted by the training data distribution. It can generate diverse and realistic test scenarios, covering visual occlusion situations in complex traffic environments such as the sudden appearance of pedestrians and non-motorized vehicles on urban roads, improving scene coverage. Furthermore, it allows for flexible adjustment of vehicle and pedestrian behaviors within the scene, generating test scenarios with specific occlusion relationships to meet the customized needs of different test scenarios. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0041] Figure 1 This is an application environment diagram of the test scenario generation method in one embodiment;

[0042] Figure 2 This is a flowchart illustrating a test scenario generation method in one embodiment;

[0043] Figure 3 This is a schematic diagram of a scene generation model in one embodiment;

[0044] Figure 4 This is a flowchart illustrating the test scene generation method in another embodiment;

[0045] Figure 5 This is a flowchart illustrating the test scene generation method in another embodiment;

[0046] Figure 6This is a flowchart illustrating the test scene generation method in another embodiment;

[0047] Figure 7 This is a system block diagram for autonomous driving testing in one embodiment;

[0048] Figure 8 This is a structural block diagram of a test scene generation device in one embodiment;

[0049] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0051] Existing reinforcement learning-based methods rely primarily on predefined reward functions and model architectures when generating test scenarios. This can lead to generated scenarios that are overly dependent on the distribution of training data and lack the ability to generalize to unseen traffic conditions. When faced with new and complex traffic environments, these models may fail to accurately generate representative and challenging test scenarios.

[0052] Furthermore, reinforcement learning methods typically require large amounts of training data and computational resources, and the training process can be cumbersome and time-consuming. This not only increases development costs but also limits their flexibility and scalability in practical applications.

[0053] In summary, existing technologies are insufficient in generating autonomous driving test scenarios with high generalization and adaptability. Therefore, this application provides a test scenario generation method, apparatus, computer equipment, and storage medium that can reduce the limitations of autonomous driving test scenarios.

[0054] The test scenario generation method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on other network servers. Terminal 102 sends scene parameters to server 104, enabling server 104 to generate target scene information that meets preset goals and rules based on the scene parameters. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0055] In one embodiment, such as Figure 2 As shown, a test scenario generation method is provided, which can be applied to... Figure 1 Taking the server in the example of this, the explanation includes:

[0056] S201, Obtain scene parameters.

[0057] The scene parameters include the number of agents, their location, speed, type, and boundary information.

[0058] In this embodiment, scene parameters can be obtained from the SinD dataset; alternatively, scene parameters can be obtained through a data acquisition device. The SinD dataset is a publicly available dataset used in fields such as autonomous driving, traffic behavior analysis, and trajectory prediction.

[0059] In this embodiment of the application, the SinD dataset can be converted into a fixed NumPy array format, including the number, location, speed, type and boundary information of agents in the scene, as well as semantic map information (such as feasible domain, sidewalk area, lane line boundary, road boundary line, etc.), and cached in memory for fast reading.

[0060] S202, Generate initial scene information based on scene parameters and scene generation model.

[0061] The scene generation model is trained based on the diffusion model; the initial scene information includes vehicle behavior and pedestrian behavior. Vehicle behavior includes the vehicle's position, speed, and orientation, while pedestrian behavior includes the pedestrian's position, speed, and orientation.

[0062] Among them, the diffusion model has stronger generation and generalization capabilities, and can gradually generate complex scene data from random noise. In addition, it can better capture the distribution characteristics of the data during the training process, thereby generating more diverse and realistic test scenarios.

[0063] In this embodiment of the application, scene parameters are input into the scene generation model, and initial scene information is generated by learning the distribution of natural driving data of vehicles and pedestrians in the scene parameters.

[0064] S203: Optimize the initial scene information based on the scene guidance model, adjust vehicle and pedestrian behaviors, and generate target scene information that meets preset goals and preset rules.

[0065] In this embodiment of the application, historical vehicle behavior and historical pedestrian behavior can be obtained, and an initial scene guidance model can be trained based on the historical vehicle behavior and historical pedestrian behavior. The initial scene guidance model is trained during the training process according to preset goals and preset rules to obtain a trained scene guidance model.

[0066] In this embodiment, initial scene information is input into a scene guidance model to correct any unreasonable information in the initial scene information, ensuring that the scene conforms to specific goals and rules, such as scene rules for view occlusion. The scene guidance model can adjust the behavior of vehicles and pedestrians in the scene according to testing requirements to generate test scenes with specific occlusion relationships.

[0067] The above test scenario generation method involves: acquiring scene parameters; generating initial scene information based on the scene parameters and the scene generation model; optimizing the initial scene information using a scene guidance model to adjust vehicle and pedestrian behaviors, and generating target scene information that meets preset goals and rules; the scene generation model is trained based on a diffusion model; the initial scene information includes vehicle and pedestrian behaviors, with vehicle behaviors including vehicle position, speed, and orientation, and pedestrian behaviors including pedestrian position, speed, and orientation; scene parameters include the number of agents, their position, speed, type, and boundary information. By employing a diffusion model, which learns the natural driving data distribution of vehicles and pedestrians in a natural dataset, complex scene data can be gradually generated from random noise, unrestricted by the training data distribution. This allows for the generation of diverse and realistic test scenarios, covering complex traffic environments such as the sudden appearance of pedestrians and non-motorized vehicles in urban roads, improving scene coverage. Furthermore, it allows for flexible adjustment of vehicle and pedestrian behaviors within the scene, generating test scenarios with specific occlusion relationships to meet the customized needs of different test scenarios.

[0068] In one embodiment, an implementation of the above-mentioned S202 is provided, wherein the above-mentioned "generating initial scene information according to scene parameters and scene generation model" includes: performing noise reduction processing on scene parameters through scene generation model, and predicting initial scene information based on the noise-reduced scene parameters.

[0069] In the embodiments of this application, such as Figure 3 As shown, the scene generation model uses the U-Net framework. In step k, the input trajectory is... Processing is achieved through a series of one-dimensional temporal convolutional blocks, which utilize skip connections and progressively downsample and upsample the sequence corresponding to the scene parameters over time. Specifically, a single conditional feature is extracted from the scene parameters and added to the intermediate trajectory features within each convolutional block; for the map M, it is encoded into a feature grid using a two-dimensional convolutional network, where each pixel contains a high-dimensional feature. In the k-th step of denoising, each two-dimensional location... The feature trajectory is obtained by interpolating the query grid, and this feature trajectory is compared with... The concatenated data becomes the input to U-Net for noise reduction.

[0070] In this embodiment of the application, the scene parameters are denoised in k steps by a scene generation model to obtain the predicted noise to be added to the trajectory, thereby obtaining the initial scene information based on the noise and the scene generation model.

[0071] In the above application embodiments, the scene parameters are first denoised, and then prediction is performed based on the denoised scene parameters to obtain the initial scene information, thereby improving the accuracy of the initial scene information.

[0072] In one embodiment, such as Figure 4 As shown, the training process of the above scene generation model includes:

[0073] S301 generates a noisy trajectory by gradually adding Gaussian noise to the vehicle's trajectory through K steps.

[0074] S302 uses a diffusion model to convert noisy trajectories into denoised trajectories.

[0075] S303, determine the loss of the diffusion model based on the denoised trajectory and the vehicle motion trajectory.

[0076] S304. The diffusion model is optimized based on the loss to obtain the scene generation model.

[0077] In this embodiment, a trajectory is generated through iterative denoising based on a diffusion model; a clean future trajectory is sampled from the data distribution of scene parameters. Initially, by adding Gaussian noise at each process step k, the forward noise-adding process generates a series of noisy trajectories. The noise-addition process conforms to Equation 1:

[0078] (Equation 1)

[0079] in, It is the variance of each step following a fixed pattern. When K is large enough, .

[0080] In this embodiment, the diffusion model learns the reaction of the noise-addition process in order to denoise the sampled noise into a reasonable trajectory. This reverse process is guided by condition C, as shown in Equation 2:

[0081] (Equation 2)

[0082] in, These are model parameters. These are parameters that follow a fixed pattern. The diffusion model learns the average Gaussian distribution of each step in the parameterized denoising process.

[0083] In the embodiments of this application, the diffusion model predicts a noise-free clean trajectory in each iteration. The mean of the Gaussian distribution is determined based on the clean trajectory. Based on the trajectory and the actual vehicle movement trajectory, the loss of the diffusion model is determined as shown in Equation 3, and the model is then optimized according to the following objective loss function:

[0084] (Equation 3)

[0085] in and It was sampled from the training dataset. It is a step index. Used for destruction To provide noisy trajectories By randomly removing the guiding conditions during training, a conditional model was trained simultaneously. and unconditional models During testing, the weights w of the two models are combined as shown in Equation 4:

[0086] (Equation 4)

[0087] in, It is the noise predicted by the model that is added to the clean trajectory.

[0088] In one embodiment, one implementation of the above-described S203 is provided, such as... Figure 5 As shown, the above-mentioned "optimizing the initial scene information based on the scene guidance model, adjusting vehicle and pedestrian behaviors, and generating target scene information that meets preset goals and preset rules" includes:

[0089] S401, Based on the scene guidance model, determine the guidance function for the initial scene information.

[0090] The guiding function includes at least one of the following: occlusion scene triangle area loss, occlusion distance-collision time loss, occlusion order loss, and collision loss.

[0091] In this embodiment of the application, in each denoising step, the input is First, based on the cleaning trajectory predicted by the network. The disturbance cleaning trajectory is shown in Equation 5:

[0092] (Equation 5)

[0093] in, This represents the optimized target trajectory, which is guided from the original trajectory through a process. Obtained in; The original trajectory without guided optimization is typically a noisy initial trajectory. It is the guide step size, which controls the magnitude of each gradient update; This means summing the gradients over each time step k, covering the effects of all time steps; It is the guiding loss function Trajectory The gradient represents the direction in which the trajectory needs to be adjusted in this step; This is the guiding loss function, which typically includes multiple loss terms, such as occlusion loss and collision loss, to ensure that the trajectory conforms to the target rules. Through this process, the model progressively optimizes the trajectory, removes noise, and generates a trajectory that meets the expected target.

[0094] Furthermore, calculate in the same manner as Equation 2. That is, assumption It is the output of the network.

[0095] In this embodiment of the application, the process for determining the occlusion scene triangle area loss, occlusion-induced collision time loss, occlusion order loss, and collision loss includes:

[0096] (1) Occlusion scene triangle area loss: In each clean trajectory obtained by denoising, the triangle area of ​​the trajectory of the key agents (self-vehicle, occluding agent, and occluding agent) is calculated. Specifically, the vector formed by the self-vehicle and the occluding vehicle, and the self-vehicle and the occluding agent at each moment is calculated and normalized; the triangle area is obtained by cross product operation. When the area is less than the threshold, it is considered that the current moment has formed an occlusion effect; before the occlusion effect is formed, the calculated area is used as the loss and used for guidance. The occlusion scene triangle area loss is shown in Equation 6:

[0097] (Equation 6)

[0098] in, This represents the area loss of a triangle, used to measure the loss between two vectors. and The area of ​​the triangle formed; and These are two vectors that represent the two sides of the triangle; It is the modulus of the cross product, representing the area of ​​the parallelogram, which is ultimately calculated by multiplying by... Obtain the area of ​​the triangle.

[0099] (2) TTC (Time to Collision) loss after occlusion: For the part after occlusion, the time difference required for the autonomous vehicle and the occluded agent to reach the intersection point between the two trajectories at the end of the occlusion is calculated and used as TTC; if there is no intersection point, it is set to a maximum value, and TTC is used as the loss to guide the process. The TTC loss after occlusion is shown in Equation 7:

[0100] (Equation 7)

[0101] in, This indicates the time difference between the arrival of the two vehicles at the intersection point.

[0102] (3) Occlusion order loss: To ensure that the occluding vehicle is positioned between the other two vehicles when the occlusion effect is achieved, an occlusion order judgment is performed. If the order is incorrect, a penalty is imposed as a loss. Let the observer's position be pobsi, the occluder's position be pocci, and the target's position be ptgti. Then, the occlusion order loss can be expressed as Equation 8:

[0103] (Equation 8)

[0104] Where N is the batch size; It is a projection deviation penalty; It represents the lateral deviation; i indicates the last frame that caused the occlusion.

[0105] The projection deviation penalty is shown in Equation 9:

[0106] (Equation 9)

[0107] in, It is the vector from the vehicle to the vehicle being blocked; It is the projection length of the occluder onto this vector.

[0108] The lateral deviation is shown in Equation 10:

[0109] (Equation 10)

[0110] in, This represents the lateral deviation loss, used to measure the lateral deviation between the target and the current trajectory; It is the current position of the target, that is, the position of the observed object (such as a vehicle or pedestrian) at the current moment; It is the location of the bicycle; It is the projection vector of the occluding object, representing the projection direction from the target to the observed object; It is the magnitude of the velocity vector of the target vehicle, that is, the speed of the target vehicle.

[0111] (4) Collision Loss: In order to ensure that the obstructing vehicle and the obstructed agent do not have overlapping trajectories and collide, a penalty is imposed as a loss for the occurrence of a collision between the two, as shown in Equation 11:

[0112] (Equation 11)

[0113] in, Indicates collision damage. . is the collision loss between the i-th object and the j-th object; It is a weighting coefficient used to adjust the degree of impact of collision loss; It is the distance between object i and object j; This is the distance threshold for collision loss; collision loss is calculated when the distance between objects is less than this threshold. It is an exponential decay function based on distance, meaning that the smaller the distance between objects, the greater the collision loss, and the loss becomes zero after exceeding a threshold.

[0114] In this embodiment, the four loss components act simultaneously as the guiding function, as shown in Equation 12:

[0115] (Equation 12)

[0116] S402, optimize the initial scene information according to the guidance function, adjust vehicle behavior and pedestrian behavior, and generate target scene information that meets the preset goals and preset rules.

[0117] In this embodiment, a guiding function is used to guide the scene information generated by the model to generate a scene with occlusion. The guiding function adjusts the sampling trajectory in each denoising step to guide it towards the desired result. Let... The guiding loss function is used to measure the trajectory. The degree of violation of user goals. This can be learned or an analytically differentiable function. Guided usage. The gradient of the model is used to perturb the mean of the model's predictions in each denoising step, thereby changing the right side of Equation 2. This allows for the adjustment of vehicle and pedestrian behaviors, generating target scene information that meets preset goals and rules.

[0118] In the above-mentioned application embodiments, the guiding function includes four parts: occlusion scene triangle area loss, occlusion TTC loss, occlusion sequence loss, and collision loss. These losses work together to ensure that the generated scene meets the specific requirements of field of view occlusion, providing strong support for testing the prediction and decision-making capabilities of autonomous driving systems when facing real complex road conditions, and effectively improving the relevance and effectiveness of the test.

[0119] In one embodiment, such as Figure 6 As shown, the above test scenario generation method also includes:

[0120] S204, standardize the target scene information to obtain the processed scene information.

[0121] Standardization processes can include data cleaning, format unification, normalization, and semantic tag integration.

[0122] In this embodiment, after standardizing the target scene information, the output is processed scene information in a standardized format to facilitate subsequent simulation testing and analysis. The processed scene information may include time-series information such as vehicle and pedestrian trajectories and speeds. Optionally, the processed scene information can be output as a structured dataset, such as a standardized scene description file, with a format compatible with subsequent testing tools, such as ROS bag files or ASAMOpenX formats.

[0123] Optionally, invalid or redundant data points can be removed; all data can be converted to a consistent coordinate system (such as the world coordinate system WGS-84 or the local ENU coordinate system) and timestamp format; numerical data can be scaled or normalized to eliminate dimensional differences. For example, position coordinates are converted to offsets relative to the vehicle coordinate system, and velocity values ​​are normalized to the range [0, 1]; standard semantic labels can be added to elements in the target scene (such as vehicles and pedestrians).

[0124] S205 conducts autonomous driving tests based on the processed scene information, semantic map information, and the initial vehicle model.

[0125] In the embodiments of this application, Figure 7 This is a system block diagram for autonomous driving testing. Processed scene information is used as dynamic input, and semantic map information is used as static input. The processed scene information and semantic map information are integrated into the simulation environment. For example, the simulator loads a map to construct a virtual world and then injects standardized scene events as dynamic elements. Further, an initial vehicle model is run in the simulation environment to evaluate the model's response in standardized scenarios, such as whether it complies with traffic rules and performs obstacle avoidance. Built-in metrics are used to quantify the model's behavior, completing the autonomous driving test. These built-in metrics may include safety scores and trajectory deviations. The initial vehicle model can then be optimized based on the quantified values.

[0126] In the above-mentioned embodiments, the heterogeneity and noise of the target scene information are eliminated by standardizing the target scene information, ensuring the uniformity and reliability of the scene description and providing a high-quality input foundation for subsequent testing. By combining the accurate environmental semantics of the semantic map and the algorithm logic of the initial vehicle model, the dynamic fusion of the scene and the map is realized in the simulation test, which significantly improves the repeatability and coverage integrity of the test.

[0127] In one embodiment, a complete test scenario generation method is provided, including:

[0128] S1, Gaussian noise is gradually added to the vehicle's trajectory through K steps to generate a noisy trajectory.

[0129] S2 uses a diffusion model to convert noisy trajectories into denoised trajectories.

[0130] S3. Determine the loss of the diffusion model based on the denoised trajectory and the vehicle motion trajectory.

[0131] S4. Optimize the diffusion model based on the loss to obtain the scene generation model.

[0132] S5, obtain scene parameters.

[0133] S6 uses a scene generation model to denoise the scene parameters and predicts the initial scene information based on the denoised scene parameters.

[0134] S7, based on the scene guidance model, determine the guidance function for the initial scene information.

[0135] S8 optimizes the initial scene information according to the guidance function, adjusts vehicle and pedestrian behaviors, and generates target scene information that meets preset goals and preset rules.

[0136] S9 standardizes the target scene information to obtain the processed scene information.

[0137] S10 conducts autonomous driving tests based on the processed scene information, semantic map information, and the initial vehicle model.

[0138] The above test scenario generation method involves: acquiring scene parameters; generating initial scene information based on the scene parameters and the scene generation model; optimizing the initial scene information using a scene guidance model to adjust vehicle and pedestrian behaviors, and generating target scene information that meets preset goals and rules; the scene generation model is trained based on a diffusion model; the initial scene information includes vehicle and pedestrian behaviors, with vehicle behaviors including vehicle position, speed, and orientation, and pedestrian behaviors including pedestrian position, speed, and orientation; scene parameters include the number of agents, their position, speed, type, and boundary information. By employing a diffusion model, which learns the natural driving data distribution of vehicles and pedestrians in a natural dataset, complex scene data can be gradually generated from random noise, unrestricted by the training data distribution. This allows for the generation of diverse and realistic test scenarios, covering complex traffic environments such as the sudden appearance of pedestrians and non-motorized vehicles in urban roads, improving scene coverage. Furthermore, it allows for flexible adjustment of vehicle and pedestrian behaviors within the scene, generating test scenarios with specific occlusion relationships to meet the customized needs of different test scenarios.

[0139] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0140] Based on the same inventive concept, this application also provides a test scene generation apparatus for implementing the test scene generation method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more test scene generation apparatus embodiments provided below can be found in the limitations of the test scene generation method described above, and will not be repeated here.

[0141] In one embodiment, such as Figure 8As shown, a test scenario generation device is provided, including: an acquisition module 10, a generation module 11, and an optimization module 12, wherein:

[0142] The acquisition module 10 is used to acquire scene parameters; scene parameters include the number of agents, location, speed, type and boundary information.

[0143] The generation module 11 is used to generate initial scene information based on scene parameters and scene generation model; the scene generation model is trained based on diffusion model; the initial scene information includes vehicle behavior and pedestrian behavior, vehicle behavior includes vehicle position, speed and orientation, and pedestrian behavior includes pedestrian position, speed and orientation.

[0144] The optimization module 12 is used to optimize the initial scene information based on the scene guidance model, adjust vehicle behavior and pedestrian behavior, and generate target scene information that meets preset goals and preset rules.

[0145] In one embodiment, the generation module 11 includes a generation unit, configured to perform denoising processing on scene parameters using a scene generation model, and predict initial scene information based on the denoised scene parameters.

[0146] In one embodiment, the above-mentioned test scene generation device further includes: a training module, used to generate a noisy trajectory by gradually adding Gaussian noise to the vehicle motion trajectory through K steps; convert the noisy trajectory into a denoised trajectory using a diffusion model; determine the loss of the diffusion model based on the denoised trajectory and the vehicle motion trajectory; and optimize the diffusion model based on the loss to obtain a scene generation model.

[0147] In one embodiment, the optimization module 12 includes: a determining unit and a generating unit, wherein:

[0148] The determining unit is used to determine the guiding function of the initial scene information based on the scene guiding model; the guiding function includes at least one of the following: occlusion scene triangle area loss, occlusion distance-collision time loss, occlusion order loss, and collision loss.

[0149] The generation unit is used to optimize the initial scene information according to the guidance function, adjust vehicle and pedestrian behaviors, and generate target scene information that meets preset goals and preset rules.

[0150] In one embodiment, the test scenario generation device further includes a processing module for standardizing the target scenario information to obtain processed scenario information.

[0151] In one embodiment, the test scenario generation device further includes a driving module for performing autonomous driving tests based on the processed scenario information, semantic map information, and an initial vehicle model.

[0152] Each module in the aforementioned test scenario generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0153] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 9 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores test scenario generation data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a test scenario generation method.

[0154] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0155] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0156] Obtain scene parameters; scene parameters include the number of agents, location, speed, type, and boundary information;

[0157] Initial scene information is generated based on scene parameters and scene generation model; the scene generation model is trained based on diffusion model; the initial scene information includes vehicle behavior and pedestrian behavior, vehicle behavior includes vehicle position, speed and orientation, and pedestrian behavior includes pedestrian position, speed and orientation;

[0158] The initial scene information is optimized based on the scene guidance model, and the behavior of vehicles and pedestrians is adjusted to generate target scene information that meets the preset goals and preset rules.

[0159] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0160] The scene generation model is used to denoise the scene parameters, and the initial scene information is predicted based on the denoised scene parameters.

[0161] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0162] Gaussian noise is gradually added to the vehicle's trajectory in K steps to generate a noisy trajectory.

[0163] The noisy trajectory is converted into a denoised trajectory using a diffusion model;

[0164] The loss of the diffusion model is determined based on the denoised trajectory and the vehicle motion trajectory.

[0165] The diffusion model is optimized based on the loss to obtain the scene generation model.

[0166] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0167] Based on the scene guidance model, determine the guidance function for the initial scene information; the guidance function includes at least one of the following: occlusion scene triangle area loss, occlusion distance-collision time loss, occlusion order loss, and collision loss;

[0168] The initial scene information is optimized based on the guiding function, and the vehicle and pedestrian behaviors are adjusted to generate target scene information that meets the preset goals and preset rules.

[0169] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0170] The target scene information is standardized to obtain the processed scene information.

[0171] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0172] Autonomous driving tests are conducted based on the processed scene information, semantic map information, and initial vehicle model.

[0173] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0174] Obtain scene parameters; scene parameters include the number of agents, location, speed, type, and boundary information;

[0175] Initial scene information is generated based on scene parameters and scene generation model; the scene generation model is trained based on diffusion model; the initial scene information includes vehicle behavior and pedestrian behavior, vehicle behavior includes vehicle position, speed and orientation, and pedestrian behavior includes pedestrian position, speed and orientation;

[0176] The initial scene information is optimized based on the scene guidance model, and the behavior of vehicles and pedestrians is adjusted to generate target scene information that meets the preset goals and preset rules.

[0177] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0178] The scene generation model is used to denoise the scene parameters, and the initial scene information is predicted based on the denoised scene parameters.

[0179] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0180] Gaussian noise is gradually added to the vehicle's trajectory in K steps to generate a noisy trajectory.

[0181] The noisy trajectory is converted into a denoised trajectory using a diffusion model;

[0182] The loss of the diffusion model is determined based on the denoised trajectory and the vehicle motion trajectory.

[0183] The diffusion model is optimized based on the loss to obtain the scene generation model.

[0184] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0185] Based on the scene guidance model, determine the guidance function for the initial scene information; the guidance function includes at least one of the following: occlusion scene triangle area loss, occlusion distance-collision time loss, occlusion order loss, and collision loss;

[0186] The initial scene information is optimized based on the guiding function, and the vehicle and pedestrian behaviors are adjusted to generate target scene information that meets the preset goals and preset rules.

[0187] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0188] The target scene information is standardized to obtain the processed scene information.

[0189] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0190] Autonomous driving tests are conducted based on the processed scene information, semantic map information, and initial vehicle model.

[0191] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0192] Obtain scene parameters; scene parameters include the number of agents, location, speed, type, and boundary information;

[0193] Initial scene information is generated based on scene parameters and scene generation model; the scene generation model is trained based on diffusion model; the initial scene information includes vehicle behavior and pedestrian behavior, vehicle behavior includes vehicle position, speed and orientation, and pedestrian behavior includes pedestrian position, speed and orientation;

[0194] The initial scene information is optimized based on the scene guidance model, and the behavior of vehicles and pedestrians is adjusted to generate target scene information that meets the preset goals and preset rules.

[0195] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0196] The scene generation model is used to denoise the scene parameters, and the initial scene information is predicted based on the denoised scene parameters.

[0197] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0198] Gaussian noise is gradually added to the vehicle's trajectory in K steps to generate a noisy trajectory.

[0199] The noisy trajectory is converted into a denoised trajectory using a diffusion model;

[0200] The loss of the diffusion model is determined based on the denoised trajectory and the vehicle motion trajectory.

[0201] The diffusion model is optimized based on the loss to obtain the scene generation model.

[0202] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0203] Based on the scene guidance model, determine the guidance function for the initial scene information; the guidance function includes at least one of the following: occlusion scene triangle area loss, occlusion distance-collision time loss, occlusion order loss, and collision loss;

[0204] The initial scene information is optimized based on the guiding function, and the vehicle and pedestrian behaviors are adjusted to generate target scene information that meets the preset goals and preset rules.

[0205] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0206] The target scene information is standardized to obtain the processed scene information.

[0207] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0208] Autonomous driving tests are conducted based on the processed scene information, semantic map information, and initial vehicle model.

[0209] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0210] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0211] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for generating test scenarios, characterized in that, The method includes: Obtain scene parameters; the scene parameters include the number of agents, location, speed, type, and boundary information; Initial scene information is generated based on the scene parameters and the scene generation model; the scene generation model is trained based on a diffusion model; the initial scene information includes vehicle behavior and pedestrian behavior, the vehicle behavior includes the vehicle's position, speed, and orientation, and the pedestrian behavior includes the pedestrian's position, speed, and orientation; The initial scene information is optimized based on the scene guidance model, and the vehicle behavior and pedestrian behavior are adjusted to generate the target scene information that meets the preset goals and preset rules.

2. The method according to claim 1, characterized in that, The step of generating initial scene information based on the scene parameters and the scene generation model includes: The scene parameters are denoised using the scene generation model, and the initial scene information is predicted based on the denoised scene parameters.

3. The method according to claim 1 or 2, characterized in that, The training process of the scene generation model includes: Gaussian noise is gradually added to the vehicle's trajectory in K steps to generate a noisy trajectory. The noisy trajectory is converted into a denoised trajectory using a diffusion model; The loss of the diffusion model is determined based on the denoised trajectory and the vehicle motion trajectory. The diffusion model is optimized based on the loss to obtain the scene generation model.

4. The method according to claim 1, characterized in that, The step of optimizing the initial scene information according to the scene guidance model, adjusting the vehicle behavior and the pedestrian behavior, and generating target scene information that meets preset goals and preset rules includes: Based on the scene guidance model, a guidance function for the initial scene information is determined; the guidance function includes at least one of the following: occlusion scene triangle area loss, occlusion distance-collision time loss, occlusion order loss, and collision loss; The initial scene information is optimized according to the guidance function, and the vehicle behavior and pedestrian behavior are adjusted to generate the target scene information that meets the preset goals and preset rules.

5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: The target scene information is standardized to obtain the processed scene information.

6. The method according to claim 5, characterized in that, The method further includes: Autonomous driving tests are conducted based on the processed scene information, semantic map information, and initial vehicle model.

7. A test scenario generation device, characterized in that, The device includes: The acquisition module is used to acquire scene parameters; the scene parameters include the number of agents, location, speed, type, and boundary information. The generation module is used to generate initial scene information based on the scene parameters and the scene generation model; the scene generation model is obtained by training a diffusion model; the initial scene information includes vehicle behavior and pedestrian behavior, the vehicle behavior includes the vehicle's position, speed, and orientation, and the pedestrian behavior includes the pedestrian's position, speed, and orientation; The optimization module is used to optimize the initial scene information according to the scene guidance model, adjust the vehicle behavior and the pedestrian behavior, and generate the target scene information that meets the preset goals and preset rules.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.