Intelligent automobile key scene optimization generation method based on large model knowledge guidance
By applying the knowledge expression module guided by big model and multi-stage optimization strategy in intelligent car testing, the problem of insufficient generation efficiency and coverage of key scenarios of smart cars in the existing technology is solved, and efficient and accurate generation of key scenarios is achieved.
Patent Information
- Application Number
- CN202510622702.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2045-05-15
AI Technical Summary
Existing smart car testing methods are difficult to efficiently and comprehensively generate key test scenarios. Especially after the level of smart driving is improved, the scene scale and complexity increase. Traditional methods cannot provide sufficient heuristic gradient information, resulting in the challenge of search efficiency, coverage and accuracy of key scenarios.
The key scenario optimization generation method of intelligent automobiles based on knowledge-guided large language model (LLM) is adopted. By constructing knowledge expression modules, parameter optimization modules and simulation testing modules, combining global exploration, local optimization and spatial pruning multi-stage optimization strategies, key scenarios of intelligent automobiles are quickly generated.
It realizes the rapid and effective generation of key smart car scenarios, improves test coverage and efficiency, and can adapt to the complex and multi-dimensional smart car scenario generation process, which is more efficient and accurate than manual generation knowledge.
Smart Images

Figure CN120144481A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of autonomous vehicle testing, and specifically relates to a method for optimizing the generation of key scenarios for intelligent vehicles guided by large model knowledge. Background Art
[0002] Intelligent vehicle technology leads the innovation frontier in the field of transportation. To ensure that intelligent vehicles can handle complex driving environments and avoid accidents, a scientific and perfect test evaluation system is needed as support. The scenario-based test method can effectively simulate the real world by abstracting various driving conditions that may be encountered during vehicle driving into "test scenario segments" described parametrically and semantically, and conduct more comprehensive tests on the system to be tested. How to generate key test scenarios with high efficiency and high coverage is the key content of intelligent vehicle performance verification.
[0003] Existing research mainly focuses on importance sampling and optimization search. The importance sampling method reconstructs the probability density function to focus test resources on key scenario areas. However, such methods focus on confidence verification in a statistical sense and are difficult to directly guide algorithm optimization and iteration. In contrast, the optimization search method directly locates the weak links of the system through parameter space exploration. The generated key test scenarios can be directly used for optimizing and improving intelligent vehicle algorithms, and have better application value. However, current algorithms generally use existing intelligent optimization algorithms or basic improved algorithms to directly optimize and search the scenario generation process, completely relying on parameter combinations and lacking in-depth understanding of test scenarios. The improvement of the intelligent driving level has significantly increased the scale and complexity of scenarios, and nonlinearity and uncertainty have become the norm in the test process. Traditional methods cannot provide sufficient heuristic gradient information, resulting in challenges in efficiency, coverage, and accuracy in key scenario search. Introducing prior knowledge into the optimization search process is expected to improve the performance of the optimization algorithm. However, traditional knowledge construction methods rely on a large amount of manual experience, with a single and fixed knowledge structure and limited guiding methods, making it difficult to apply to the complex and multi-dimensional intelligent vehicle scenario generation process.
[0004] Therefore, there is an urgent need for an optimization search method that comprehensively considers knowledge construction and knowledge application to achieve targeted and continuous generation of key scenarios for intelligent vehicles. Summary of the Invention
[0005] To solve the above problems, the present invention provides a method for optimizing the generation of key scenarios for intelligent vehicles guided by large model (Large Language Model, LLM) knowledge. By combining the knowledge model, large language model, and optimization search, the key scenarios of intelligent vehicles can be quickly generated.
[0006] The technical solution of the present invention is described in conjunction with the accompanying drawings as follows: The present invention provides an intelligent vehicle key scenario optimization generation method based on large model knowledge guidance, comprising the following steps: S1. Construct a knowledge expression module, and design the knowledge result, the application method of the large language model, and the dynamic update process from two parts: scenario theory knowledge and scenario exploration knowledge; S2. Construct a parameter optimization module, and design a multi-stage optimization strategy including global exploration, local optimization, and space pruning, and integrate it with the knowledge model; S3. Build a simulation test module, based on the Carla simulation platform, and construct components for scenario construction, the system under test, simulation execution, and data export through LLM-Agent; S4. Select a pre-trained large language model, design selection indicators, and select a model; S5. Construct an evaluation and memory module, evaluate the test results, and store all test and knowledge data during the process.
[0007] Furthermore, the specific method of S1 is as follows: S11. Establish scenario theory knowledge, including three parts: importance, monotonicity, and coupling; S111. Establish importance; For a determined autonomous driving system, obtain the importance of specific scenario elements through mutual comparison, so as to construct an element importance model; S112. Establish monotonicity; The monotonicity is used to describe the monotonic relationship between parameters and results within a specific parameter range, which is analyzed by the LLM based on kinematic equations and physical laws, and is used to guide the search process of test boundaries; S113. Establish coupling; Analyze the mutual dependence relationship between elements through the coupling degree theory in systems engineering, which is completed by the LLM; S12. Establish scenario exploration knowledge, including three parts: spatial region characteristics, optimal solution characteristics, and convergence characteristics; S121. Analyze the spatial region characteristics; Divide the search space into an unexplored part and an explored part; S122. Analyze the optimal solution characteristics; Record the optimal solution information of key scenario elements found during the optimization process; by real-time tracking and analyzing the performance of each element region, save the global optimal solution, and when a new global optimal solution is found, add the global optimal solution to the set, set the maximum capacity , and when the maximum capacity is exceeded, remove the earliest entered element; Meanwhile, through prompt design, the LLM is required to self-infer the recommended values in the current dimension, thereby constructing and dynamically updating the set of high-quality solutions, and using the LLM's understanding ability of knowledge to guide the subsequent local optimization process; statistical analysis is performed on the corresponding dimensions in the set of high-quality solutions to obtain the mean and standard deviation: ; ; The calculation results are used to assist the value recommendation process of the LLM; S123. Evaluate the effect of the optimization search process; S13. Design the knowledge construction and dynamic update process; Guide the LLM to generate context prompts through a preset prompt template, thereby dynamically updating the knowledge expression model, and thus guiding subsequent decisions and actions; S131. Design the initial test stage; S132. Design the optimization process; S133. Perform dynamic update.
[0008] Furthermore, the specific method of S111 is as follows: S1111. The LLM analyzes the functional requirements of the system under test, generates semantic descriptions of pairwise comparisons of elements through natural language reasoning, and converts them into judgment matrices; S1112. The Agent based on the analytic hierarchy process (AHP) conducts a judgment. If the consistency ratio, i.e., the CR test passes, it indicates that the result is available and is saved in the knowledge base for subsequent optimization search. Otherwise, the previous value is used. The calculation method of CR is as follows: ; In the formula, is the random consistency index. When is less than 0.1, it is considered that the matrix has satisfactory consistency; by combining AHP with the LLM, an importance model of scenario elements is automatically generated and updated to quantify the influence of each element. At the same time, the LLM dynamically adjusts the values of the judgment matrix elements according to the parameter sensitivity data in the subsequent optimization process to form a closed-loop correction system; The specific method of S112 is as follows: S1121. The LLM preliminarily judges the monotonicity level of scenario elements based on physical kinematics theory; S1122. Construct a local sensitivity analysis method, i.e., SA, and calculate the partial derivative according to the discrete difference approximation: ; The test data and the sensitivity analysis results are provided to the LLM again, and the LLM generates a corrected monotonicity mapping table based on the test data; The specific method of S113 is as follows: S1131. Utilize the understanding ability of the LLM for the test scenario. Based on historical data, establish the coupling relationship between elements, label the coupling strength, and express it with the coupling degree matrix M, where each element represents the element and the coupling strength between; S1132. At each stage of the test process, use correlation analysis, i.e., CA, to calculate the Spearman correlation coefficient between each element , quantify the non-linear association between elements, and provide it to the LLM to assist the LLM in adjusting the coupling relationship. The calculation formula is as follows: ; In the formula, is the difference between two sets of sorted data, is the number of samples; adjust the corresponding position in the coupling degree matrix according to the value to reflect the latest non-linear correlation relationship; The specific method of S121 is as follows: S1211. The LLM identifies the blank area in the search process and combines it with the subsequent scene space partitioning strategy to optimize the global exploration efficiency; in the dimensional test space, each point is represented by the vector , where , for each dimension , define the distance from any point to the nearest forward recursive known point as follows: ; In the formula, is the projection of the set of points determined to be in the explored area on the dimension. Set the threshold . If the calculated distance result is less than , it is considered explored; dynamically adjust. The LLM automatically identifies and updates the regional characteristics based on historical data and theoretical models, thereby realizing the dynamic update of regional characteristics during the accelerated test process; The specific method of S123 is as follows: S1231. The LLM analyzes whether the local optimization stage can continuously explore the test scenario or whether it needs to enter the global exploration stage according to the number of key scenarios in each optimization search process and the convergence criterion of the particle swarm; S1232. The convergence analysis includes the convergence speed , stability and repetitive characteristics Conduct a quantitative evaluation and adjust the optimization strategy according to the evaluation results to ensure the comprehensiveness of the search process. To assist the LLM analysis, the calculation formulas for each index are constructed as follows: ; ; ; In the formula, is the number of key scenarios found in the th iteration; is the number of key scenarios in the initial particle space; is the average value of the positions of all particles in the th generation; is the Euclidean distance between particles; The specific method of S131 is as follows: In the initial test stage, based on the relevant theory of the test scenario and the information of the system under test, construct a preliminary scenario theory model; convert the scenario description into a prompt, and combine it with the context information to assist the LLM in initializing and constructing the theoretical knowledge model; The specific method of S132 is as follows: During the optimization process, collect the historical instructions, population variable status, scenario library data, and simulation test results of the optimization search process, and form context information based on the preset prompt templates covering the key concepts, objective functions, and scenario theory of the optimization search; the LLM, based on the current context information, calls the corresponding Agent calculation tool to generate knowledge about the importance, monotonicity, and coupling of scenario elements, and dynamically updates the scenario theory knowledge accordingly; for the exploration process knowledge, record the regional characteristics, optimal solution characteristics, and convergence characteristics, and infer the LLM optimal solution, and save it as a specific numerical matrix; The specific method of S133 is as follows: After each round of optimization, the LLM continuously receives new data, and through the collaborative work of the SA, CA, and AHP agents, realizes knowledge verification and the generation of sensitivity and correlation data, assists the LLM in learning and adapting to the changes in the test environment, and adjusts the knowledge expression model; the updated knowledge expression will guide the decision-making behavior of the agents in the subsequent parameter optimization module, and the decision-making results are fed back to the system again to form a continuously improving closed loop.
[0009] Furthermore, the specific method of S2 is as follows: S21. Model the global exploration part; S22. Model the local optimization part; S23. Model the space pruning part; S24. Design the optimization execution process.
[0010] Further, the specific method of S21 is as follows: S211. For each scenario dimension, determine whether the importance and value range of each dimension have changed; for dimensions that are newly generated or have changed, re-partition according to the specific values, discrete step sizes, and importance of the scenario parameters; if there is no change, there is no need for re-partitioning. S212. Randomly select data points within each single-dimension partition and combine them to generate a sampling space. S213. Use the random sampling method to select the required samples in the sampling space. The specific method of S22 is as follows: S221. Region aggregation First, aggregate the regions divided by the global exploration module using region features and optimal solution features, perform statistical analysis on each scenario parameter within its respective divided region, starting from the value starting point, and mark the region where the number of key scenarios is greater than 20% of the number of key scenarios in the overall space as the core region; define a separation zone around the center of the core region, and the length of the aggregated core region does not exceed 3 times the minimum region length of this scenario parameter. For non-core regions, aggregate them with a length not exceeding 5 times the minimum region length, which is greater than the core region. S222. Particle equation optimization Construct an importance weight equivalent to the importance knowledge result; the LLM gives the optimal solution recommended for exploration through prompts, and guides the particle movement to design the following particle movement equation: ; ; In the formula, is the time step is the velocity of particle at the th parameter dimension at time is the inertia weight; is the importance weight of the th parameter dimension; is the acceleration constant in the region where the particle is located; is the acceleration constant in other regions. The region where the particle is located and other regions are the regions where the particle is located after region aggregation. Considering multiple regions helps the particle converge quickly and have a global view; is the global acceleration constant; is the LLM acceleration constant; , , , is a random number between [0, 1], used to increase the randomness of the search; is the current particle at the The position on a parameter dimension; For the current particle at the Optimal position within the region for the th parameter dimension; Is the sum of the optimal solutions for all other regions except the region where the th parameter dimension of the particle is located; Is the number of aggregation regions on the th parameter dimension of the particle; Is the optimal solution for the th parameter dimension of the particle given by the LLM analysis; Is the particle position at time step Is the calculated Particle velocity at time step The specific method of S23 is as follows: S231. Constraint monotonicity; For parameters known to have monotonicity, establish constraint conditions to exclude regions that cannot contain better solutions based on monotonicity judgment; S232. Analyze coupling; Regarding the coupling between parameters, construct a correlation model between parameters and use the model to judge invalid parameter combinations; during the search process, when a certain set of parameter values is encountered, according to the coupling analysis results, cut off the parameter space regions that cannot produce better solutions under the given parameter values; S233. Design pruning buffer zones; The initial buffer zone of the most critical element is the highest, which is the regional width of the element in the global exploration part. The buffer zones of other elements are scaled proportionally according to importance. Each time the space pruning part is executed, the buffer zone width is adjusted to 3 / 4 of the previous round; The specific method of S24 is as follows: The collaborative action of the three modules of global exploration, local optimization, and space pruning completes the cyclic optimization process; the global exploration part is called at the start of the test and when the optimization falls into a local optimum to supplement diverse individuals in the particle swarm; the local optimization part judges whether the number of loop rounds ends after each round of optimization; after each round of optimization, judge whether the number of loop rounds ends. If not, prune the parameter space according to the space pruning part to exclude non-critical regions; further integrate convergence knowledge. If convergence occurs, transfer to the global exploration part to generate a new round of exploration results, otherwise continue to execute the local optimization part; convert the statement logic into task prompts to assist the LLM in Agent scheduling and optimization work.
[0011] Furthermore, the specific method of S3 is as follows: S31. Build a simulation test platform based on CARLA simulation; the simulation test platform includes four core components: scenario construction, system under test, simulation execution, and data export; S32. The scenario construction component selects elements from the element library according to the input use cases to build a test scenario, and uses the internal API of CARLA to customize static scenario elements, dynamic traffic participants, and environmental characteristics; the element library defines various elements for environment initialization, and the constructed elements include: lane width, lane id, longitudinal speed, lateral speed, lateral offset from the lane, lateral distance and longitudinal distance between the host vehicle and the traffic vehicle, longitudinal speed and lateral speed of the traffic vehicle, light intensity, road surface adhesion coefficient, weather conditions; the system under test component provides an external interface for the autonomous driving algorithm, realizes sensor setting, vehicle control signal input, and chassis and scenario feedback information output, and supports multiple perception sensors according to the sensor characteristics in Carla; the simulation execution component initializes the scenario by loading the specific values of the above scenario elements, and executes the simulation program, and saves the kinematic indicators of each traffic participant in real time, including vehicle position, speed, acceleration, and heading angle to the result library; the data export component exports and merges all the motion data collected during the simulation in a standardized JSON format for saving.
[0012] Further, the specific method of S4 is as follows: Select the Qwen model.
[0013] Further, the specific method of S5 is as follows: S51. Define scenario criticality indicators from two core dimensions related to danger, collision time and safety distance, and assign different criticality levels, as shown in the following formula: ; In the formula, is the scenario fitness value for guiding the optimization search. To avoid the negative value of the collision time and relative distance from affecting the gradient search process, their reciprocals are taken; when the collision time is less than 0.6 s and the safety distance is less than 3 m, it represents an extreme scenario. Therefore, takes 1.67 s-1, takes 0.33 m-1; and The calculation formulas of ; ; The scene criticality is designed into three levels and different weights are assigned; when both indicators are met, it indicates the limit of the relative position of the scene and the collision time is extremely small, indicating a critical scene concerned in the test process, with a high criticality level and a weight of 10 assigned. When only one indicator is met, the criticality level is medium. When neither indicator is met, the criticality level is low and a weight of 0.1 is assigned. S52. Data memory stores the historical LLM interaction status, various aspects of knowledge in the knowledge model, the parameter space related to the test scene and the test result information, as well as the particle positions and movement information of the historical 5 optimization steps; store the test scene and test result information into the vector database Chroma; for other information, build an SQL database based on SQLite to implement the writing, querying and updating of the historical dialogue, knowledge base and particle swarm optimization status.
[0014] The beneficial effects of the present invention are as follows: 1) By combining the knowledge model, large language model and optimization search algorithm, the present invention can quickly generate the key scenes of intelligent vehicles. 2) The method for automatically constructing and actively updating the knowledge model based on LLM designed by the present invention can realize the dynamic construction of a self-learning multi-source knowledge base, and guide the accurate optimization search process with a transparent knowledge representation and reasoning mechanism, which is more efficient and accurate than manually generated knowledge.
[0015] 3) The multi-stage optimization strategy of global exploration, local optimization and space pruning designed by the present invention can effectively apply the knowledge model and improve the discovery efficiency of key scenes.
[0016] 4) The automated test tool based on the Carla simulation platform designed by the present invention can make full use of the advantages of LLM in tool invocation to realize the automated deconstruction, reconstruction, simulation and testing of test scenes. Description of the Drawings
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and thus should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0018] Figure 1 It is a schematic flow chart of a method for optimizing and generating key scenes of intelligent vehicles guided by large model knowledge according to the present invention; Figure 2 It is a schematic structural diagram of a method for optimizing and generating key scenes of intelligent vehicles guided by large model knowledge according to the present invention; Figure 3 It is a schematic diagram of the knowledge construction and update process; Figure 4 It is a schematic diagram of the improved Latin hypercube sampling method; Figure 5 It is a schematic diagram of the local optimization process; Figure 6 It is a schematic diagram of the spatial pruning method; Figure 7 It is a schematic diagram of the optimization prompt design rules; Figure 8 It is a schematic diagram of the simulation test platform architecture; Figure 9 It is a schematic diagram of the test scenario; Figure 10 It is a schematic diagram of determining the discrete step size of the scenario; Figure 11 It is a schematic diagram of the simulation test scenario demonstration; Figure 12 It is a schematic diagram of generating data for the key test scenarios of each group; Figure 13 It is a schematic diagram of the coverage data of each group; Figure 14 It is a schematic diagram of the test time data of each group. Specific implementation manners
[0019] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. Additionally, it should be noted that for the sake of description, only parts related to the present invention are shown in the accompanying drawings, rather than all the structures.
[0020] Embodiment 1: Refer to Figure 1 and Figure 2 This embodiment provides an intelligent vehicle key scenario optimization generation method based on large model knowledge guidance, including the following steps: S1. Construct a knowledge expression module, and design the knowledge result, the application mode of the large language model, and the dynamic update process from two parts: scenario theory knowledge and scenario exploration knowledge, specifically as follows: S11. Establish scenario theory knowledge, including three parts: importance, monotonicity, and coupling, specifically: S111. Establish importance; The influence degrees of different scenario elements on the test results are different; for a determined autonomous driving system, the importance of specific scenario elements is obtained through mutual comparison, so as to construct an element importance model; the specific steps are: S1111. The large language model (LLM) analyzes the functional requirements of the system under test, generates semantic descriptions of pairwise comparisons of elements through natural language reasoning, and converts them into judgment matrices. Let be a set of scenario elements to be compared, be the number of elements, and construct the judgment matrix . By solving the maximum eigenvalue and the corresponding eigenvector of this matrix, the relative weight of each element can be obtained; S1112. Based on the Analytical Hierarchy Process (AHP), the Agent makes a judgment. If the consistency ratio (CR) test passes, it indicates that the result is available and is saved in the knowledge base for subsequent optimization search. Otherwise, the previous value is used. The calculation method of CR is as follows: ; In the formula, is the random consistency index. When is less than 0.1, it can be considered that the matrix has satisfactory consistency. By combining the AHP with the LLM, an importance model of scenario elements can be automatically generated and updated, quantifying the influence of each element. At the same time, the LLM dynamically adjusts the element values of the judgment matrix (by itself) according to the parameter sensitivity data in the subsequent optimization process, forming a closed-loop correction system. The adjustment process is to feedback the sensitivity data to the LLM, and the LLM decides whether to adjust the elements in the judgment matrix by itself.
[0021] S112. Establish monotonicity; The monotonicity is used to describe the monotonic relationship between parameters and results within a specific parameter range. The LLM analyzes it based on kinematic equations and physical laws and is used to guide the search process of test boundaries. Because the change of some scenario parameters will cause the risk to show an overall monotonic change trend (for example, the increase in vehicle speed may lead to an increase in braking distance, thus increasing the risk). The specific steps are as follows: S1121. The LLM initially judges the monotonicity level (0, 1, 2) of scenario elements based on physical kinematic theory. The judgment process is to analyze the monotonic influence of this element on the safety of test results and score according to the influence degree; Among them, the initial judgment of the monotonicity level of scenario elements can be judged according to preset rules; When there is no clear monotonic relationship between the change of scenario elements and the test results, that is, when the element increases, the test results do not move in one direction, the level is 0; When the influence of the change of scene elements on the test results shows a small - range monotonic relationship, the minimum width of the range is not less than 1 / 5 of the entire element value range, and the level is 1; When the influence of the change of scene elements on the test results shows a significant monotonic relationship, that is, when the element increases, the test results will move in the same direction, and the level is 2; S1122. Construct a local sensitivity analysis method, namely SA, and calculate the partial derivative according to the discrete difference approximation: ; The test data and the sensitivity analysis results are provided to the LLM again, and the LLM fuses knowledge and test data to generate a corrected monotonicity mapping table; S113. Establish coupling; Systematically analyze the interdependence between elements through the coupling degree theory in systems engineering, which is mainly completed by the LLM. The specific steps are as follows: S1131. Utilize the LLM's understanding ability of the test scenario. Based on historical data, establish the coupling relationship between elements, label the coupling intensity, and express it with a coupling degree matrix M, where each element represents the element and the coupling intensity between; Among them, when it is defined as weak coupling, that is, when multiple elements change together in a fixed direction and have no single - direction influence on the test results, it is labeled as 0; When it is defined as strong coupling, that is, when multiple elements change together in a fixed direction and have a single - direction influence on the test results, it is labeled as 1; The weak coupling and strong coupling are determined according to the preset threshold; S1132. At each stage of the test process, use correlation analysis, namely CA, to calculate the Spearman correlation coefficient between each element, quantify the non - linear association between elements, and provide it to the LLM to assist the LLM in adjusting the coupling relationship. The calculation formula is as follows: ; In the formula, is the difference between two sets of ranked data, is the sample size; according to value, adjust the corresponding position in the coupling degree matrix to reflect the latest non - linear correlation relationship; S12. Establish scene exploration knowledge, which includes three parts: spatial region characteristics, optimal solution characteristics, and convergence characteristics; S121. Analyze the spatial region characteristics; Divide the search space into an unexplored part and an explored part; the specific steps are as follows: The LLM identifies blank areas during the search process and combines it with subsequent scene space partitioning strategies to optimize the global exploration efficiency; in the dimensional test space, each point is represented by a vector , where , for each dimension , the distance from any point to the nearest known point in the forward recurrence is defined as follows: ; In the formula, is the projection of the set of points determined to be in the explored area on the dimension. Set a threshold . If the calculated distance result is less than , it is considered explored; dynamically adjusted, the LLM automatically identifies and updates the regional features based on historical data and theoretical models, thus realizing the dynamic update of regional features during the acceleration test process and can adapt to different exploration stages; S122. Optimal solution feature analysis; Record the optimal solution information of the key scene elements found during the optimization process; by real-time tracking and analyzing the performance of each element area, save the global optimal solution. When a new global optimal solution is found, add it to the set: ; To prevent the set from being too large, set a maximum capacity . When it exceeds this capacity, remove the earliest entered element: ; At the same time, through prompt design, require the LLM to self-infer the recommended value in the current dimension, thus constructing and dynamically updating the high-quality solution set, and using the LLM's understanding ability of knowledge to guide the subsequent local optimization process; conduct statistical analysis on the corresponding dimensions in the high-quality solution set to obtain the mean and standard deviation: ; ; The calculation results are used to assist the LLM's value recommendation process; S123. Convergence characteristics; Evaluate the effect of the optimization search process; the specific steps are as follows: S1231. The LLM analyzes whether the local optimization stage can continuously explore test scenarios or whether it needs to enter the global exploration stage according to the number of key scenarios and the convergence criterion of the particle population during each optimization search process; S1232. The convergence analysis includes the convergence speed of the optimization algorithm, stability and repetitive features Quantitative evaluation is carried out to ensure the comprehensiveness of the search process. To assist the LLM analysis, the calculation formulas for each index are constructed as follows: ; ; ; In the formula, is the number of key scenarios found in the th iteration; is the number of key scenarios in the initial particle space; is the average value of the positions of all particles in the th generation; is the Euclidean distance between particles; By comprehensively utilizing the automatic analysis ability of the LLM, exploring the construction and update of knowledge will help improve the interpretability and search efficiency of optimization; S13. Design knowledge construction and dynamic update process; Traditional knowledge expression methods usually rely heavily on human subjective analysis and are limited by the understanding limitations of experts. The present invention comprehensively considers information such as historical instructions, population variable states, scenario library data, and simulation test results in the optimization search process, and guides the LLM to generate context prompts through a preset prompt word template, thereby dynamically updating the knowledge expression model to guide subsequent decisions and actions. The specific process is as Figure 3 shown.
[0022] S131. In the initial test stage, based on the relevant theories of test scenarios and the information of the system under test, a preliminary scenario theory model is constructed. The scenario description is converted into prompt words, and combined with context information, to assist the LLM in initializing the construction of the theoretical knowledge model; S132. During the optimization process, collect historical instructions, population variable states, scenario library data, and simulation test results of the optimization search process, and form context information based on a preset prompt word template covering key concepts, objective functions, and scenario theories of the optimization search. The LLM, based on the current context information, calls the corresponding Agent calculation tool to generate knowledge about the importance, monotonicity, and coupling of scenario elements, and dynamically updates the scenario theory knowledge accordingly. For the knowledge of the exploration process, record the regional features, optimal solution features, and convergence features, and infer the LLM optimal solution, and save it as a specific numerical matrix; S133. Dynamic update: After each round of optimization, the LLM continuously receives new data. Through the collaborative work of the SA, CA, and AHP agents, knowledge verification and the generation of sensitivity and correlation data are achieved to assist the LLM in learning and adapting to changes in the test environment and adjusting the knowledge expression model. The updated knowledge expression will guide the decision-making behavior of the agents in the subsequent parameter optimization module, and the decision results are fed back to the system again to form a closed-loop of continuous improvement.
[0023] S2. Construct a parameter optimization module and design a multi-stage optimization strategy including global exploration, local optimization, and space pruning, which is integrated with the knowledge model; S21. Model the global exploration part; Latin Hypercube Sampling (LHS) can provide uniform and discrete scenario data by hierarchically controlling the sampling process in each batch. Since different scenario elements have different degrees of influence on the test results and the sampling frequency needs to be adjusted accordingly, the sampling can be guided by the knowledge results in the knowledge base. During the optimization process, the subsequent pruning module will delete the scenario space. The improved LHS algorithm process is as Figure 4 shown; S211. For each scenario dimension, judge whether the importance of the dimension and the value range have changed. If it is a newly generated or changed dimension, re-partition according to the specific values, discrete steps, and importance of the scenario parameters; if there is no change, there is no need to re-partition.
[0024] S212. Randomly select data points within each single-dimensional partition and combine them to generate a sampling space; S213. Use the random sampling method to select the required samples in the sampling space; S22. Model the local optimization part; Based on the traditional Particle Swarm Optimization (PSO), the present invention is improved by combining the knowledge model, as Figure 5 shown, and the specific measures are as follows: 221) Region aggregation; First, aggregate the regions divided by the global exploration module using region features and optimal solution features, and conduct statistical analysis on each scenario parameter within its respective divided region. Starting from the value starting point, mark the region where the number of key scenarios is greater than 20% of the number of key scenarios in the overall space as the core region. Define a separation zone around the center of the core region. After aggregation, the length of the core region does not exceed 3 times the length of the smallest region of this scenario parameter. For non-core regions, aggregate them with a length not exceeding 5 times the smallest region and with a length greater than the core region to reduce the complexity of the search space while ensuring the search effect.
[0025] 222) Particle equation optimization; The contribution degrees of different scenario parameters to the test results are different. Integrate the importance knowledge into the particle movement process, construct an importance weight equivalent to the importance knowledge result, so that the particle pays more attention to the important parameter dimensions during the optimization process; if a certain dimension is more important, then when updating the particle velocity, the movement of this dimension will be more affected, enabling the particle to adjust its position faster in the important dimension and approach the optimal solution. The LLM can directly give the optimal solution recommended for exploration through the prompt words, thus guiding the particle movement. In order to better apply the features of different regions during the optimization process and achieve cross-region information sharing and global information target search. Design the following particle movement equation: ; ; In the formula, is the time step is the particle at the velocity on the th parameter dimension; is the inertia weight; is the importance weight of the th parameter dimension; is the acceleration constant in the current region; is the acceleration constant in other regions. Here, the current region and other regions are the regions where the particle is located after region aggregation. Considering multiple regions helps the particle converge quickly and gain a global perspective; is the global acceleration constant; , , , is a random number between [0, 1], used to increase the randomness of the search; is the current particle at the position on the th parameter dimension; is the optimal position of the current particle on the th parameter dimension within the current region; is the sum of the optimal solutions of all other regions except the region where the particle is located on the th parameter dimension; is the number of aggregation regions of the particle on the th parameter dimension; is the optimal solution of the particle on the th parameter dimension given by the LLM analysis; is the particle position at time step; is the particle velocity calculated at S23. Model the space pruning part; Due to the characteristics of multi - dimensionality, different step - sizes, and wide value ranges of scenario elements, the intelligent vehicle test parameter space generated by the combination of multi - dimensional scenario elements is huge and difficult to exhaust. There are a large number of non - critical regions in the parameter space. The global random exploration characteristic of the optimization algorithm may probabilistically explore these non - critical regions. Since the intelligent vehicle simulation test process consumes a large amount of time and computing power resources, the exploration process of non - critical regions will inevitably affect the test efficiency. To improve the efficiency, the present invention proposes a space pruning strategy, which combines the monotonicity, coupling, and regional characteristics in the knowledge model to prune and optimize the parameter space. Specifically, it includes the following three strategies: S231. Monotonicity constraint; For parameters known to have monotonicity, establish constraint conditions to exclude regions that cannot contain better solutions based on monotonicity judgment. For example, if an increase in a certain parameter value leads to a decrease in the objective function value, then avoid exploring in the increasing direction of this parameter during the search. When other parameters remain unchanged, prune this parameter dimension; S232. Coupling analysis; Regarding the coupling between parameters, construct a correlation model between parameters and use the model to judge invalid parameter combinations. During the search process, when encountering a certain set of parameter values, according to the coupling analysis results, prune the parameter space regions that cannot produce better solutions under the given parameter values; S233. Refer to Figure 6 and design a pruning buffer zone; As the optimization search process continues to deepen, a large number of key scenarios are discovered. The boundary region between the key and non - key areas will be the focus of the optimization search. To avoid excessive pruning of key regions in the initial stage of optimization, based on the importance of scenario elements and the search process, design a pruning buffer zone. The initial buffer zone of the element with the highest criticality is the highest, which is the regional width of this element in the global exploration part. The buffer zones of other elements are converted proportionally according to importance. Each time the space pruning part is executed, the buffer zone width is adjusted to 3 / 4 of the previous round, so as to achieve fine - grained pruning. Figure 7 shows a parameter space containing four dimensions. The orange combined use cases (orange connecting lines) indicate the regions that have been tested and have results, and the blue indicates the untested regions. The parameter D has monotonicity. Under the influence of the first set of results, pruning to the left will not generate key scenarios (yellow connecting lines). The parameters C and D have coupling. Under the influence of the second set of results, pruning C to the right and D to the left will not generate key scenarios. The yellow - covered area in the figure is the buffer area set by the present invention.
[0026] S24. Design the optimization execution process; The collaborative effect of the three modules of global exploration, local optimization, and space pruning completes the cyclic optimization process. The present invention designs optimization rules in combination with the module characteristics as Figure 7 shown. The global exploration part is called at the beginning of the test and when the optimization falls into a local optimum, to supplement diverse individuals in the particle swarm. Its role is to explore the dispersed space hierarchically and break the local optimum phenomenon. The local optimization part judges whether the number of loop iterations has ended after each round of optimization. Its role is to perform space optimization using the gradient characteristics of the parameters. After each round of optimization, it is judged whether the number of loop iterations has ended. If not, the parameter space is pruned according to the space pruning part to exclude non-critical regions and improve the search efficiency. Further integrate convergence knowledge. If convergence occurs, transfer to the global exploration part to generate a new round of exploration results. Otherwise, continue to execute the local optimization part. Convert the above statement logic into a task prompt to assist the LLM in Agent scheduling and optimization work.
[0027] S3. Build a simulation test module. Based on the Carla simulation platform, use the LLM-Agent to construct components for scenario building, the system under test, simulation execution, and data export, as follows: S31. The simulation test platform is the basic support for simulation testing. The functional verification of intelligent vehicles based on large language models requires a highly controllable, repeatable, and highly realistic virtual environment. CARLA has real-time three-dimensional scene rendering capabilities, physical engine support, and traffic element simulation functions, and is programmed in the same Python language as mainstream large language models. Therefore, the present invention constructs a simulation test platform based on CARLA simulation, as Figure 8 shown, specifically including four core components: scenario building, the system under test, simulation execution, and data export.
[0028] S32. The scenario construction component selects elements from the element library according to the input test cases to construct a test scenario, and uses the internal API of CARLA to customize static scenario elements such as road structures, traffic signs, and buildings; dynamic traffic participants such as vehicles, pedestrians, and bicycles; and environmental characteristics such as lighting, weather conditions, and road surface conditions. The element library defines various elements that can be used for environment initialization. The elements constructed in the present invention include: lane width, lane ID, longitudinal speed, lateral speed, lateral offset from the lane, lateral distance between the host vehicle and the traffic vehicle, longitudinal distance, longitudinal speed of the traffic vehicle, lateral speed, light intensity, road surface adhesion coefficient, weather conditions (including sunny, rainy, and foggy days, and the intensity of each meteorological index can be defined). The component of the system under test provides an external interface for the autonomous driving algorithm to implement sensor settings, input of vehicle control signals, and output of chassis and scenario feedback information. According to the sensor characteristics in Carla, it supports various perception sensors such as cameras and lidar. The simulation execution component initializes the scenario by loading the specific values of the above-mentioned scenario elements and executes the simulation program. During the process, the kinematic indicators of each traffic participant, including vehicle position, speed, acceleration, heading angle, etc., are saved in real time to the result library. The data export component exports and merges all the motion data collected during the simulation process in a standardized JSON format for saving.
[0029] S4. Select a pre-trained large language model, design selection indicators, and select a model as follows: S41. To ensure the effectiveness of the acceleration test method guided by the LLM, it is crucial to select a suitable LLM. The present invention designs the following selection criteria: a. Knowledge understanding and expression ability: The core of the present invention is knowledge understanding and application. Therefore, the LLM needs to have a profound understanding of complex scenarios and multi-dimensional data and be able to generate accurate and rich knowledge expressions; b. Reasoning and optimization ability: The LLM should be able to quickly process large-scale data, support real-time reasoning and optimization to improve efficiency; c. Interaction and tool scheduling ability: The large language model needs to be able to interact effectively with the optimization Agent, support flexible scheduling and task allocation to ensure the high efficiency and controllability of the optimization process; d. Scalability: Since the combined process of simulation testing and optimization search is complex, the large language model should be easy to deploy, have good scalability, and be able to be dynamically updated as the test requirements change; S42. According to the above criteria, DeepSeek, ChatGPT, and Qwen can all meet the requirements. Among them, the present invention selects Qwen as the core technical support because Qwen has undergone large-scale data training, can provide rich knowledge support, can achieve fast knowledge reasoning, can be seamlessly docked with Agent tools, supports flexible task scheduling and optimized process management. More importantly, Qwen has a perfect API system, which is convenient and fast to call, supports dynamic update and adjustment, and has obvious advantages compared with other LLMs.
[0030] S5. Construct an evaluation and memory module to evaluate the test results and store all test and knowledge data during the process, specifically as follows: S51. How to evaluate the key nature of the test scenario and design accurate evaluation indicators is one of the core tasks of the intelligent vehicle acceleration test. Since the present invention focuses on the dangers during the test process, during the vehicle operation, the collision time determines the longest reaction time when danger occurs, and the safety distance determines the main vehicle and the interaction object. Therefore, the scenario key nature indicators of the present invention are defined from two core dimensions related to danger, namely the collision time and the safety distance, and different key nature levels are assigned, as shown in the following formula: ; In the formula, is the scenario fitness value for guiding the optimization search. To avoid the negative value effects of the collision time and the relative distance on the gradient search process, their reciprocals are taken. According to existing research, when the collision time is less than 0.6 s and the safety distance is less than 3 m, it represents an extreme scenario. Therefore takes 1.67 s-1, takes 0.33 m-1. and The calculation formulas are as follows: ; ; Optimization algorithms all require gradient information to assist in optimization, and there should be no confusion between scenarios with different key nature features. Therefore, the present invention designs the scenario key nature into three levels and assigns different weights. When both indicators are satisfied, it indicates that the relative position of the scenario is extreme and the collision time is extremely small, indicating a key scenario concerned in the test process, with a high key nature level and a weight of 10 assigned. When only one indicator is satisfied, the key nature level is medium. When neither indicator is satisfied, the key nature level is low and a weight of 0.1 is assigned; S52. An efficient and maintainable memory pool is a key component of test quality assurance and can systematically organize all test-related information. To ensure the smooth operation of the system and avoid memory pressure, the data memory of the present invention mainly stores historical LLM interaction states, various aspects of knowledge in the knowledge model, parameter spaces related to test scenarios and test result information, as well as the particle positions and movement information of the historical 5 optimization step sizes. To store information efficiently, the test scenario and test result information are stored in the vector database Chroma, facilitating subsequent storage and query operations for a large number of scenarios. For other information, an SQL database is built based on SQLite to achieve fast writing, querying, and updating of historical conversations, knowledge bases, and particle swarm optimization states.
[0031] Embodiment 2: In this embodiment, a to-be-tested scenario is designed to test and analyze the to-be-tested system, specifically as follows: S6. Design a to-be-tested scenario to test and analyze the to-be-tested system. The specific method is as follows: S61. Test scenario design; S611. The test scenario cannot exist outside the functional design operation domain. The to-be-tested system set by the present invention is a vehicle equipped with an ACC and AEB system based on millimeter-wave radar ranging. The core decision logic of this algorithm is the time to collision TTC and the safety distance model. Adverse weather has a significant impact on the perception sensors and chassis control effects of intelligent vehicles. At the same time, the response ability of the ACC system to multi-target and cut-in scenarios is crucial. Therefore, the present invention sets the functional scenario as follows: Under rainy weather, there is a leading vehicle driving at a constant speed in front of the host vehicle. At a certain moment, a vehicle in the adjacent lane cuts into the host vehicle lane. Through this scenario, the multi-target following ability of the ACC system and the emergency avoidance ability of the AEB system under rainy scenarios can be comprehensively evaluated.
[0032] S612. As Figure 9 shown, the rainfall intensity of the scenario is , the host vehicle drives along the left road centerline, with an initial speed , the leading vehicle drives at a constant speed in the same lane, and the initial distance between the two vehicles is ; the cut-in vehicle drives along the right lane centerline at at a constant speed and cuts into the host vehicle lane after distance. The longitudinal length of the cut-in trajectory is , the lateral length is , and it keeps driving straight after cutting in. The initial distance between the cut-in vehicle and the host vehicle is ; thus, the semantic test scenario is represented as an abstract scenario composed of 10 scenario elements, covering four element types: weather, distance, movement, and road surface. S613. Since the scenario space is a concept of a continuous domain, the test cases generated by sampling it are theoretically infinite and cannot be comprehensively tested. In addition, due to the hardware precision of different sensors and controllers, the test results obtained from overly subdivided test cases tend to be unified; weather, distance, and motion conditions will affect the functions of the system under test to varying degrees, and the scales of the horizontal distance and the vertical distance in the motion direction are different. Therefore, in the present invention, the radar, tires, etc. in the system under test are treated according to scenario elements; the simulation frequency and simulation accuracy in the simulation process; and the efficiency and accuracy of the test requirements, and the scenario space is discretized, as Figure 10 shown.
[0033] S62. Experimental design and execution; To verify the effectiveness of the proposed method, a series of experimental groups were designed. Experimental group A is a complete implementation of the method proposed in the present invention, including scenario theory knowledge, scenario exploration knowledge, the active construction process of knowledge by the LLM, and the dynamic optimization method, aiming to comprehensively demonstrate the capabilities and potential advantages of the new method; control group B uses the traditional particle swarm algorithm without additional knowledge guidance or dynamic optimization to illustrate the difference between the algorithm of the present invention and the most basic traditional method. In addition, ablation groups C to E were designed to gradually remove the key components in the method of the present invention to evaluate the impact of each part on the overall performance. Specifically, ablation group C does not integrate scenario theory knowledge and simultaneously removes the dynamic partitioning and pruning strategies that require the construction of scenario theory knowledge, and completes the scenario search with a simplified LLM-Agent, aiming to evaluate the importance of scenario theory knowledge in the entire system. The reason for only removing scenario theory knowledge is that the subsequent optimization agent must rely on the existence of scenario exploration knowledge; ablation group D does not integrate the process of the LLM actively constructing knowledge and constructs knowledge manually and by rules, aiming to evaluate the impact of the actively constructed and dynamically updated knowledge model on the search results; ablation group E uses rule-based search instead of the LLM-Agent, and executes each optimization process with a fixed convergence threshold. When no new key scenarios are found in two consecutive rounds of loops, it will automatically switch to the global exploration stage, aiming to analyze the value of the LLM dynamic optimization for the search results. For each group, one parameter optimization is regarded as one round of the search process, and 100 rounds are executed cumulatively. During this period, the information of the search process and the final key scenario information will be recorded.
[0034] S63. Result analysis and evaluation; S631. Simulation test scenario demonstration; During the test, the scenario images generated by the Carla simulation platform are as Figure 10As shown, the rainfall intensity and the position of the traffic vehicle in the scenario have changed significantly. It can be found that through the simulation test module constructed by the present invention, the LLM can correctly execute the simulation test tool to generate test scenarios with different rainfall intensities, different vehicle kinematic information, and different road adhesion coefficients, further reducing the workload of designing scenarios and test execution.
[0035] S632. Analysis of the key scenario generation effect; To verify the scenario generation effect of each algorithm, the key scenario data generated by each round of iteration of a total of 5 groups from A to E are plotted as Figure 11 shown.
[0036] In the figure, the abscissa represents the number of overall parameter optimization cycles (theoretically 100 tests are performed in one cycle), and the ordinate represents the number of key scenarios found. From Figure 12 the trend in it, it can be seen that the optimization algorithm guided by LLM knowledge dynamics (Group A) shows the strongest optimization ability in the whole test stage, discovers the most key scenarios within the number of cycles, and the average slope is also higher than other groups. The traditional particle swarm algorithm (Group B) can discover test scenarios in the initial stage, but due to the local convergence characteristics of the algorithm, it cannot continuously discover key scenarios. Among other ablation groups, removing the LLM dynamic construction knowledge (Group D), removing the scenario theoretical knowledge (Group C), and removing the LLM-Agent dynamic search (Group E) respectively show decreasing key scenario discovery capabilities, indicating that these components have a positive contribution to the overall performance. The performance of the control group is significantly lower than that of all experimental groups and ablation groups, demonstrating the comprehensive effectiveness of the multi-Agent optimization framework proposed by the present invention.
[0037] S633. Coverage rate evaluation and analysis; Fully exploring the overall parameter space and the key test area is the core of intelligent vehicle scenario generation. Given the highly multi-dimensional and large-scale characteristics of the test scenario space studied by the present invention, it is impossible to conduct comprehensive tests within a limited test cycle. To explore the coverage of each algorithm in the process of key scenario generation, the present invention designs the following two indicators: Overall space area coverage rate: Evaluate all non-repeated scenarios executed during the search process for each group, and calculate the average percentage of the value range of the scenario element dimension in the overall value range under a single group, reflecting the exploration degree of the acceleration test algorithm for the overall test space.
[0038] For each group , the overall space area coverage rate can be expressed as: ; Among them, is the number of dimensions; is the dimension The value range of the scenario elements in the lower group; is the overall value range of this element dimension.
[0039] Key scenario area coverage rate: Evaluate all the key test scenarios discovered during the search process for each group, count the value ranges of the elements in all dimensions of all the key test scenarios, and calculate the mean value of the value of each dimension of the elements of the key test scenarios found in a single group accounting for the overall value range of the key scenario dimensions.
[0040] For each group , the key scenario area coverage rate can be expressed as: ; where is the number of dimensions; is the dimension in the value range of the elements of the key test scenarios found in the lower group; is the value range of this element dimension in all the key test scenarios.
[0041] The coverage calculation results of each group are as Figure 13 shown.
[0042] As can be seen from the figure, the present invention (Group A) has the highest overall spatial coverage (35.23% improvement compared to the traditional algorithm) and key area coverage (22.96% improvement compared to the traditional algorithm), indicating that the comprehensive application of knowledge-LLM-Agent can effectively jump out of the local optimum and conduct global exploration. Due to the limited exploration range of the traditional algorithm (Group B) and the small number of key test scenarios explored, its coverage ability for the scenario space and key areas is limited. The coverage of Group C, Group D, and Group E has all improved compared to the traditional algorithm, but Group D has the most obvious improvement, indicating the important role of the comprehensive utilization of scenario theory knowledge and the optimization architecture in scenario coverage. Dynamically updating knowledge also has a certain effect, but the impact is the smallest.
[0043] S634. Time cost analysis; The test time is a key efficiency indicator in the intelligent vehicle test evaluation process. Accelerated testing should discover a large number of key test scenarios in a short time. Compared with the basic traversal test, the accelerated test method based on optimized search discussed in the present invention generates key test scenarios through targeted optimization and has a natural efficiency advantage. To comprehensively compare the time costs of each group, the overall time consumption (unit: hour) of each group is counted during the test process, and the scenario generation efficiency indicator is defined as: the number of key test scenarios discovered per unit time. The statistics and calculation results of each group are as Figure 14 shown.
[0044] From the analysis of the data, it can be seen that in terms of the overall time, due to the influence of the repetition phenomenon, the number of test times of the algorithm will be reduced to a certain extent, resulting in the longest overall time of the present invention and the shortest time of the traditional algorithm. However, this does not mean that the efficiency of the present invention is the lowest, because the test process should ensure the rapid generation of a large number of key test scenarios in a short time. In terms of the generation efficiency index, due to the highest number of key scenarios generated, the present invention has the highest generation efficiency, while the generation efficiency of the traditional algorithm (Group B) is the lowest. Among other groups, the generation efficiencies of Group D, Group C, and Group E decrease in turn, but are all better than the traditional algorithm. It shows that both the scenario theory knowledge and the optimized architecture are beneficial to improving the scenario generation efficiency.
[0045] In summary, the present invention constructs a new search architecture based on LLM, namely "multi-dimensional knowledge generation - process dynamic guidance - automatic simulation execution", designs an automatic construction and active update method of the knowledge model based on LLM, realizes the dynamic construction of a self-learning multi-source knowledge base, and guides an accurate optimization search process with a transparent knowledge representation and reasoning mechanism; utilizes the information dynamic flow and collaborative optimization effect of "LLM - knowledge model - optimization Agent" to construct a multi-stage optimization strategy of global exploration, local optimization, and spatial pruning to improve the discovery efficiency of key scenarios; based on the advantages of LLM in tool invocation, an automatic test tool based on the Carla simulation platform is established. Through the LLM-Agent, four core components of scenario construction, system under test, simulation execution, and data export are constructed, realizing the automatic deconstruction, reconstruction, simulation, and testing of test scenarios. Finally, it improves the generation efficiency and coverage rate of key test scenarios, while effectively balancing the time cost. Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principle and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for optimizing and generating key scenarios of intelligent vehicles based on large model knowledge, characterized in that: The following steps are involved: S1. Construct a knowledge expression module, design knowledge results, large language model application methods and dynamic update process from two parts: scenario theory knowledge and scenario exploration knowledge; S2. Build a parameter optimization module, design a multi-stage optimization strategy including global exploration, local optimization and spatial pruning, and integrate it with the knowledge model; S3, build simulation test module, based on Carla simulation platform, build scenario building, system to be tested, simulation execution, and data export components through LLM-Agent; S4. Select a pre-trained large language model, design selection indicators and perform model selection; S5. Construct an evaluation and memory module to evaluate the test results and store all test and knowledge data in the process.
2. According to claim 1, a method for optimizing and generating key scenarios of intelligent vehicles based on large model knowledge guidance is characterized in that: The specific method of S1 is as follows: S11. Establish scenario theory knowledge, including importance, monotonicity and coupling; S111, establish importance; For a certain autonomous driving system, the importance of specific scene elements is obtained by mutual comparison, thereby constructing an element importance model; S112, establish monotonicity; The LLM is derived based on the kinematic equations and physical laws and is used to guide the search process of the test boundary; S113, establish coupling; The interdependence between elements is analyzed through coupling theory in system engineering, which is completed by LLM; S12, establish scene exploration knowledge, including spatial region features, optimal solution features and convergence features; S121, analyzing the characteristics of the spatial region; dividing the search space into an unexplored part and an explored part; S122, analyzing the optimal solution characteristics; Record the optimal solution information of key scene elements found during the optimization process; save the global optimal solution by real-time tracking and analyzing the performance of each element area, and when a new global optimal solution is found When the global optimal solution Add to collection, set maximum capacity , when the maximum capacity is exceeded, remove the earliest element that enters; At the same time, through the design of prompt words, LLM infers the recommended value under the current dimension, thereby constructing and dynamically updating the set of high-quality solutions, and using LLM's ability to understand knowledge to guide the subsequent local optimization process; statistical analysis is performed on the corresponding dimensions in the set of high-quality solutions to obtain the mean and standard deviation: ; ; The calculation results are used to assist the LLM value recommendation process; S123, evaluating the effect of the optimization search process; S13, design knowledge construction and dynamic update process; Guide LLM to generate contextual prompts through preset prompt word templates, so as to dynamically update the knowledge expression model and guide subsequent decisions and actions; S131, initial stage of design and testing; S132, design optimization process; S133. Perform dynamic update.
3. The method for optimizing and generating key scenarios of intelligent vehicles based on large model knowledge guidance according to claim 2 is characterized in that: The specific method of S111 is as follows: S1111, LLM analyzes the functional requirements of the system to be tested, generates semantic descriptions of element comparisons between two elements through natural language reasoning, and converts them into judgment matrices; S1112. Based on the hierarchical analysis test agent, if the consistency ratio, i.e., CR test, passes, the result is available and saved in the knowledge base for subsequent optimization search. Otherwise, the previous value is used. The calculation method of CR is as follows: ; In the formula, is a random consistency indicator, when If it is less than 0.1, the matrix is considered to have satisfactory consistency. By combining AHP with LLM, the importance model of scene elements is automatically generated and updated to quantify the impact of each element. At the same time, LLM dynamically adjusts the element values of the judgment matrix according to the parameter sensitivity data in the subsequent optimization process to form a closed-loop correction system. The specific method of S112 is as follows: S1121, LLM preliminarily determines the monotonicity level of scene elements based on the physical kinematics theory; S1122. Construct a local sensitivity analysis method, namely SA, and calculate partial derivatives based on discrete difference approximation: ; The test data and sensitivity analysis results are provided to LLM again, and LLM generates a revised monotonicity mapping table based on the test data; The specific method of S113 is as follows: S1131. LLM's ability to understand test scenarios is used to establish coupling relationships between elements based on historical data, and the coupling strength is annotated and expressed as a coupling matrix M, where each element Representation elements and The coupling strength between S1132. At each stage of the testing process, the Spearman correlation coefficient between the various factors is calculated using correlation analysis (CA). , quantify the nonlinear correlation between the elements and provide it to LLM to assist LLM in adjusting the coupling relationship. The calculation formula is as follows: ; In the formula, is the difference between the two sets of sorted data, is the sample size; The value of adjusts the corresponding position in the coupling matrix to reflect the latest nonlinear correlation; The specific method of S121 is as follows: S1211, LLM identifies blank areas during the search process and combines it with the subsequent scene space partitioning strategy to optimize the global exploration efficiency; In the dimensional test space, each point Use vector Indicates that , for each dimension , the distance from any point to the nearest forward recursive known point is defined as follows: ; In the formula, To determine the point set in the excavated area, Projection on dimension, setting threshold , if the calculated distance result is less than , it is considered to have been discovered; dynamic adjustment, LLM automatically identifies and updates regional features based on historical data and theoretical models, thereby realizing the dynamic update of regional features during the accelerated testing process; The specific method of S123 is as follows: S1231, LLM analyzes whether the local optimization stage can continuously explore test scenarios or whether it needs to enter the global exploration stage based on the number of key scenarios in each optimization search process and the convergence criterion of the particle population; S1232. Convergence analysis includes the convergence speed of the optimization algorithm. ,stability and repeated features Conduct quantitative evaluation and adjust the optimization strategy according to the evaluation results to ensure the comprehensiveness of the search process. In order to assist LLM analysis, the calculation formulas for each indicator are constructed as follows: ; ; ; In the formula, For the The number of key scenes found in the iteration; is the number of key scenes in the initial particle space; For the The average value of all particle positions; is the Euclidean distance between particles; The specific method of S131 is as follows: In the initial stage of testing, a preliminary scenario theory model is constructed based on the theory related to the test scenario and the information of the system to be tested. The scenario description is converted into prompt words, and combined with the context information, the theoretical knowledge model is constructed to assist LLM initialization. The specific method of S132 is as follows: During the optimization process, historical instructions, population variable states, scenario library data, and simulation test results of the optimization search process are collected, and context information is formed based on preset prompt word templates covering key concepts of optimization search, objective functions, and scenario theory-related. Based on the current context information, LLM calls the corresponding Agent calculation tool to generate knowledge about the importance, monotony, and coupling of scenario elements, and dynamically updates the scenario theory knowledge accordingly. For the exploration process knowledge, the regional characteristics, optimal solution characteristics and convergence characteristics are recorded, and the LLM optimal solution is inferred and saved as a specific numerical matrix; The specific method of S133 is as follows: After each round of optimization, LLM continuously receives new data, and through the collaborative work of SA, CA and AHP agents, it realizes knowledge verification and sensitivity and correlation data generation, assists LLM to learn and adapt to changes in the test environment, and adjusts the knowledge expression model; the updated knowledge expression will guide the decision-making behavior of the intelligent agent in the subsequent parameter optimization module, and the decision results will be fed back to the system again, forming a closed loop of continuous improvement.
4. According to claim 1, a method for optimizing and generating key scenarios of intelligent vehicles based on large model knowledge guidance is characterized in that: The specific method of S2 is as follows: S21, modeling the global exploration part; S22, modeling the local optimization part; S23, modeling the spatial pruning part; S24. Design optimization execution process.
5. The method for optimizing and generating key scenarios of intelligent vehicles based on large model knowledge guidance according to claim 4 is characterized in that: The specific method of S21 is as follows: S211, for each scene dimension, determine whether the importance and value range of each dimension have changed; if it is a dimension generated for the first time or has changed, re-partition it according to the specific value, discrete step length and importance of the scene parameter; if there is no change, there is no need to re-partition; S212, randomly selecting data points in each single-dimensional partition, and combining them to generate a sampling space; S213, selecting the required samples in the sampling space by using a random sampling method; The specific method of S22 is as follows: S221, regional aggregation; First, the regions divided by the global exploration module are aggregated using regional features and optimal solution features, and statistical analysis is performed on the parameters of each scene in each divided region. Starting from the starting point of the value, the region where the number of key scenes is greater than 20% of the number of key scenes in the overall space is marked as the core region; a separation zone is defined around the center of the core region, and the length of the core region after aggregation does not exceed 3 times the length of the minimum region of the scene parameter. For non-core areas, the length is not more than 5 times the minimum area, and the length is greater than the core area; S222, particle equation optimization; Construct the importance weights that are equal to the importance knowledge results; LLM gives the optimal solution for recommended exploration through prompt words, guides particle movement, and designs the following particle motion equation: ; ; In the formula, is the time step Time Particle In the The speed in the parameter dimension; is the inertia weight; For the The importance weight of each parameter dimension; is the acceleration constant of the region; is the acceleration constant of other regions. The region where the particle is located and other regions are the regions where the particle is located after regional aggregation. The integration of multiple regions helps the particle converge quickly and grasp the global vision. is the global acceleration constant; is the LLM acceleration constant; , , , is a random number between [0,1], used to increase the randomness of the search; For the current particle In the The position in the parameter dimension; The current particle The optimal position of each parameter dimension in the region; To remove particles The sum of the optimal solutions of all other regions except the region where the parameter dimension is located; For particle The number of aggregation regions in each parameter dimension; The particle number given by LLM analysis is The optimal solution for each parameter dimension; for The particle position at the time step; For the calculated The particle velocity at the time step; The specific method of S23 is as follows: S231, constrained monotonicity; For parameters known to be monotonic, establish constraints to exclude areas that are unlikely to contain better solutions based on monotonicity. S232, analysis of coupling; According to the coupling between parameters, a correlation model between parameters is constructed, and the invalid parameter combination is judged by the model. During the search process, when a set of parameter values is encountered, the parameter space region that cannot produce a better solution under the given parameter values is cut off according to the coupling analysis results. S233, design pruning buffer zone; The initial buffer zone of the most critical element is the highest, which is the area width of the element in the global exploration part. The buffer zones of other elements are proportionally converted according to their importance. Each time the spatial pruning part is started, the buffer zone width is adjusted to 3 / 4 of the previous round. The specific method of S24 is as follows: The synergy of the three modules of global exploration, local optimization and spatial pruning completes the cyclic optimization process; the global exploration part is called at the beginning of the test and when the optimization falls into the local optimum to supplement the diverse individuals in the particle swarm; the local optimization part determines whether the number of cycles has ended after each round of optimization; after each round of optimization, it determines whether the number of cycles has ended. If not, the parameter space is deleted according to the spatial pruning part to exclude non-critical areas; further integrates convergence knowledge, if converged, it turns to the global exploration part to generate a new round of exploration results, otherwise continue to execute the local optimization part; converts the statement logic into task prompt words to assist LLM in agent scheduling and optimization.
6. The method for optimizing and generating key scenarios of intelligent vehicles based on large model knowledge guidance according to claim 1 is characterized in that: The specific method of S3 is as follows: S31. Construct a simulation test platform based on CARLA simulation; the simulation test platform includes four components: scenario construction, system to be tested, simulation execution, and data export; S32, the scenario building component selects elements from the element library to build the test scenario according to the input use case, and uses the CARLA internal API to customize static scene elements, dynamic traffic participants and environmental features; The element library defines various elements for environment initialization, including lane width, lane ID, longitudinal speed, lateral speed, lateral offset from the lane, lateral distance between the main vehicle and the traffic vehicle, longitudinal distance, longitudinal speed of the traffic vehicle, lateral speed, light intensity, road adhesion coefficient, and weather conditions. The system component under test provides an external autonomous driving algorithm interface to implement sensor settings, vehicle control signal input, chassis and scene feedback information output, and supports multiple perception sensors according to the sensor characteristics in Carla. The simulation execution component initializes the scene by loading the specific values of the above scene elements and executing the simulation program. During the process, the kinematic indicators of each traffic participant are saved in real time, including vehicle position, speed, acceleration, and heading angle to the result library. The data export component exports and saves all motion data collected during the simulation in a standardized JSON format.
7. The method for optimizing and generating key scenarios of intelligent vehicles based on large model knowledge guidance according to claim 1 is characterized in that: The specific method of S4 is as follows: Select the Qwen model.
8. The method for optimizing and generating key scenarios of intelligent vehicles based on large model knowledge guidance according to claim 1 is characterized in that: The specific method of S5 is as follows: S51. Define scenario criticality indicators from two core dimensions related to risk, namely collision time and safety distance, and assign different criticality levels, as shown in the following formula: ; In the formula, To guide the optimization search scene fitness value, in order to avoid the possible negative value of collision time and relative distance affecting the gradient search process, the reciprocal is taken; collision time less than 0.6s and safety distance less than 3m indicate extreme scenarios, so Take 1.67s-1, Take 0.33m-1; and The calculation formula is as follows: ; ; The scene criticality is designed into three levels and assigned different weights. When two indicators are met at the same time, it indicates that the scene relative position is extreme and the collision time is extremely small, indicating that it is a critical scene of concern in the test process. The criticality level is high and the weight is 10. When only one indicator is met, the criticality level is medium. When none of the indicators are met, the criticality level is low and the weight is 0.
1. S52, data memory stores historical LLM interaction status, various knowledge in the knowledge model, parameter space and test result information related to the test scenario, and particle position and motion information of the historical 5 optimization steps; stores the test scenario and test result information in the vector database Chroma; for other information, build an SQL database based on SQLite to realize the writing, query and update of historical dialogues, knowledge base and particle swarm optimization status.
Citation Information
Patent Citations
Automatic driving system acceleration test method based on global agent optimization
CN116976220A
Intelligent automobile virtual simulation test method based on large language model
CN118586281A
Finished vehicle testing method and device based on LLM (Logistics Language Model), medium and equipment
CN118939541A
Intelligent automobile edge scene generation method based on hierarchical reinforcement architecture
CN119167802A
Method for evaluating performance of self-driving vehicle oriented to full parameter space of logical scenario
US20230304896A1
Cited By
Marketing knowledge base construction system and method based on large model
CN120671794A
A large model-based marketing knowledge base construction system and method
CN120671794B
Adjusting method of automobile wire harness fixing frame
CN121256959A
Automatic design optimization method of buffer configuration scheme based on LLM
CN121615198A