A data-driven autonomous driving simulation scenario generation method and test system

By using a data-driven method for generating autonomous driving simulation scenarios, and leveraging data primitive processing and collaborative modeling with graph attention networks, the problems of insufficient scenario realism and poor scalability in existing virtual simulation testing systems are solved, thus achieving efficient autonomous driving testing and verification.

CN122285529APending Publication Date: 2026-06-26TONGJI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TONGJI UNIV
Filing Date
2026-05-27
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing virtual simulation testing systems are unable to meet the stringent testing requirements of high-level autonomous driving, exhibiting problems such as insufficient scene realism and diversity, insufficient interaction realism, poor scalability, incomplete evaluation indicators, and a disconnect between software and hardware testing.

Method used

A data-driven method for generating autonomous driving simulation scenarios is adopted. Through data primitive processing, collaborative modeling of scene encoders and scene decoders, unified modeling and highly interactive generation of multiple types of traffic participants are achieved. Trajectory prediction is performed by combining graph attention networks, and a modular system architecture and comprehensive evaluation mechanism are constructed.

Benefits of technology

It enhances the realism of simulation scenarios and the ability to transfer data across different scenarios, improves the scalability and adaptability of the system, effectively identifies algorithm failure modes in high-risk scenarios, and improves the systematicness and reliability of autonomous driving testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122285529A_ABST
    Figure CN122285529A_ABST
Patent Text Reader

Abstract

This invention relates to a data-driven method and testing system for generating simulation scenarios of autonomous driving. The method includes the following steps: Step S1, data primitiveization processing; Step S2, constructing and training an autonomous driving test scenario simulation generation model based on primitive prediction and graph attention mechanisms; Step S3, multi-agent scenario generation simulation evaluation. The system evaluates the quality of the generated simulation scenarios from three aspects: trajectory accuracy, kinematic feature realism, and zero-shot generalization ability across datasets. The system adopts a modular design, enabling comprehensive evaluation of simulation scenario quality and testing effectiveness. The testing and verification module integrates software-in-the-loop (SIL) and hardware-in-the-loop (HIL) testing capabilities to complete the full-link performance verification of the system. This invention can significantly improve the realism and cross-scenario adaptability of simulation scenarios, effectively reduce trajectory prediction errors and traffic participant collision rates, and provide efficient and reliable technical support for the research, testing, and iterative verification of autonomous driving algorithms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of computer software technology and intelligent transportation, and particularly relates to a data-driven method and testing system for generating simulation scenarios for autonomous driving. Background Technology

[0002] As autonomous driving technology evolves towards Level 3 and above, functional safety and expected functional safety have become core bottlenecks restricting its commercialization. Research indicates that high-level autonomous driving systems require billions of kilometers of testing to meet stringent safety requirements. However, real-world road testing has inherent limitations such as high cost, long cycles, and incomplete coverage of test scenarios, making it difficult to meet the needs of technology research and development and verification. Against this backdrop, virtual simulation testing, with its significant advantages of low cost, high efficiency, and high controllability, has become a core means of testing and verifying autonomous driving systems, and its performance directly determines the efficiency of algorithm iteration and the commercialization process. However, existing virtual simulation testing systems have significant technical shortcomings and are unable to meet the stringent testing requirements of high-level autonomous driving, specifically as follows: First, the core models of mainstream simulation testing systems have fundamental shortcomings. Current mainstream solutions are still primarily rule-driven systems, relying on preset rules and fixed behavioral models. While these systems offer good interpretability and operational efficiency, their rigid behavioral modeling logic makes it difficult to depict complex driving game behavior, irrational reactions, and personalized driving characteristics. They also fail to reproduce dynamic interactive scenarios, resulting in a severe lack of scenario realism and diversity. It is worth noting that a mature data-driven simulation testing platform has not yet been established, and related data-driven modeling technologies are mostly still in the research stage. Even when these modeling technologies attempt to improve behavioral fidelity at the theoretical level, they generally fall into the core dilemma of balancing high behavioral fidelity with strong cross-scenario transferability: imitation learning models are highly sensitive to the distribution of training data and are prone to instability across scenarios; reinforcement learning models lack sufficient behavioral fidelity; deep learning models are often strongly coupled with specific maps, resulting in weak transferability, and the displacement error and cross-dataset error of mainstream models in existing research are both at high levels.

[0003] Secondly, the simulation system architecture has structural flaws. Mainstream platforms (such as TESS NG, VTD, and AirSim) mostly adopt historical trajectory playback mode or rely on mechanical and simple traditional rule-based models, resulting in a lack of real-time interaction capabilities for background traffic participants and insufficient realism in interaction. At the same time, these platforms generally lack modular design and standardized interface adaptation capabilities, resulting in cumbersome processes for external model access, replacement, and algorithm integration, and extremely poor scalability and adaptability.

[0004] In addition, the existing system lacks a full-link performance evaluation mechanism. The evaluation indicators only focus on trajectory error, ignoring core testing requirements such as safety and comfort. Furthermore, the software-in-the-loop and hardware-in-the-loop test data are disconnected, which seriously restricts the engineering implementation process.

[0005] The inherent shortcomings at the model level and the structural defects at the system level, as mentioned above, together hinder the in-depth application of virtual simulation testing in autonomous driving verification. Summary of the Invention

[0006] In view of the problems existing in the prior art, the purpose of this invention is to overcome the above-mentioned defects of the prior art by providing a data-driven method and testing system for generating autonomous driving simulation scenarios, which can improve the system's flexibility, scalability and end-to-end verification capabilities while ensuring authenticity and robustness.

[0007] The objective of this invention can be achieved through the following technical solutions: One aspect of the present invention provides a data-driven method for generating autonomous driving simulation scenarios, comprising the following steps: Step S1, data primitiveization processing; Trajectory data of various traffic participants, including motor vehicles, non-motor vehicles, and pedestrians, are collected from real-world autonomous driving datasets, along with corresponding high-precision map data. The data undergoes spatiotemporal alignment, anomaly removal, interpolation completion, smoothing, normalization, and primitive generation to produce trajectory primitive sequences and map primitive sequences. This provides a unified data foundation for subsequent multi-agent behavior modeling and scene generation; each traffic participant is considered an agent. Step S2: Construct and train an autonomous driving test scenario simulation generation model based on primitive prediction and graph attention mechanism; By using a unified spatiotemporal discretization representation method, the original continuous trajectory and map structure are transformed into a learnable discrete primitive sequence. The map encoder and trajectory decoder are combined to jointly model the three-dimensional interaction relationship between map, agent and time series, thereby generating background traffic behavior trajectories with high realism, high interactivity and strong cross-scene transfer capability. Step S3: Multi-agent scene generation simulation evaluation. The quality of the generated simulation scene is systematically evaluated from three aspects: trajectory accuracy, kinematic feature realism, and zero-shot generalization ability across datasets.

[0008] Through Waymo dataset experiments, cross-dataset zero-shot generalization tests, software-in-the-loop tests, and hardware-in-the-loop tests, the trajectory accuracy, kinematic distribution consistency, scene interaction complexity, and system testing effectiveness of the generated simulation scene are comprehensively evaluated to verify the effectiveness of the invention in terms of simulation realism, generalization ability, and engineering implementation capability.

[0009] In step S2, the road geometric constraints, topological relationships, and environmental semantic information in the traffic scene are encoded using a scene encoder. The specific process is as follows: First, the map data is primitiveized using the K-Dists clustering method to construct a vocabulary of map primitives containing typical geometric patterns such as straight ahead, left turn, and right turn. Matching and mapping are then performed based on the average Euclidean distance between map fragments and various map primitives, realizing the transformation from continuous map geometry to discrete map primitives. Second, each map polyline primitive is treated as a graph node. Its continuous geometric features are embedded using a multilayer perceptron, and its discrete attribute features are mapped using an embedding table to form an initial node representation. Further, adjacency relationships are constructed based on a fixed-radius search, and Fourier embedding is used to encode the relative position vectors of opposite edges. Finally, a multilayer graph attention network is used to aggregate and model local topological dependencies. Information propagation is achieved through a message aggregation mechanism based on attention weights, and the feature update ratio is controlled by a gated residual structure, resulting in a high-dimensional scene representation for subsequent trajectory generation.

[0010] Furthermore, multi-agent trajectory generation is achieved through a scene decoder, the specific process of which is as follows: The scene decoder constructs three types of semantically complementary relationship graphs, corresponding to temporal evolution relationships, spatial interaction relationships, and environmental constraint relationships, respectively. Specifically, in the agent-time sequence graph, temporal edges are established for the states of the same agent at different times, and relative state vectors are used to describe the differences in coordinates and heading angles to characterize the motion continuity of a single traffic participant. In the map-agent graph, association edges are established when the Euclidean distance between an agent and map elements is less than a set threshold, and relative state vectors are used to describe its spatial offset and orientation angle to reflect the constraint effect of road geometry on motion behavior. In the agent-agent graph, interaction edges are established when the Euclidean distance between two agents at the same time is less than a given radius to represent the dynamic game relationship between traffic participants. The relative state vectors in the above relationship graphs are mapped to a high-dimensional space via Fourier embedding, then uniformly input into an attention network for feature fusion. After multi-layer interaction updates, they are fed into a multi-layer perceptron prediction head, outputting the trajectory primitive probability distribution at the corresponding time, and autoregressive trajectory prediction is achieved through Softmax.

[0011] Furthermore, the scene decoder employs a label smoothing strategy to construct a loss function to optimize trajectory generation performance, as detailed below: For the trajectory primitive classification task of each agent at each prediction time, the original single-class label is converted into a soft label distribution, and the model parameters are optimized based on the log loss between the prediction probability distribution and the soft label distribution. The label smoothing strategy can alleviate the overfitting of the model to the training samples, improve the robustness of the model to input disturbances and unseen scenarios, thereby enhancing the stability and generalization ability of the simulation framework in complex traffic scenarios. In one embodiment of the present invention, the total number of trajectory primitive categories is set to 2048, and the label smoothing parameter is set to 0.1.

[0012] Furthermore, a primitive prediction mechanism is employed to achieve unified motion modeling for multiple types of traffic participants, as detailed below: K-Dists clustering was used to construct independent trajectory primitive vocabularies for trajectory segments of motor vehicles, non-motor vehicles, and pedestrians, respectively. A map primitive vocabulary based on typical geometric patterns was also constructed for map polylines to achieve unified discretization representation of different modal inputs. During trajectory generation, the model predicts the corresponding trajectory primitives at each time step based on the features obtained by fusing the three types of relationship graphs, and then recovers the continuous trajectory through primitive back mapping. This primitive prediction-based modeling method can effectively reduce the model's dependence on specific map structures and manual semantic annotations, and enhance the model's transferability in heterogeneous road networks and complex interactive scenarios.

[0013] In step S3, after the simulation scene is generated, the generation results and test effects are quantitatively evaluated through a comprehensive evaluation mechanism, as follows: For autonomous driving control algorithms, an evaluation index system is established from three core dimensions: safety, efficiency, and comfort, with weights of 50%, 30%, and 20% respectively, to evaluate the comprehensive performance of the tested algorithms in risk avoidance, task completion efficiency, and ride comfort. For simulation scene generation algorithms, evaluation is conducted from two dimensions: realism and test effectiveness. Realism is quantified by average displacement error, endpoint displacement error, and Jensen-Shannon (JS) divergence of multiple kinematic features, while test effectiveness is quantified by interaction complexity, collision rate, and failure mode recognition capability, to achieve a systematic assessment of scene quality and test value.

[0014] In another aspect, the present invention provides a data-driven autonomous driving simulation testing system for implementing the aforementioned data-driven autonomous driving simulation scenario generation method, the simulation testing system comprising: The map parsing module is used to parse high-precision XML format map files based on the OpenDRIVE 1.6.0 standard and follow the process of "structured parsing - discretization transformation" to construct an object model containing road geometry, topological relationships and traffic control attributes, and generate discrete map points through equidistant arc length sampling, providing a unified environmental semantic foundation for the simulation environment and autonomous driving algorithm; The environmental control module is used to build a simulation environment based on the bird's-eye view mode. It uses structured state vectors to uniformly describe the position, speed, acceleration, heading angle and geometric dimensions of the main vehicle and the background vehicle. It also integrates control logic such as collision detection, road boundary crossing, target arrival and timeout termination, and records data throughout the simulation process. The background traffic simulation module is used to access data-driven or rule-driven traffic simulation models through standardized interfaces, and to perform state organization, model forward inference and agent lifecycle management operations in each simulation step in sequence to form a continuous closed-loop background traffic flow generation mechanism. The main vehicle update module is used to reserve a standardized access interface for the autonomous driving algorithm under test, so that it can complete closed-loop control after outputting control quantities based on unified observation information. The system automatically performs constraint verification and state update, realizing rapid decoupling and integration between the algorithm under test and the simulation environment. The comprehensive evaluation module is used to quantitatively evaluate the performance of autonomous driving control algorithms and the quality of simulation scene generation according to a two-dimensional evaluation system, and outputs core indicator results, evaluation reports and traceable test data.

[0015] Furthermore, the system also includes a model building module, comprising: The data acquisition and preprocessing module is used to collect multi-source traffic flow trajectory data and high-precision map data, and to complete spatiotemporal alignment, abnormal data removal, missing segment completion, smoothing, primitive processing and normalization processing to generate trajectory primitive sequences and map primitive sequences. The multi-agent modeling module is used to build the HIGTOP-Sim data-driven simulation framework based on scene encoders and scene decoders. It achieves joint modeling of the map-agent-temporal three-dimensional interaction relationship through unified primitive representation and graph attention network, and generates highly realistic behavioral trajectories of multiple types of traffic participants. The generalization optimization module is used to optimize the training of model parameters based on the label smoothing loss function, thereby improving the robustness and generalization performance of the model in complex traffic scenarios, heterogeneous map environments, and unseen test scenarios.

[0016] Compared with the prior art, the present invention has at least one of the following beneficial effects: (1) This invention realizes the unified modeling and joint generation of multiple types of traffic participants such as motor vehicles, non-motor vehicles and pedestrians through unified spatiotemporal discretization primitive representation, which can effectively improve the consistency and realism of mixed traffic flow simulation. The generated trajectory has better performance in terms of average displacement error and endpoint displacement error. (2) This invention uses graph attention network to jointly model the three-dimensional interaction relationship between map, agent and time sequence, which can more fully capture the spatial constraints, temporal dependencies and multi-agent interaction behavior in complex traffic scenarios, thereby generating dynamic background traffic flow that is more in line with real traffic laws, effectively reducing the background vehicle collision rate, and improving the complexity of scene interaction and test value. (3) The present invention adopts a modular system architecture and standardized interface design, which can support the flexible access and rapid replacement of multiple traffic simulation models and autonomous driving algorithms, overcome the problems of poor scalability and cumbersome model integration of existing simulation platforms, and significantly improve the system's adaptability and engineering application capabilities. (4) This invention constructs a two-dimensional comprehensive evaluation system covering the quality of scene generation and the performance of the tested algorithm. Combined with Waymo dataset experiments, cross-dataset zero-shot generalization tests, software-in-the-loop tests and hardware-in-the-loop tests, it forms a complete technical closed loop from model construction, system integration to application verification. It can effectively identify algorithm failure modes in high-risk scenarios and improve the systematicness and reliability of autonomous driving test verification. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of the HIGTOP-Sim data-driven simulation framework according to an embodiment of the present invention; Figure 2 This invention provides trajectory primitives for various types of traffic participants in its embodiments. Figure 3 This is a schematic diagram of typical clustering results of map polylines in an embodiment of the present invention; Figure 4 This is a schematic diagram of the map primitive fusion encoding module according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the trajectory primitive prediction and decoding module according to an embodiment of the present invention; Figure 6 This is a schematic diagram illustrating the zero-shot generalization inference results of the model in this embodiment of the invention on multiple datasets; Figure 7 This is a schematic diagram of the overall architecture of the autonomous driving simulation test system according to an embodiment of the present invention; Figure 8 This is a schematic diagram of the background traffic update module process in an embodiment of the present invention; Figure 9 This is a schematic diagram of the main vehicle update module process in an embodiment of the present invention. Detailed Implementation

[0018] The technical solution provided in this application will be further described below with reference to specific embodiments and accompanying drawings. The advantages and features of this application will become clearer from the following description.

[0019] Example 1 This embodiment takes the HIGTOP-Sim (HIerarchical Graph-based TOken Predictor for traffic SIMulation) simulation framework as its core. Through unified spatiotemporal discretized primitive representation, collaborative modeling of scene encoders and scene decoders, it realizes unified modeling and interactive generation of multiple types of traffic participants such as motor vehicles, non-motor vehicles and pedestrians, thereby significantly improving the consistency, realism and cross-scene generalization ability of mixed traffic flow simulation.

[0020] Figure 1 This is the core architecture diagram of the HIGTOP-Sim simulation framework. The framework comprises three stages: data primitive processing, model training, and scene generation and simulation evaluation. The data primitive processing stage converts multimodal inputs into a unified discrete representation; the model training stage uses a scene encoder and scene decoder to collaboratively model and capture road environment constraints, multi-agent interaction relationships, and temporal evolution patterns; and the scene generation and simulation evaluation stage verifies the effectiveness of the method from dimensions such as trajectory accuracy, kinematic distribution consistency, and cross-dataset generalization ability.

[0021] A data-driven method for generating autonomous driving simulation scenarios includes the following steps: Step S1, Data Primitiveization Processing. Discretization is used to unify multimodal inputs, providing a standardized primitive sequence for simulation framework modeling. Specifically: Step S101: Data Acquisition, Preprocessing, and Primitive Transformation. Acquire real road topology data, traffic signal status data, and historical trajectory data of various types of traffic participants. Preprocess and primitive transformation are performed on the continuous trajectories of these traffic participants to enhance the model's adaptability to unseen scenarios.

[0022] In this embodiment, Waymo's public dataset and real-world road test data are collected, including complete trajectory information of motor vehicles, non-motor vehicles, and pedestrians, as well as high-precision map data in XML format. The trajectory data is spatiotemporally aligned, with a uniform time step set to 0.1 seconds; each trajectory segment consists of 5 consecutive time steps, used to describe the position and heading changes of traffic participants in the local time domain. When there are short-term missing segments in the trajectory sequence caused by sensor occlusion, short-term target loss, missing detection frames, or inconsistent timestamps, linear interpolation is used to fill in the missing states between adjacent valid trajectory points in order to maintain the continuity of the trajectory sequence in the time dimension. When there are position jitters, abrupt changes in heading angles, or discontinuities in local motion states caused by detection noise between adjacent sampling points, the trajectory coordinates, heading angles, and their derived motion states are smoothed to reduce the impact of abnormal measurement noise on subsequent primitive matching and trajectory generation. For trajectory segments whose missing duration exceeds a preset threshold or whose motion state clearly does not meet the motion constraints of vehicles, non-motorized vehicles, or pedestrians, they will be removed or truncated and will not participate in the subsequent construction of the primitive vocabulary.

[0023] The scene context includes road topology, traffic signal status, and agent history status. The road topology consists of map polylines, and each polyline is segmented into segments of no more than 5 meters in length. Eleven control points are sampled at 0.5-meter intervals to form a map representation at a uniform scale. The K-Dists clustering algorithm is used to generate a primitive vocabulary, which includes: a trajectory primitive vocabulary, consisting of three categories, independently constructed for motor vehicles, non-motor vehicles, and pedestrians; and a map primitive vocabulary, used to represent typical map geometric patterns such as going straight, turning left, and turning right.

[0024] The trajectory primitives use a fixed window of 5 consecutive time steps to record the plane coordinates and heading angles. During primitiveization, a sliding time window is constructed based on the trajectory sequence after interpolation and smoothing. A sliding window update mechanism is introduced, using the primitive matching result of the previous time step as a reference to iteratively match the candidate primitives of the next time step, thereby reducing primitive jumps between adjacent time steps and enhancing the consistency and stability of the generation process.

[0025] Map primitiveization completes the matching mapping by calculating the average Euclidean distance between map fragments and candidate primitives in the map primitive vocabulary. The formula for calculating the Euclidean distance is: in, Representing the eigenvector With feature vectors The Euclidean distance between them; Representing the eigenvector The One component; Representing the eigenvector The One component; This serves as the index for the feature components. The feature vector is a one-dimensional vector obtained by numerically expanding a map fragment or candidate map primitive under a unified coordinate reference, unified sampling order, and unified sampling scale. It includes geometric features such as the planar coordinates of each control point, local tangential direction, heading angle change, and curvature change, and is used to characterize the spatial morphology and turning trend of the map fragment. Through the above processing, a unified discretization representation of trajectory data and map data is achieved.

[0026] Figure 2 This diagram illustrates the trajectory primitives of various types of traffic participants and their typical clustering results in this embodiment. Figure 2 As shown, the three sub-figures, from top to bottom, illustrate the spatial distribution of the original trajectory segments of motor vehicles, non-motor vehicles, and pedestrians in a unified local coordinate system. The horizontal axis represents the displacement of the trajectory segment in the forward direction, the vertical axis represents the lateral offset of the trajectory segment, and the trajectory line represents the actual motion segment of the traffic participants within a continuous short time window. It can be seen that although the three types of traffic participants differ significantly in speed level, trajectory length, and lateral disturbance amplitude, they all exhibit relatively stable local motion patterns. That is, most trajectories extend along the main direction, accompanied by a small amount of deflection, bending, or lateral adjustment behavior. This provides a data foundation for subsequent trajectory primitive extraction.

[0027] Figure 3 These are some typical trajectory primitives obtained based on the clustering algorithm in this embodiment. The gray curve represents the original trajectory samples belonging to the same cluster, and the red curve and nodes represent the representative trajectory primitives of the corresponding cluster. The clustering results show that different clusters mainly reflect the differences in the trajectory segments' forward distance, lateral offset direction, and curvature variation. Specifically, some clusters (cluster 2, cluster 3, cluster 6, cluster 9) exhibit near-linear motion or short-term forward movement with small lateral offsets, mainly used to characterize the behavior of traffic participants maintaining stable directional movement within a local time window; some clusters (cluster 1, cluster 4) exhibit slight positive lateral offsets or slow bending changes while moving along the forward direction, corresponding to a relatively gentle directional adjustment process; some clusters (cluster 5, cluster 7) exhibit negative lateral offsets or slight downward bending trends, used to describe the behavior of adjusting the local movement direction to the other side; and another cluster (cluster 8) shows a more obvious positive lateral offset and a larger bending amplitude, which can characterize a stronger turning or lateral adjustment movement within a short time window. It can be seen that the constructed trajectory primitives do not only represent a single straight or turning category, but rather use a limited number of representative trajectory shapes to discretize the short-term displacement scale, lateral offset direction and local curvature changes commonly found in real traffic flow.

[0028] Step S2: Construct and train an autonomous driving test scenario simulation generation model based on primitive prediction and graph attention mechanisms. The model includes a scene encoder and a scene decoder, as detailed below: Step S201: Scene encoder construction. The scene encoder is used to extract spatial structure, topological dependencies, and semantic constraints in the road environment, providing a high-dimensional map representation for subsequent multi-agent trajectory generation.

[0029] In this embodiment, the preprocessed map fragments are first mapped to their corresponding map primitive categories, completing the map discretization transformation. Let the first... The continuous geometric features of a map segment are Its corresponding map primitive category is The discrete semantic features of road attributes, lane attributes, and traffic control attributes are: Continuous geometric features include the coordinates of map fragment sampling points, local tangential direction, heading angle variation, and curvature variation; discrete semantic features include road type, lane attributes, turning attributes, and traffic signal association attributes. Map primitive categories Obtained by matching the map primitive vocabulary, specifically: the preprocessed map fragment is converted into a map feature vector at a uniform scale, the distance between it and each candidate primitive in the map primitive vocabulary is calculated, and the candidate primitive number with the smallest distance is used as the map primitive category label of the map fragment.

[0030] Continuous geometric features are embedded using a multilayer perceptron, and map primitive categories and discrete semantic attributes are mapped using an embedding table. The two are then fused to form the initial features of the map nodes. in, Indicates the first Initial features of each map node; Represents a continuous geometric feature embedding function; Represents the map primitive category embedding table; Represents a discrete semantic attribute embedding function; The representation layer normalization operation is used to unify the numerical scale of features from different sources and improve training stability.

[0031] Subsequently, adjacency relationships between map nodes are established based on a fixed-radius search. Let the... The center point of each map node is located at , No. The center point of each map node is located at The set of adjacent edges in a map is defined as follows: in, Represents the set of adjacent edges on the map; The search radius represents the map's adjacency relationships; This represents Euclidean distance. This method allows for the connection of spatially close or locally topologically related map segments within a graph structure.

[0032] For map nodes Its adjacent nodes Construct the relative geometric feature vectors of map edges: in, Represents the relative geometric features between map nodes; and Representing nodes respectively Relative to node Local coordinate differences; This represents the angle between the local tangential directions of two map nodes; This represents the Euclidean distance between the center points of two map nodes. and Commonly representing the angle difference can avoid angles at... and Numerical discontinuities occur at the periodic boundaries. Furthermore, [the following is likely a separate, unrelated sentence:] Fourier embedding mapping to high-dimensional edge features This enhances the model's ability to express local distance changes, direction changes, and periodic geometric relationships.

[0033] Based on this, a multi-layer graph attention network is used to aggregate and model the local topological dependencies of the map. For the first... Layered graph attention network, current node Its adjacent nodes The query vector, key vector, and value vector are constructed as follows: in, Represents a node The query vector; Indicates adjacent nodes On the side The corresponding key vector; Indicates adjacent nodes On the side The corresponding value vector; and Representing nodes respectively and nodes In the Input features of the layer; , , These represent the query, key, and value mapping matrices, respectively. , These represent the mapping matrices from edge features to the key space and value space, respectively.

[0034] node For adjacent nodes The attention weights and aggregated messages are represented as follows: in, Represents a node Assigned to adjacent nodes Attention weights; Represents a node The set of adjacent nodes on the map; This represents the index of any node in the set of adjacent nodes; Represents the dimension of attention features; Used to scale the inner product result; This represents the message characteristics obtained by aggregating adjacent nodes.

[0035] To control the update ratio between the original node features and the adjacent aggregated features, a gated residual structure is introduced for node updates: in, Represents a node The gating coefficient; This represents the Sigmoid activation function; Indicates feature concatenation operation; This represents element-wise multiplication; This represents the gating mapping matrix.

[0036] After multiple layers of graph attention updates as described above, a high-dimensional map representation containing map primitive categories, local geometry, and road topological dependencies is obtained: in, express The first map node passes through Map node representation after layered graph attention update. This indicates the number of map nodes.

[0037] This high-dimensional map representation serves as the environmental context input for subsequent scene decoders, providing road geometry, local topology, and traffic semantic constraints in the map-agent relationship graph, thereby supporting multi-agent trajectory primitive prediction.

[0038] Figure 4 This is a schematic diagram of the map primitive fusion encoding module in an embodiment of the present invention. Figure 4As shown, firstly, map polyline primitives are used as graph nodes, and continuous geometric features and discrete semantic attributes such as roads, lanes, and traffic signals are embedded and mapped to form an initial representation of the map nodes. Subsequently, adjacency relationships between map nodes are constructed based on a fixed radius search, and Fourier embedding is performed on the relative position vectors between adjacent nodes to obtain edge feature representations. Finally, node features and edge features are input into a multi-layer graph attention update module, and adjacent node information is aggregated through attention calculation of query vectors, key vectors, and value vectors. Combined with a feedforward network, normalization, and residual connections, a high-dimensional map representation is generated, providing road geometry, topological relationships, and traffic semantic constraints for subsequent multi-agent trajectory generation.

[0039] Step S202, Scene decoder construction. The scene decoder is represented by the high-dimensional map output in step S201 above. As input to the environmental context, and combined with the historical states, agent types, and historical trajectory primitive information of multiple agents, an agent time sequence graph, a map-agent graph, and an agent-agent graph are constructed to model time dependencies, environmental constraints, and spatial interaction relationships, thereby realizing the autoregressive generation of multi-agent trajectories.

[0040] In this embodiment, the state node of the intelligent agent (corresponding to traffic participants) is first constructed.

[0041] time No. The state vectors of the agents are: The state vector includes position coordinates, velocity, acceleration, heading angle, and geometric dimensions. Type label is This can be obtained from the object category field in the original dataset; The trajectory primitive category within the corresponding time window is The category is obtained by matching the trajectory primitive vocabulary. Specifically, the trajectory segments of the agent for 5 consecutive time steps are transformed into a unified local coordinate system to form a trajectory feature vector containing changes in planar position and heading angle. Then, distance matching is performed with the trajectory primitive vocabulary of the corresponding traffic participant type, and the primitive number with the smallest distance is selected as the trajectory primitive category.

[0042] By fusing the agent's continuous state features, agent type embedding, and historical trajectory primitive embedding, the initial features of the agent's state nodes are obtained: in, Represents intelligent agents At any moment Initial node characteristics; Represents the embedding function of the agent's state features; Represents the embedding table of agent types; Represents the trajectory primitive embedding table. Presentation layer normalization operation.

[0043] Subsequently, the scene decoder constructs three types of semantically complementary relationship graphs: agent-sequence graph, map-agent graph, and agent-agent graph.

[0044] In the agent time sequence diagram, if the same agent At two different time steps and If valid trajectory data exists for both states and the time interval meets the set window requirement, a temporal edge is established between the corresponding two state nodes. Temporal edges are primarily used to describe the continuity of motion and the trend of directional change of the same agent within a local time range. To avoid confusion with variables in other relational graphs, the relative state vector of a temporal graph is defined as: in, , This represents the state nodes corresponding to the same agent at different time steps. Represents two state nodes , The time interval between; Represents a node Relative to node Longitudinal displacement in the agent's local coordinate system; Represents a node Relative to node Lateral displacement in the agent's local coordinate system; Indicates the change in heading angle of the same agent between two time steps; superscript This indicates that the variable belongs to the time series diagram.

[0045] In the map-agent graph, when the Euclidean distance between an agent node and a map node is less than a set threshold, a map constraint edge is established between them. This graph describes the constraints imposed by road geometry, lane orientation, and local topology on the agent's motion behavior. To highlight the map constraint relationship, the relative state vector of the map-agent edge is defined as: in, Represents the state node of the intelligent agent. Represents a map node; This represents the longitudinal projection distance of the agent relative to the local tangential direction of the map node; This represents the lateral offset distance of the agent relative to the local normal direction of the map node; This represents the angle between the agent's heading angle and the local tangential direction of the map node; Represents the Euclidean distance between the agent and the center point of the map node; superscript This indicates that the variable belongs to the map constraint relationship graph.

[0046] In an agent-agent graph, when the distance between two different agents at the same time is less than a given interaction radius, an interaction edge is established between the corresponding state nodes. This graph is used to characterize dynamic interactions among multiple agents, such as following, avoiding, parallelism, and cross-conflict. To distinguish it from temporal relationships and map constraint relationships, the relative state vector of an agent-agent interaction edge is defined as: in, , This represents the state nodes corresponding to two different agents at the same time, and ; Represents intelligent agents Compared to intelligent agents In intelligent agents Vertical relative position in the local coordinate system; Represents intelligent agents Compared to intelligent agents In intelligent agents Lateral relative position in the local coordinate system; This represents the relative velocity between two intelligent agents; Indicates the difference in heading angles between two agents; superscript This indicates that the variable belongs to the agent interaction relationship graph.

[0047] Before entering the attention mechanism, the three types of relative state vectors are all mapped to a high-dimensional space through Fourier embedding to enhance the model's ability to perceive directional periodicity, relative distance changes, and local interaction relationships. Subsequently, feature fusion is performed on the three types of relationship graphs using a graph attention mechanism of the same form as in step S201. That is, a query vector is constructed based on the target node features, and key and value vectors are constructed based on the source node features and edge embeddings. The weights of adjacent nodes are calculated through scaled dot product attention. For the map-agent graph, the source node features come from the map node representation output by the scene encoder; for the agent temporal graph and agent-agent graph, the source node features come from the corresponding agent state node representation.

[0048] After the three types of relationship graphs have completed message aggregation, time-dependent messages, map-constrained messages, and agent interaction messages are fused together, and the agent node features are updated through a gated residual structure. After multi-layer relationship graph attention updates, the agent node features simultaneously include their own historical movement trends, surrounding map constraints, and interaction information of nearby traffic participants.

[0049] Finally, the updated agent node features are input into the multilayer perceptron prediction head, which outputs the probability distribution of the trajectory primitives at the next time step: in, Indicates a historical state and map scene representation Under the given conditions, the trajectory primitive category at the next moment is The generation probability; Indicates the end time The set of historical states of the intelligent agent; This represents the high-dimensional map representation output by the scene encoder; Indicates the first Output scores corresponding to each candidate trajectory primitive; This represents the total number of candidate primitives in the trajectory primitive vocabulary; This represents the candidate class index during the normalization summation process.

[0050] During the inference process, the trajectory primitive with the highest probability or obtained by sampling according to the probability distribution is selected as the next generation result, and continuous trajectory segments are recovered through reverse mapping of the trajectory primitive. Subsequently, the generated state continues to be used as the input for the next simulation step, forming an autoregressive multi-agent trajectory generation process of "state encoding - relation modeling - primitive prediction - trajectory update".

[0051] Figure 5 This is a schematic diagram of the trajectory primitive prediction and decoding module in an embodiment of the present invention. Figure 5 As shown, the scene decoder takes the map fusion encoding output by the scene encoder, the agent's historical trajectory primitives, the agent's type and state attributes, and the relative state of the relation edges as input. First, it forms the initial representation of the agent nodes and the edge feature representation through multilayer perceptron embedding, type attribute embedding, and relative state Fourier embedding. Then, it constructs the agent temporal dependency graph, the map-agent constraint graph, and the agent-agent interaction graph, respectively, and performs graph attention updates on the three types of graphs in sequence to fuse temporal dependencies, road environment constraints, and multi-agent spatial interaction information. Finally, it inputs the updated agent node features into the MLP prediction head, and outputs the trajectory primitive probability distribution for the next time step after Softmax normalization, thereby realizing autoregressive multi-agent trajectory generation.

[0052] Step S203, Model training loss optimization. A label smoothing strategy is used to construct a loss function to optimize the probability distribution of trajectory primitives output by the scene decoder, thereby alleviating the model's overfitting to single-class labels in the training data and enhancing the model's robustness to input perturbations, trajectory noise, and unseen scenes.

[0053] In this embodiment, the scene decoder in step S202 outputs the trajectory primitive probability distribution of the corresponding agent at each prediction time. For the first... An intelligent agent at time For trajectory primitive prediction, let the predicted probability distribution of the model output be... , of which Each component This indicates that the model predicts the agent's time at time [time value missing]. Adopting the first The probability of each trajectory primitive; This represents the total number of categories in the trajectory primitive vocabulary.

[0054] Real category labels The trajectory primitives are obtained from step S101, not from manual annotation. Specifically, for the... An intelligent agent at time For the corresponding real trajectory segment, firstly, select the corresponding trajectory primitive vocabulary based on the type of traffic participant; specifically, motor vehicles, non-motor vehicles, and pedestrians each have their own independently constructed trajectory primitive vocabulary. Then, transform the real trajectory segment to a unified local coordinate system and extract the planar coordinates, heading angle, and their variation features over five consecutive time steps to form a trajectory segment feature vector. Calculate the distance between this trajectory segment feature vector and each candidate primitive in the corresponding trajectory primitive vocabulary, and use the candidate primitive number with the smallest distance as the real category index. .therefore, Indicates the first An intelligent agent at time The trajectory primitive category number corresponding to the actual trajectory segment.

[0055] To avoid the model developing excessive confidence in the true category, this embodiment converts the original one-hot labels into a soft-label distribution. Let... Indicates the number after label smoothing. The soft tag values ​​corresponding to each category are: in, Indicates the label smoothing parameter; when When, it indicates the first The class is the primitive category of the real trajectory; when When, it indicates the first The class is a non-real trajectory primitive category. Through this processing method, the real class still retains the highest supervision weight, while other candidate classes are assigned a small amount of probability mass, thereby reducing the model's over-reliance on a single primitive category.

[0056] Based on the above soft-label distribution, the label smoothing loss function is expressed as: in, Indicates label smoothing loss; This represents the probability distribution of trajectory primitive predictions output by the model; Indicates indexing by real category The corresponding original real labels; Indicates the first label after smoothing Values ​​for soft tags; The model predicts the first... An intelligent agent at time Belongs to the The probability of each trajectory primitive category; Indicates the total number of trajectory primitive categories; This indicates a category index.

[0057] During multi-agent, multi-timestep training, the losses of all effective agents and effective prediction moments are summed or averaged to obtain the overall training objective: in, This represents the total training loss of the model; The set of valid samples participating in training includes agent-time step samples that have valid real trajectory segments and can complete primitive matching. Indicates the number of valid samples.

[0058] Samples with severe trajectory loss, targets that have left the scene, insufficient time windows, or inability to complete effective primitive matching are not included. In this embodiment, the total number of trajectory primitive categories Set the value to 2048, which is the label smoothing parameter. We set the loss function to 0.1. Through the above loss function, the model can align the trajectory primitive probability distribution output by the scene decoder with the primitive labels automatically obtained from the real trajectory segments. While maintaining the accuracy of trajectory prediction, it reduces the overfitting to a single primitive category in the training samples, thereby improving the model's generalization ability in scenarios with no road structure, different combinations of traffic participants, and complex interactions.

[0059] Step S3: Multi-agent scene generation simulation evaluation. The quality of the generated simulation scene is systematically evaluated from three aspects: trajectory accuracy, kinematic feature realism, and zero-shot generalization ability across datasets.

[0060] Step S301, Trajectory Error Measurement and Evaluation. This step evaluates the similarity between the generated trajectory and the real expert trajectory at the micro-trajectory level, using the average displacement error (ADE) and the endpoint displacement error (FDE) as the main evaluation indicators. The formula for calculating the average displacement error (ADE) is: The formula for calculating the endpoint displacement error FDE is: in, Indicates the average displacement error; Indicates the error in the endpoint displacement; Indicates the number of agents participating in the evaluation; Indicates the prediction time step; Indicates the agent index; Indicates the index of the prediction time step; Indicates the first The agent in the th... The generated trajectory position at each predicted time; Indicates the first The agent in the th... The actual trajectory position at each predicted moment; This represents the L2 norm, used to calculate the Euclidean distance between two points.

[0061] Step S302, Realism Assessment of Trajectory Motion Features. This step evaluates the realism and robustness of the generated trajectory from the perspectives of distribution consistency and behavioral feasibility using various kinematic features. Specifically, key kinematic features such as linear velocity, acceleration, angular velocity, angular acceleration, following distance, relative velocity, relative acceleration, and collision time TTC are extracted, and the Jensen-Shannon (JS) divergence is used to quantify the differences between the generated trajectory and the real trajectory in the distribution of these features. The formula for calculating the Jensen-Shannon divergence is: in, Represents distribution With distribution Jensen-Shannon divergence between them; This represents the probability distribution of the kinematic features corresponding to the generated trajectory; This represents the probability distribution of the kinematic features corresponding to the true trajectory. express and The average distribution of is defined as ; Represents distribution Relative to distribution Kullback-Leibler divergence; Represents distribution Relative to distribution The Kullback-Leibler divergence. The Kullback-Leibler divergence can be expressed as: in, Represents discrete values ​​in the kinematic feature space; Indicates the generated trajectory in the range of values The probability at that location; This indicates that the average distribution takes values ​​of The probability at a given point. The JS divergence ranges from 0 to 1. The closer the value is to 0, the closer the two distributions are, meaning the simulated trajectory is closer to real traffic data in terms of motion behavior.

[0062] We randomly selected 1000 typical scenarios from the Waymo dataset for realism evaluation, comparing the HIGTOP-Sim model with the benchmark model TrafficBots. The results are shown in Table 1. TrafficBots is an open-source multi-agent traffic simulation and motion prediction framework released by the academic team at ETH Zurich.

[0063] Table 1. Differences in Realism Evaluation Indicators between HIGTOP-Sim Model and Benchmark Model Compared with the baseline model, the HIGTOP-Sim model reduces ADE by 58.4% and FDE by 25.8%, indicating that the method described in this embodiment has a significant advantage in multi-agent trajectory generation accuracy and can better reproduce the real motion characteristics in mixed traffic flow.

[0064] Meanwhile, experimental results show that the HIGTOP-Sim model outperforms the benchmark model in multiple kinematic feature distributions, indicating that the method described in this embodiment can not only better characterize the motion law of the vehicle itself, but also effectively reflect the behavioral characteristics of traffic interaction such as following, yielding and cooperative avoidance, thereby generating a simulation trajectory that is closer to the real traffic scenario.

[0065] Step S303, zero-shot generalization evaluation across datasets. This step evaluates the model's adaptability and transferability on non-training distributions by directly applying the model to other datasets that were not used in the training, without any fine-tuning or retraining.

[0066] In this embodiment, four datasets—highD, sinD, INTERACTION, and CitySim—were selected as unused training datasets. 200 typical scenarios were chosen from each dataset, resulting in a total of 800 test samples. The model was trained solely on the Waymo dataset, without any parameter updates during the inference phase. The evaluation metric used was the kinematic feature distribution consistency index defined in step S302, which quantitatively evaluated the generated results across eight dimensions: velocity, acceleration, angular velocity, angular acceleration, relative velocity, relative acceleration, relative position, and time to collision (TTC). The formula for calculating TTC is: in, Indicates the time of collision between the vehicle and the vehicle in front; It indicates the relative distance between the vehicle and the vehicle in front, that is, the longitudinal distance between the rear of the vehicle in front and the front of the vehicle. Indicates the longitudinal speed of the vehicle; Indicates the longitudinal speed of the vehicle in front; This represents a very small positive value used to avoid the denominator being zero; in this embodiment, it is taken as 0.01 m / s. This indicates taking the larger of the two values. When the vehicle's speed is no greater than the speed of the vehicle in front, there is no risk of a rear-end collision, and TTC is set to infinity.

[0067] Table 2 Consistency evaluation results of zero-sample generalization inference distribution for each dataset For all four datasets, the JS divergence between the eight kinematic features of the trajectories generated by the HIGTOP-Sim model and the real data is less than 0.3, demonstrating highly consistent macroscopic statistical properties. Specific results are shown in Table 2. This result fully demonstrates that the HIGTOP-Sim model still possesses good behavior generation stability and cross-domain modeling ability even without the available datasets, validating its excellent transfer and generalization performance in complex traffic simulation tasks.

[0068] Figure 6This diagram illustrates the zero-shot generalization inference results of the model on various datasets. In this embodiment, representative typical scenarios from each dataset are selected to visually compare the generated trajectories with the real trajectories. Rectangles represent the initial positions of the agents, solid lines represent simulated generated trajectories, and transparent dashed lines represent real trajectories. The results show that under various complex traffic structures, the spatial deviation between the background traffic participant trajectories generated by the model and the real trajectories remains within a small range. Furthermore, it effectively maintains the interaction relationships between agents, such as following and yielding, as well as adherence to map structure constraints such as road boundaries and lane keeping. This further verifies that the method described in this embodiment can still generate high-quality trajectory sequences with realistic physical plausibility and traffic semantic consistency even when lacking target domain training data.

[0069] The method described in this embodiment has the following characteristics: (1) By adopting a unified primitive representation method, multimodal traffic data is converted into discrete symbol sequences, realizing unified modeling of road environment and trajectories of multiple types of traffic participants, laying the foundation for generating realistic and consistent mixed traffic flow simulations.

[0070] (2) A graph attention model that integrates map constraints and spatiotemporal interaction was constructed. By collaboratively modeling three types of relationship graphs—time dependence, spatial interaction, and environmental constraints—it can accurately depict the dynamic interaction behavior of multiple agents in complex traffic scenarios.

[0071] (3) By introducing label smoothing loss and cross-dataset zero-shot evaluation mechanism, the generalization ability of the model is improved while ensuring the reliability of the generated scene in multiple dimensions such as trajectory accuracy, motion feature authenticity and cross-domain adaptability.

[0072] Example 2 To address the issues of high module coupling, cumbersome external model integration, and a single testing and evaluation system in existing simulation testing systems, this embodiment provides a modular and highly adaptable autonomous driving simulation testing system. This system integrates the HIGTOP-Sim simulation framework described in Embodiment 1 and constructs five core functional modules: map parsing, environmental control, background traffic simulation, vehicle updating, and comprehensive evaluation. This enables high-fidelity generation of simulation scenarios, flexible integration of autonomous driving algorithms, and comprehensive quantification of testing results, providing an efficient, controllable, and traceable testing platform for autonomous driving algorithm verification.

[0073] Figure 7This is a diagram illustrating the overall architecture of the autonomous driving simulation testing system described in this embodiment. The architecture is centered on "modular integration + standardized interaction," covering the entire process of "scenario configuration—simulation execution—data recording—comprehensive evaluation." Specifically, the scenario configuration module provides initial scenario definition and parameter settings; five core functional modules collaboratively complete environment analysis, background traffic generation, vehicle control, and state management; the comprehensive evaluation module enables a two-dimensional quantitative evaluation of both the autonomous driving algorithm performance and the simulation scenario quality; and the data storage module retains data from the entire simulation process. The modules interact through standardized interfaces, enabling flexible expansion and collaborative work, while ensuring unified interfaces between modules, facilitating the direct application of the methods verified in Embodiment 1. The specific process is as follows.

[0074] A data-driven autonomous driving simulation testing system includes a map parsing module, an environmental control module, a background traffic simulation module, a main vehicle update module, and a comprehensive evaluation module. By breaking down the core functions of the system into independent but collaboratively operating modules and adopting a standardized interface design, the system achieves high scalability, high adaptability, and high maintainability.

[0075] Specifically as follows: Map parsing module: Used to convert high-precision map data into a standardized environment representation that can be recognized by the system and autonomous driving algorithms, providing a consistent environmental semantic foundation for subsequent simulation execution.

[0076] In this embodiment, the module is developed based on the OpenDRIVE 1.6.0 standard and employs a two-stage processing flow of "structured parsing - discretization conversion" to process high-precision map data in XML format. First, it parses the road geometry, road network topology, traffic control attributes, and lane attributes in the map file. The traffic control attributes include traffic light positions and phases, and the lane attributes include lane width and speed limits, thereby constructing a structured object model containing multi-dimensional semantic information. Subsequently, an equidistant arc length sampling method is used to discretize the map polylines, converting the continuous map geometry into a discrete point set. In this embodiment, the sampling interval is set to 0.5 meters. This module directly applies the map encoder method from Embodiment 1 to primitiveize the map data and construct a high-dimensional scene representation for subsequent multi-agent trajectory generation and environmental constraint modeling, thereby ensuring the consistency and usability of map information in simulation and algorithm integration.

[0077] Environmental control module: used to realize state synchronization, termination condition determination and full-process data recording during the simulation process, so as to ensure the stability, integrity and traceability of the simulation.

[0078] In this embodiment, the module uses a bird's-eye view mode to construct a unified environmental state representation, and uses a structured state vector to represent the operating state of the main vehicle and background traffic participants. The state vector is represented as follows: in, This represents the state vector of a single vehicle or traffic participant at the current moment. Represents the lateral position coordinates in a planar coordinate system; Represents the longitudinal position coordinates in a planar coordinate system; (a) represents longitudinal velocity; (b) represents longitudinal acceleration. Indicates the heading angle; Indicates the width of a vehicle or traffic participant; This represents the length of the vehicle or traffic participant. Through this unified state vector, the synchronous updating and consistent management of the states of all agents within a single simulation step can be achieved.

[0079] Furthermore, this embodiment integrates multiple termination conditions, such as collision detection, road boundary crossing, target arrival, and timeout termination, into the environmental control module. The collision detection threshold is set to 0.5 meters, and the maximum simulation duration is set to 300 seconds. When any termination condition is triggered, the system automatically ends the current simulation and records the reason for termination. Simultaneously, this module stores the entire simulation process data in CSV format at a frequency of 10 Hz. This data includes the state parameters of each agent, control input sequences, key event logs, and termination marker information, thus providing complete data support for subsequent algorithm performance evaluation, behavior analysis, and fault diagnosis.

[0080] Background traffic simulation module: As the core execution unit of the system, it is used to generate background traffic flow with high interactivity and high realism, and supports flexible access to multi-source simulation models.

[0081] In this embodiment, the module reserves a standardized model access interface, which is compatible with the HIGTOP-Sim data-driven model, rule-driven model, and third-party traffic simulation model described in Embodiment 1. In this embodiment, the simulation step size is set to 0.1 seconds. Within each simulation step, the module sequentially performs state organization, model inference, and lifecycle management. State organization is used to collect and standardize the states of all background agents. Model inference calls the selected simulation model to generate the trajectory for the next moment. Lifecycle management is used for agent generation, updating, and recycling, thereby forming a continuous closed-loop background traffic flow. The system integrates the HIGTOP-Sim framework described in Embodiment 1 by default as the background traffic simulation model. This model is based on a unified primitive representation and scene encoding-scene decoding mechanism, jointly modeling the map, agents, and temporal relationships, and generating the trajectory results of background traffic participants for the next moment based on the current observation state. For agents newly entering the scene at the road entrance, the system adds them to the simulation environment according to the scene configuration and traffic flow generation logic; for agents reaching the road exit or meeting the removal conditions, the system automatically removes them from the simulation environment. Through the above mechanism, a continuous, stable background traffic flow with realistic traffic interaction characteristics is formed.

[0082] Figure 8 This is a flowchart illustrating the background traffic update module in this embodiment. The background traffic update module revolves around "acquiring test tasks, loading test scenarios, setting simulation parameters, and initializing background traffic flow." After initialization, it enters a cyclic update process, sequentially executing action preprocessing, vehicle state updating, and state postprocessing within each simulation step. Action preprocessing organizes the behavioral inputs of each background agent in the current scene state; vehicle state updating outputs the position, speed, and heading of the background agents based on the simulation model; and state postprocessing generates, updates, and reclaims background agents, thereby changing the scene state from the current state. Evolves into the state of the next moment This enables continuous closed-loop updates of background traffic flow.

[0083] Main vehicle update module: Used to provide a unified and standardized access channel for autonomous driving algorithms, and realize the decoupled integration between the autonomous driving algorithm under test and the simulation environment.

[0084] In this embodiment, the module designs a unified observation data structure and outputs environmental observation information in each simulation step of the autonomous driving algorithm. The environmental observation information includes the status of background traffic participants, map information, and traffic signal status. The autonomous driving algorithm under test outputs vehicle control commands based on the observation information, and its control vector is represented as: in, Indicates the main vehicle control vector; This indicates the longitudinal acceleration control value of the main vehicle; This represents the steering angle control value of the front wheels of the main vehicle. In this embodiment, the longitudinal acceleration of the main vehicle ranges from [value missing]. to The range of values ​​for the front wheel steering angle of the main vehicle is: to .

[0085] The system receives control vectors Subsequently, the vehicle's state is updated based on the vehicle dynamics model, and dynamic constraint checks are automatically performed to ensure the physical feasibility of the vehicle's motion. For example, in this embodiment, the maximum lateral acceleration constraint is set to not exceed... In this way, the autonomous driving algorithm under test does not need to worry about the underlying environment synchronization and state management. It only needs to output standardized control commands to complete the closed-loop interaction with the simulation system, thereby significantly reducing the cost of algorithm access and test deployment.

[0086] Figure 9 This is a flowchart illustrating the master vehicle update module in this embodiment. The master vehicle update module revolves around "reading test scenario information, parsing scenario source files, and initializing the master vehicle state." After completing simulation reset and planner initialization, it enters a cyclic update process, sequentially executing the following steps within each simulation step: reading environmental observations, performing trajectory planning and prediction, outputting control variables, executing the dynamics calibration kernel, and updating the master vehicle kinematics. Specifically, reading environmental observations provides the tested autonomous driving algorithm with background traffic, map, and traffic signal information; trajectory planning and prediction generates future behavior decisions for the master vehicle; outputting control variables generates control commands such as longitudinal acceleration and front wheel steering angle; and the dynamics calibration kernel and master vehicle kinematics update ensure that the master vehicle's state progression meets physical constraints, thereby achieving standardized closed-loop interaction between the master vehicle and the simulation environment.

[0087] The comprehensive evaluation module is used to establish a two-dimensional evaluation system for the performance of autonomous driving algorithms and the quality of simulation scenarios, thereby providing a systematic, quantitative and comparable evaluation basis for the test results.

[0088] Table 3. Simulation Algorithm Evaluation System In this embodiment, a quantitative evaluation system as shown in Table 3 is constructed for the simulation scene generation algorithm. A percentage-based evaluation method is used to comprehensively assess the quality of the generated simulation scene from two aspects: simulation realism and testing effectiveness. Simulation realism has a maximum score of 60 points, and testing effectiveness has a maximum score of 40 points. The simulation realism part includes three indicators: safety, dynamic safety, and distribution consistency. Specifically, safety indicator A evaluates whether the background vehicle collides in the test scene, and is scored according to the proportion of scenarios without collisions to the total number of test scenarios, with a maximum score of 10 points. Dynamic safety indicator B evaluates whether the background vehicle exceeds dynamic constraint limits during the simulation process, and is scored according to the proportion of scenarios that meet dynamic safety constraints to the total number of test scenarios, with a maximum score of 20 points. Distribution consistency indicator C evaluates the degree of consistency between the simulation environment and the real scene in the distribution of key kinematic features, with a maximum score of 30 points. Specifically, the distribution consistency is composed of velocity distribution consistency index C1, longitudinal acceleration distribution consistency index C2, angular velocity distribution consistency index C3, and angular velocity related distribution consistency index C4. Each of these indexes has a maximum score of 7.5 points. All of them are calculated by subtracting the average JS divergence of the corresponding feature from 1, so that the closer the simulated distribution is to the real distribution, the higher the score will be.

[0089] The effectiveness of the test includes two indicators: interactivity and the difference in scores between autonomous driving algorithms. Interactivity indicator D evaluates the richness of effective interactive behaviors in the simulation scenario. It is calculated based on the duration for which the interaction intensity index exceeds a set threshold in each test scenario, and after normalization, an average score is assigned to each scenario, with a maximum score of 10 points. The difference in scores between simulated and real trajectories evaluates the ability of the simulated trajectory to distinguish the test results of the tested autonomous driving algorithm. It is calculated by averaging the score differences between the tested object in simulated and real trajectory tests, with a maximum score of 30 points. This evaluation system measures both the degree to which the simulation scenario reproduces real traffic behavior and its ability to reveal the performance boundaries and behavioral differences of autonomous driving algorithms, thus achieving a comprehensive evaluation of the quality of the generated simulation scenario.

[0090] System testing and verification: The engineering applicability, testing effectiveness, and operational stability of the simulation test system described in this embodiment are verified through software-in-the-loop testing and hardware-in-the-loop testing.

[0091] Software-in-the-loop (Software-in-the-loop) testing is used to verify the performance of the system described in this embodiment in terms of scene generation realism and algorithm testing effectiveness. In this embodiment, 1000 typical scenarios from the OnSite test scenario library are selected as test objects, including highway scenarios, intersection scenarios, and mixed traffic scenarios. To ensure fairness in the comparison, the autonomous driving algorithm and test process are kept consistent during the test, and the system described in this embodiment is compared with the traditional rule-driven system TESS NG. The results are shown in Table 4.

[0092] Table 4 Performance Comparison of Software-in-the-Loop Testing Systems As shown in Table 4, while maintaining consistency with the tested autonomous driving algorithms, the total score of the data-driven system in this embodiment improved from 59 points for the rule-driven system to 69.3 points, an increase of 17.5%. Specifically, in terms of simulation realism, the safety score of the data-driven system improved from 7.27 to 8.58 points, and the distribution consistency score improved from 18.70 to 21.46 points, indicating that the generated background traffic flow is closer to the real scenario in terms of collision control and kinematic distribution reconstruction. Although the dynamic safety score decreased slightly, the overall realism performance was still better than that of the rule-driven system. Regarding test effectiveness, the interactivity score of the data-driven system improved from 5.71 to 7.52 points, and the difference in rule control algorithm scores improved from 12.56 to 18.12 points, indicating that the system described in this embodiment can generate more interactive and discriminative test scenarios, thereby more effectively exposing the performance defects of autonomous driving algorithms in complex traffic environments. The above results show that the system described in this embodiment has good overall performance in both simulation realism and test effectiveness, and can provide a more challenging and valuable simulation environment for testing autonomous driving algorithms.

[0093] Hardware-in-the-loop testing is used to verify the compatibility, closed-loop operation capability, and real-time performance of the system described in this embodiment with real autonomous driving hardware.

[0094] In this embodiment, an automotive domain controller equipped with a Jetson AGX Orin 32GB processor is selected as the hardware under test and connected to the system described in this embodiment to construct a closed-loop test environment. The system exchanges data with the domain controller in real time through the Redis communication mechanism. In each simulation frame cycle, the system sends environmental status data to the domain controller. After the domain controller executes the planning and control algorithm, it returns control commands. Subsequently, the system completes the update of the master vehicle status and the evolution of background traffic flow, thereby forming a complete closed-loop test link.

[0095] In this embodiment, the communication latency for the system to send environmental status data to the domain controller does not exceed 10 ms, and the closed-loop simulation frame rate is stably maintained at 30 fps. Test results show that the system described in this embodiment successfully identifies typical failure modes of the domain controller in three high-risk scenarios: insufficient interaction stability in unprotected left turns, stalemate during interaction with oncoming vehicles, and lack of effective obstacle avoidance strategies in narrow road scenarios. These results demonstrate that the system described in this embodiment not only possesses good hardware adaptability and real-time interaction capabilities but also effectively uncovers the performance boundaries and potential risks of autonomous driving algorithms in engineering applications.

[0096] The system described in this embodiment has the following characteristics: (1) The modular architecture and standardized interface design are adopted to split the five major functions of map parsing, environmental control, background traffic simulation, main vehicle update and comprehensive evaluation into independent modules, thereby significantly reducing the system coupling and supporting the flexible access and replacement of multi-source simulation models and autonomous driving algorithms, thus improving the system's scalability and adaptability.

[0097] (2) The HIGTOP-Sim simulation framework described in Example 1 is integrated. Relying on the unified primitive representation and the map-agent-temporal three-dimensional interactive modeling capability, the background traffic scene generated by the system is superior to the traditional rule-driven system in terms of trajectory accuracy, kinematic distribution consistency and interaction complexity.

[0098] (3) Construct a two-dimensional comprehensive evaluation system covering the performance of autonomous driving algorithms and the quality of simulation scenarios, and record complete data throughout the simulation process, so as to provide reliable data support for test effect review, algorithm optimization and failure mode analysis.

[0099] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention should fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope defined in the claims.

Claims

1. A data-driven method for generating autonomous driving simulation scenarios, characterized in that, Includes the following steps: Step S1, data primitiveization processing; Trajectory data of various traffic participants, including motor vehicles, non-motor vehicles, and pedestrians, are collected from real-world autonomous driving datasets, along with corresponding high-precision map data. The data undergoes spatiotemporal alignment, anomaly removal, interpolation completion, smoothing, normalization, and primitive generation to produce trajectory primitive sequences and map primitive sequences. This provides a unified data foundation for subsequent multi-agent behavior modeling and scene generation; each traffic participant is considered an agent. Step S2: Construct and train an autonomous driving test scenario simulation generation model based on primitive prediction and graph attention mechanism; By using a unified spatiotemporal discretization representation method, the original continuous trajectory and map structure are transformed into a learnable discrete primitive sequence. The map encoder and trajectory decoder are combined to jointly model the three-dimensional interaction relationship between map, agent and time series, thereby generating background traffic behavior trajectories with high realism, high interactivity and strong cross-scene transfer capability. Step S3: Multi-agent scene generation simulation evaluation; The quality of the generated simulation scene is systematically evaluated from three aspects: trajectory accuracy, kinematic feature authenticity, and zero-shot generalization ability across datasets. Through Waymo dataset experiments, cross-dataset zero-shot generalization tests, software-in-the-loop tests, and hardware-in-the-loop tests, the trajectory accuracy, kinematic distribution consistency, scene interaction complexity, and system testing effectiveness of the generated simulation scene are comprehensively evaluated to verify its effectiveness in terms of simulation realism, generalization ability, and engineering implementation capability.

2. The data-driven autonomous driving simulation scene generation method according to claim 1, characterized in that, Step S1 is as follows: We collected Waymo's public dataset and real-world road test data, including complete trajectory information for motor vehicles, non-motor vehicles, and pedestrians, as well as high-precision map data in XML format; we performed spatiotemporal alignment on the trajectory data and set a uniform time step of 0.1 seconds; each trajectory segment consists of 5 consecutive time steps, used to describe the position and heading changes of traffic participants in the local time domain. When there are short-term missing segments in the trajectory sequence caused by sensor occlusion, short-term target loss, missing detection frames, or inconsistent timestamps, linear interpolation is used to fill in the missing states between adjacent valid trajectory points. When there are position jitters, abrupt changes in heading angle, or discontinuities in local motion states caused by detection noise between adjacent sampling points, the trajectory coordinates, heading angle, and their derived motion states are smoothed. For trajectory segments whose missing duration exceeds a preset threshold or whose motion state clearly does not meet the motion constraints of vehicles, non-motorized vehicles, or pedestrians, they will be removed or truncated and will not participate in the subsequent construction of the primitive vocabulary. The scene context includes road topology, traffic signal status, and agent history status. The road topology consists of map polylines, and each polyline is segmented into segments of no more than 5 meters in length. Eleven control points are sampled at 0.5-meter intervals to form a map representation at a uniform scale. The K-Dists clustering algorithm is used to generate a primitive vocabulary, which includes: a trajectory primitive vocabulary, consisting of three categories, independently constructed for motor vehicles, non-motor vehicles, and pedestrians; and a map primitive vocabulary, used to represent typical map geometric patterns of going straight, turning left, and turning right. The trajectory primitives use a fixed window of 5 consecutive time steps to record the plane coordinates and heading angles. During primitiveization, a sliding time window is constructed based on the trajectory sequence after interpolation and smoothing. A sliding window update mechanism is introduced, using the primitive matching result of the previous time step as a reference to iteratively match the candidate primitives of the next time step, thereby reducing primitive jumps between adjacent time steps and enhancing the consistency and stability of the generation process.

3. The data-driven autonomous driving simulation scene generation method according to claim 2, characterized in that, Map primitiveization completes the matching mapping by calculating the average Euclidean distance between map fragments and candidate primitives in the map primitive vocabulary; the formula for calculating the Euclidean distance is: in, Representing the eigenvector With feature vectors The Euclidean distance between them; Representing the eigenvector The One component; Representing the eigenvector The One component; The feature vector is a one-dimensional vector obtained by numerically expanding a map fragment or candidate map primitive under a unified coordinate reference, unified sampling order and unified sampling scale. It includes the planar coordinates of each control point, local tangential direction, change in heading angle and curvature geometric features, and is used to characterize the spatial morphology and turning trend of the map fragment.

4. The data-driven autonomous driving simulation scene generation method according to claim 1, characterized in that, Step S2 is as follows: Step S201, Scene encoder construction; The scene encoder is used to extract spatial structure, topological dependency and semantic constraint information in the road environment, and provide a high-dimensional map representation for subsequent multi-agent trajectory generation; Step S202, Scene Decoder Construction: The scene decoder uses the high-dimensional map representation output in step S201 as the environmental context input, and combines the historical states of multiple agents, agent types, and historical trajectory primitive information to construct agent time sequence graphs, map-agent graphs, and agent-agent graphs, thereby modeling time dependencies, environmental constraints, and spatial interaction relationships, and realizing the autoregressive generation of multi-agent trajectories. Step S203, Model training loss optimization: A label smoothing strategy is used to construct a loss function to optimize the probability distribution of trajectory primitives output by the scene decoder, so as to alleviate the overfitting of the model to a single class label in the training data and enhance the robustness of the model to input perturbations, trajectory noise and unseen scenes.

5. The data-driven autonomous driving simulation scene generation method according to claim 4, characterized in that, The scene encoder encodes the road geometric constraints, topological relationships, and environmental semantic information in the traffic scene. The specific process is as follows: First, the map data is primitiveized using the K-Dists clustering method to construct a vocabulary of map primitives containing typical geometric patterns of straight ahead, left turn, and right turn. Matching and mapping are then performed based on the average Euclidean distance between map fragments and various map primitives, achieving the conversion from continuous map geometry to discrete map primitives. Second, each map polyline primitive is treated as a graph node. Its continuous geometric features are embedded using a multilayer perceptron, and its discrete attribute features are mapped using an embedding table to form an initial node representation. Adjacency relationships are constructed based on a fixed-radius search, and Fourier embedding is used to encode the relative position vectors of opposite edges. Finally, a multilayer graph attention network is used to aggregate and model local topological dependencies. Information propagation is achieved through a message aggregation mechanism based on attention weights, and a gated residual structure is used to control the feature update ratio, resulting in a high-dimensional scene representation for subsequent trajectory generation.

6. The data-driven autonomous driving simulation scene generation method according to claim 4, characterized in that, Multi-agent trajectory generation is achieved through a scene decoder, and the specific process is as follows: The scene decoder constructs three types of semantically complementary relationship graphs, corresponding to temporal evolution relationships, spatial interaction relationships, and environmental constraint relationships, respectively. Specifically, in the agent-time sequence graph, temporal edges are established for the states of the same agent at different times, and relative state vectors are used to describe the differences in coordinates and heading angles to characterize the motion continuity of a single traffic participant. In the map-agent graph, association edges are established when the Euclidean distance between an agent and map elements is less than a set threshold, and relative state vectors are used to describe its spatial offset and orientation angle to reflect the constraint effect of road geometry on motion behavior. In the agent-agent graph, interaction edges are established when the Euclidean distance between two agents at the same time is less than a given radius to represent the dynamic game relationship between traffic participants. The relative state vectors in the above relationship graphs are mapped to a high-dimensional space via Fourier embedding, then uniformly input into an attention network for feature fusion. After multi-layer interaction updates, they are fed into a multi-layer perceptron prediction head, outputting the trajectory primitive probability distribution at the corresponding time, and autoregressive trajectory prediction is achieved through Softmax.

7. The data-driven autonomous driving simulation scene generation method according to claim 6, characterized in that, A label smoothing strategy is used to construct the loss function to optimize the trajectory generation effect, as follows: For the trajectory primitive classification task of each agent at each prediction time, the original single-class labels are converted into a soft label distribution, and the model parameters are optimized based on the log loss between the predicted probability distribution and the soft label distribution.

8. The data-driven autonomous driving simulation scene generation method according to claim 4, characterized in that, A unified motion modeling approach for multiple types of traffic participants is achieved using an elementary prediction mechanism, as detailed below: K-Dists clustering is used to construct independent trajectory primitive vocabularies for trajectory segments of motor vehicles, non-motor vehicles, and pedestrians respectively, and a map primitive vocabulary based on typical geometric patterns is constructed for map polylines to achieve unified discretization representation of different modal inputs. During trajectory generation, the model predicts the corresponding trajectory primitives at each time step based on the features obtained by fusing the three types of relationship graphs, and then recovers the continuous trajectory through primitive back mapping.

9. The data-driven autonomous driving simulation scene generation method according to claim 1, characterized in that, In step S3, after the simulation scene is generated, the generation results and test effects are quantitatively evaluated through a comprehensive evaluation mechanism, as follows: For autonomous driving control algorithms, an evaluation index system is established from three core dimensions: safety, efficiency, and comfort, with weights of 50%, 30%, and 20% respectively, to evaluate the comprehensive performance of the tested algorithms in risk avoidance, task completion efficiency, and ride comfort. For simulation scene generation algorithms, evaluation is conducted from two dimensions: realism and test effectiveness. Realism is quantified by average displacement error, endpoint displacement error, and Jensen-Shannon divergence of multiple kinematic features, while test effectiveness is quantified by interaction complexity, collision rate, and failure mode recognition capability, to achieve a systematic assessment of scene quality and test value.

10. A data-driven autonomous driving simulation testing system, used to implement the method according to any one of claims 1-9, characterized in that, include: The map parsing module is used to parse high-precision XML format map files based on the OpenDRIVE 1.6.0 standard and follow the process of "structured parsing - discretization transformation" to construct an object model containing road geometry, topological relationships and traffic control attributes, and generate discrete map points through equidistant arc length sampling, providing a unified environmental semantic foundation for the simulation environment and autonomous driving algorithms; The environmental control module is used to build a simulation environment based on the bird's-eye view mode. It uses structured state vectors to uniformly describe the position, speed, acceleration, heading angle and geometric dimensions of the main vehicle and the background vehicle. It also integrates collision detection, road boundary crossing, target arrival and timeout termination control logic, and records the data of the entire simulation process. The background traffic simulation module is used to access data-driven or rule-driven traffic simulation models through standardized interfaces, and to perform state organization, model forward inference and agent lifecycle management operations in each simulation step in sequence to form a continuous closed-loop background traffic flow generation mechanism. The main vehicle update module is used to reserve a standardized access interface for the autonomous driving algorithm under test, so that it can complete closed-loop control after outputting control quantities based on unified observation information. The system automatically performs constraint verification and state update, realizing rapid decoupling and integration between the algorithm under test and the simulation environment. The comprehensive evaluation module is used to quantitatively evaluate the performance of autonomous driving control algorithms and the quality of simulation scene generation according to a two-dimensional evaluation system, and outputs core indicator results, evaluation reports and traceable test data.