Autonomous driving test method and electronic equipment based on traffic regulations weight

By introducing a scenario generation method based on traffic regulations weights in the test of autonomous driving system, the attention mechanism is used to learn the global context in the traffic scenario, the problem of incomplexity in the existing technology is solved, and a more accurate self-driving system compliance test is achieved.

CN119783552BActive Publication Date: 2025-05-16XIDIAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510272127.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-10
Publication Date
2025-05-16
Estimated Expiration
2045-03-10

AI Technical Summary

Technical Problem

The scenarios generated by the existing autonomous driving system test scenario generation methods in complex or high-risk traffic scenarios are not complex and diverse enough to accurately reflect the compliance performance of the autonomous driving system.

Method used

The autonomous driving test method based on traffic regulations weights is adopted to segment the initial scene sequence data through the specified scene generation model, and the attention mechanism is used to learn the word block vector and its context, generate a global context representation, and generate new scene sequence data based on this, and repeat the training until the preset threshold is reached.

Benefits of technology

The generated test scenarios are more complex and diverse, and can more accurately reflect the compliance performance of autonomous driving systems in complex and high-risk traffic scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119783552B_ABST
    Figure CN119783552B_ABST
Patent Text Reader

Abstract

The present invention discloses an automatic driving test method and electronic device based on traffic regulation weights. In the test scene generation process, the importance weights of traffic regulations are introduced. These importance weights guide the attention mechanism to assign different attention levels to chunk vectors. For example, a higher attention level is assigned to chunk vectors corresponding to high-risk behaviors and key regulations to ensure that subsequent scene generation preferentially covers high-risk behaviors and violation scenes of key traffic regulations; and each chunk vector and its context in a chunk vector sequence are learned through the attention mechanism to obtain a global context representation. The global context representation can reflect the global dynamic interaction information in complex scenes, and further generate diversified and complex test scenes, so that when the test scenes generated by the present invention are used to test the automatic driving system, the compliance performance of the automatic driving system in complex and high-risk traffic scenes can be more accurately reflected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to an automatic driving test method and electronic equipment based on traffic regulation weights. Background Art

[0002] In recent years, the rapid development of autonomous driving technology has brought huge social and economic benefits to the global transportation sector. Although autonomous driving technology has made many breakthroughs, the safety and compliance of autonomous driving systems are still the main obstacles to their large-scale commercial application; autonomous driving systems need to operate in complex and changing traffic environments. Vehicles equipped with autonomous driving systems must not only meet basic collision-free goals, but also strictly abide by traffic regulations. As the brain of autonomous driving vehicles, autonomous driving systems should be tested in a variety of test scenarios before deployment to ensure the safety and legality of the vehicle.

[0003] In related technologies, the test scenario generation of the autonomous driving system is based on GFlowNet (Generative FlowNetwork). This method is not able to cope with the generation of more complex traffic scenarios, such as when the acceleration and steering of vehicles need to be processed in combination with information from multiple time steps, making the generated test scenarios not complex and diverse enough; and it cannot accurately reflect the compliance performance of the autonomous driving system in complex or high-risk traffic scenarios. Summary of the invention

[0004] In order to solve the above problems existing in the prior art, the present invention provides an automatic driving test method and electronic equipment based on traffic regulations weights. The technical problem to be solved by the present invention is achieved through the following technical solutions:

[0005] According to a first aspect of an embodiment of the present invention, there is provided an autonomous driving test method based on traffic regulation weights, which is applied to an autonomous driving system. The method includes:

[0006] The initial scene sequence data is used as input data, and the input data is segmented by a specified scene generation model to obtain a word block vector sequence; the scene sequence data is obtained by serializing traffic scene information in the automatic driving of the vehicle, and the traffic scene information includes the behavior state of each traffic participant, the environment state and / or the interaction information between the behavior state and the environment state;

[0007] Based on the importance weight of traffic regulations, the attention mechanism in the scene generation model is used to learn each chunk vector in the chunk vector sequence and its context to obtain a global context representation; wherein the importance weight is set based on the violation frequency of each traffic regulation, and is used to guide the attention mechanism to allocate corresponding attention to the chunk vector;

[0008] Predicting current traffic scene information based on the global context representation and generating new scene sequence data;

[0009] The new scene sequence data is used as input data to perform the next training on the scene generation model. When the number of training times is greater than a preset threshold, the final scene sequence data generated is used as a test scene generation result; and the test scene generation result is used to test the autonomous driving system.

[0010] Optionally, the importance weight based on traffic regulations utilizes the attention mechanism in the scene generation model to learn each chunk vector and its context in the chunk vector sequence to obtain a global context representation, including:

[0011] Based on the importance weight of traffic regulations, the self-attention mechanism in the Transformer model is used to learn each chunk vector and its context in the chunk vector sequence to generate a context representation containing interactive information in the current traffic scene;

[0012] The multi-head attention mechanism of the Transformer model is used to concatenate the context representations and then linearly transform them to obtain the global context representation.

[0013] Optionally, the importance weight based on traffic regulations utilizes the self-attention mechanism in the Transformer model to learn each chunk vector in the chunk vector sequence and its context to generate a context representation containing interactive information in the current traffic scene, including:

[0014] Based on the importance weight of traffic regulations, an attention guidance function is constructed:

[0015] ;

[0016] in, For the The importance weight of traffic regulations, Represents the new scene sequence data For Traffic regulations The degree of violation, Express concern;

[0017] According to the attention guidance function, the self-attention mechanism in the Transformer model is used to learn each chunk vector and its context in the chunk vector sequence to generate a context representation containing the interactive information in the current traffic scene:

[0018] ;

[0019] in, is the query vector, which indicates the information that the current chunk vector hopes to obtain from other chunk vectors; K is the key matrix, which represents the index of the word chunk vector and is used to calculate the correlation between each word chunk vector and the query vector The relevance of is the transposed matrix of the key matrix; V is a value matrix, which is used to represent the specific content of the word chunk vector; is the scaling factor, for function.

[0020] Optionally, the importance weight is set in the following manner:

[0021] Formalizing the traffic regulations to obtain a logical expression of the traffic regulations;

[0022] Matching the new scene sequence data with the logical expression of the traffic regulations to obtain the violation frequency corresponding to each traffic regulation;

[0023] The difference between the violation frequency and the target frequency is calculated, and the importance weight is set based on the product of the difference and a preset coefficient.

[0024] Optionally, the calculating the difference between the violation frequency and the target frequency, and setting the importance weight based on the product of the difference and a preset coefficient, includes:

[0025] The importance weights are set based on the following formula:

[0026] ;

[0027] in, is the importance weight after this update, is the previous importance weight, is the preset coefficient, A sign for traffic regulations.

[0028] Optionally, the formalizing the traffic regulations to obtain a logical expression of the traffic regulations includes:

[0029] The traffic regulations are formalized by using signal timing logic STL to obtain a logical expression of the traffic regulations.

[0030] Optionally, the importance weight is set in the following manner:

[0031] Formalizing the traffic regulations to obtain a logical expression of the traffic regulations;

[0032] Matching the initial scene sequence data with the logical expression of the traffic regulations to obtain the violation frequency corresponding to each traffic regulation;

[0033] The violation frequency and the safety risk value of the traffic regulations are weighted, and the importance weight is set according to the weighted result.

[0034] Optionally, weighting the violation frequency and the safety risk value of the traffic regulations, and setting the importance weight according to the weighted result includes:

[0035] By formula , weighting the violation frequency and the safety risk value of the traffic regulations, and setting the importance weight according to the weighted result;

[0036] in, is the safety risk value of the traffic regulations, is the violation frequency, is the weighted result, A sign for traffic regulations.

[0037] According to a second aspect of an embodiment of the present invention, there is provided an electronic device, the device comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0038] Memory, used to store computer programs;

[0039] The processor is used to implement the automatic driving test method based on traffic regulations weight as described in any one of the first aspects when executing the computer program stored in the memory.

[0040] Compared with the prior art, the present invention has the following beneficial effects:

[0041] The automatic driving test method based on traffic regulations weight provided by the embodiment of the present invention first takes the initial scene sequence data as input data, and performs word segmentation on the input data through a specified scene generation model to obtain a word block vector sequence, wherein the above scene sequence data is obtained after serialization of traffic scene information in vehicle automatic driving; then, based on the importance weight of traffic regulations, the attention mechanism in the scene generation model is used to learn each word block vector and its context in the above word block vector sequence to obtain a global context representation; wherein the importance weight is set based on the violation frequency of each traffic regulation, and is used to guide the attention mechanism to allocate corresponding attention to the word block vector; then, according to the global context representation, the current traffic scene information is predicted to generate new scene sequence data; finally, the new scene sequence data is used as input data to train the scene generation model for the next time, and when the number of training times is greater than a preset threshold, the generated final scene sequence data is used as a test scene generation result; and the test scene generation result is used to test the automatic driving system. The present invention introduces importance weights of traffic regulations in the process of test scenario generation. These importance weights can guide the attention mechanism to assign different attention levels to chunk vectors. For example, higher attention levels can be assigned to chunk vectors corresponding to high-risk behaviors and key regulations to ensure that subsequent scenario generation prioritizes coverage of high-risk behaviors and violation scenarios of key traffic regulations; and, through the attention mechanism in the scenario generation model, each chunk vector and its context in the chunk vector sequence are learned to obtain a global context representation that can reflect the global dynamic interaction information in complex scenarios, thereby generating diverse and complex test scenarios. This allows the test scenarios generated by the present invention to more accurately reflect the compliance performance of the autonomous driving system in complex and high-risk traffic scenarios when testing the autonomous driving system.

[0042] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A flowchart of the steps of an automatic driving test method based on traffic regulations weights provided by an embodiment of the present invention;

[0044] Figure 2 Another step flow chart of an automatic driving test method based on traffic regulations weights provided by an embodiment of the present invention;

[0045] Figure 3 A schematic diagram of converting traffic scene information into scene sequence data provided by an embodiment of the present invention;

[0046] Figure 4 A schematic diagram of the internal processing process of the Transformer model provided by an embodiment of the present invention;

[0047] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The present invention is further described in detail below with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.

[0049] Embodiment 1

[0050] Reference Figure 1 , shows a step flow chart of an automatic driving test method based on traffic regulations weights provided according to Embodiment 1 of the present invention.

[0051] The automatic driving test method based on traffic regulations weights of this embodiment is applied to an automatic driving system and specifically includes the following steps:

[0052] Step 101: Use the initial scene sequence data as input data, segment the input data using a specified scene generation model, and obtain a word block vector sequence.

[0053] The scene sequence data is obtained by serializing the traffic scene information in the vehicle's automatic driving, and the traffic scene information includes the behavior status of each traffic participant, the environmental status, and / or the interaction information between the behavior status of the traffic participant and the environmental status. The traffic scene information can be real traffic scene information collected or traffic scene information obtained through simulation.

[0054] Step 102: Based on the importance weight of traffic regulations, the attention mechanism in the scene generation model is used to learn each chunk vector and its context in the chunk vector sequence to obtain a global context representation.

[0055] In this implementation, an importance weight is set for each traffic regulation. These importance weights are set based on the violation frequency of each traffic regulation and are used to guide the attention mechanism to allocate corresponding attention to the word block vector.

[0056] Based on the guidance of the importance weights of traffic regulations, the attention mechanism in the scene generation model learns each chunk vector and its context in the chunk vector sequence to obtain a global context representation.

[0057] Step 103: predict the current traffic scene information based on the above global context representation and generate new scene sequence data.

[0058] Since the above-mentioned initial scene sequence data can reflect the behavior status, environmental status and / or the interaction information between the behavior status of each traffic participant in the traffic scene and the environmental status, and then guided by the importance weights of traffic regulations, the attention mechanism in the scene generation model allocates corresponding attention to each word block vector in the word block vector sequence, and learns its context, and finally obtains the global context representation. The global context representation can also reflect the behavior status, environmental status and / or the interaction information between the behavior status of each traffic participant and the environmental status in the traffic scene after learning by the scene generation model. Therefore, it is possible to predict the current traffic scene information based on the global context representation, and then generate new scene sequence data.

[0059] Step 104: Use the new scene sequence data as input data to perform the next training on the scene generation model. When the number of training times is greater than a preset threshold, use the final scene sequence data generated as a test scene generation result; and use the test scene generation result to test the autonomous driving system.

[0060] The number of training times for the scene generation model can be set according to the experience of those skilled in the art, for example, it can be set to 1024 times; that is, after 1024 training times, the scene sequence data generated by the trained scene generation model can be used as the test scene generation result. The test scene generation result is then used to test the autonomous driving system.

[0061] The autonomous driving test method based on traffic regulation weights provided in an embodiment of the present invention introduces the importance weights of traffic regulations in the process of test scenario generation. These importance weights can guide the attention mechanism to assign different attention levels to chunk vectors. For example, a higher attention level can be assigned to chunk vectors corresponding to high-risk behaviors and key regulations to ensure that subsequent scenario generation preferentially covers high-risk behaviors and violation scenarios of key traffic regulations; and, through the attention mechanism in the scenario generation model, each chunk vector and its context in the chunk vector sequence are learned to obtain a global context representation. The global context representation can reflect the global dynamic interaction information in complex scenarios, and thus can generate diverse and complex test scenarios. Therefore, when the autonomous driving system is tested using the test scenario generated by the method of an embodiment of the present invention, the compliance performance of the autonomous driving system in complex and high-risk traffic scenarios can be more accurately reflected.

[0062] Embodiment 2

[0063] The following is a more detailed description of the automatic driving test method based on traffic regulations weights provided by an embodiment of the present invention. Figure 2 As shown, Figure 2Another flow chart of an automatic driving test method based on traffic regulation weights provided in an embodiment of the present invention includes the following steps:

[0064] Step 201: Use the initial scene sequence data as input data, segment the input data using a specified scene generation model, and obtain a word block vector sequence.

[0065] refer to Figure 3 , Figure 3 A schematic diagram of converting traffic scene information into scene sequence data provided by an embodiment of the present invention. Figure 3 The left side shows a number of different traffic scene information, which can be real traffic scene information collected or obtained through simulation, and can include the main vehicle's driving trajectory, acceleration and deceleration, steering, and other vehicle status, environmental status and other information; these traffic scene information can be used as initial training data. First, the traffic scene information needs to be converted into machine language, that is, serialized to obtain the initial scene sequence data, such as Figure 3 Shown on the right is a schematic diagram of the scene sequence data obtained after serialization.

[0066] Then the initial scene sequence data is used as input data and input into the specified scene generation model, which can be a Transformer model, such as Figure 4 The figure shows the internal processing process of the Transformer model. First, the Tokenize layer of the Transformer model performs word segmentation on the input initial scene sequence data to obtain a word block vector sequence. Each word block vector of the word block vector sequence corresponds to a feature information. For example, the word block vector sequence may include feature information such as vehicle position, vehicle speed, pedestrian status, signal status, main vehicle status, NPC (Non-Player Character) vehicle status, and environmental status. Then the word block vector sequence is input into the embedding layer for processing.

[0067] Step 202: Based on the importance weight of traffic regulations, the self-attention mechanism in the Transformer model is used to learn each chunk vector in the chunk vector sequence and its context, and generate a context representation containing interactive information in the current traffic scene.

[0068] In this embodiment, the importance weight of the traffic regulations can be set based on experience, or can be set based on the violation frequency of each traffic regulation.

[0069] Furthermore, before training the Transformer model for the first time, the importance weights of traffic regulations can be pre-set in the following way:

[0070] First, formalize the traffic regulations and obtain the logical expression of the traffic regulations.

[0071] Traffic regulations often contain ambiguity and complex dependencies in natural language descriptions, and there are significant difficulties in directly using them for autonomous driving tests. The present invention can use signal temporal logic STL (Signal Temporal Logic) to formalize traffic regulations and obtain the logical expression of traffic regulations. For example, when a red cross light or arrow light is on, vehicles in the lane are prohibited from passing, and its logical expression can be expressed as:

[0072]

[0073]

[0074]

[0075] in:

[0076] Indicates that the traffic direction indicator ahead is red; Indicates that there is a stop line or an intersection ahead; Indicates that in the next [0, realvalue] time range, the speed (speed) must be less than a certain real value (realvalue); when it is necessary to prohibit vehicles in the lane from passing, The realvalue in is set to 0.

[0077] Through the above formalization method, all traffic regulations that need to be converted are converted into corresponding logical expressions, and the logical expressions of these traffic regulations can be combined into a constraint rule set.

[0078] Then, the initial scene sequence data is matched with the logical expressions in the constraint rule set to obtain the violation frequency corresponding to each traffic regulation; the violation frequency and the safety risk value of the traffic regulations are weighted, and the above importance weight is set according to the weighted result.

[0079] Specifically, the formula , weight the violation frequency and the safety risk value of traffic regulations, and set the importance weight according to the weighted result. is the safety risk value of traffic regulations, is the violation frequency, is the weighted result, It is the symbol of traffic regulations; the safety risk value of traffic regulations can be set manually based on experience.

[0080] It should be noted that the present invention can also divide the logical expressions of traffic regulations in the constraint rule set into two categories: high priority rules and low priority rules; high priority rules can cover scenarios closely related to road safety, such as vehicles must stop when the traffic light is red, and give priority to pedestrians near zebra crossings. Low priority rules involve minor behaviors, such as minor speeding or lane changes. Although traffic regulations are equally important, violations of different traffic regulations have different effects on driving safety. Violations of high priority rules may directly lead to serious traffic accidents, such as vehicle collisions with pedestrians or traffic conflicts at intersections. Obviously, high priority rules can be given higher importance weights, and low priority rules can be given relatively lower importance weights.

[0081] After obtaining the importance weights of traffic regulations, during the first training of the Transformer model, based on the importance weights of traffic regulations, the self-attention mechanism in the Transformer model is guided to assign corresponding attention to the chunk vectors, and then each chunk vector and its context in the chunk vector sequence are learned to generate a contextual representation containing the interactive information in the current traffic scene.

[0082] Specifically, an attention guidance function can be constructed based on the above importance weights:

[0083] ;

[0084] in, For the The importance weight of traffic regulations, Represents new scene sequence data π For Traffic regulations The degree of violation, Indicates attention.

[0085] Importance weight of introducing traffic regulations , and integrate it into the above attention guidance function, which can be used to guide the tendency of generating scenes, that is, by maximizing , guiding the Transformer model to generate scene sequence data that is more likely to trigger traffic law violations with higher importance weights.

[0086] According to the above attention guidance function, the self-attention mechanism in the Transformer model is used to learn each chunk vector and its context in the chunk vector sequence to generate a context representation containing the interactive information in the current traffic scene:

[0087] ;

[0088] in, The query vector represents the information that the current chunk vector (e.g., the vector corresponding to the state of the main vehicle) hopes to obtain from other chunk vectors (e.g., the vectors corresponding to the state of neighboring vehicles, red light information, etc.). In an autonomous driving scenario, the main vehicle may need to query the dynamics of neighboring vehicles (e.g., whether to brake) or changes in the environment (e.g., the state of a red light) to decide the next driving behavior. K is the key matrix, which represents the index of the word chunk vector and is used to calculate the correlation between each word chunk vector and the query vector The relevance of is the transposed matrix of the key matrix; V is a value matrix, which is used to represent the specific content of the chunk vector, such as the deceleration of the neighboring vehicle, the relative distance to the main vehicle, or the time status of the red light; is a scaling factor that prevents the dot product value from being too large and affecting the gradient stability. for function.

[0089] refer to Figure 4 After the embedding layer of the Transformer model learns each word block vector and its context, the output of multiple self-attention heads can be obtained. For each self-attention head, its output can be defined by the following formula:

[0090] ;

[0091] in, For the The weight matrix of the self-attention heads, is the total number of self-attention heads, Included Used for , K, V After linear transformation, the output of each self-attention head contains the interaction information in the current traffic scene, that is, a self-attention head focuses on modeling a specific interaction relationship, which can be, for example, Figure 4 The relationship between vehicles and pedestrians, the speed correlation between vehicles, the impact of traffic lights on vehicle behavior, and the impact of weather on NPCs and vehicles shown in the figure; in addition, it can also be the relative distance and speed relationship between the main vehicle and the nearest vehicle, the interaction between the main vehicle and traffic lights, the position and dynamic performance of the main vehicle in the current lane, etc., and the self-attention mechanism of the present invention can capture the time dependency and other potential associations between word block vectors, and learn the time-series change characteristics of the states of vehicles, pedestrians, traffic lights, etc., such as the dynamic adjustment of vehicle speed with changes in traffic lights or the time dependency of vehicles on pedestrian avoidance behavior, etc., which are not listed one by one here.

[0092] In this embodiment, in order to enhance the Transformer model's ability to pay attention to the chunk vectors corresponding to key traffic regulations, the importance weights of traffic regulations are introduced in the chunk vector sequence modeling process. These importance weights can guide the model's attention mechanism to pay more attention to features related to high-priority rules (such as red light status and pedestrians on zebra crossings); for example, for red light stops, the attention mechanism will emphasize the interaction between the main vehicle and the traffic light. By assigning higher importance weights to high-priority traffic regulations in traffic scenes, the self-attention mechanism effectively filters out low-correlation noise features and provides accurate feature representation for test scene modeling.

[0093] Step 203: Using the multi-head attention mechanism of the Transformer model, the context representations are concatenated and then linearly transformed to obtain a global context representation.

[0094] The global context representation can be defined by the following formula:

[0095] ;

[0096] in, It is to concatenate the outputs of multiple self-attention heads ( Concat ) is used to synthesize the outputs of different attention heads. The global context is represented as a high-order feature sequence, which can simultaneously focus on the different interactive relationships between the main vehicle, other vehicles and the environment, reflecting the global dynamic relationship in complex scenes. The high-order feature sequence (global context representation) can be used to predict the current traffic scene information.

[0097] It can be understood that the multi-head attention mechanism is composed of multiple self-attention heads. The parallel modeling capability of the multi-head attention mechanism can capture the multi-level interactions between chunk vectors from different dimensions, effectively model the time dependencies between chunk vectors in the chunk vector sequence, and capture the interaction characteristics with the logical expressions of traffic rules, and finally generate a high-order feature sequence that reflects the dynamics of complex scenes. The complex scenes reflected by the high-order feature sequence can also effectively cover the complex dynamics of violations of more high-weight traffic regulations.

[0098] Step 204: predict the current traffic scene information based on the global context representation and generate new scene sequence data.

[0099] Since the global context representation can simultaneously focus on the different interactive relationships between the host vehicle, other vehicles and the environment, and reflect the global dynamic interactive relationships in complex scenes, the current traffic scene information can be predicted based on the global context representation. Figure 4As shown, from the global context representation, the updated behavior status of each traffic participant, the environmental status and / or the interaction information between the traffic participant and the environment can be obtained, such as: updated vehicle position, updated vehicle speed, updated pedestrian status, updated traffic light status, etc., thereby generating optimized new scene sequence data.

[0100] In this embodiment, the Transformer model can dynamically update the status of each traffic participant in the scene. For example, the position and speed of the vehicle can be adjusted according to the position of the pedestrian and the status of the traffic light, and the status of the pedestrian can be dynamically updated in combination with the avoidance behavior of the vehicle. These updated states can not only express complex traffic scenes more comprehensively, but also provide high-quality input for subsequent model training, ensuring the robustness and accuracy of the model.

[0101] Step 205: Use the new scene sequence data as input data to perform next training on the scene generation model, and reset the importance weights of traffic regulations based on the new scene sequence data.

[0102] Obviously, when the Transformer model is subsequently trained, the importance weights of traffic regulations will be continuously and dynamically updated based on the new scene sequence data generated.

[0103] Specifically, the setting of importance weights during subsequent training includes: matching new scene sequence data with the logical expression of traffic regulations to obtain the violation frequency corresponding to each traffic regulation; calculating the difference between the violation frequency and the target frequency, and setting the importance weight based on the product of the difference and the preset coefficient.

[0104] Furthermore, based on the formula , set the importance weight; among them, is the importance weight after this update, is the previous importance weight, is the preset coefficient.

[0105] If the violation frequency of a traffic regulation is higher than the target frequency, it means that the Transformer model has paid enough attention to the traffic regulation, and the importance weight of the traffic regulation can be appropriately reduced; if the violation frequency of a traffic regulation is lower than the target frequency, the importance weight of the traffic regulation can be appropriately increased. The dynamic adjustment of the importance weight directly affects the above attention, so that the Transformer model continuously optimizes the test scenario generation strategy during training.

[0106] In this embodiment, the importance weights of traffic regulations can be dynamically adjusted according to different traffic scenario information. For example, in a densely populated urban road environment, failure to give priority to pedestrians and failure to obey traffic lights are high-frequency violations, and the importance weights of the corresponding traffic regulations can be increased; similarly, in highway scenarios, the importance weights of speeding rules and lane keeping can be appropriately increased. The higher the importance weight, the greater the impact of the traffic regulation on driving safety. By dynamically adjusting the importance weights of traffic regulations, the Transformer model will focus on key safety scenarios and balance the coverage of the importance weights for violation scenarios corresponding to traffic regulations.

[0107] Step 206: When the number of training times is greater than a preset threshold, the final scene sequence data generated is used as a test scene generation result, and the test scene generation result is used to test the automatic driving system.

[0108] Among them, the number of training times for the scenario generation model can be set according to the experience of technical personnel in this field, and then the final test scenario generation result can be used to test the autonomous driving system. In this embodiment, the Transformer model gradually learns the violation characteristics corresponding to traffic regulations with high importance weights through multiple rounds of training and feedback optimization, and reflects them in the test scenario generation, so that the final test scenario generation results can cover high-risk violation traffic scenarios. Finally, the scenario test module can be used to verify and evaluate the generated scenario sequence data and constraint rule sets using a simulator to test the performance of the autonomous driving system under real traffic regulations, and verify the autonomous driving system's ability to comply with key traffic regulations and its performance in complex and high-risk violation traffic scenarios.

[0109] In the automatic driving test method based on traffic regulations weight provided by the embodiment of the present invention, a scene generation method based on the Transformer model is proposed. The self-attention mechanism and multi-head attention mechanism in the Transformer model are used to comprehensively model the complex temporal dependencies and behavioral interaction features in the traffic scene: the self-attention mechanism can give higher attention weights to important features in the scene in the process of modeling each word block vector and its context and generating context representation, and capture the temporal dependencies and other potential associations between features; for example, in the traffic scene, the self-attention mechanism can learn the dynamic adjustment mode of vehicle speed with the change of traffic lights, the time-dependent characteristics of the avoidance behavior between vehicles and pedestrians, and the global impact of weather factors on the dynamic changes of the scene; the multi-head attention mechanism captures the dynamic interaction mode between vehicle behavior, traffic signals and environmental conditions, and integrates local feature information (context representation generated by each self-attention) into a global context representation. Multiple attention heads focus on multiple different types of feature interaction relationships to generate a more complete, diverse, and complex scene feature representation (scene sequence data). In addition, based on the dynamic importance weights of traffic regulations, the attention mechanism pays more attention to key traffic regulations, ensuring that scenario generation prioritizes violation scenarios of key regulations, thereby improving the diversity and accuracy of test scenario generation, and then making it possible to more accurately reflect the compliance performance of the autonomous driving system in complex and high-risk traffic scenarios when testing the autonomous driving system.

[0110] The method provided in the embodiment of the present invention can be applied to electronic devices. Specifically, the electronic device can be: a desktop computer, a portable computer, an intelligent mobile terminal, a server, etc. This is not limited here, and any electronic device that can implement the present invention belongs to the protection scope of the present invention.

[0111] Embodiment 3

[0112] The embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, it includes a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304;

[0113] A memory 303, used for storing a program 305;

[0114] The processor 301 is used to implement any of the above-mentioned autonomous driving test methods based on traffic regulations weights when executing the program 305 stored in the memory 303.

[0115] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0116] The communication interface is used for communication between the above electronic device and other devices.

[0117] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0118] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0119] As for the electronic device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0120] It should be noted that the electronic device of the embodiment of the present invention is an electronic device that applies the above-mentioned automatic driving test method based on traffic regulations weights. Then all embodiments of the above-mentioned automatic driving test method based on traffic regulations weights are applicable to the electronic device, and can achieve the same or similar beneficial effects. In addition, the terms "first" and "second" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0121] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification.

[0122] Although the present invention is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art can understand and implement other changes in the embodiments by viewing the drawings and the disclosed content. The above content is a further detailed description of the present invention in conjunction with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For those of ordinary skill in the technical field to which the present invention belongs, without departing from the concept of the present invention, several simple deductions or substitutions can be made, which should all be deemed to belong to the scope of protection of the present invention.

Claims

1. An automatic driving test method based on traffic regulations weights, applied to an automatic driving system, characterized in that: The method comprises: The initial scene sequence data is used as input data, and the input data is segmented by a specified scene generation model to obtain a word block vector sequence; the scene sequence data is obtained by serializing traffic scene information in the automatic driving of the vehicle, and the traffic scene information includes the behavior state of each traffic participant, the environment state and / or the interaction information between the behavior state and the environment state; Based on the importance weight of traffic regulations, the attention mechanism in the scene generation model is used to learn each chunk vector in the chunk vector sequence and its context to obtain a global context representation; wherein the importance weight is set based on the violation frequency of each traffic regulation, and is used to guide the attention mechanism to allocate corresponding attention to the chunk vector; Predicting current traffic scene information based on the global context representation and generating new scene sequence data; The new scene sequence data is used as input data to perform the next training on the scene generation model. When the number of training times is greater than a preset threshold, the final scene sequence data generated is used as a test scene generation result; and the test scene generation result is used to test the autonomous driving system.

2. The method according to claim 1, characterized in that The importance weight based on traffic regulations and the attention mechanism in the scene generation model are used to learn each chunk vector and its context in the chunk vector sequence to obtain a global context representation, including: Based on the importance weight of traffic regulations, the self-attention mechanism in the Transformer model is used to learn each chunk vector and its context in the chunk vector sequence to generate a context representation containing interactive information in the current traffic scene; The multi-head attention mechanism of the Transformer model is used to concatenate the context representations and then linearly transform them to obtain the global context representation.

3. The method according to claim 2, characterized in that The importance weight based on traffic regulations utilizes the self-attention mechanism in the Transformer model to learn each chunk vector and its context in the chunk vector sequence to generate a context representation containing interactive information in the current traffic scene, including: Based on the importance weight of traffic regulations, an attention guidance function is constructed: ; in, For the The importance weight of traffic regulations, Represents the new scene sequence data For Traffic regulations The degree of violation, Express concern; According to the attention guidance function, the self-attention mechanism in the Transformer model is used to learn each chunk vector and its context in the chunk vector sequence to generate a context representation containing the interactive information in the current traffic scene: ; in, is the query vector, which indicates the information that the current chunk vector hopes to obtain from other chunk vectors; K is the key matrix, which represents the index of the word chunk vector and is used to calculate the correlation between each word chunk vector and the query vector The relevance of is the transposed matrix of the key matrix; V is a value matrix, which is used to represent the specific content of the word chunk vector; is the scaling factor, for function.

4. The method according to claim 1, characterized in that: The importance weights are set in the following way: Formalizing the traffic regulations to obtain a logical expression of the traffic regulations; Matching the new scene sequence data with the logical expression of the traffic regulations to obtain the violation frequency corresponding to each traffic regulation; The difference between the violation frequency and the target frequency is calculated, and the importance weight is set based on the product of the difference and a preset coefficient.

5. The method according to claim 4, characterized in that The calculating the difference between the violation frequency and the target frequency, and setting the importance weight based on the product of the difference and a preset coefficient, includes: The importance weights are set based on the following formula: ; in, is the importance weight after this update, is the previous importance weight, is the preset coefficient, A sign for traffic regulations.

6. The method according to claim 4, characterized in that The step of formalizing the traffic regulations to obtain a logical expression of the traffic regulations includes: The traffic regulations are formalized by using signal timing logic STL to obtain a logical expression of the traffic regulations.

7. The method according to claim 1, characterized in that The importance weights are set in the following way: Formalizing the traffic regulations to obtain a logical expression of the traffic regulations; Matching the initial scene sequence data with the logical expression of the traffic regulations to obtain the violation frequency corresponding to each traffic regulation; The violation frequency and the safety risk value of the traffic regulations are weighted, and the importance weight is set according to the weighted result.

8. The method according to claim 7, characterized in that The weighting of the violation frequency and the safety risk value of the traffic regulations and setting the importance weight according to the weighted result includes: By formula , weighting the violation frequency and the safety risk value of the traffic regulations, and setting the importance weight according to the weighted result; in, is the safety risk value of the traffic regulations, is the violation frequency, is the weighted result, A sign for traffic regulations.

9. An electronic device, characterized in that: The device comprises: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor is used to implement the automatic driving test method based on traffic regulations weight as described in any one of claims 1 to 8 when executing a computer program stored in a memory.

Citation Information

Patent Citations

  • Automatic driving test case generation method based on scenes and tasks

    CN110597711A

  • Robot monomer system in indoor complex environment and multi-robot interaction cooperation method

    CN115220461A