Unmanned bus simulation test scene generation method and device, equipment and storage medium
By using human ethical knowledge base and scene loss function to optimize the initial scene model, and combining unmanned bus scene data to generate simulation scenarios that conform to ethical rules, the problem of insufficient scene coverage in the existing technology is solved, and higher quality and efficiency simulation testing is achieved.
Patent Information
- Application Number
- CN202510500355.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-08-15
AI Technical Summary
The existing unmanned bus simulation test scenario generation method is difficult to cover both human ethical rules and long-tail extreme working conditions, resulting in a deviation between simulation test and real road scenarios, and it is impossible to comprehensively evaluate the performance of unmanned driving systems in complex ethical conflicts.
The initial scene model is generated using the human ethics knowledge base, and the scene loss function is optimized and updated, the scene timing and causal model are determined in combination with the unmanned bus scene data, and a lightweight scoring mechanism is used to generate simulated scenes that conform to human ethics.
A simulation test scenario of unmanned buses that is more in line with human ethical standards and is more authentic and complex is generated, which improves the quality and efficiency of scene generation and provides a more accurate and reliable simulation environment for the research and development and testing of unmanned buses.
Smart Images

Figure CN120493494A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent transportation technology, and in particular to a method, device, equipment and storage medium for generating simulation test scenarios for unmanned buses. Background Art
[0002] With the rapid development of intelligent transportation and autonomous driving technologies, driverless buses, as a crucial component of future urban public transportation, face higher demands for safety and stability in complex environments. To ensure that driverless systems possess reliable decision-making and adaptability in the real world, constructing highly realistic and complex simulation test scenarios is crucial. Traditional rule-based or scene-recording methods struggle to fully capture long-tail scenarios, particularly those involving extreme weather, unexpected obstacles, and unusual human behavior. In reality, driverless systems present more than just technical challenges; their behavior is also constrained by ethical and social norms, such as avoiding pedestrians and responding to life-threatening situations. Existing testing systems often overlook the "human ethics" factor, resulting in discrepancies between simulation tests and real-world road scenarios, making it difficult to fully assess the performance of driverless systems in complex ethical conflicts.
[0003] Traditional autonomous driving test platforms often utilize digital twins and generative AI technologies, integrating digital twins with automated generation to create virtual test environments. However, they lack sufficient data for "long-tail extreme scenarios," such as extreme weather, unusual road conditions, and rare human behaviors. These scenarios are difficult to collect in real life, resulting in insufficient model training coverage. Furthermore, test models fail to consider how autonomous vehicles should choose their behavior paths in ethical conflicts, making them unable to replicate real-world decision-making scenarios involving moral judgment.
[0004] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is prior art. Summary of the Invention
[0005] The main purpose of this application is to provide a method, device, equipment and storage medium for generating simulation test scenarios for unmanned buses, aiming to solve the technical problem that existing simulation tests are difficult to generate autonomous driving test scenarios that comply with human ethical rules and cover long-tail extreme working conditions.
[0006] To achieve the above objectives, this application proposes a method for generating a simulation test scenario for an unmanned bus, the method comprising:
[0007] Generate an initial scenario model based on a human ethics knowledge base, and update the initial scenario model according to a scenario loss function to obtain a target scenario model;
[0008] Generate unmanned bus scene data according to the target scene model;
[0009] Determining a scenario timing model and a causal model based on the unmanned bus scenario data, and generating a human ethics simulation scenario based on the scenario timing model and the causal model;
[0010] Scoring the human ethics simulation scenario to obtain a lightweight score;
[0011] The target scenario model is updated according to the human ethics simulation scenario corresponding to the lightweight score, and an unmanned bus simulation test scenario is generated according to the updated target scenario model.
[0012] In one embodiment, the steps of generating an initial scenario model based on a human ethics knowledge base and updating the initial scenario model based on a scenario loss function to obtain a target scenario model include:
[0013] Obtain human ethical rules based on the human ethical knowledge base;
[0014] Performing semantic encoding according to the human ethical rules, and mapping the encoded human ethical rules into a vector of a preset dimension to obtain a human ethical rule vector;
[0015] splicing the human ethics rule vectors to obtain an ethics rule matrix;
[0016] Generate an initial scenario model based on preset scenario data, a cross-attention mechanism, and the ethical rule encoding matrix;
[0017] A scene loss function is determined according to the extreme scene data and the generated distribution data, and the initial scene model is updated according to the scene loss function to obtain a target scene model.
[0018] In one embodiment, the step of determining a scene loss function based on the extreme scene data and the generated distribution data, and updating the initial scene model based on the scene loss function to obtain a target scene model includes:
[0019] According to the extreme scenario data, the conditional intensity coefficient, the preset deviation divergence and the extreme scenario weight are obtained;
[0020] Determine human ethical condition generation distribution data and preset condition generation distribution data according to generation distribution data;
[0021] Determine a scenario loss function according to the condition intensity coefficient, the preset deviation divergence, the extreme scenario weight, the human ethics condition generation distribution data, and the preset condition generation distribution data;
[0022] The initial scene model is updated according to the scene loss function to obtain a target scene model.
[0023] In one embodiment, the steps of determining a scene timing model and a causal model based on the driverless bus scene data, and generating a human ethics simulation scene based on the scene timing model and the causal model include:
[0024] Acquire vehicle status data, pedestrian status data, environmental data, construction time, and coding dimensions based on the unmanned bus scenario data;
[0025] Determining a scene timing model according to the vehicle state data, the pedestrian state data, the environmental data, the construction time, and the encoding dimension;
[0026] Generate a target scene segment according to the scene timing model, and obtain driving characteristics, response characteristics, and causal relationship strength according to the target scene segment;
[0027] A causal model is determined according to the driving characteristics, the response characteristics, the causal relationship strength, and a preset scaling factor, and a human ethics simulation scenario is generated according to the scenario timing model and the causal model.
[0028] In one embodiment, after the steps of determining a scene timing model and a causal model based on the driverless bus scene data, and generating a human ethics simulation scene based on the scene timing model and the causal model, the method further includes:
[0029] Obtaining causal events according to the human ethics simulation scenario;
[0030] extracting causal relationships from the human ethical knowledge base;
[0031] Determining a true or false relationship between the causal event according to the causal relationship, and determining a causal loss function according to the true or false relationship;
[0032] The causal model is updated according to the causal loss function.
[0033] In one embodiment, the step of scoring the human ethics simulation scenario to obtain a lightweight score includes:
[0034] determining the number of dynamic obstacles, the map structure, the speed of dynamic objects, the distance of dynamic objects, and the moving direction of dynamic objects according to the human ethics simulation scenario;
[0035] Calculating a static complexity score based on the number of dynamic obstacles, the map structure, the obstacle weight, and the map structure weight;
[0036] Calculate a dynamic gaming degree score according to the speed of the dynamic object, the distance of the dynamic object, and the moving direction of the dynamic object;
[0037] The lightweight score is calculated according to the static complexity score, the dynamic game degree score, the simulation time and the preset attenuation factor.
[0038] In one embodiment, the step of updating the target scenario model according to the human ethics simulation scenario corresponding to the lightweight score, and generating the driverless bus simulation test scenario according to the updated target scenario model includes:
[0039] Get the lightweight score threshold;
[0040] When the lightweight score is greater than the lightweight score threshold, determining a human ethics simulation scenario corresponding to the lightweight score according to the lightweight score;
[0041] The target scenario model is updated according to the human ethics simulation scenario, and an unmanned bus simulation test scenario is generated according to the updated target scenario model.
[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes a device for generating a simulation test scenario for an unmanned bus, the device comprising:
[0043] A model building module is used to generate an initial scenario model based on the human ethics knowledge base, and update the initial scenario model according to the scenario loss function to obtain a target scenario model;
[0044] A scene generation module, used to generate unmanned bus scene data according to the target scene model;
[0045] The model building module is further configured to determine a scene timing model and a causal model based on the unmanned bus scene data, and generate a human ethics simulation scene based on the scene timing model and the causal model;
[0046] A scenario scoring module, used to score the human ethics simulation scenario to obtain a lightweight score;
[0047] A model updating module is used to update the target scenario model according to the human ethics simulation scenario corresponding to the lightweight score, and generate an unmanned bus simulation test scenario according to the updated target scenario model.
[0048] In addition, to achieve the above-mentioned purpose, the present application also proposes a device for generating an unmanned bus simulation test scenario, which includes: a memory, a processor, and a computer program stored on the memory and runnable on the processor, and the computer program is configured to implement the steps of the unmanned bus simulation test scenario generation method as described above.
[0049] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium. A computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the unmanned bus simulation test scenario generation method as described above are implemented.
[0050] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the unmanned bus simulation test scenario generation method as described above.
[0051] One or more technical solutions proposed in this application have at least the following technical effects:
[0052] By adopting the human ethics knowledge base to generate the initial scenario model, and optimizing and updating the initial scenario model through the scenario loss function to obtain the target scenario model, and combining the unmanned bus scenario data to determine the scenario timing model and causal model to generate a human ethics simulation scenario, and using a lightweight scoring mechanism to evaluate the simulation scenario, the target scenario model is finally updated according to the scoring results and the unmanned bus simulation test scenario is generated. This technical means solves the problems of insufficient consideration of ethical factors in the existing unmanned bus simulation test scenario generation process, lack of scenario complexity and authenticity, and inability to effectively evaluate scenario quality. Compared with the existing technology, it achieves the generation of unmanned bus simulation test scenarios that are more in line with human ethical standards, more realistic and complex, while improving the quality and efficiency of scenario generation, providing a more accurate and reliable simulation environment for the research and development and testing of unmanned buses. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0054] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0055] Figure 1 A flowchart illustrating the first embodiment of the method for generating a simulation test scenario for an unmanned bus in this application;
[0056] Figure 2 A flowchart illustrating the second embodiment of the method for generating a simulation test scenario for an unmanned bus in this application;
[0057] Figure 3A schematic diagram of a simplified flow chart of a method for generating a simulation test scenario for an unmanned bus provided in Example 2 of this application;
[0058] Figure 4 This is a schematic diagram of the module structure of the device for generating a simulation test scenario for an unmanned bus according to an embodiment of the present application;
[0059] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the unmanned bus simulation test scenario generation method in the embodiment of the present application.
[0060] The purpose, features and advantages of this application will be further explained with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION
[0061] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.
[0062] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0063] The main solution of the embodiment of the present application is: generate an initial scenario model based on the human ethics knowledge base, and update the initial scenario model according to the scenario loss function to obtain a target scenario model; generate unmanned bus scenario data according to the target scenario model; determine the scenario timing model and causal model according to the unmanned bus scenario data, and generate a human ethics simulation scenario based on the scenario timing model and the causal model; score the human ethics simulation scenario to obtain a lightweight score; update the target scenario model according to the human ethics simulation scenario corresponding to the lightweight score, and generate an unmanned bus simulation test scenario according to the updated target scenario model.
[0064] In this embodiment, for ease of description, the following description is made using the device for generating a simulation test scenario for identifying an unmanned bus as the execution entity.
[0065] Since existing simulation tests in existing technologies find it difficult to generate autonomous driving test scenarios that comply with human ethical rules and cover long-tail extreme working conditions, the present application provides a solution. By using a human ethical knowledge base to generate an initial scenario model, and optimizing and updating the initial scenario model through a scenario loss function to obtain a target scenario model, the application combines the unmanned bus scenario data to determine the scenario timing model and causal model to generate a human ethical simulation scenario, and uses a lightweight scoring mechanism to evaluate the simulation scenario. Finally, the target scenario model is updated according to the scoring results and an unmanned bus simulation test scenario is generated. This technical means solves the problems of insufficient consideration of ethical factors in the existing unmanned bus simulation test scenario generation process, lack of scenario complexity and authenticity, and inability to effectively evaluate scenario quality. Compared with the existing technology, it achieves the generation of unmanned bus simulation test scenarios that are more in line with human ethical standards, more realistic and complex, while improving the quality and efficiency of scenario generation, providing a more accurate and reliable simulation environment for the research and development and testing of unmanned buses.
[0066] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device capable of implementing the above functions, a self-driving bus simulation test scenario generation device, etc. The following uses the self-driving bus simulation test scenario generation device as an example to illustrate this embodiment and the following embodiments.
[0067] Based on this, the embodiment of the present application provides a method for generating a simulation test scenario for an unmanned bus, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for generating a simulation test scenario for an unmanned bus in this application.
[0068] In this embodiment, the method for generating a driverless bus simulation test scenario includes steps S10 to S50:
[0069] Step S10, generating an initial scene model based on a human ethics knowledge base, and updating the initial scene model based on a scene loss function to obtain a target scene model;
[0070] It should be noted that the Human Ethics Knowledge Base is a collection of various human ethical knowledge, including traffic laws, moral codes, and common subconscious rules related to traffic scenarios, such as yielding to pedestrians, driving slowly at intersections, and driving slowly in blind spots.
[0071] Furthermore, the initial scenario model is a model initially constructed based on the human ethical knowledge base and is the basis for subsequent model optimization.
[0072] It's also important to note that the scene loss function measures the difference between the initial scene model and the desired target scene. By calculating the scene loss function, we can identify model deficiencies and improve them accordingly. For example, in a driverless bus scenario, if the initial model fails to account for pedestrians suddenly crossing the road, the scene loss function will yield a large value, indicating that the model needs improvement.
[0073] Furthermore, the target scene model is a model obtained by updating the initial scene model through the scene loss function. It is more in line with human ethical rules and actual unmanned bus simulation scene requirements, and can simulate real scenes more accurately.
[0074] It's understandable that relevant knowledge is extracted from the human ethics knowledge base, used as a foundation to construct an initial scenario model and establish a preliminary framework for the autonomous bus simulation scenario. The initial scenario model is evaluated using a scenario loss function to analyze the gap between the model and the ideal scenario. Based on this gap, the parameters, structure, or elements of the initial scenario model are adjusted and optimized. This evaluation and update process is repeated until the model meets certain standards, ultimately resulting in the target scenario model.
[0075] In a feasible implementation, step S10 may include steps S11 to S15:
[0076] Step S11, obtaining human ethics rules based on the human ethics knowledge base;
[0077] It's important to note that human ethical rules are the specific manifestation of human ethical knowledge within the human ethical knowledge base and serve as normative guidelines for specific scenarios or behaviors. In the simulation test scenarios for autonomous buses, human ethical rules determine the appropriate behavior of traffic participants, including autonomous buses and pedestrians. For example, the human ethical rule that vehicles should stop and yield to pedestrians at crosswalks is a requirement.
[0078] It's understandable that ethical rules relevant to the driverless bus simulation test scenarios can be extracted from a pre-established human ethics knowledge base. This can be done by first clarifying the scope of the driverless bus's operational scenarios, such as intersection traffic and road section driving. Then, based on these scenarios, the corresponding human ethics rules can be searched in the knowledge base. When constructing a simulation scenario for intersection traffic, human ethics rules such as "stop at red lights, go at green lights" and "turning vehicles give way to straight vehicles" can be retrieved from the knowledge base.
[0079] Step S12, performing semantic encoding according to the human ethical rules, and mapping the encoded human ethical rules into a vector of a preset dimension to obtain a human ethical rule vector;
[0080] It should be noted that semantic encoding is the process of converting human ethical rules in natural language into digital code that computers can understand and process. Through semantic encoding, key semantic information in the rules can be extracted and converted into a specific encoding format to facilitate subsequent calculation and analysis.
[0081] Furthermore, a vector of pre-defined dimensions is a vector space with artificially defined dimensions. The dimension of a vector determines the complexity and richness of the information it can represent. By mapping the encoded human ethical rules into this pre-defined vector space, each dimension can represent a characteristic or attribute of the rule.
[0082] Step S13, concatenating the human ethics rule vectors to obtain an ethics rule matrix;
[0083] It should be noted that the ethics rule matrix is a matrix-like data structure composed of multiple human ethics rule vectors concatenated in a specific order. It integrates multiple human ethics rules, facilitating their unified processing and application in subsequent model calculations. Each row in the matrix represents a human ethics rule vector, and the number of columns is the same as the pre-set vector dimensions. For example, there can be three 5-dimensional human ethics rule vectors, which, when concatenated, form an ethics rule matrix with three rows and five columns.
[0084] It is understandable that the human ethics rule vectors are arranged in the row direction. The first human ethics rule vector is used as the first row of the matrix, the second vector as the second row, and so on, until all the rule vectors are spliced together to form a complete ethics rule matrix. Organizing multiple human ethics rules in the form of a matrix makes the storage and call of the rules more orderly and efficient, and facilitates the operation and processing of multiple rules at one time in subsequent model calculations, thereby improving the efficiency of model construction. The ethics rule matrix can be K = [k1, k2, ..., k n ] T , where k1~k n Vector of ethical rules for humans.
[0085] Step S14, generating an initial scenario model according to the preset scenario data, the cross-attention mechanism, and the ethical rule encoding matrix;
[0086] It's important to note that the pre-set scenario data is the basic data for the autonomous bus simulation scenario, including information such as road layout, location of traffic facilities, and initial vehicle and pedestrian distribution. This data provides the basic framework and background information for building the initial scenario model. For example, the pre-set scenario data includes the road structure of an intersection, the location of traffic lights, and the initial number and location of vehicles and pedestrians around the intersection.
[0087] Furthermore, the cross-attention mechanism is a technical approach used to enhance the correlation between different pieces of information during model calculations. In this step, it is used to correlate and fuse the information in the ethical rule matrix with the pre-set scenario data, enabling the generated scenario model to fully incorporate human ethical principles. Through this cross-attention mechanism, the model can dynamically adjust its focus on different elements of the pre-set scenario data based on the importance of ethical rules.
[0088] Furthermore, the initial scenario model is a model that is initially constructed based on preset scenario data, cross-attention mechanism and ethical rule matrix. The initial scenario model contains basic scenario elements and the scenario structure after preliminary consideration of human ethical rules.
[0089] It is understandable that the preset scene data is input into the model. The cross-attention mechanism is used to calculate the association weight between the ethical rule matrix and the preset scene data. According to the association weight, the information in the ethical rule matrix is integrated into the preset scene data. During the calculation process, the cross-attention mechanism will pay different attention to different parts of the preset scene data according to the importance of the ethical rules. For example, if the ethical rules emphasize pedestrian priority, then a higher weight will be given when processing pedestrian-related information in the preset scene data. In this way, the preset scene data is adjusted and optimized to generate an initial scene model that contains human ethical rules. The generation of the initial scene model is as follows:
[0090] ∈ θ (x t ,t,K)=Attention(∈ θ (x t ,t),K)+MLP(x t )
[0091] Where x t is the preset scene data; the time step t represents the time mark in the diffusion process, which controls the noise intensity. The larger the time step, the stronger the noise. Attention(,) represents the cross attention mechanism, which is used to inject ethical rule conditions into noise prediction. ∈ θ (x t ,t) represents the latent vector output by the noise prediction head; K represents the ethical rule matrix, which aligns the scene and rule relevance through attention weights; MLP(x t ) represents a multi-layer perception mechanism that preserves the physical plausibility of the original noise prediction.
[0092] Step S15: determining a scene loss function according to the extreme scene data and the generated distribution data, and updating the initial scene model according to the scene loss function to obtain a target scene model.
[0093] It should be noted that extreme scenario data refers to special scenarios that may occur with low probability but have a significant impact during the operation of autonomous buses, such as road conditions in extreme weather conditions such as heavy rain and snow, and unusual pedestrian behavior. Extreme scenario data is used to evaluate the performance of the initial scenario model under extreme conditions.
[0094] In addition, generated distribution data refers to the distribution of scene data generated by the initial scene model, reflecting the diversity and rationality of the model-generated scenes. For example, the distribution characteristics of generated data such as vehicle speed and pedestrian walking routes.
[0095] Furthermore, the scenario loss function is used to measure the difference between the scene generated by the initial scenario model and the ideal scene. The scenario loss function comprehensively considers the extreme scene data and the generated distribution data, and by calculating this difference, it determines the direction and degree of model improvement.
[0096] It should also be noted that the target scenario model is derived by updating and optimizing the initial scenario model using the scenario loss function. Taking into account human ethical principles, the target scenario model can more accurately simulate various real-world scenarios, including extreme ones, and better meet the requirements of autonomous bus simulation testing.
[0097] Understandably, if the extreme scenario data includes a vehicle skidding in heavy rain, and the initial scenario model doesn't simulate this, this discrepancy will be reflected in the loss function calculation. Based on the value of the scenario loss function, the parameters or structure of the initial scenario model are adjusted and optimized. By repeatedly calculating the loss function and updating the model, the target scenario model is ultimately obtained.
[0098] In a feasible implementation, step S15 may include steps S151 to S154:
[0099] Step S151, obtaining a conditional intensity coefficient, a preset deviation divergence, and an extreme scene weight according to the extreme scene data;
[0100] It should be noted that the conditional strength coefficient is a parameter used to control the degree to which ethical rules constrain generated scenarios. In extreme scenarios, the conditional strength coefficient determines the degree of influence of human ethical rules on the scenario generation process. A larger coefficient means that the generated scenarios adhere more strictly to ethical rules, but this also reduces scenario diversity. A smaller coefficient means that ethical rules exert relatively weaker constraints on scenario generation, potentially increasing scenario diversity, but also increasing the degree of deviation from ethical rules.
[0101] Additionally, the pre-defined deviation divergence is a pre-defined metric that measures the degree of difference between two distributions. It measures the allowable deviation between the generated distribution under the constraints of human ethical rules and the original distribution of the unconditionally generated scenario. This provides a quantitative standard for judging the rationality of scenario generation, ensuring that the generated scenario not only meets certain ethical rules but also does not deviate excessively from the natural scene distribution.
[0102] In addition, the extreme scenario weight indicates the importance of the extreme scenario in the overall scenario construction and evaluation. The higher the weight, the greater the influence of the extreme scenario in the scenario loss function calculation and model update process.
[0103] It is understandable that the collected extreme scenario data is analyzed. The conditional intensity coefficient is determined based on factors such as the scenario's complexity, degree of danger, and criticality of its impact on the autonomous bus's operation. For extreme scenarios involving life-threatening situations, such as a pedestrian suddenly darting toward a moving autonomous bus, a higher conditional intensity coefficient may be set to ensure the autonomous bus strictly adheres to the ethical rule of yielding to pedestrians in the simulated scenario. By studying a large number of normal and extreme scenarios, and combining practical application needs and experience to set a preset deviation divergence, the reasonable deviation range of the generated distribution from the original distribution in extreme scenarios is determined. Different extreme scenarios are assigned corresponding weights based on their importance to the autonomous bus system testing. For example, extreme weather scenarios that could potentially lead to major accidents are given a higher weight, while rare pedestrian behavior scenarios with relatively less impact are given a lower weight.
[0104] Step S152, determining human ethical condition generated distribution data and preset condition generated distribution data according to the generated distribution data;
[0105] It should be noted that the distribution data generated by human ethical conditions is the distribution of scenario data generated by the initial scenario model when human ethical rules are taken into account. The distribution data generated by human ethical conditions reflects the distribution of scenario elements when human ethical rules are followed.
[0106] In addition, the pre-conditional generated distribution data is the original distribution of the unconditional generated scenario. The pre-conditional generated distribution data serves as a reference standard for comparison with the human ethical condition generated distribution data to determine whether the scenario generated by the initial scenario model meets expectations.
[0107] It can be understood that starting from the generative distribution data generated by the initial scenario model, based on established human ethical rules, scenario data that conforms to these rules is screened and organized, thereby obtaining human ethical condition generative distribution data. Scenario element data related to ethical rules is extracted and its distribution patterns analyzed. Based on actual traffic scenario experience, industry standards, and ethical rule requirements, preset conditional generative distribution data is established. Taking into account different types of traffic scenarios and common behavioral patterns, the distribution range and probability of each scenario element under ideal conditions are determined.
[0108] Step S153, determining a scenario loss function according to the condition intensity coefficient, the preset deviation divergence, the extreme scenario weight, the human ethical condition generation distribution data, and the preset condition generation distribution data;
[0109] It is understandable that the conditional strength coefficient is used to adjust the constraint strength of human ethical rules on scenario generation and incorporate it into the calculation of the scenario loss function. The larger the conditional strength coefficient, the greater the influence of human ethical rules in calculating differences. According to the preset deviation divergence, the degree of deviation between the distribution data generated by human ethical conditions and the distribution data generated by preset conditions is measured. If the deviation between the two exceeds the preset range, a larger penalty value will be reflected in the loss function. Combined with the extreme scenario weights, the extreme scenario data is included in the loss function calculation. For extreme scenarios with higher weights, if the scenarios generated by the model perform poorly in these extreme cases, the value of the loss function will increase significantly. The calculation of the scenario loss function is as follows:
[0110] L ethics =β·KL(ρ(x|K)||p(x))+w(x)·∈ θ (D(x),t,K)
[0111] In the formula, β represents the conditional strength coefficient, which is responsible for overall control of the strength of ethical rule constraints. The larger β is, the more strictly the generated scenario matches the ethical rules, but diversity may be sacrificed; ρ(x|K) represents the distribution data generated under human ethical conditions, that is, the distribution generated under the constraints of human ethical rules; p(x) represents the distribution data generated under preset conditions, that is, the original distribution of unconditional generated scenarios; KL represents the preset deviation divergence, which is used to weigh the deviation between the generated distribution of ρ(x|K) and the unconditional distribution of p(x) to ensure the convergence direction of the core function model; w(x) represents the extreme scenario weight, which is used to enhance the contribution of long-tail extreme scenarios in adversarial training; D(x) represents long-tail extreme scenario data, that is, extreme scenario data.
[0112] In addition, it is understandable that by explicitly injecting human ethical knowledge into the large model, improving the diffusion model, embedding ethical rules as conditions into the noise prediction network, and converging the model through the enhanced adversarial loss function, unmanned bus scene data that complies with human ethical rules and covers the long tail can be generated.
[0113] Step S154: Update the initial scene model according to the scene loss function to obtain a target scene model.
[0114] It is understandable that based on the calculated value of the scene loss function, the deficiencies of the initial scene model can be analyzed. If the loss function value is large, it means that the scene generated by the model is quite different from the ideal scene, and it is necessary to adjust the model parameters such as the vehicle speed setting, the parameters of the pedestrian behavior pattern, or the structure such as the relationship between scene elements and the topological structure of the scene. Using the optimization algorithm, the parameters or structure of the initial scene model are gradually updated according to the feedback information of the scene loss function. After each update, the value of the scene loss function is recalculated to determine whether the model has been improved. This updating and evaluation process is repeated until the value of the scene loss function reaches an acceptable range. The model obtained at this time is the target scene model.
[0115] Step S20, generating unmanned bus scene data according to the target scene model;
[0116] It should be noted that autonomous bus scenario data is a collection of data describing the autonomous bus's operating status and surrounding environment in specific scenarios. This includes data on the vehicle's speed, position, and acceleration; pedestrians' positions and behavioral intentions; and environmental factors such as weather and lighting. Autonomous bus scenario data is a digital representation of the actual autonomous bus's operating scenario.
[0117] It's understandable that the various rules, parameters, and elements already defined in the target scenario model are used to generate various data related to the autonomous bus's operation according to specific algorithms and logic. The road topology in the target scenario model determines the autonomous bus's route. Combined with traffic regulations and pedestrian behavior rules, data such as the autonomous bus's speed changes and interactions with pedestrians are generated during its journey.
[0118] Step S30, determining a scene timing model and a causal model based on the driverless bus scene data, and generating a human ethics simulation scene based on the scene timing model and the causal model;
[0119] It's important to note that a scene temporal model is used to describe how various events in a scene change over time. It records the state information of objects like vehicles and pedestrians at different time steps, presenting the progression of events in chronological order. For example, it might record the speed and position changes of a driverless bus at each moment within 10 seconds, as well as the movement trajectories of pedestrians within that same timeframe.
[0120] In addition, causal models are used to represent the causal relationship between different events in a scenario. Causal models show how the occurrence of one event affects other events, such as the causal relationship between speeding and the risk of an accident in the driverless bus scenario.
[0121] Furthermore, the human ethics simulation scenario simulates a real-world scenario generated based on human ethical rules, combined with a scenario temporal model and a causal model. In this scenario, all events and behaviors adhere to human ethical knowledge, such as autonomous buses obeying traffic laws and yielding to pedestrians.
[0122] It's understandable that based on the temporal changes of various objects in the autonomous bus scenario data, a scenario time series model is constructed to unravel the temporal context of events. The causal relationships between different events in the data are analyzed to construct a causal model. Combining the scenario time series model with the causal model, a scenario is simulated and generated in accordance with human ethical principles. In the time series model, a self-driving bus approaches an intersection at a certain point in time, while a pedestrian prepares to cross the road. The causal model determines that the self-driving bus should slow down to yield to the pedestrian, ultimately generating a simulated scenario that conforms to human ethics.
[0123] In a feasible implementation, step S30 may include steps S301 to S304:
[0124] Step S301, obtaining vehicle status data, pedestrian status data, environmental data, construction time and coding dimension according to the unmanned bus scene data;
[0125] It's important to note that vehicle status data represents the autonomous bus's operating status, including parameters such as speed, position, acceleration, and direction. This data reflects the autonomous bus's state of motion at different moments and is crucial for analyzing its driving behavior and interactions with other road users. For example, a vehicle's speed data can indicate its speed, while its position data can clearly identify its location on the road.
[0126] Additionally, pedestrian status data represents various information about the pedestrian's state within the scene, including relative position coordinates, gait, and intention. Relative position coordinates are used to determine the spatial relationship between the pedestrian and the autonomous bus and other objects; gait reflects the pedestrian's walking style and rhythm, such as normal walking or running; and intention indicates the pedestrian's purpose for their action, such as crossing the street or waiting by the roadside. This data helps us understand pedestrian behavior patterns and simulate interactive scenarios between the autonomous bus and pedestrians.
[0127] It should also be noted that environmental data refers to data on external environmental factors within the autonomous bus's operating environment, including rainfall, lighting, temperature, road conditions, etc. Environmental factors can affect the behavior of both the autonomous bus and pedestrians. For example, rainfall can make roads slippery, affecting vehicle braking performance and potentially changing pedestrians' walking speed and path.
[0128] Additionally, build time is a time parameter used to construct the scenario's sequential model. It represents the total duration of the simulation scenario build segment and determines the time range covered by the data. Build time provides a time scale for analyzing the temporal evolution of various scenario events. Different build times affect the scenario model's recording and analysis of event sequences.
[0129] Additionally, encoding dimensions refer to the number of dimensions used to encode data when building a model. These dimensions determine the complexity and manner in which the model can represent information. Different types of data require different encoding dimensions to accurately represent their characteristics.
[0130] Step S302: determining a scene timing model according to the vehicle state data, the pedestrian state data, the environmental data, the construction time, and the encoding dimension;
[0131] It is understandable that by constructing a scenario timing model, the dynamic changes of various elements in the driverless bus operation scenario can be clearly presented, providing strong support for analyzing the cause-effect relationship in the scenario and generating more realistic simulation scenarios, thereby improving the authenticity and accuracy of the simulation scenario in the time dimension. The scenario timing model is constructed as follows:
[0132]
[0133] Where, Represents the vehicle state of vehicle i in time step 1:T, including vehicle speed, position, acceleration, etc.; represents the pedestrian state of pedestrian j in time step 1:T, including relative position coordinates, gait, intention, etc. Represents the impact of environmental factors within the time step 1:T, including rainfall, light, temperature, etc.; T represents the time step, which represents the total length of the simulation scene construction segment; Sequence represents the dimension d of the temporal model encoding layer h , output time model H.
[0134] Step S303: generating a target scene segment according to the scene time series model, and obtaining driving characteristics, response characteristics, and causal relationship strength according to the target scene segment;
[0135] It should be noted that a target scene segment is a scene segment selected from the scene time series model that is of particular research value or representativeness. It contains information about the state changes of elements such as vehicles, pedestrians, and the environment within a certain time range, which is used for subsequent analysis of causal relationships within the scene. The selection of a target scene segment is generally based on the research objectives and the characteristics of the scene. For example, the time period when an autonomous bus encounters a pedestrian crossing the road at an intersection can be selected as the target scene segment to study the interactive behavior in this scenario.
[0136] Furthermore, driving features refer to the characteristics of factors that can trigger other events or behaviors within the target scenario segment, also known as potential "cause" characteristics. In the autonomous bus scenario, the acceleration of the vehicle may cause the distance to the vehicle ahead to decrease. Therefore, the characteristics corresponding to this acceleration, such as the speed change and acceleration, are driving features. Driving features represent the characteristics of the initiating factors that trigger a series of changes in the scenario.
[0137] Response features, on the other hand, are features corresponding to factors in the target scene segment that respond or change due to the driving features—in other words, "result"-related features. For example, when the autonomous bus accelerates, shortening the distance to the vehicle ahead, the deceleration of the preceding vehicle and the change in distance between them are response features. They reflect the changes in other elements in the scene as a result of the driving features.
[0138] It's important to note that causal strength is a measure of the closeness of the causal relationship between the driver and response characteristics. A larger causal strength value indicates a stronger causal relationship between the driver and response characteristics—that is, the driver is more likely to cause the response characteristic. A smaller value indicates a weaker causal relationship.
[0139] It can be understood that, based on the research objectives or scenario characteristics, a suitable time range is intercepted from the scenario time series model as the target scenario segment. The data in the target scenario segment is analyzed to identify possible driving factors and response factors. The features corresponding to the driving factors are extracted as driving features, and the features corresponding to the response factors are extracted as response features.
[0140] Step S304: determining a causal model according to the driving characteristics, the response characteristics, the causal relationship strength, and a preset scaling factor, and generating a human ethics simulation scenario according to the scenario timing model and the causal model.
[0141] It's important to note that a preset scaling factor is a pre-set coefficient used to adjust certain parameters or data during model calculations. In causal models, this factor is primarily used to stabilize model gradients and prevent saturation during training or calculation. For example, when calculating the strength of a causal relationship, multiplying the factor by the preset scaling factor can keep the result within a reasonable range, preventing instability in model training caused by excessively large or small values.
[0142] It can be understood that the mathematical expression or model structure of the causal model is constructed based on the driving characteristics, response characteristics, and causal relationship strength, combined with the preset scaling factor. The driving characteristics, response characteristics, and causal relationship strength are integrated using methods such as the Sigmoid activation function, and the calculation process is adjusted by the preset scaling factor. The causal model is constructed as follows:
[0143]
[0144] Where, represents the driving feature, i.e., the potential feature of the “cause” of event i within the scene segment under the temporal model; A represents the response feature, that is, the correlation feature of the “result” of event j in the scene segment under the time model; i,j It represents the causal strength of event i on associated event j. The larger it is, the stronger the causal relationship is. σ represents the Sigmoid activation function. Represents the environmental scaling factor, stabilizing the model gradient and preventing model saturation.
[0145] In a feasible implementation manner, after step S30, steps S31 to S34 may be further included:
[0146] Step S31, obtaining causal events according to the human ethics simulation scenario;
[0147] It's important to note that a causal event represents two or more events with a causal connection in a human ethics simulation scenario. The occurrence of one event leads to the occurrence of another, with the former being the "cause" and the latter being the "effect." For example, if a driverless bus speeds (the cause) and causes a longer braking distance (the effect), these two events constitute a set of causal events. In this scenario, causal events reflect the inherent logical connections between different behaviors or phenomena.
[0148] It is understandable that detailed observation and analysis of human ethics simulation scenarios is necessary. From the numerous events and behaviors within the scenario, pairs of events or chains of events with causal relationships are selected. Causal relationships can be identified by tracking the state changes of various elements within the scenario. In the simulation scenario, the speed and position of the autonomous bus, as well as the state changes of surrounding pedestrians, are recorded at different times. If pedestrians avoid the bus when it suddenly accelerates, then the sudden acceleration of the autonomous bus and the pedestrian's avoidance can be identified as a set of causal events. These causal events are organized and recorded in preparation for subsequent analysis.
[0149] Step S32, extracting the causal relationship of the human ethics knowledge base;
[0150] It should be noted that causality is a rule or knowledge within the human ethical knowledge base that reflects the causal relationship between different behaviors and events. Causality clearly defines the logical relationship whereby one behavior or event, as a "cause," triggers another behavior or event, as a "effect."
[0151] It is understandable that, based on the human ethics knowledge base, data is extracted for the parts related to the current human ethics simulation scenario. According to the topics involved in the simulation scenario, such as intersection traffic, road section driving, etc., the corresponding causal relationship knowledge is screened out.
[0152] Step S33, determining the true or false relationship of the causal event according to the causal relationship, and determining a causal loss function according to the true or false relationship;
[0153] It should be noted that the true-false relationship is used to determine whether the causal events in the simulation scenario are consistent with the causal relationships in the human ethics knowledge base. If the causal event in the simulation scenario is consistent with the causal relationship in the knowledge base, then the causal event is judged to be true; conversely, if the two do not match, then it is false. For example, if a vehicle speeding in the simulation increases the risk of an accident, this causal event is true; if the vehicle color changes, causing an increased risk of an accident, and there is no such relationship in the knowledge base, then the causal event is false.
[0154] It is understandable that by determining the true or false relationship of causal events and constructing a causal loss function, the accuracy of the causal model can be quantified, providing a clear direction and basis for updating the causal model, helping to improve the causal model's ability to simulate real causal relationships and making the generated simulation scenarios more reasonable. The calculation of the causal loss function is as follows:
[0155]
[0156] Where, (c i ,c j) represents a causal event, i.e., the causal pair of causal events i and corresponding event j, and the known causal relationship extracted from the ethical rule base, such as speeding will lead to a high risk of accidents. The first term of the loss function represents the highlighting of "true" causal relationships, and the second term of the loss function represents the suppression of "false" causal relationships. For example, if the large model learns that speeding will lead to a high risk of accidents, and the human ethical rule base clearly states that it is "true", then A i,j →1; The large model learns that the shape of the vehicle will cause a high accident risk, and the human ethical rule base does not mention this relationship, so A i,j →0.
[0157] Step S34: updating the causal model according to the causal loss function.
[0158] It's understandable that the calculated causal loss function value can be used to analyze deviations in the causal model. A large causal loss function value indicates that the model's simulation of causal relationships is inaccurate and requires adjustment. An optimization algorithm is used to adjust the parameters of the causal model based on the feedback from the causal loss function. In the formula for calculating the strength of causal relationships, the correlation coefficient or weight is adjusted. After adjusting the parameters, the causal loss function value is recalculated to determine whether the model has improved. This updating and evaluation process is repeated until the causal loss function value reaches a satisfactory range. The resulting causal model is the updated model. By updating the causal model using the causal loss function, the causal model can be continuously optimized to more accurately reflect the causal relationships in real-world scenarios. The updated causal model can generate simulation scenarios that are more realistic and authentic to human ethics, improving the quality and reliability of simulation scenarios and providing more effective support for the testing and research of driverless buses.
[0159] Step S40, scoring the human ethics simulation scenario to obtain a lightweight score;
[0160] It should be noted that the lightweight score is a numerical value obtained by evaluating the human ethics simulation scenario using a lightweight scoring function. The lightweight score comprehensively considers multiple dimensions of the scenario and is used to measure the scenario's performance in terms of quality, efficiency, and safety.
[0161] Understandably, a pre-defined lightweight scoring function is used to evaluate the human ethics simulation scenario. This scoring function considers multiple dimensions, including the scenario's static complexity, dynamic game play, and simulation time. Static complexity is assessed by calculating the mixed entropy of the number of dynamic obstacles (such as vehicles and people) and the road topology. The dynamic game play is determined by calculating the collision risk between the autonomous bus and other entities. The simulation time is recorded as the time required to complete the scenario simulation.
[0162] Step S50: update the target scenario model according to the human ethics simulation scenario corresponding to the lightweight score, and generate an unmanned bus simulation test scenario according to the updated target scenario model.
[0163] It is understandable that based on the obtained lightweight scores, human ethics simulation scenarios with better performance are selected. The characteristics and information of these scenarios are fed back into the target scenario model, and the parameters, structure or elements of the target scenario model are adjusted and optimized. Using the updated target scenario model, the unmanned bus simulation test scenario is regenerated. If the interaction between the unmanned bus and pedestrians in a scenario with a higher lightweight score is more reasonable, the relevant parameters of this interaction method are incorporated into the target scenario model, and then the simulation test scenario containing this optimized interaction method is regenerated. By continuously optimizing the target scenario model, the generated unmanned bus simulation test scenario is made more in line with actual needs, which can more comprehensively and accurately test the unmanned bus system and improve the research and development and testing level of unmanned buses.
[0164] In a feasible implementation, step S50 may include steps S51 to S53:
[0165] Step S51, obtain the lightweight score threshold;
[0166] It should be noted that the lightweight score threshold is a pre-set standard value for measuring the lightweight score. When evaluating human ethics simulation scenarios, the lightweight score represents the comprehensive performance of the scenario in terms of quality, efficiency, safety, and other aspects. High scores appear in scenarios with high complexity and high dynamic game. Low scores appear in simple, low-conflict scenarios. The model is screened by the threshold, taking into account both efficiency and true restoration. The lightweight score threshold is used to distinguish which scenarios meet certain standards and have higher value, and which scenarios may need further optimization. In this embodiment, the lightweight score threshold is set to 60 points, so the human ethics simulation scenario corresponding to a lightweight score greater than 60 points is considered to be a relatively good scenario and can be used for subsequent scenario optimization and model update operations.
[0167] Step S52: when the lightweight score is greater than the lightweight score threshold, determining a human ethics simulation scenario corresponding to the lightweight score according to the lightweight score;
[0168] It is understandable that after obtaining the lightweight score of each human ethics simulation scenario, it is compared with the lightweight score threshold. When the lightweight score of a certain scenario is greater than the lightweight score threshold, the human ethics simulation scenario corresponding to the score is determined. Each lightweight score is associated with the human ethics simulation scenario that generated it, so that after comparing the scores, the corresponding scenario can be quickly found. If there are 10 different human ethics simulation scenarios, their lightweight scores are calculated respectively. Assuming that the lightweight score threshold is 60 points, when the lightweight score of scene A is 75 points, scene A is determined from the correspondence table as a scene that meets the requirements.
[0169] Step S53: update the target scenario model according to the human ethics simulation scenario, and generate an unmanned bus simulation test scenario according to the updated target scenario model.
[0170] It is understandable that the excellent features and information from the determined human ethics simulation scenario are integrated into the target scenario model. The behavior patterns of vehicles and pedestrians, the layout of roads, and the implementation of traffic rules in the human ethics simulation scenario are analyzed to adjust and optimize the parameters or structure of the target scenario model. Using the updated target scenario model, according to certain algorithms and rules, an unmanned bus simulation test scenario is generated. When updating the target scenario model, if it is found that the waiting time of vehicles at a specific intersection in the human ethics simulation scenario is more in line with the actual situation, this waiting time parameter is updated to the target scenario model. Based on the updated target scenario model, an unmanned bus simulation test scenario including the intersection is generated to simulate the driving conditions of the unmanned bus at the intersection and its interaction with other traffic participants.
[0171] By continuously optimizing the target scenario model, the generated unmanned bus simulation test scenario is made closer to the real traffic scenario, which can more comprehensively and accurately test the performance and safety of the unmanned bus system and improve the efficiency and quality of unmanned bus research and development and testing.
[0172] This embodiment provides a method for generating unmanned bus simulation test scenarios. By combining technical means such as a human ethics knowledge base, a scenario loss function, a scenario timing model, a causal model, and a lightweight scoring mechanism, it solves the technical problems of insufficient consideration of ethical factors, lack of scenario authenticity and complexity, and inability to effectively evaluate scenario quality in the existing unmanned bus simulation test scenario generation process. It achieves the beneficial effect of being able to generate unmanned bus simulation test scenarios that are more in line with human ethical rules, more realistic, and more complex. At the same time, it improves the quality and efficiency of scenario generation, and provides a more accurate and reliable simulation environment for the research and development and testing of unmanned buses.
[0173] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 2 , step S40 of the unmanned bus simulation test scenario generation method includes steps S41 to S44:
[0174] Step S41, determining the number of dynamic obstacles, map structure, dynamic object speed, dynamic object distance, and dynamic object movement direction according to the human ethics simulation scenario;
[0175] It should be noted that the number of dynamic obstacles refers to the number of objects in motion that may hinder the operation of the autonomous bus in the human ethics simulation scene, including pedestrians, moving vehicles, etc. The number of these dynamic obstacles will affect the complexity of the scene and the difficulty of the autonomous bus's operation.
[0176] Additionally, the map structure represents the layout and characteristics of the map within the simulation scenario, including information such as the number and type of roads, the number of lanes, and the form and distribution of intersections. Complex map structures, such as those with multiple intersections, complex lane weaving, and irregular road shapes, increase the complexity of the scenario and the challenges faced by the autonomous bus. Simple map structures, such as those with straight roads and few intersections, create a relatively simple scenario.
[0177] It's important to note that dynamic object speed refers to the speed of dynamic obstacles in the simulation. Different dynamic object speeds affect their interactions with the autonomous bus and the potential risk of collision. For example, a fast-moving vehicle will have a greater impact on the autonomous bus's movement than a slow-moving pedestrian, as fast-moving objects have shorter reaction times and can potentially lead to more urgent situations.
[0178] Additionally, dynamic object distance refers to the spatial distance between a dynamic obstacle and the autonomous bus. This distance is crucial when determining potential conflict risks. The closer the distance, the higher the likelihood of a collision or other conflict; the farther the distance, the lower the risk. For example, when a pedestrian approaches a self-driving bus, the distance between them is close, requiring the bus to react promptly to avoid a collision.
[0179] Additionally, the direction of movement of dynamic objects indicates the direction of movement of dynamic obstacles, such as pedestrians crossing the road or vehicles traveling. The direction of movement of dynamic objects determines their relative motion relationship with the autonomous bus, which in turn influences the autonomous bus's driving decisions. If a dynamic object and the autonomous bus are traveling in opposite directions or across from each other, the likelihood of a collision is higher than when they are traveling in the same direction.
[0180] Step S42, calculating a static complexity score based on the number of dynamic obstacles, the map structure, the obstacle weight, and the map structure weight;
[0181] It is understandable that by quantifying the static complexity score, we can intuitively compare the complexity of static elements in different human ethics simulation scenarios, helping to screen out scenarios with moderate complexity for driverless bus testing, ensuring that the test scenarios can reflect the complexity of actual conditions while not being too complex, resulting in excessive testing costs or difficulty in analysis. The static complexity score is calculated as follows:
[0182] C s =α·log(N obj +1)+β·G road
[0183] Where N obj Represents the number of dynamic obstacles such as cars and people in the simulation scene; G road Represents the structure of the map after simulation. The more lanes, intersections, and other information there are, the more complex the structure is, and the larger the value is. α and β represent the obstacle weight and map structure weight, respectively.
[0184] Step S43, calculating a dynamic game degree score according to the dynamic object speed, the dynamic object distance, and the dynamic object moving direction;
[0185] It is understandable that the dynamic game degree score quantifies the risk of collision between the autonomous bus and other dynamic objects, which can help evaluate the effectiveness of simulation scenarios for the safety testing of the autonomous bus system and provide a basis for screening scenarios with different risk levels in order to comprehensively test the autonomous bus's ability to respond to various conflict situations. The dynamic game degree score is calculated as follows:
[0186]
[0187] Where, v i (t) represents the speed of the dynamic object, that is, the speed of the i-th dynamic object at time t; d safe (i) represents the dynamic object distance, i.e., the safe distance between the autonomous bus and the i-th dynamic object; cosθ i (t) represents the moving direction of the dynamic object, that is, the cosine angle value of the moving direction of the unmanned bus relative to the i-th dynamic object in the table; by maximizing the time series value and counting the instantaneous value of the highest conflict intensity in the entire time period, the average masking of the peak risk is avoided.
[0188] Step S44, calculating a lightweight score according to the static complexity score, the dynamic game degree score, the simulation time and a preset attenuation factor.
[0189] It's important to note that simulation time refers to the time required to complete the target scenario simulation. This reflects the efficiency of the scenario simulation: shorter simulation times mean more tests can be performed within the same timeframe. However, oversimplifying the scenario to shorten simulation time can compromise its realism and test effectiveness.
[0190] In addition, the preset attenuation factor is a pre-set coefficient used to control the impact of time cost on the lightweight score. The larger the preset attenuation factor, the stronger the penalty effect of simulation time on the lightweight score; conversely, the penalty effect is weaker.
[0191] It is understandable that by comprehensively considering multiple key factors to calculate the lightweight score, the quality of human ethics simulation scenarios can be comprehensively evaluated, providing a quantitative comprehensive indicator for screening and optimizing simulation scenarios, helping to quickly find scenarios that both meet test requirements and have high efficiency, thereby improving the efficiency and quality of the construction of unmanned bus simulation test scenarios. The lightweight score is calculated as follows:
[0192]
[0193] Where C s represents the static complexity score, i.e., the static complexity of the target simulation scenario, which characterizes the inherent complexity of the static elements in the simulation scenario; D c represents the dynamic game degree score, that is, the dynamic game degree of the target simulation scene, which characterizes the intensity of the game of dynamic objects in the simulation scene and reflects the conflict risk between the unmanned bus and other entities; sim It represents the simulation time, which represents the time required to complete the simulation of the target scenario; γ represents the preset attenuation factor, the attenuation coefficient in the negative exponential term, which controls the penalty intensity of time cost on the score.
[0194] This embodiment provides a method for generating an unmanned bus simulation test scenario, determines the number of dynamic obstacles, map structure, dynamic object speed, dynamic object distance and movement direction, and calculates a static complexity score and a dynamic game degree score, as well as a technical means for calculating a lightweight score by combining simulation time and a preset attenuation factor. This solves the technical problem of the lack of quantitative evaluation standards and comprehensive considerations in the existing unmanned bus simulation test scenario evaluation, and achieves the beneficial effect of comprehensively evaluating the complexity and safety of the simulation scenario and improving the efficiency and quality of the unmanned bus simulation test scenario construction.
[0195] For example, in order to help understand the implementation process of the method for generating the unmanned bus simulation test scenario obtained by combining this embodiment with the above embodiment 1, please refer to Figure 3 , Figure 3 This paper provides a brief flow chart of the method for generating unmanned bus simulation test scenarios, specifically:
[0196] Starting with a human ethics database and simulation target scenarios, these are fed into the ethics rule macromodel. The ethics rule macromodel generates ethics rule simulation data, which is then fed into the causal macromodel. The causal macromodel combines temporal information to generate causal logic-annotated ethics simulation data. This causal logic-annotated ethics simulation data is used to construct simulation scenarios. Once the simulation scenarios are constructed, a lightweight evaluation is performed, which is then used to improve the causal model and the ethics rule macromodel.
[0197] It should be noted that the above examples are only used to understand this application and do not constitute a limitation on the method for generating unmanned bus simulation test scenarios in this application. More simple transformations based on this technical concept are all within the scope of protection of this application.
[0198] This application also provides a device for generating unmanned bus simulation test scenarios, please refer to Figure 4 , the unmanned bus simulation test scenario generating device includes:
[0199] A model building module 10 is used to generate an initial scenario model based on the human ethics knowledge base, and update the initial scenario model according to the scenario loss function to obtain a target scenario model;
[0200] A scene generation module 20 is used to generate unmanned bus scene data according to the target scene model;
[0201] The model building module 10 is further configured to determine a scene timing model and a causal model based on the unmanned bus scene data, and generate a human ethics simulation scene based on the scene timing model and the causal model;
[0202] A scenario scoring module 30 is used to score the human ethics simulation scenario to obtain a lightweight score;
[0203] The model updating module 40 is used to update the target scenario model according to the human ethics simulation scenario corresponding to the lightweight score, and generate an unmanned bus simulation test scenario according to the updated target scenario model.
[0204] The unmanned bus simulation test scenario generation device provided in this application adopts the unmanned bus simulation test scenario generation method of the above-mentioned embodiment, which can solve the technical problem that existing simulation tests are difficult to generate autonomous driving test scenarios that both comply with human ethical rules and cover long-tail extreme working conditions. Compared with the existing technology, the beneficial effects of the unmanned bus simulation test scenario generation device provided in this application are the same as the beneficial effects of the unmanned bus simulation test scenario generation method provided in the above-mentioned embodiment, and the other technical features of the unmanned bus simulation test scenario generation device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.
[0205] In one embodiment, the model construction module 10 is further used to obtain human ethical rules based on a human ethical knowledge base; perform semantic encoding according to the human ethical rules, and map the encoded human ethical rules into vectors of preset dimensions to obtain human ethical rule vectors; splice the human ethical rule vectors to obtain an ethical rule matrix; generate an initial scenario model based on preset scenario data, a cross-attention mechanism, and the ethical rule encoding matrix; determine a scenario loss function based on extreme scenario data and generated distribution data, and update the initial scenario model based on the scenario loss function to obtain a target scenario model.
[0206] In one embodiment, the model building module 10 is also used to obtain a conditional strength coefficient, a preset deviation divergence, and an extreme scenario weight based on extreme scenario data; determine human ethical condition generation distribution data and preset condition generation distribution data based on the generated distribution data; determine a scenario loss function based on the conditional strength coefficient, the preset deviation divergence, the extreme scenario weight, the human ethical condition generation distribution data, and the preset condition generation distribution data; and update the initial scenario model based on the scenario loss function to obtain a target scenario model.
[0207] In one embodiment, the model construction module 10 is further used to obtain vehicle status data, pedestrian status data, environmental data, construction time and coding dimensions based on the unmanned bus scene data; determine the scene timing model based on the vehicle status data, the pedestrian status data, the environmental data, the construction time and the coding dimensions; generate a target scene segment based on the scene timing model, and obtain driving characteristics, response characteristics and causal relationship strength based on the target scene segment; determine a causal model based on the driving characteristics, the response characteristics, the causal relationship strength and a preset scaling factor, and generate a human ethics simulation scene based on the scene timing model and the causal model.
[0208] In one embodiment, the model construction module 10 is also used to obtain causal events based on the human ethics simulation scenario; extract the causal relationship of the human ethics knowledge base; determine the true or false relationship of the causal event based on the causal relationship, and determine the causal loss function based on the true or false relationship; and update the causal model based on the causal loss function.
[0209] In one embodiment, the scenario scoring module 30 is further used to determine the number of dynamic obstacles, the map structure, the speed of dynamic objects, the distance of dynamic objects, and the moving direction of dynamic objects based on the human ethics simulation scenario; calculate the static complexity score based on the number of dynamic obstacles, the map structure, the obstacle weight, and the map structure weight; calculate the dynamic game degree score based on the dynamic object speed, the dynamic object distance, and the moving direction of the dynamic object; calculate the lightweight score based on the static complexity score, the dynamic game degree score, the simulation time, and a preset attenuation factor.
[0210] In one embodiment, the model update module 40 is also used to obtain a lightweight score threshold; when the lightweight score is greater than the lightweight score threshold, determine the human ethics simulation scenario corresponding to the lightweight score according to the lightweight score; update the target scenario model according to the human ethics simulation scenario, and generate an unmanned bus simulation test scenario according to the updated target scenario model.
[0211] The present application provides an unmanned bus simulation test scenario generation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the unmanned bus simulation test scenario generation method in the above-mentioned embodiment one.
[0212] Reference below Figure 5 , which shows a schematic diagram of the structure of a device for generating a simulation test scenario for an unmanned bus suitable for implementing an embodiment of the present application. The device for generating a simulation test scenario for an unmanned bus in an embodiment of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The unmanned bus simulation test scenario generation device shown is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present application.
[0213] like Figure 5As shown, the unmanned bus simulation test scenario generation device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to the program stored in the ROM (Read Only Memory) 1002 or the program loaded from the storage device 1003 to the RAM (Random Access Memory) 1004. Various programs and data required for the operation of the unmanned bus simulation test scenario generation device are also stored in RAM1004. The processing device 1001, ROM1002 and RAM1004 are connected to each other via a bus 1005. The input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the unmanned bus simulation test scenario generation device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows an unmanned bus simulation test scenario generation device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.
[0214] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0215] The unmanned bus simulation test scenario generation device provided in this application adopts the unmanned bus simulation test scenario generation method of the above-mentioned embodiment, which can solve the technical problem that existing simulation tests are difficult to generate autonomous driving test scenarios that both comply with human ethical rules and cover long-tail extreme working conditions. Compared with the existing technology, the beneficial effects of the unmanned bus simulation test scenario generation device provided in this application are the same as the beneficial effects of the unmanned bus simulation test scenario generation method provided in the above-mentioned embodiment, and the other technical features of the unmanned bus simulation test scenario generation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0216] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0217] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0218] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the unmanned bus simulation test scenario generation method in the above-mentioned embodiment.
[0219] The computer-readable storage medium provided in this application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination thereof. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, RAM (Random Access Memory), ROM (Read Only Memory), Erasable Programmable Read Only Memory (Erasable Programmable Read Only Memory or flash memory, EPROM), optical fiber, CD-ROM (CD-Read Only Memory, portable compact disk read-only memory), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0220] The above-mentioned computer-readable storage medium may be included in the unmanned bus simulation test scenario generation device; or it may exist independently without being assembled into the unmanned bus simulation test scenario generation device.
[0221] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the unmanned bus simulation test scenario generation device, the unmanned bus simulation test scenario generation device: generates an initial scenario model based on the human ethics knowledge base, and updates the initial scenario model according to the scenario loss function to obtain a target scenario model; generates unmanned bus scenario data according to the target scenario model; determines the scenario timing model and causal model according to the unmanned bus scenario data, and generates a human ethics simulation scenario according to the scenario timing model and the causal model; scores the human ethics simulation scenario to obtain a lightweight score; updates the target scenario model according to the human ethics simulation scenario corresponding to the lightweight score, and generates an unmanned bus simulation test scenario according to the updated target scenario model.
[0222] The computer program code for performing the operations of the present application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a LAN (Local Area Network) or a WAN (Wide Area Network), or can be connected to an external computer (e.g., using an Internet service provider to connect via the Internet).
[0223] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0224] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.
[0225] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., a computer program) for executing the above-mentioned unmanned bus simulation test scenario generation method. This can solve the technical problem that existing simulation tests are difficult to generate autonomous driving test scenarios that both comply with human ethical rules and cover long-tail extreme working conditions. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the unmanned bus simulation test scenario generation method provided in the above-mentioned embodiment, and will not be repeated here.
[0226] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned method for generating an unmanned bus simulation test scenario.
[0227] The computer program product provided in this application addresses the technical issue of existing simulation tests, which struggle to generate autonomous driving test scenarios that both comply with ethical principles and cover long-tail, extreme operating conditions. Compared to existing technologies, the computer program product provided in this application offers the same beneficial effects as the method for generating driverless bus simulation test scenarios provided in the aforementioned embodiments, and will not be further elaborated here.
[0228] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for generating a simulation test scenario for an unmanned bus, characterized in that: The method comprises: Generate an initial scenario model based on a human ethics knowledge base, and update the initial scenario model according to a scenario loss function to obtain a target scenario model; Generate unmanned bus scene data according to the target scene model; Determining a scenario timing model and a causal model based on the driverless bus scenario data, and generating a human ethics simulation scenario based on the scenario timing model and the causal model; Scoring the human ethics simulation scenario to obtain a lightweight score; The target scenario model is updated according to the human ethics simulation scenario corresponding to the lightweight score, and an unmanned bus simulation test scenario is generated according to the updated target scenario model.
2. The method according to claim 1, wherein The steps of generating an initial scenario model according to the human ethics knowledge base and updating the initial scenario model according to the scenario loss function to obtain a target scenario model include: Obtain human ethical rules based on the human ethical knowledge base; Performing semantic encoding according to the human ethical rules, and mapping the encoded human ethical rules into a vector of a preset dimension to obtain a human ethical rule vector; splicing the human ethics rule vectors to obtain an ethics rule matrix; Generate an initial scenario model based on preset scenario data, a cross-attention mechanism, and the ethical rule encoding matrix; A scene loss function is determined according to the extreme scene data and the generated distribution data, and the initial scene model is updated according to the scene loss function to obtain a target scene model.
3. The method according to claim 2, wherein The step of determining a scene loss function based on the extreme scene data and the generated distribution data, and updating the initial scene model based on the scene loss function to obtain a target scene model includes: According to the extreme scenario data, the conditional intensity coefficient, the preset deviation divergence and the extreme scenario weight are obtained; Determine human ethical condition generation distribution data and preset condition generation distribution data according to generation distribution data; Determine a scenario loss function according to the condition intensity coefficient, the preset deviation divergence, the extreme scenario weight, the human ethics condition generation distribution data, and the preset condition generation distribution data; The initial scene model is updated according to the scene loss function to obtain a target scene model.
4. The method according to claim 1, wherein The steps of determining a scene timing model and a causal model based on the unmanned bus scene data, and generating a human ethics simulation scene based on the scene timing model and the causal model include: Acquire vehicle status data, pedestrian status data, environmental data, construction time, and coding dimensions based on the unmanned bus scenario data; Determining a scene timing model according to the vehicle state data, the pedestrian state data, the environmental data, the construction time, and the encoding dimension; Generate a target scene segment according to the scene timing model, and obtain driving characteristics, response characteristics, and causal relationship strength according to the target scene segment; A causal model is determined according to the driving characteristics, the response characteristics, the causal relationship strength, and a preset scaling factor, and a human ethics simulation scenario is generated according to the scenario timing model and the causal model.
5. The method according to claim 1, wherein After the steps of determining a scene timing model and a causal model based on the unmanned bus scene data, and generating a human ethics simulation scene based on the scene timing model and the causal model, the method further includes: Obtaining causal events according to the human ethics simulation scenario; extracting causal relationships from the human ethical knowledge base; Determining a true or false relationship between the causal event according to the causal relationship, and determining a causal loss function according to the true or false relationship; The causal model is updated according to the causal loss function.
6. The method according to claim 1, wherein The step of scoring the human ethics simulation scenario to obtain a lightweight score includes: determining the number of dynamic obstacles, the map structure, the speed of dynamic objects, the distance of dynamic objects, and the moving direction of dynamic objects according to the human ethics simulation scenario; Calculating a static complexity score based on the number of dynamic obstacles, the map structure, the obstacle weight, and the map structure weight; Calculate a dynamic gaming degree score according to the speed of the dynamic object, the distance of the dynamic object, and the moving direction of the dynamic object; The lightweight score is calculated according to the static complexity score, the dynamic game degree score, the simulation time and the preset attenuation factor.
7. The method according to claim 1, wherein The step of updating the target scenario model according to the human ethics simulation scenario corresponding to the lightweight score, and generating an unmanned bus simulation test scenario according to the updated target scenario model includes: Get the lightweight score threshold; When the lightweight score is greater than the lightweight score threshold, determining a human ethics simulation scenario corresponding to the lightweight score according to the lightweight score; The target scenario model is updated according to the human ethics simulation scenario, and an unmanned bus simulation test scenario is generated according to the updated target scenario model.
8. A device for generating a simulation test scenario for an unmanned bus, characterized in that: The device comprises: A model building module is used to generate an initial scenario model based on the human ethics knowledge base, and update the initial scenario model according to the scenario loss function to obtain a target scenario model; A scene generation module, used to generate unmanned bus scene data according to the target scene model; The model building module is further configured to determine a scene timing model and a causal model based on the unmanned bus scene data, and generate a human ethics simulation scene based on the scene timing model and the causal model; A scenario scoring module, used to score the human ethics simulation scenario to obtain a lightweight score; A model updating module is used to update the target scenario model according to the human ethics simulation scenario corresponding to the lightweight score, and generate an unmanned bus simulation test scenario according to the updated target scenario model.
9. A device for generating unmanned bus simulation test scenarios, characterized in that: The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for generating a simulation test scenario for an unmanned bus as described in any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the unmanned bus simulation test scenario generation method according to any one of claims 1 to 7 are implemented.