Vehicle lamp test case intelligent generation method and system based on knowledge graph

Through the knowledge graph and reinforcement learning-driven intelligent filtering system, standard headlight test cases are automatically generated, solving the problems of invalid test cases and resource waste in existing technologies, and achieving efficient test case generation and result traceability.

CN120595185APending Publication Date: 2025-09-05CHANGZHOU XINGYU AUTOMOTIVE LIGHTING SYST CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

The existing method for generating vehicle headlight test cases lacks industry standard constraints, resulting in invalid use cases, repeated parameter combinations, and waste of resources. It also requires manual screening and filtering, increasing the workload.

Method used

The knowledge graph-based intelligent generation method for headlight test cases automatically generates standard test cases through demand analysis, knowledge reasoning, mathematical sampling and reinforcement learning filtering.

Benefits of technology

The generated test cases comply with industry standards, reduce invalid cases, improve test efficiency, and achieve traceability of test results and defect prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120595185A_ABST
    Figure CN120595185A_ABST
Patent Text Reader

Abstract

The invention provides a vehicle lamp test case intelligent generation method and system based on a knowledge graph, and relates to the technical field of vehicle lamp test. Comprising the steps of analyzing a test demand according to a customer product demand document, generating a test case according to a vehicle lamp test knowledge graph, filtering invalid test cases and performing case verification, feeding back a test report and updating the vehicle lamp test knowledge graph. According to the method, the test requirements and the index parameters are extracted through the natural language processing technology, intelligent generation of the test cases is achieved in combination with the knowledge graph, invalid cases are filtered through the reinforcement learning agent, the effectiveness and the test efficiency of the test cases are improved, and industrial standards and regulation requirements are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of vehicle light testing technology, and in particular to a method and system for intelligently generating vehicle light test cases based on a knowledge graph. Background Art

[0002] In the field of automotive lighting testing technology, a complete automotive lighting product undergoes various tests after design. Currently, automotive lighting testing relies primarily on manually written test cases or fixed automated script generation, which cannot quickly adapt to the needs of multiple customers, multiple product lines, and multiple testing projects. To expedite the development of automotive lighting test cases, existing technologies include methods that generate test cases by pre-defining test templates and inputting relevant parameters (see invention patent CN118939560A), methods that automatically fill in test case templates using a general large language model to generate test cases (see invention patent CN118377723A), and methods that retrieve and recommend test cases by constructing knowledge graphs (CN113900954A).

[0003] However, the prior art has the following technical problems:

[0004] (1) The generated test cases often lack the constraints of industry standards and regulations, resulting in some generated test cases being invalid.

[0005] (2) The generated test cases may contain test cases that do not conform to physical constraints, repeat parameter combinations, or exceed critical boundary conditions. Executing these test cases will waste test resources and, in severe cases, damage the test equipment.

[0006] (3) The generated test cases need to be manually screened and filtered, which increases the workload.

[0007] Therefore, there is an urgent need to provide a new technical solution to solve the above problems. Summary of the Invention

[0008] The purpose of the present invention is to overcome at least one technical problem existing in the prior art and to provide a method and system for intelligently generating vehicle light test cases based on a knowledge graph.

[0009] On the one hand, an embodiment of the present invention provides a method for intelligently generating vehicle headlight test cases based on a knowledge graph, the method comprising: step S1, obtaining a product requirement document and a vehicle headlight field standard library input by a user; step S2, parsing the user product requirement document through a requirement parsing engine in combination with the vehicle headlight field standard library, and outputting a parsing result, including: product test requirements, test objects, and test index parameters; step S3, constructing a vehicle headlight test knowledge graph based on historical vehicle headlight test data; step S4, inputting the test objects and test requirements into a knowledge reasoning engine, and the knowledge reasoning engine retrieves matching entities and constraints in the vehicle headlight test knowledge graph; step S5, combining the entities and constraints based on the entities and constraints. Step S6: perform latent space sampling on the test index parameters by mathematical methods to generate a multi-objective parameter combination list; Step S7: inject each group of parameters in the multi-objective parameter combination list into the test case unit to replace the basic parameters to generate candidate test cases; Step S8: input the candidate test cases into the intelligent filtering system driven by reinforcement learning to filter the candidate test cases to eliminate invalid test cases and then output valid test cases; Step S9: execute the test process of the headlights based on the valid test cases and generate a corresponding test report; Step S10: feedback the generated test report and update the headlight test knowledge graph based on the test report.

[0010] Furthermore, the step S2 includes: step S21, parsing the user product requirement document through the natural language processing model installed in the requirement parsing engine in combination with the vehicle lamp field standard library to output test objects, test requirements, performance indicators and regulatory standards; step S22, searching the vehicle lamp field standard library according to the regulatory standards to obtain regulatory standard performance indicators; step S23, combining the product performance indicators with the regulatory standard performance indicators to obtain test indicator parameters; step S24, outputting the parsing results, including product test requirements, test objects and test indicator parameters.

[0011] Furthermore, the step S21 also includes fine-tuning the natural language processing model based on preset annotation data in the field of vehicle lights to obtain a natural language processing model enhanced with vehicle light field knowledge.

[0012] Furthermore, step S3 includes: the headlight test knowledge graph is unit-designed according to the test types of different test objects and stored through a graph database, and a graph records relevant test information of a test method of the test object and associates the corresponding test results; the headlight test knowledge graph is composed of nodes and edge relationships, and the nodes include test objects, test types, test methods, equipment resources, test steps, test index parameters and test result entities or attributes. The nodes are connected by edges, and the edges represent the relationship between entities or attribute associations.

[0013] Furthermore, the step S4 includes: step S41, inputting the test object and test requirements into a knowledge reasoning engine equipped with a graph neural network model; step S42, the graph neural network model uses the test object as the first keyword and the test type as the second keyword to perform entity retrieval in the headlight test knowledge graph, screen out matching entities, and extract corresponding constraints.

[0014] Furthermore, the test case subunits include: one or a combination of: test object, test type, test method, equipment resources, test steps, expected results and test results.

[0015] Furthermore, the step S6 includes: step S61, performing latent space sampling on the test indicator parameters by mathematical methods to generate multiple groups of parameter combinations, covering the normal range, boundary values ​​and abnormal values; step S62, cross-matching the multiple groups of parameter combinations with the basic parameters in the test case unit to form a parameter list containing different variables; the step S7 includes: injecting each group of parameters in the parameter list containing different variables into the test case unit, replacing the basic parameters to generate candidate test cases.

[0016] Furthermore, the step S8 includes: step S81, training the reinforcement learning agent model integrated in the reinforcement learning-driven intelligent filtering system through a preset plurality of historical test records of vehicle lights; step S82, inputting the candidate test case into the reinforcement learning agent model for processing, so that the reinforcement learning agent model makes an action decision on the candidate test case, including acceptance, rejection and marking as high risk; step S83, when the action decision is acceptance, adding the candidate test case to the execution queue for physical and / or virtual testing to verify whether the expected test effect can be achieved; step S84, based on the actual test results obtained from the physical and / or virtual testing, calculating the reward value according to the preset feedback reward function, and giving feedback reward to the reinforcement learning agent model; step S85, the reinforcement learning agent model performs self-optimization based on the reward value.

[0017] Furthermore, the feedback reward function is:

[0018]

[0019] Among them, r invalid Indicates whether the use case violates any physical constraint, 1 if violated, 0 if not; N coverage Indicates the number of newly added parameter combinations; N defect Indicates the number of new defects triggered.

[0020] In the second aspect, the present invention provides an intelligent generation system for vehicle headlight test cases based on a knowledge graph, the system comprising: a test requirement parsing module, adapted to obtain a product requirement document and a vehicle headlight field standard library input by a user; a requirement parsing engine is combined with the vehicle headlight field standard library to parse the user product requirement document and output parsing results, including: product test requirements, test objects and test index parameters; a candidate test case generation module, adapted to construct a vehicle headlight test knowledge graph based on historical vehicle headlight test data; the test objects and test requirements are input into a knowledge reasoning engine, the knowledge reasoning engine retrieves matching entities and constraints in the vehicle headlight test knowledge graph; based on the entities and constraints, they are combined into test case examples Unit; perform latent space sampling on the test index parameters by mathematical methods to generate a multi-objective parameter combination list; inject each group of parameters in the multi-objective parameter combination list into the test case unit to replace the basic parameters to generate candidate test cases; a candidate test case filtering module is suitable for inputting the candidate test cases into the intelligent filtering system driven by reinforcement learning to filter the candidate test cases, so as to eliminate invalid test cases and then output valid test cases; a test case execution module is suitable for executing the test process of the headlights based on the valid test cases and generating a corresponding test report; a feedback and update module is suitable for feeding back the generated test report and updating the headlight test knowledge graph based on the test report.

[0021] In a third aspect, an embodiment of the present invention further provides an electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the above-mentioned method for intelligently generating vehicle light test cases based on knowledge graphs.

[0022] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the above-mentioned knowledge graph-based intelligent generation method of vehicle light test cases.

[0023] The beneficial effects of the present invention are:

[0024] (1) Automatically extract test requirements and indicator parameters through natural language processing technology, and align with industry standards and regulations so that the generated test cases meet relevant standards.

[0025] (2) A knowledge graph for vehicle headlight testing was constructed. By structurally associating multi-source data with domain knowledge, the test results can be traced and defects can be predicted. At the same time, combined with the reasoning ability of the knowledge graph, the intelligent generation of test cases can be achieved.

[0026] (3) By building a reinforcement learning agent to filter the generated test cases, the number of invalid cases is reduced and the test efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The present invention will be further described below with reference to the accompanying drawings and examples.

[0028] Figure 1 This is a flow chart of a method for intelligently generating vehicle headlight test cases based on a knowledge graph, as provided in Example 1 of the present invention.

[0029] Figure 2 This is a schematic diagram of a test requirement analysis process provided by Example 1 of the present invention.

[0030] Figure 3 This is a schematic diagram of a vehicle light test knowledge graph provided in Example 1 of the present invention.

[0031] Figure 4 This is a flowchart of generating candidate test cases provided by Example 1 of the present invention.

[0032] Figure 5 This is a schematic diagram of a candidate test case filtering process provided by Example 1 of the present invention.

[0033] Figure 6 This is a schematic diagram of the structure of an intelligent generation system for vehicle headlight test cases based on a knowledge graph provided in Example 2 of the present invention.

[0034] Figure 7 This is a partial block diagram of an electronic device provided by Example 3 of the present invention. DETAILED DESCRIPTION

[0035] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the various operations as sequential processes, many of the operations therein can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the various operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0036] It should be understood that although the terms "first," "second," and the like may be used herein to describe various elements, these elements should not be limited by these terms. These terms are used solely to distinguish one element from another. For example, a first element may be referred to as a second element, and similarly, a second element may be referred to as a first element, without departing from the scope of the exemplary embodiments. The term "and / or" as used herein includes any and all combinations of one or more of the listed associated items.

[0037] The present invention will now be described in detail with reference to the accompanying drawings. This figure is a simplified schematic diagram, which only illustrates the basic structure of the present invention in a schematic manner, and therefore only shows the components related to the present invention.

[0038] Example 1

[0039] The specific implementation is as follows:

[0040] like Figure 1 As shown, this is a flow chart of a method for intelligently generating vehicle light test cases based on a knowledge graph provided by the present invention.

[0041] As an example, the method includes: step S1, obtaining a product requirement document and a vehicle lamp field standard library input by a user; step S2, parsing the user product requirement document through a requirement parsing engine in combination with the vehicle lamp field standard library and outputting a parsing result, including: product test requirements, test objects and test index parameters; step S3, constructing a vehicle lamp test knowledge graph based on historical vehicle lamp test data; step S4, inputting the test objects and test requirements into a knowledge reasoning engine, and the knowledge reasoning engine retrieves matching entities and constraints in the vehicle lamp test knowledge graph; step S5, based on the entities and constraints, The test indicator parameters are combined into a test case unit; step S6, the test indicator parameters are sampled in the latent space by a mathematical method to generate a multi-objective parameter combination list; step S7, each group of parameters in the multi-objective parameter combination list is injected into the test case unit to replace the basic parameters to generate candidate test cases; step S8, the candidate test cases are input into the intelligent filtering system driven by reinforcement learning to filter the candidate test cases to eliminate invalid test cases and then output valid test cases; step S9, the test process of the headlights is executed based on the valid test cases, and a corresponding test report is generated;

[0042] Step S10: Feedback the generated test report and update the headlight test knowledge graph based on the test report.

[0043] In some feasible embodiments, combined with Figure 2As shown, step S2 includes: step S21, using the natural language processing model installed in the requirements parsing engine and the automotive lighting field standard library to parse the user product requirements document and output test objects, test requirements, performance indicators, and regulatory standards; step S22, searching the automotive lighting field standard library based on the regulatory standards to obtain regulatory standard performance indicators; step S23, combining the product performance indicators with regulatory standard performance indicators to obtain test indicator parameters; step S24, outputting the parsing results, including product test requirements, test objects, and test indicator parameters. Specifically, the automotive lighting field standard library refers to the mandatory standards that need to be complied with during the design, development, and testing of automotive lights, mainly covering national regulatory standards, foreign regulatory standards, and OEM enterprise standards.

[0044] Preferably, the requirements parsing engine uses natural language processing technology to extract key information from the product requirements document. This key information includes test objects, product test requirements, product performance indicators, and regulatory standards. Test objects cover all types of lighting and signal lamps on the vehicle, including but not limited to exterior lighting fixtures (headlights, fog lights, reverse lights, license plate lights, etc.), signal lamps (turn signals, brake lights, clearance lights, hazard warning lights, etc.), interior lighting fixtures (reading lights, instrument lights, door lights, etc.), and special function lamps (intelligent interactive lights, etc.). Product testing requirements mainly cover multiple dimensions such as performance testing, environmental adaptability testing, functional reliability testing, and regulatory compliance testing. Product performance indicators mainly cover indicators in multiple dimensions such as optical performance, environmental adaptability, mechanical reliability, electrical stability, and intelligent functions. Regulatory standards include mandatory standards and enterprise standard regulations that the test object must comply with. Specifically, regulatory standard performance indicators are structured triplet parameter indicators, that is, parameter indicators in the form of subject-condition-threshold. For example, the indicator requirement that the light intensity fluctuation is less than 5% can be broken down into a structured triplet of light intensity fluctuation-less than-5%. Test index parameters refer to the physical index parameters that automotive lighting products need to meet, covering electrical parameters, environmental parameters, optical parameters, etc.

[0045] Preferably, the step S21 further includes fine-tuning the natural language processing model based on the preset annotation data in the field of vehicle lights, so as to obtain a natural language processing model with enhanced knowledge in the field of vehicle lights. Specifically, since some vehicle light professional terms may not be in the vocabulary of a general natural language processing model, in order to ensure that the key information extracted from the product requirements is not missing and the accuracy is guaranteed, it is necessary to add the annotation data in the field of vehicle lights to fine-tune the natural language processing model, so as to obtain a natural language processing model with enhanced knowledge in the field of vehicle lights. Among them, the annotation data in the field of vehicle lights include manual annotation of vehicle light professional terms (such as "light distribution performance" and "glare suppression") and entity relationships (such as "test method-requirements-equipment") to form a training data set. By fine-tuning the natural language processing model, the accuracy of the requirements parsing engine for user input requirements can be effectively improved, providing a good foundation for the subsequent automatic generation of test cases.

[0046] In some feasible implementations, step S3 includes: the headlight test knowledge graph is unitized according to the test types of different test objects and stored through a graph database, and a graph records relevant test information of a test method of the test object and associates the corresponding test results; the headlight test knowledge graph is composed of nodes and edge relationships, and the nodes include test objects, test types, test methods, equipment resources, test steps, test indicator parameters and test result entities or attributes. The nodes are connected by edges, and the edges represent the relationship between entities or attribute associations.

[0047] Preferably, combined Figure 3As shown, the headlight test knowledge graph is constructed based on historical headlight test data. The headlight test knowledge graph primarily consists of nodes and edges. Nodes primarily represent entities or attributes, such as test objects, test types, test methods, equipment resources, test steps, test parameters, and test results. Nodes are connected by edges, which represent relationships between entities or attribute associations. Test objects primarily relate to attributes such as headlight type, material type, power range, and communication protocol. Test types are driven by test requirements, and different test types correspond to different test methods. For example, functional testing includes smoke tests, basic lighting tests, and intelligent function tests. Different test objects and test methods require corresponding equipment resources to implement. A test method may involve multiple test steps, each of which involves setting key parameters. The headlight test knowledge graph is unitized according to the test type of each test object and stored in a graph database. A single graph records relevant test information for a test method of a test object and links it to the corresponding test results, facilitating problem tracing, quality assessment, and process optimization. At the same time, in order to make the test cases cover as completely as possible and discover the relevant defects of the test object, the defects found in the test results also need to be marked in the headlight test knowledge graph.

[0048] More specifically, a graph database (such as Neo4j) is used to store node and edge relationships. Node types include: core entities: test object (headlights, fog lights, etc.), test type (optical performance test, environmental test, etc.), test method (light intensity test, vibration test, etc.), and equipment resources (integrating sphere, temperature and humidity chamber, etc.). Attribute entities: power range, light intensity threshold, material type, etc. are used as node attributes (e.g., "headlight" node attributes: power = 55W, material = PC plastic). Edge relationship definitions: test object - belongs to - lamp type (e.g., "headlight - belongs to - external lighting fixture"); test type - driver - test method (e.g., "environmental adaptability test - driver - high temperature aging test"); test method - required - equipment resources (e.g., "high temperature aging test - required - temperature and humidity chamber"); regulatory standards - constraints - test indicators (e.g., "GB 4599 - constraints - light intensity fluctuation ≤ 5%").

[0049] Preferably, combined Figure 4As shown, step S4 includes: step S41, inputting the test object and test requirements into a knowledge reasoning engine equipped with a graph neural network model; step S42, the graph neural network (GNN) model uses the test object as the first keyword and the test type as the second keyword to perform entity search in the headlight test knowledge graph, screen out matching entities, and extract corresponding constraints. Specifically, the knowledge reasoning engine screens out key entities that match the input requirements from the headlight test knowledge graph, including: test methods (such as "light intensity distribution test"), equipment resources (such as "integrating sphere"), test steps (such as "turning on the lamp in a darkroom environment"), historical defects (such as "uneven light spot"), etc. At the same time, constraints are extracted, such as "light intensity fluctuation ≤ 5%" in regulatory standards and "power range 50-60W" in physical constraints.

[0050] Preferably, step S5, combining the entities and constraints into a test case subunit based on the entities and constraints, includes: combining the entities and constraints into a test case subunit, i.e., a minimum module comprising a basic test framework. Example structure: Test object: headlamp; Test type: optical performance test; Test method: light intensity distribution test; Equipment resources: integrating sphere, photometer; Basic steps: 1. Install the headlamp in the integrating sphere; 2. Turn on the lamp and allow it to stabilize for 5 minutes; 3. Record the photometer measurement; Expected result: Light intensity distribution complies with the national standard GB 4599-2007.

[0051] Preferably, combined Figure 4 As shown, step S6 includes: step S61, sampling the test indicator parameters in the latent space by mathematical methods to generate multiple sets of parameter combinations, covering the normal range, boundary values ​​and abnormal values; step S62, cross-matching the multiple sets of parameter combinations with the basic parameters in the test case subunit to form a parameter list containing different variables; step S7 includes: injecting each set of parameters in the parameter list containing different variables into the test case subunit, replacing the basic parameters to generate candidate test cases. The test case subunit includes: one or a combination of test object, test type, test method, equipment resources, test steps, expected results and test results. That is, first, the test object and its test requirements are input into the knowledge reasoning engine, and the key entities (nodes) and constraints (edge ​​relationships) are screened through the headlight test knowledge graph, and the corresponding test case subunit is generated. Considering that the generated test case subunits are based on historical test data, and in order to cover the test boundaries and abnormal scenarios, the generated data may not necessarily meet the performance indicators required for this test. Therefore, it is necessary to perform latent space sampling on the test indicator parameters of this test, and then obtain a list of multi-objective parameter combinations. Finally, combine the multi-objective parameter combination list with the test case subunits to generate the test cases required for this test.

[0052] Specifically, since the test case subunit is generated based on historical data, it may not cover all the boundary conditions of the current test (such as extreme environmental parameters, new material properties, etc.). Therefore, it is necessary to perform latent space sampling on the obtained test index parameters (such as electrical parameters, environmental parameters, and optical parameters), that is, to generate multiple sets of parameter combinations through mathematical methods (such as uniform sampling and Gaussian sampling) to cover the normal range, boundary values, and abnormal values. For example, the sampling dimensions are: ambient temperature: -40°C (low temperature boundary), 25°C (normal temperature), 85°C (high temperature boundary); voltage fluctuation: 9V (undervoltage), 12V (rated), 16V (overvoltage); lighting time: continuous lighting for 100 hours (durability test); generate a list of multi-target parameter combinations; cross-match the sampled parameter combinations with the basic parameters in the subunit to form a parameter list containing different variables, as shown in Table 1.

[0053] Table 1:

[0054] Test case number Ambient temperature Voltage Light exposure time Expected results (light intensity fluctuations) UC-001 -40℃ 9V 1h ≤5% UC-002 85℃ 16V 100h ≤8% (high temperature allowable threshold)

[0055] Each parameter set in the multi-objective parameter combination list is injected into the test case subunit, replacing basic parameters (such as ambient temperature and voltage) to generate specific test case instances. For example, the basic step of the subunit "Record photometer measurement value" → combined with the parameter "Ambient temperature -40°C", the step is refined to "After stabilizing in a -40°C constant temperature box for 30 minutes, record the photometer measurement value."

[0056] The output candidate test case sets include: the final generated test case set covers normal scenarios, boundary scenarios, and abnormal scenarios, for example: normal scenario: optical performance test under normal temperature and pressure; boundary scenario: durability test under extreme temperature / voltage; abnormal scenario: parameter combination that intentionally triggers defects (such as exceeding the power limit).

[0057] Preferably, the generated candidate test cases can be fed back to the knowledge graph to update historical data and defect records, forming a closed loop of "generation-testing-optimization".

[0058] The above-mentioned candidate test case generation process solves the problems of incomplete test case coverage and low efficiency of manual design in traditional methods through structured knowledge reuse and intelligent reasoning of knowledge graphs. At the same time, it covers complex scenarios through latent space sampling, ensuring that the generated test cases not only meet industry standards but also can effectively discover potential defects.

[0059] In some feasible embodiments, combined with Figure 5As shown, the step S8 includes: step S81, training the reinforcement learning agent model integrated in the intelligent filtering system based on reinforcement learning through a preset plurality of historical test records of vehicle lights; step S82, inputting the candidate test case into the reinforcement learning agent model for processing, so that the reinforcement learning agent model makes an action decision on the candidate test case, including acceptance, rejection and marking as high risk; step S83, when the action decision is acceptance, adding the candidate test case to the execution queue for physical and / or virtual testing to verify whether the expected test effect can be achieved; step S84, according to the actual test results obtained from the physical and / or virtual testing, calculating the reward value according to the preset feedback reward function, and giving the reinforcement learning agent model feedback reward; step S85, the reinforcement learning agent model performs self-optimization based on the reward value.

[0060] Preferably, when the action decision is to reject, the candidate test case is discarded; when the action decision is to mark high risk, the candidate test case is manually reviewed.

[0061] Preferably, the specific training method of the reinforcement learning agent model is as follows: the model structure is: using a deep reinforcement learning (DRL) framework (such as DQN or PPO), the state space is the parameter combination of the test case (such as temperature, voltage), the action space is "accept", "reject", and "mark high risk", and the reward function is based on the formula: Among them, r invalid Indicates whether the use case violates any physical constraint, 1 if violated, 0 if not; N coverage Indicates the number of newly added parameter combinations; N defect Indicates the number of new defects triggered. Training data: Manually annotated historical test cases with "valid / invalid" labels, combined with defect records (such as "overvoltage causes lamp damage") as reward signals.

[0062] Optimally, the agent makes action decisions for candidate use cases, which fall into three categories: Accept: If the agent determines that a candidate use case is valid, i.e., it meets physical constraints, has a reasonable parameter combination, and does not exceed critical boundary conditions, it will be added to the execution queue. These valid use cases will then enter physical or virtual testing to verify whether they achieve the expected test results. For example, for a use case testing headlight intensity distribution, if all parameters are within a reasonable range, the agent will determine that it is valid and add it to the execution queue. Reject: If the agent identifies a candidate use case that does not meet physical constraints (e.g., voltage exceeds the device's allowable range), has a duplicate parameter combination (the same parameters have already been tested), or exceeds critical boundary conditions (e.g., excessive power can damage the device), it will execute a reject action and directly discard the use case to avoid wasting testing resources. Mark as High Risk: For some candidate use cases that cannot be directly judged as invalid but may pose risks, the agent will execute a high-risk flag action and send them for manual review. For example, if the parameter combination of some use cases approaches the device's operating limits, it may damage the test equipment or produce unpredictable results, requiring further manual review and confirmation. Use cases that successfully join the execution queue (including high-risk use cases that pass manual review) will enter the physical / virtual testing phase. These tests are performed in actual physical environments (such as temperature and humidity chambers, salt spray chambers, etc.) or virtual environments (such as optical simulation software, circuit simulation software, etc.) to obtain realistic test results.

[0063] Preferably, the reward value is calculated according to the feedback reward function based on the actual results obtained from physical and / or virtual tests, and feedback rewards are given to the reinforcement learning agent. The agent performs self-optimization based on the reward situation, and the specific process is as follows: Strategy adjustment: If a positive reward is obtained, it means that the current decision-making strategy is better, and the agent will increase the probability of taking similar decision-making actions in the future; if a negative reward is obtained, the agent will reduce the probability of taking related decision-making actions. Experience learning: The agent stores the decision-making process of each use case (state, action, reward, next state, etc.) in the experience replay buffer, trains the internal neural network by randomly sampling experience data, adjusts the network parameters, and then optimizes the decision-making strategy. Balance between exploration and utilization: The agent explores with a certain probability, tries new decision-making actions, and discovers better decision-making strategies; at the same time, in most cases, it uses the learned experience and strategies to select the decision-making action that seems to be the best, so as to balance the discovery of new situations and the use of existing experience, achieve continuous optimization, and make the entire use case filtering process more accurate and efficient in continuous iteration.

[0064] In some feasible implementations, step S9, executing the vehicle headlight test process based on the valid test case and generating a corresponding test report; and step S10, providing feedback on the generated test report and updating the vehicle headlight test knowledge graph based on the test report, include: after completing the execution and verification of the test case, the system automatically collects and organizes various data from the entire test process, including but not limited to detailed information on the test object, the test type and method adopted, the equipment resources used, the specific test steps, and the actual test results of each test case. This information is structured and integrated according to a pre-defined report template to form a complete test report. The report content should clearly and accurately reflect the test process and results. For example, for items that failed the test, the specific phenomenon of failure, relevant parameters, and possible causes of the problem should be recorded in detail. The generated test report will be fed back to relevant stakeholders, such as the product design team, quality control department, and customers. For product design teams, test reports help them understand any issues exposed during testing of automotive lighting products, enabling them to implement targeted product optimization and improvements. Quality control departments can use these reports to assess whether products meet quality standards and requirements. Customers can also use these reports to understand product testing results, bolstering their confidence in product quality and providing suggestions for further improvement. Feedback can be provided through various channels, such as email and internal management systems, ensuring timely access to the report content.

[0065] Preferably, updating the headlight test knowledge graph based on the test report includes: data extraction: extracting data valuable for updating the knowledge graph from the test report. For example, newly discovered defect types of test objects, innovative test methods adopted for specific test objects, new correlations between different test index parameters discovered during the test process, etc. These data will serve as the basic material for updating the knowledge graph. Node and relationship update: Based on the extracted data, the nodes and edge relationships in the headlight test knowledge graph are updated accordingly. If a new defect type is discovered, a corresponding defect type node is added to the knowledge graph, and an edge relationship is established between the node and related nodes such as the test object and test results to clarify their association; if a new test method appears, a new test method node is created, and the relationship between the method and nodes such as the test type, equipment resources, and test steps is sorted out, connected through edges, and the structure of the knowledge graph is improved. Knowledge fusion and optimization: During the update process, the new data is integrated with the existing knowledge in the knowledge graph to avoid data redundancy and conflict. At the same time, the overall structure and knowledge associations of the knowledge graph are optimized based on the new data, so that it can more accurately and comprehensively reflect the knowledge system in the field of vehicle light testing, provide more valuable reference for subsequent test case generation and testing work, and form a virtuous cycle of continuous iteration and continuous improvement.

[0066] In some feasible implementations, a large language model can also be used in combination with RAG

[0067] Test cases are generated using Retrieval-Augmented Generation (RAG) technology. A large language model is used to extract relevant test information from the requirement document and directly generate test cases. Then, RAG is used to retrieve real constraints from the document to optimize test case generation.

[0068] In the above implementation, natural language processing technology is used to automatically extract test requirements and indicator parameters, and industry standards and regulations are aligned at the same time, so that the generated test cases meet the relevant standards; a knowledge graph for headlight testing is constructed, and through structured association of multi-source data and domain knowledge, test results are traceable and defects are predictable. At the same time, combined with the reasoning ability of the knowledge graph, intelligent generation of test cases can be achieved; by building a reinforcement learning agent to filter the generated test cases, the number of invalid cases is reduced and the test efficiency is improved.

[0069] Example 2

[0070] See also Figure 6 , this embodiment provides a structural diagram of an intelligent generation system for vehicle headlight test cases based on a knowledge graph.

[0071] As an example, the system is implemented using the method for intelligently generating vehicle headlight test cases based on the knowledge graph described in Example 1, including:

[0072] The test requirement parsing module 600 is adapted to obtain a product requirement document and a standard library for vehicle lighting input by a user; parse the user product requirement document through a requirement parsing engine in combination with the standard library for vehicle lighting, and output parsing results, including: product test requirements, test objects, and test indicator parameters.

[0073] The candidate test case generation module 610 is suitable for constructing a headlight test knowledge graph based on historical headlight test data; inputting the test object and test requirements into the knowledge reasoning engine, and the knowledge reasoning engine retrieves matching entities and constraints in the headlight test knowledge graph; combining the entities and constraints into test case sub-units based on the entities and constraints; performing latent space sampling on the test indicator parameters by mathematical methods to generate a multi-objective parameter combination list; injecting each group of parameters in the multi-objective parameter combination list into the test case sub-unit to replace the basic parameters, thereby generating candidate test cases.

[0074] The candidate test case filtering module 620 is adapted to input the candidate test cases into the intelligent filtering system driven by reinforcement learning to filter the candidate test cases, so as to eliminate invalid test cases and output valid test cases.

[0075] The test case execution module 630 is adapted to execute the test process of the vehicle lamp based on the valid test case and generate a corresponding test report.

[0076] The feedback and update module 640 is adapted to provide feedback on the generated test report and update the vehicle light test knowledge graph based on the test report.

[0077] It is not difficult to find that this embodiment is a system embodiment corresponding to the first embodiment, and this embodiment can be implemented in conjunction with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in this embodiment, and to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the first embodiment.

[0078] It is worth noting that all modules involved in this embodiment are logical units. In actual applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. Furthermore, to highlight the innovations of this invention, this embodiment does not include units that are not closely related to solving the technical problems proposed by this invention. However, this does not mean that other units do not exist in this embodiment.

[0079] Example 3

[0080] See also Figure 7 An embodiment of the present invention also provides an electronic device, comprising: a memory and a processor; the memory stores at least one program instruction; the processor loads and executes the at least one program instruction to implement the knowledge graph-based intelligent generation method for vehicle light test cases provided in Example 1.

[0081] The memory 702 and processor 701 are connected using a bus. The bus can include any number of interconnected buses and bridges, connecting various circuits of one or more processors 701 and memory 702. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits. These are all well known in the art and, therefore, are not described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single component or multiple components, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor 701 is transmitted over a wireless medium via an antenna. Furthermore, the antenna receives data and transmits it to the processor 701.

[0082] The processor 701 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. The memory 702 can be used to store data used by the processor 701 when performing operations.

[0083] Example 4

[0084] An embodiment of the present invention further provides a storage medium storing a method for intelligently generating vehicle headlight test cases based on a knowledge graph. When executed by a processor, this program implements the steps of the method for intelligently generating vehicle headlight test cases based on a knowledge graph as described above. Because this storage medium incorporates all the technical solutions of all the aforementioned embodiments, it possesses at least all the beneficial effects brought about by the technical solutions of these embodiments, and therefore will not be further elaborated upon here.

[0085] The above is only an embodiment of the present invention. Common knowledge such as the known specific structures and characteristics in the scheme is not described in detail here. Ordinary technicians in the field are aware of all common technical knowledge in the technical field of the invention before the application date or priority date, can obtain all existing technologies in the field, and have the ability to apply conventional experimental means before that date. Ordinary technicians in the field can improve and implement this scheme in combination with their own abilities under the inspiration given by this application. Some typical known structures or known methods should not become obstacles for ordinary technicians in the field to implement this application. It should be pointed out that for those skilled in the art, without departing from the structure of the present invention, several variations and improvements can be made, which should also be regarded as the scope of protection of the present invention. These will not affect the effect of the implementation of the present invention and the practicality of the patent. The scope of protection required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.

Claims

1. A method for intelligently generating vehicle light test cases based on knowledge graph, characterized in that: The method comprises: Step S1: Obtain the product requirement document and the vehicle lighting field standard library input by the user; Step S2: parsing the user product requirement document using a requirement parsing engine in combination with the vehicle lamp field standard library to output parsing results, including: product test requirements, test objects, and test index parameters; Step S3: constructing a headlight test knowledge graph based on historical headlight test data; Step S4: input the test object and test requirements into a knowledge reasoning engine, and the knowledge reasoning engine retrieves matching entities and constraints in the headlight test knowledge graph; Step S5: combining the entities and constraints into test case subunits; Step S6: performing latent space sampling on the test index parameters by mathematical methods to generate a multi-objective parameter combination list; Step S7: inject each set of parameters in the multi-objective parameter combination list into the test case unit to replace the basic parameters, thereby generating a candidate test case; Step S8: Input the candidate test cases into an intelligent filtering system driven by reinforcement learning to filter the candidate test cases, so as to eliminate invalid test cases and output valid test cases; Step S9: executing a test process of the vehicle lamp based on the valid test case and generating a corresponding test report; Step S10: Feedback the generated test report and update the headlight test knowledge graph based on the test report.

2. The method for intelligently generating vehicle light test cases based on knowledge graph according to claim 1, characterized in that: The step S2 comprises: Step S21: parse the user product requirement document using the natural language processing model installed in the requirement parsing engine in combination with the vehicle lamp field standard library to output test objects, test requirements, performance indicators, and regulatory standards; Step S22: searching the vehicle lamp field standard library according to the regulations and standards to obtain regulatory standard performance indicators; Step S23: combining the product performance index with the regulatory standard performance index to obtain test index parameters; Step S24: Output the analysis results, including product test requirements, test objects, and test index parameters.

3. The method for intelligently generating vehicle light test cases based on knowledge graph according to claim 2, characterized in that: The step S21 further includes fine-tuning the natural language processing model based on preset annotation data in the field of vehicle lights to obtain a natural language processing model enhanced with vehicle light field knowledge.

4. The method for intelligently generating vehicle light test cases based on knowledge graph according to claim 1, characterized in that: The step S3 comprises: The headlight test knowledge graph is designed in units according to the test types of different test objects and stored in a graph database. One graph records the relevant test information of a test method of the test object and is associated with the corresponding test results. The headlight test knowledge graph consists of nodes and edge relationships. The nodes include test objects, test types, test methods, equipment resources, test steps, test index parameters and test result entities or attributes. The nodes are connected by edges, and the edges represent the relationship between entities or attribute associations.

5. The method for intelligently generating vehicle light test cases based on knowledge graph according to claim 4 is characterized in that: The step S4 comprises: Step S41: input the test object and test requirements into a knowledge reasoning engine equipped with a graph neural network model; Step S42: The graph neural network model uses the test object as the first keyword and the test type as the second keyword to perform entity retrieval in the headlight test knowledge graph, screens out matching entities, and extracts corresponding constraints.

6. The method for intelligently generating vehicle light test cases based on knowledge graph according to claim 1, characterized in that: The test case subunits include: one or a combination of test objects, test types, test methods, equipment resources, test steps, expected results and test results.

7. The method for intelligently generating vehicle light test cases based on knowledge graph according to claim 1, characterized in that: The step S6 comprises: Step S61: Performing latent space sampling on the test index parameters by mathematical methods to generate multiple groups of parameter combinations covering normal ranges, boundary values, and abnormal values; Step S62: Cross-match the multiple parameter combinations with the basic parameters in the test case unit to form a parameter list containing different variables; The step S7 includes: injecting each set of parameters in the parameter list containing different variables into the test case unit, replacing the basic parameters to generate candidate test cases.

8. The method for intelligently generating vehicle light test cases based on knowledge graph according to claim 1, characterized in that: The step S8 comprises: Step S81: training a reinforcement learning agent model integrated in the reinforcement learning-driven intelligent filtering system using a plurality of preset historical vehicle lamp test records; Step S82: Input the candidate test case into the reinforcement learning agent model for processing, so that the reinforcement learning agent model makes an action decision for the candidate test case, including accepting, rejecting, and marking high risk; Step S83: When the action decision is to accept, the candidate test case is added to the execution queue for physical and / or virtual testing to verify whether the expected test effect can be achieved; Step S84: Based on the actual test results obtained from the physical and / or virtual tests, a reward value is calculated according to a preset feedback reward function, and a feedback reward is given to the reinforcement learning agent model; Step S85: The reinforcement learning agent model performs self-optimization based on the reward value.

9. The method for intelligently generating vehicle light test cases based on knowledge graph according to claim 8, characterized in that: The feedback reward function is: Among them, r invalid Indicates whether the use case violates any physical constraint, 1 if violated, 0 if not; N coverage Indicates the number of newly added parameter combinations; N defect Indicates the number of new defects triggered.

10. A system for intelligently generating vehicle headlight test cases based on a knowledge graph, the system being implemented using the method for intelligently generating vehicle headlight test cases based on a knowledge graph according to any one of claims 1 to 9, characterized in that: The system comprises: The test requirement parsing module is adapted to obtain a user-inputted product requirement document and a vehicle lighting field standard library; parse the user's product requirement document using a requirement parsing engine in conjunction with the vehicle lighting field standard library, and output parsing results, including: product test requirements, test objects, and test indicator parameters; A candidate test case generation module is adapted to construct a vehicle headlight test knowledge graph based on historical vehicle headlight test data; input the test object and test requirements into a knowledge reasoning engine, which retrieves matching entities and constraints in the vehicle headlight test knowledge graph; combines the entities and constraints into test case units based on the entities and constraints; performs latent space sampling on the test indicator parameters using mathematical methods to generate a multi-objective parameter combination list; and injects each set of parameters in the multi-objective parameter combination list into the test case unit to replace the basic parameters, thereby generating a candidate test case. A candidate test case filtering module is adapted to input the candidate test cases into an intelligent filtering system driven by reinforcement learning to filter the candidate test cases, thereby eliminating invalid test cases and outputting valid test cases; A test case execution module, adapted to execute a test process of the vehicle lamp based on the valid test case and generate a corresponding test report; The feedback and update module is adapted to provide feedback on the generated test report and update the vehicle light test knowledge graph based on the test report.

Citation Information

Patent Citations

  • Test case recommendation method and device using knowledge graph

    CN113900954A

  • Test case generation method, device and equipment

    CN118377723A

  • Software test data and test case intelligent generation method and system

    CN118939560A

Cited By

  • Automatic use case construction method and system for private protocol test

    CN120785656A

  • Electrified detection method and system for power equipment and related equipment

    CN121049625A

  • Intelligent domain controller test case generation method and system based on knowledge graph

    CN121680359A