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

By constructing a knowledge graph and using graph neural networks for intelligent reasoning to generate test paths, the problems of insufficient coverage and low efficiency in domain controller testing are solved, achieving efficient and automated test case generation and optimization, which is suitable for complex function verification in the automotive electronics field.

CN121680359APending Publication Date: 2026-03-17SONKWO COM

Patent Information

Application Number
CN202610179122.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-09
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing technologies suffer from insufficient coverage in domain controller testing, low test design efficiency, significant susceptibility to human factors in test quality, and difficulty in systematically accumulating and reusing test knowledge.

Method used

We construct a knowledge graph that integrates the functional architecture of the domain controller, historical test data, and expert experience. We use graph neural networks for intelligent reasoning to generate test paths, and generate test cases through heuristic optimization algorithms and generalization techniques. We then optimize the test case set by combining a quality assessment mechanism.

Benefits of technology

It enables intelligent generation and optimization of test cases, improves test coverage and design efficiency, and ensures that the generated test case sets have high coverage, effectiveness and maintainability, making them suitable for complex functional verification in the automotive electronics field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121680359A_ABST
    Figure CN121680359A_ABST
Patent Text Reader

Abstract

The invention provides a domain controller test case intelligent generation method and system based on a knowledge graph, belongs to the technical field of automobile electronic testing, and is used for solving the problems of insufficient coverage rate, low efficiency and difficulty in knowledge inheritance of domain controller testing in related technologies. According to the method, a test knowledge graph fusing a functional architecture, historical data and expert experience is constructed, vector representation of nodes and relationships is learned by using a graph neural network, an optimized test path is generated through intelligent reasoning, then an extended test case is generated through a multi-dimensional generalization technology, and finally continuous optimization is performed through closed-loop quality evaluation. The test coverage rate and the design efficiency can be remarkably improved, and systematic precipitation and reuse of test knowledge are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automotive electronics testing technology, and in particular to a method and system for intelligent generation of domain controller test cases based on knowledge graphs. Background Technology

[0002] As automotive electronic and electrical architectures evolve towards centralization, domain controllers, as core control units, are becoming increasingly complex and integrated, placing higher demands on test coverage and efficiency.

[0003] Currently, domain controller testing primarily relies on engineers' experience to manually design test cases or on script-automated testing tools. Traditional testing methods struggle to systematically cover complex functional interactions, boundary conditions, and failure scenarios, and their test design is inefficient and unable to quickly respond to iteration requirements. While existing automation tools can execute preset scripts, they lack semantic understanding and intelligent reasoning capabilities regarding system functional logic and historical defect data, and therefore cannot adaptively generate high-coverage test case sets.

[0004] Therefore, existing technologies generally suffer from technical defects such as insufficient test coverage, low test design efficiency, test quality being greatly affected by human factors, and difficulty in systematically accumulating and reusing test knowledge. Summary of the Invention

[0005] This application provides a knowledge graph-based intelligent generation method and system for domain controller test cases, which can systematically improve the coverage and design efficiency of domain controller tests in an automated and intelligent manner, and effectively accumulate test knowledge.

[0006] Firstly, this application provides a knowledge graph-based intelligent generation method for domain controller test cases. The method involves constructing a test knowledge graph that integrates the functional architecture of the domain controller, historical test data, and expert experience; learning vector representations of nodes and relationships within the test knowledge graph using a graph neural network model based on these knowledge graphs; generating one or more initial test paths using a graph traversal algorithm based on these vector representations; combining and optimizing these initial test paths using a heuristic optimization algorithm to obtain optimized test paths; generating extended test cases based on these optimized test paths using at least one of parameter generalization, scenario generalization, and data generalization techniques; evaluating the quality of the generated test cases based on preset coverage and effectiveness metrics; and optimizing the test cases based on the evaluation results.

[0007] By adopting the above technical solution, this method constructs a unified test knowledge graph to structure dispersed functions, data, and experience; utilizes graph neural networks to mine complex logical relationships within the graph and intelligently infers initial test paths based on vector representations; optimizes path combinations using optimization algorithms and expands test case diversity by incorporating various generalization techniques; and finally, continuously optimizes the test case set through a closed-loop evaluation mechanism. This technical solution achieves intelligent processing of the entire process from test case generation and expansion to optimization, significantly improving the completeness of test path exploration and the automation level of test design.

[0008] Furthermore, the construction of the test knowledge graph includes: collecting data from multiple data sources, including domain controller design documents, historical test reports, fault databases, and expert experience records; extracting knowledge from the collected data to identify functional entities, parameter entities, scenario entities, fault entities, and the relationships between the entities; and fusing the knowledge extracted from different data sources, including entity alignment and relationship fusion, to construct a unified test knowledge graph.

[0009] By adopting the above technical solutions and integrating multi-source heterogeneous data, the comprehensiveness and richness of the knowledge graph content are ensured, providing a solid data foundation for subsequent intelligent reasoning.

[0010] Furthermore, the knowledge extraction from the collected data includes: extracting information from unstructured document data using natural language processing techniques; and extracting information from structured and semi-structured data using a rule engine or parser.

[0011] By adopting the above technical solutions, differentiated extraction techniques are used for data with different structural characteristics, thereby improving the accuracy and efficiency of knowledge extraction.

[0012] Furthermore, the step of learning the vector representation of nodes and relationships in the test knowledge graph through a graph neural network model includes: for a node in the test knowledge graph, updating the vector representation of the node by sampling its neighboring nodes and aggregating the feature information of the neighboring nodes; during the aggregation process, calculating the association weights between the node and its neighboring nodes through a learnable attention mechanism, and performing weighted aggregation based on the weights.

[0013] By adopting the above technical solutions, graph neural networks combined with attention mechanisms can effectively learn the structural information and importance differences of nodes in the local graph. The resulting vector representations can better reflect the semantic association strength between nodes, thus improving the accuracy of subsequent path reasoning.

[0014] Furthermore, the method of using a heuristic optimization algorithm to combine and optimize one or more initial test paths includes: using the number of paths not covered in the test knowledge graph as a penalty term, or using the estimated test execution time as a cost function, to perform path combination optimization.

[0015] By adopting the above technical solution, a clear technical objective function is set for the optimization algorithm, guiding the algorithm to search in the direction of maximizing coverage or minimizing cost, making the generated test path set more targeted.

[0016] Furthermore, it also includes: calculating the risk weight of each node in the test knowledge graph based on historical data related to faults; and adjusting the generation order or selection probability of nodes or paths according to the risk weights when generating test paths.

[0017] By adopting the above technical solutions and integrating historical fault data into the test generation process, high-risk areas can be prioritized for coverage, thereby improving the effectiveness of testing and the efficiency of resource utilization.

[0018] Furthermore, the parameter generalization includes generating combinations of test parameters based on equivalence class partitioning, orthogonal experimental design, or pairwise combination testing methods; the scenario generalization includes generating test scenario sequences based on state machine models or Markov chain models; and the data generalization includes synthesizing test input data based on generative models trained adversarially or generative models based on probabilistic coding.

[0019] By adopting the above technical solutions, the basic test cases are systematically expanded from three dimensions: parameters, scenarios, and data, which significantly enhances the diversity of test cases and the ability to cover complex situations.

[0020] Furthermore, optimizing the test cases based on the evaluation results includes: identifying functional nodes or logical paths in the test knowledge graph that are not covered by the current test case set, and generating new test cases based on the nodes or paths; calculating the semantic or execution trajectory similarity between test cases, and merging or deleting some of the test cases when the similarity is higher than a preset threshold.

[0021] By adopting the above technical solution, specific optimization operation rules are provided, which can automatically fill in coverage blind spots and eliminate redundancy, making the test case set more refined while ensuring coverage.

[0022] Furthermore, the domain controller includes a powertrain domain controller, a body domain controller, or a chassis domain controller; the test knowledge graph further integrates the functional dependencies and fault propagation relationships of cross-domain controllers to generate cross-domain collaborative test cases.

[0023] By adopting the above technical solution, the applicable fields of this method are clarified, and collaborative testing of cross-domain controllers is supported, thus meeting the system-level verification requirements under the centralized architecture of automotive electronics.

[0024] Secondly, this application provides a knowledge graph-based intelligent test case generation system for domain controllers. The system, used to implement the method described in any one of the first aspects, comprises: a knowledge graph construction module configured to construct and maintain the test knowledge graph; an intelligent inference engine module configured to generate and optimize test paths based on graph neural network models and inference algorithms; a test case generator module configured to generate test cases based on the test paths and through generalization techniques; and a quality assessment module configured to evaluate the generated test cases and provide optimization suggestions.

[0025] By adopting the above technical solution, the system realizes all the functions of the method described in the first aspect through modular design, providing complete tool support for automated and intelligent domain controller testing.

[0026] In summary, this application has at least the following beneficial effects:

[0027] It provides an intelligent and automated solution for generating and optimizing domain controller test cases, which systematically improves test coverage and design efficiency;

[0028] By integrating multi-source data to construct a knowledge graph and using graph neural network reasoning, we have achieved in-depth mining and utilization of complex functional logic and historical experience.

[0029] Through three-dimensional generalization of parameters, scenarios, and data, and closed-loop optimization based on risk and coverage, the generated test case set is ensured to have high coverage, effectiveness, and maintainability.

[0030] It should be understood that the description in the Summary Section is not intended to limit the key or essential features of the embodiments of this application, nor is it intended to restrict the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0031] The above and other features, advantages, and aspects of the embodiments of this application will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:

[0032] Figure 1 The diagram illustrates the principle of a knowledge graph-based intelligent generation system for domain controller test cases, as described in an embodiment of this application.

[0033] Figure 2A flowchart of a knowledge graph-based intelligent generation method for domain controller test cases is shown in an embodiment of this application. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0035] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0036] This application provides a knowledge graph-based intelligent generation method and system for domain controller test cases. By constructing a graph that integrates knowledge from multiple sources, and utilizing graph neural network intelligent reasoning and multi-dimensional generalization techniques, it automatically generates and optimizes test cases, which can significantly improve test coverage and design efficiency, and realize the systematic accumulation and reuse of test knowledge.

[0037] In a first aspect, embodiments of this application disclose an intelligent generation system for domain controller test cases based on knowledge graphs.

[0038] Figure 1 The diagram illustrates the principle of a knowledge graph-based intelligent generation system for domain controller test cases, as described in an embodiment of this application.

[0039] Reference Figure 1 This system achieves automated and intelligent generation and optimization of test cases through the coordinated operation of multiple functional modules, and is particularly suitable for domain controller testing scenarios in the automotive electronics field where functional safety and reliability requirements are stringent.

[0040] The system includes a knowledge graph construction module, whose function is to build and maintain a test knowledge graph that integrates the domain controller's functional architecture, historical test data, and expert experience. This module typically consists of a data interface unit, a data processing engine, and a knowledge repository. The data interface unit connects to external data sources, and its physical form can be a software API or a hardware network interface. It receives design documents in XML or JSON format, such as requirements specifications and AUTOSAR design documents; test reports consisting of historical test execution records and defect reports; and structured fault database records containing controller area network bus error frames or diagnostic fault codes. Furthermore, this unit provides a human-computer interaction interface, allowing test experts to input test experience and rules in the form of structured forms or natural language text. The data processing engine, with its built-in rule engine and natural language processing components, is the core computational part of the module. The rule engine is configured with parsing templates for different data sources, such as directly mapping entity relationships from database tables. The natural language processing component integrates open-source or commercial named entity recognition and relation extraction models, such as pre-trained models based on the BERT architecture. These models automatically identify functions, parameters, and fault entities like "motor torque control," "battery state of charge (SOC) threshold," and "over-temperature fault" from unstructured Word or PDF documents, along with relationships such as "depends on," "mutually exclusive of," and "leads to." The engine fuses the extracted knowledge. For example, it aligns the "energy recovery function" node from the design document with the "low energy recovery efficiency" fault node from the fault database by comparing the semantic similarity of their descriptive texts. The similarity threshold can be set to, for example, 0.7, 0.85, or a preferred value of 0.8. The knowledge repository organizes and stores this fused, structured knowledge in the form of a graph database, such as Neo4j or JanusGraph. In the database, entities are nodes, and relations are edges. Node attributes can include function ID, parameter value range, fault code, risk level, etc., forming a test knowledge graph that the system can query and reason about.

[0041] The system also includes an intelligent inference engine module, whose function is defined based on the test knowledge graph, using graph neural network models and inference algorithms to generate and optimize test paths. This module is directly connected to the knowledge repository of the knowledge graph construction module through a database query interface or a memory data bus to obtain the node and edge data of the graph in real time. Internally, it typically includes an embedding learning unit and a path planning unit. The embedding learning unit runs a graph neural network model. In one specific implementation, this model adopts the GraphSAGE architecture, updating the vector representation of each node by sampling its neighboring nodes and aggregating the feature vectors of the neighboring nodes. The number of sampled neighbors can be set to 2, 10, or preferably 5. The aggregation function can use mean pooling or max pooling. Simultaneously, this unit introduces a graph attention mechanism, assigning a weight between 0 and 1 to each neighbor. The weight calculation is completed by a trainable single-layer feedforward network, allowing the model to pay more attention to strongly correlated neighbors. For example, when calculating the "brake control" node vector, its neighbor "wheel speed signal" is assigned a higher attention weight than "air conditioning status". The path planning unit, based on the learned node and relation vector representations, uses graph traversal algorithms such as depth-first search or breadth-first search to explore and generate all possible paths to the exit node, starting from the specified entry functional node, as initial test paths. Subsequently, this unit further employs a genetic algorithm as a heuristic optimization algorithm, encoding each path as a chromosome, and iteratively optimizing it guided by a fitness function. The fitness function can be set as the number of key functional nodes covered by the path minus the number of uncovered edges in the path multiplied by a penalty coefficient of 0.1, with the goal of maximizing this function value; alternatively, the fitness function can be set as the reciprocal of the estimated execution time of the path, obtained by summing the standard execution times of each node in the path. The standard execution time can be between 10 milliseconds and 2000 milliseconds, for example, 50 milliseconds, 1000 milliseconds, or preferably 200 milliseconds. Through optimization, a set of optimized test path sequences that achieve a balance between coverage and efficiency is finally output.

[0042] The system further includes a test case generator module. Its function is defined based on the optimized test path output by the intelligent inference engine module, and it applies parameter generalization, scenario generalization, and data generalization techniques to generate specific and scalable test cases. This module is connected to the path output of the intelligent inference engine module via an internal message queue or function call. Internally, it integrates a generalization execution unit that parses the received test path, where each node corresponds to a test step. For steps involving parameter input, this unit calls a pre-defined equivalence class partitioning algorithm, for example, partitioning a throttle opening parameter into "valid equivalence classes: 0%-100%" and "invalid equivalence classes: <0%, >100%", and generating boundary values ​​of 0%, 100%, and values ​​within the range such as 50% for testing. For more complex multi-parameter combinations, orthogonal arrays can be used to reduce the number of test cases. For scenarios requiring verification of functional sequences, this unit can invoke a scenario generator based on a finite state machine model. This model generates a valid test sequence such as "Power On -> Charging -> Driving" based on the state of the powertrain domain controller (e.g., "Power On", "Driving", "Charging", "Fault") and its transition conditions (e.g., "Charging Gun Connected", "Vehicle Speed ​​> 0"), or generates a random sequence containing probabilities using a Markov chain model. For tests requiring specific input data, such as simulating sensor fault messages, this unit can utilize a pre-trained generative adversarial network model to learn the data distribution of normal CAN messages, and then generate test data that conforms to the protocol format but has abnormal content, such as generating abnormal data of 5.5V or -0.1V from a voltage signal value that normally ranges from 0-5V.

[0043] The system ultimately includes a quality assessment module, whose function is to evaluate the test case set output by the test case generator module and provide optimization suggestions to form a closed loop. This module connects to the output of the test case generator module and the knowledge repository of the knowledge graph construction module, thereby simultaneously acquiring the test case set to be evaluated and the knowledge graph as a benchmark. Internally, it includes an indicator calculation unit and an optimization suggestion unit. The indicator calculation unit calculates based on preset coverage and effectiveness indicators. Coverage indicators include node coverage and edge coverage, calculated by mapping the test case execution trajectory back to the knowledge graph and statistically analyzing the proportion of triggered nodes and edges. Effectiveness indicators are indirectly evaluated by calculating the correlation between test cases and historical high-frequency defect patterns. For example, a test case covering a combination of functional paths that historically caused a "control unit reset" failure has a high correlation score. This unit also calculates the redundancy between test cases by comparing the semantic similarity of test steps or the similarity of the system state sequence after execution. The similarity threshold can be set to 0.8, 0.95, or preferably 0.9. The optimization suggestion unit then automatically generates structured instructions based on these calculation results. For example, when a node related to "heat management" and its connecting edges in the knowledge graph are identified as not being covered by any test cases, this unit generates a request for supplementary test cases and sends it to the test case generator module. The request includes the target node ID and the type of relationship to be covered. When the similarity of multiple test cases exceeds a threshold, this unit generates a merge suggestion, attaching the IDs of these test cases, prompting test engineers to review and merge them to streamline the test case set.

[0044] In summary, this system uses a knowledge graph construction module as the core data and knowledge hub, an intelligent inference engine module as the planning core, a test case generator module as the execution extender, and a quality assessment module as the feedback optimizer. These four modules are connected and work collaboratively through pre-defined data interfaces and call logic sequences. Specifically, the output of the knowledge graph construction module serves as the input to the intelligent inference engine module; the output path of the inference engine drives the test case generator; the generator's output is then evaluated by the quality assessment module; and the optimization suggestions from the assessment module can be fed back to the knowledge graph to supplement knowledge or directly trigger the test case generator to iterate. This process forms a complete closed loop from knowledge fusion, intelligent inference, test case generation to quality assessment, jointly achieving the intelligent generation and continuous optimization of domain controller test cases, effectively addressing the challenges of incomplete coverage, low efficiency, and difficulty in knowledge transfer in automotive electronics testing.

[0045] Secondly, embodiments of this application disclose a method for intelligent generation of domain controller test cases based on knowledge graphs.

[0046] Figure 2A flowchart of a knowledge graph-based intelligent generation method for domain controller test cases is shown in an embodiment of this application.

[0047] Reference Figure 2 This method achieves automated and intelligent construction, generation, and optimization of test cases through a series of logically rigorous steps.

[0048] This approach begins by constructing a test knowledge graph that integrates domain controller functional architecture, historical test data, and expert experience. The construction process first collects raw data from multiple heterogeneous data sources. These sources include software design documents describing functional logic (such as requirements specifications and AUTOSAR design documents), historical test reports recording the testing process and results (including test cases, execution logs, and defect reports), fault databases recording fault phenomena and causes (such as OEM after-sales fault databases and bench test fault records), and test experience rule bases summarized by experts (usually existing in the form of rule files or knowledge bases). Subsequently, knowledge extraction is performed on the collected data. For unstructured document data, natural language processing techniques based on pre-trained language models are used for information extraction. Specific steps include: using a named entity recognition model to identify entities such as function points, signal parameters, and fault modes in the text, and using a relation extraction model to determine the dependencies, triggering, or mutual exclusion relationships between entities. For structured and semi-structured data, such as database tables or JSON / XML files, specific parsing rules or templates are configured to extract entities and relationships through direct mapping. Finally, the knowledge extracted from different sources is fused. This involves entity alignment, the core of which is calculating the cosine similarity between entity description vectors. If the similarity exceeds a preset threshold, they are determined to be the same entity and merged. Relationship fusion handles potentially conflicting relationship assertions, prioritizing them based on the authority or timeliness of the data source. Through these steps, a unified test knowledge graph is formed, with entities as nodes, relationships as edges, and attached attributes.

[0049] Based on a structured knowledge graph, this method utilizes a graph neural network model to learn low-dimensional vector representations of nodes and relationships within the graph. For any node in the graph... The learning of its vector representation is an iterative update process. In the... Layers, nodes vector By aggregating its neighbor nodes In the Layer vector Update. The aggregation process introduces an attention mechanism to distinguish the importance of different neighbors. First, the nodes are calculated. with his neighbors Attention coefficient between The formula is ,in It is a learnable linear transformation weight matrix. It is a learnable attention vector. This represents vector concatenation, with LeakyReLU as the activation function. Subsequently, the Softmax function is applied to the nodes. The attention coefficients of all neighbors are normalized to obtain the normalized attention weights. Ultimately, the node The updated vector representation is ,in It is a non-linear activation function. Through propagation via multiple layers of such a graph attention network, each node ultimately obtains a vector. It contains its own attribute information as well as its semantic and relational information in the global graph structure.

[0050] Based on the learned node vector representations, this method generates one or more initial test paths using a graph traversal algorithm. Path generation can be viewed as finding a sequence of connected subgraphs from a specific starting point to an ending point within the graph. One implementation uses an improved breadth-first search algorithm, where the edge selection probability is adjusted during traversal. By connecting two nodes Vector similarity and importance weight of the relationship represented by the edge. Joint decision, for example ,in The cosine similarity function is used. In this way, while exploring all possible paths, the algorithm tends to select connections with stronger and more important semantic relationships, thus generating a series of meaningful initial functional test paths.

[0051] Next, a heuristic optimization algorithm is used to combinatorially optimize these initial test path sets, aiming to obtain a subset of test paths that offers more comprehensive coverage or higher execution efficiency with a finite number of paths. This problem can be formalized as a combinatorial optimization problem: from Select from the initial path strip( To maximize overall coverage effectiveness and minimize redundancy and cost, the objective function is defined as follows: ,in It is a subset of paths to be evaluated. It is a path The number of unique feature nodes and edges covered is obtained from the knowledge graph. Measure path with subset The repetition of other paths can be calculated using Jaccard similarity to determine the overlapping coverage. It is an execution subset The estimated total time for all paths is based on statistical analysis of historical test reports. The weighting coefficients are used to balance different objective items. The optimization process employs a genetic algorithm, encoding a subset of paths into chromosomes, and iteratively searching through selection, crossover, and mutation operations to optimize the fitness function. Maximize and finally output the optimized set of test paths.

[0052] To generate concrete, executable test cases, this method applies parameter generalization, scenario generalization, and data generalization techniques based on optimized test paths. Parameter generalization targets nodes in the path that involve input parameters, employing equivalence class partitioning and boundary value analysis. For example, for a node receiving the "battery state of charge" parameter, its input domain is partitioned into valid equivalence classes, invalid equivalence classes, and boundary values. For multiple parameter combinations, orthogonal experimental design or pairwise methods are used to generate a simplified set of parameter combinations covering the main interactions between all parameters. Scenario generalization generates test scenario sequences based on a finite state machine model. The behavior of the domain controller is modeled as a state machine, with states representing different control modes and transitions driven by events. By traversing the state machine, all legal transition sequences from the initial state to the target state can be generated as test scenarios. Data generalization utilizes generative models to synthesize test data in a specific format. For example, using a conditional generative adversarial network, based on "fault type," simulated message data conforming to the vehicle CAN bus protocol format is generated for injection testing.

[0053] After generating test cases, their quality needs to be evaluated. The evaluation is based on two core metrics: coverage metrics and effectiveness metrics. Coverage metrics are calculated by mapping the execution logic of the test cases back to the knowledge graph, including node coverage. and edge coverage ,in and These represent the number of nodes and edges covered by the test case execution path, respectively. and This represents the total number of nodes and edges in the graph. The effectiveness metric is evaluated by the correlation between use cases and historical defects. For example, the maximum overlap between the set of nodes and edges covered by the use case path and the set of nodes and edges associated with each historically discovered defect is calculated as a score for the potential defect discovery capability of that use case.

[0054] Based on the evaluation results, the test case set is optimized, which is a closed-loop feedback process. The optimization mainly includes two aspects: First, supplementing omissions. By comparing the coverage of the knowledge graph and the current test case set, functional nodes or key logical paths not covered by any test cases are accurately identified. Then, for these uncovered targets, the process from path generation to test case generalization is re-triggered to generate new supplementary test cases. Second, eliminating redundancy. This is done by calculating the semantic similarity between any two test cases. Similarity can be obtained by comparing the node sequence vectors or state transition sequences executed by both. A similarity threshold can be set. ,like If these two use cases are considered highly redundant, optimization operations will suggest merging them or deleting one of them, thereby improving the refinement of the use case set.

[0055] Furthermore, this method considers the specific type of domain controller and the needs of cross-domain collaborative testing. When constructing the knowledge graph, it can focus on integrating the domain-specific functional architecture and data for a particular domain controller type. For cross-domain collaborative testing, the knowledge graph further integrates the functional dependencies and fault propagation relationships between different domain controllers. The test paths and test cases generated based on this cross-domain graph can verify the correctness and collaborativeness of cross-domain functions.

[0056] In summary, this method constructs and continuously enriches the test knowledge graph from multi-source heterogeneous data, utilizes graph neural networks to deeply understand functional logical relationships, plans efficient test paths through intelligent search and optimization algorithms, generates rich and specific test cases through multi-dimensional generalization technology, and finally ensures that the generated test case set has high coverage, high efficiency and low redundancy through rigorous quantitative evaluation and closed-loop optimization mechanisms, thus systematically solving the core challenges in domain controller testing.

[0057] Building upon the aforementioned method embodiments, this optimized scheme further introduces a deeply integrated autonomous cognitive verification system. This system aims to construct a unified intelligent agent with endogenous causal understanding, metacognitive planning, and differentiable logic verification capabilities, fusing knowledge evolution, strategy optimization, and execution verification into a continuous cognitive-action loop. Starting from the intermediate results generated by the method embodiments, such as the structured knowledge graph, node vector representation, and test paths, the system utilizes a series of innovative algorithmic components to simulate the high-order reasoning and learning abilities of human testing experts, achieving a paradigm shift from automated generation to autonomous cognition.

[0058] The cornerstone of the system is a dual-state cognitive graph fusion model. This model constructs a factual knowledge graph in the method implementation examples. In addition, a counterfactual inference graph is constructed and maintained in parallel. Fact Map node set and edge set The node feature vectors are derived from entities and relationships extracted and fused from multi-source data in the embodiments. Obtained by the graph neural network in the embodiment. Counterfactual graph. This is dynamically generated through a causal structure learning and intervention simulation module. This module uses... and a predefined set of potential intervention points based on domain knowledge (For example, "brake pedal signal failure" or "battery cell voltage imbalance exceeding limits") are used as inputs. For each intervention point... The module utilizes an attention-based conditional variational autoencoder to simulate the system state after intervention. Encoder Mapping the current factual map to intervention conditions into a latent variable decoder Then the intervention is reconstructed The following may emerge new nodes (representing abnormal states) and edges (representing fault propagation paths), thus forming a counterfactual subgraph. The union of all counterfactual subgraphs constitutes a dynamic counterfactual deduction graph. The two graphs are linked through shared entity nodes, forming a joint cognitive representation space.

[0059] Decision-making in this joint cognitive space is governed by a metacognitive policy network. Overall planning. The goal of this network is to plan the optimal "cognition-testing" action sequence to most efficiently increase the system's understanding of the functionality and risks of the tested object. The input is the current cognitive state. ,in and These are the feature matrices of all nodes in the fact and counterfactual graphs, respectively. It is a memory vector that encodes a summary of historical test actions and their results. The input is processed using a hybrid architecture of multi-head graph attention and recurrent neural networks. First, a graph attention layer calculates the relative importance weights of different nodes and subgraphs for achieving the test objective in the current cognitive state. For any node pair... Regardless of whether they belong to the same graph or two different graphs, their cross-graph attention coefficient is calculated as follows:

[0060] ;

[0061] in For node features, This represents vector concatenation. It is a meta-feature vector representing the graph relationship (same fact, same counterfact, or cross-graph) between two nodes and their topological distance within the graph. Normalized attention weights. This reflects the strength of connections between nodes within a global cognitive context. Subsequently, a gated recurrent unit network integrates this weighted neighborhood information with historical memory. Update the context-aware representation of the node. Finally, Output a policy vector This vector does not directly correspond to specific test cases, but rather defines the resource allocation ratio that the system should allocate among different cognitive objectives over the next period of time, such as exploring unknown counterfactual scenarios, deepening the coverage of known functional paths, and verifying specific causal hypotheses.

[0062] Policy Vector This will guide a unified action generator to produce specific, executable test instructions. The action generator is essentially a conditional sequence generation model, which uses... Based on the subgraphs with high attention weights in the current joint cognitive graph, two types of outputs are automatically generated: one type is atomic test actions, such as "injecting message sequences into the ECU". and monitor signals In the time window "Internal changes"; another type is cognitive exploration actions, such as "targeting subgraphs". Design an experiment to distinguish causality. and The generation process is based on a Transformer decoder architecture, where conditional information is injected through a cross-attention mechanism. The generated test actions are sent to the test execution environment, while cognitive probing actions trigger a new round of internal causal reasoning, updating the counterfactual graph. This design separates strategy from action, allowing high-level strategies to focus on macro-level cognitive planning, while complex, specific action generation is handled by a powerful generative model.

[0063] To efficiently manage test resources and instantly verify test results, the system incorporates an online learning orchestration validator. This component maintains a dynamic resource-task benefit graph. The left-hand nodes of the graph represent various types of test resources. (e.g., software-in-the-loop simulator, specific HIL test bench, actual vehicle), each resource node is accompanied by its current status (idle, busy, partially available) and a set of capability labels. The nodes on the right represent the test tasks to be executed. (From the action generator), each task node is equipped with its required resource and capability configuration, estimated execution time, and cognitive value assigned by the metacognitive policy network. and the urgency of risks The core of the orchestration validator is an online bipartite graph matching optimizer that solves the following optimization problem in real time to assign tasks:

[0064] in, Indicates test resources The capability vector, which is composed of It consists of several dimensions, which quantify the performance indicators of the resource in terms of computing power, memory capacity, hardware interface support, simulation accuracy, etc. Indicates test task The demand vector, whose dimensions correspond to the capability vector, defines the minimum thresholds for each capability required for successful task execution. Matching degree function. To determine the degree of fit between the computational capability vector and the demand vector, one implementation method is to calculate the weighted sum of the two vectors based on whether they satisfy threshold conditions in each dimension, i.e.:

[0065] ;

[0066] In the formula, For the first Normalized weights of dimensional capabilities and These are the capability and requirement values ​​for the corresponding dimensions. It is an indicator function that takes the value 1 when the condition is met, and 0 otherwise.

[0067] and The tasks output by the metacognitive policy network are respectively The cognitive value score and risk urgency score range from 0 to 1. In order to have resources Execute the task The estimated total cost can be quantified as follows:

[0068] ;

[0069] In the formula, The estimated execution time is based on historical data or benchmark tests. To estimate energy consumption, and A coefficient used to convert time and energy consumption into a uniform cost unit.

[0070] Weighting coefficient , , , This value is used to balance the relative importance of fit, perceived value, risk urgency, and cost. It can be set based on project testing strategies through expert experience or optimized offline using historical data. For example, it can be set to... , , , Decision variables In the middle, index , , respectively corresponding to all One test resource and One test task to be assigned.

[0071] ;

[0072] ;

[0073] The matching optimizer employs a Hungarian algorithm with relaxation and repair mechanisms for fast solution. The results returned after task execution immediately flow into an online incremental verification module. This module compares the actually observed system behavior with the cognitive subgraph upon which the action generator is based, calculating a belief update. If there is a significant discrepancy between observation and prediction (for example, a counterfactual scenario predicted to be high-risk does not trigger a failure), this discrepancy will trigger two actions: first, adjust the confidence of relevant causal edges based on Bayesian update rules; second, generate a new "meta-verification" task aimed at exploring the root cause of this discrepancy, and feed it back to the action generator, thus forming a reinforcement learning closed loop from cognitive prediction to action execution to belief correction.

[0074] The reliability and interpretability of the entire system are fundamentally guaranteed by a differentiable neural symbolic reasoning layer. This layer is not an external verifier, but is deeply embedded in the representation learning and message propagation processes of the graph neural network. Specifically, it is used in constructing factual knowledge graphs. At this time, the system extracts first-order logic predicates and temporal logic rules from domain specifications (such as functional safety requirements and design constraints) and converts them into differentiable loss functions. For example, a rule "After functional state A is activated, an acknowledgment signal B must be received within 100 milliseconds" can be encoded as the following temporal constraint loss term:

[0075] ;

[0076] in, and These are node vector representations of state A and signal B at different time steps, respectively. It is a learnable "time-sensitivity" vector. It is the sigmoid function. This refers to the tolerance margin. These constraint loss terms, along with the original task loss of the graph neural network (such as link prediction loss), participate in the model training. During message passing, when nodes aggregate neighbor information, they simultaneously consider the "pressure" of satisfying these logical constraints, resulting in a final learned node representation. These representations not only contain topological information but also internalize domain rules. When the system makes testing decisions based on these representations (such as determining which path is critical), we can provide traceable, rule-based decision-making basis by visualizing which logical constraints contribute the most to the final representation, thereby achieving a "white-box" explanation of complex AI decisions.

[0077] In summary, this optimized scheme, by constructing a dual-state cognitive graph fusion model, a metacognitive policy network, a unified action generator, an online learning orchestration validator, and a differentiable neural symbolic reasoning layer, builds upon the solid foundation of the original method implementation. It creates an advanced verification agent capable of autonomously exploring causal relationships, intelligently planning test strategies, dynamically optimizing resource scheduling, and providing inherent interpretability. This system not only continues and enhances the ability to automatically generate test cases but also achieves autonomous decision-making and continuous optimization on meta-questions such as "what to test," "why to test," and "how to test efficiently," marking a substantial step towards an autonomous verification system with cognitive capabilities.

[0078] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0079] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the foregoing disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. A method for intelligently generating test cases for domain controllers based on knowledge graphs, characterized in that, include: Construct a test knowledge graph that integrates the functional architecture of the domain controller, historical test data, and expert experience; Based on the test knowledge graph, a graph neural network model is used to learn the vector representations of nodes and relationships in the test knowledge graph; Based on the vector representation, one or more initial test paths are generated using a graph traversal algorithm; A heuristic optimization algorithm is used to combine and optimize one or more initial test paths to obtain optimized test paths; Based on the optimized test path, extended test cases are generated using at least one of the techniques of parameter generalization, scenario generalization, and data generalization. The generated test cases are evaluated for quality based on preset coverage and effectiveness metrics. The test cases are optimized based on the evaluation results.

2. The method according to claim 1, characterized in that, Building a test knowledge graph includes: Data is collected from multiple data sources, including domain controller design documents, historical test reports, fault databases, and expert experience records. Knowledge extraction is performed on the collected data to identify functional entities, parameter entities, scene entities, fault entities, and the relationships between these entities; Knowledge extracted from different data sources is integrated, including entity alignment and relationship fusion, to build a unified test knowledge graph.

3. The method according to claim 2, characterized in that, The knowledge extraction from the collected data includes: For unstructured document data, natural language processing techniques are used for information extraction; For structured and semi-structured data, a rule engine or parser is used to extract information.

4. The method according to claim 1, characterized in that, The step of learning the vector representations of nodes and relationships in the test knowledge graph through a graph neural network model includes: For a node in the test knowledge graph, its vector representation is updated by sampling its neighboring nodes and aggregating the feature information of the neighboring nodes. During the aggregation process, the association weights between the node and its neighboring nodes are calculated through a learnable attention mechanism, and weighted aggregation is performed based on these weights.

5. The method according to claim 1, characterized in that, The step of using a heuristic optimization algorithm to combine and optimize one or more initial test paths includes: The number of paths not covered in the test knowledge graph is used as a penalty, or the estimated test execution time is used as a cost function, to optimize path combination.

6. The method according to claim 1, characterized in that, Also includes: Based on the historical data related to faults in the test knowledge graph, calculate the risk weight of each node in the graph; When generating test paths, the generation order or selection probability of nodes or paths is adjusted according to the risk weights.

7. The method according to claim 1, characterized in that, The parameter generalization includes test methods based on equivalence class partitioning and / or orthogonal experimental design to generate combinations of test parameters; The scenario generalization includes generating a sequence of test scenarios based on a state machine model or a Markov chain model; The data generalization includes synthesizing test input data using generative models based on adversarial training or probabilistic coding.

8. The method according to claim 1, characterized in that, The optimization of the test cases based on the evaluation results includes: Identify functional nodes or logical paths in the test knowledge graph that are not covered by the current test case set, and generate new test cases based on the nodes or paths; Calculate the semantic or execution trajectory similarity between test cases. When the similarity is higher than a preset threshold, merge or delete some of the test cases.

9. The method according to any one of claims 1 to 8, characterized in that, The domain controller includes a powertrain domain controller, a body domain controller, or a chassis domain controller. The test knowledge graph further integrates the functional dependencies and fault propagation relationships of cross-domain controllers to generate cross-domain collaborative test cases.

10. A knowledge graph-based intelligent test case generation system for domain controllers, characterized in that, The system for implementing the method as described in any one of claims 1 to 9 comprises: The knowledge graph construction module is configured to build and maintain the test knowledge graph. The intelligent inference engine module is configured to generate and optimize test paths based on graph neural network models and inference algorithms. The test case generator module is configured to generate test cases based on the test path and using generalization techniques. The quality assessment module is configured to evaluate the generated test cases and provide optimization suggestions.

Citation Information

Patent Citations

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

    CN120595185A

  • Large model test case generation method, system and equipment based on multi-Agent collaboration

    CN121210315A

  • Test case generation method and device, equipment and storage medium

    CN121301220A

  • Test case recommendation method and device, electronic equipment, medium and product

    CN121478637A

  • Testing method and apparatus for test case, and electronic device and storage medium

    WO2023104121A1

Cited By

  • Chip test vector adaptive intelligent generation and optimization method

    CN122263770A