An industrial agent-based test case generation method and system

By using a test case generation method based on industrial intelligent agents, a system dependency model is constructed and multi-agent collaborative analysis is utilized. This solves the problems of low efficiency and insufficient dynamic analysis capabilities of existing testing methods, achieves comprehensive test coverage of industrial control systems, and improves system reliability and security.

CN121386734BActive Publication Date: 2026-03-20GUANGZHOU ZHANGDONG INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511993359.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-03-20
Estimated Expiration
2045-12-26

AI Technical Summary

Technical Problem

Existing industrial control system testing methods rely on manual design, which is inefficient and lacks the ability to dynamically analyze the overall behavior logic of the system and the complex interactions between control variables. This results in insufficient test coverage and makes it difficult to effectively verify complex scenarios such as parameter boundaries, abnormal sequences, and concurrent conditions, thus affecting system reliability and security.

Method used

An industrial intelligent agent-based test case generation method is adopted. By constructing a system dependency model and utilizing multi-agent collaborative analysis of process logic paths, boundary conditions and dependencies, path coverage test sequences covering process logic paths, boundary value test datasets and abnormal test scenario information simulating dependency failures are generated, thereby realizing the automated generation of test cases.

Benefits of technology

It improves test generation efficiency, enhances coverage of boundary conditions, abnormal scenarios, and concurrent paths, improves test reliability and consistency, and ensures comprehensive verification of industrial control systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121386734B_ABST
    Figure CN121386734B_ABST
Patent Text Reader

Abstract

The application relates to an industrial agent-based test case generation method and system, comprising the following steps: obtaining an industrial dataset and constructing a system dependency model; generating a path coverage test sequence through a first agent; generating a boundary value test dataset through a second agent; generating abnormal test scenario information through a third agent; and generating a test case set based on the path coverage test sequence, the boundary value test dataset and the abnormal test scenario information. In summary, the application realizes multi-dimensional coverage of an industrial control system test scenario, realizes automation of test case generation, improves generation efficiency and enhances the comprehensiveness of test coverage, especially the coverage of boundary conditions, abnormal scenarios and concurrent paths, reduces manual dependence, and improves the reliability and consistency of tests by constructing a system dependency model and using multi-agent collaborative analysis of process logic paths, boundary conditions and dependency relationships.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of industrial control system testing, in particular to a test case generation method and system based on an industrial agent. BACKGROUND

[0002] With the continuous evolution of industrial control systems towards intelligence and networking, the system scale has significantly expanded, the number of components has increased dramatically, and the interaction relationship has become increasingly complex, which has put forward strict requirements on operation reliability and security protection. Under this background, the testing link of industrial control software has become an indispensable core step to ensure the overall quality of the system.

[0003] In the current industrial field, the generation process of test cases highly depends on the manual design and personal experience accumulation of testers, and this approach has multiple inherent defects: first, manual design process is time-consuming and inefficient, which is difficult to match the rapid iteration development rhythm of modern industrial software, resulting in serious lag of test progress behind the development cycle; second, due to excessive reliance on individual experience, the generated test cases lack consistency and reusability in different scenarios, and experience differences easily cause test coverage blind spots; more importantly, existing testing methods generally present static and passive characteristics, lacking dynamic modeling and real-time analysis of the overall behavior logic of industrial systems, especially among industrial control variables, there are complex dependency networks and process logic paths, such as temperature, pressure, flow, etc. Variables are coupled and affect the system state, and existing technologies are difficult to effectively capture the causal relationship and dynamic interaction characteristics between these variables, which directly leads to the generated test case set only covering preset routine operation conditions or a few typical abnormal scenarios, and the verification ability of key complex scenarios such as parameter boundary value region, abnormal event continuous triggering sequence, and concurrent execution conditions is seriously insufficient. SUMMARY

[0004] In order to solve the above-mentioned defects, the present application provides a test case generation method and system based on an industrial agent.

[0005] The above-mentioned invention purpose of the present application is realized by the following technical scheme:

[0006] A test case generation method based on an industrial agent, comprising the steps of:

[0007] In response to the received test case generation instruction, the test target type corresponding to the test case generation instruction is parsed, and the corresponding industrial data set is obtained from the target industrial control system based on the parsed test target type;

[0008] A system dependency model is constructed based on the obtained industrial data set, the system dependency model including a state space composed of industrial control variables, dependency relationships between industrial control variables, and process logic paths;

[0009] The process logic path is analyzed by a pre-configured first intelligent agent to generate a path coverage test sequence for covering the process logic path;

[0010] The pre-configured second agent analyzes the range of values ​​of industrial control variables in the state space and generates a boundary value test dataset covering the boundary conditions of each industrial control variable.

[0011] By analyzing the dependencies between industrial control variables through a pre-configured third-party intelligent agent, information on abnormal test scenarios that simulate dependency failure is generated.

[0012] A test case set suitable for the target industrial control system is generated based on path coverage test sequences, boundary value test datasets, and abnormal test scenario information.

[0013] In a preferred embodiment, this application can be further configured as follows: the step of responding to a received test case generation instruction, parsing the test target type corresponding to the test case generation instruction, and obtaining the corresponding industrial dataset from the target industrial control system based on the parsed test target type includes the following steps:

[0014] Parse the test case generation instructions and identify the test target identifier, which includes instruction keywords and configuration template identifiers;

[0015] The identified test target identifiers are matched with predefined test target types, which include functional logic testing, boundary robustness testing, abnormal failure testing, and full scenario coverage testing.

[0016] Based on the matched test target type, the category of industrial data to be acquired is determined from the preset type-data mapping relationship;

[0017] Obtain the corresponding industrial dataset based on the determined industrial data category.

[0018] In a preferred embodiment, this application can be further configured as follows: the step of constructing a system dependency model based on the acquired industrial dataset, wherein the system dependency model includes a state space composed of industrial control variables, the dependencies between industrial control variables, and the process logic path, including the following steps:

[0019] Control logic information is extracted from industrial datasets, and a dependency network of industrial control variables is constructed based on the control logic information.

[0020] Historical operational data is extracted from industrial datasets, and the causal direction between industrial control variables is obtained through a pre-defined causal discovery algorithm.

[0021] direct the edges in the correlation dependency network according to the causal direction to obtain a causal dependency network, and construct dependency relationships among the industrial control variables and the process logic path based on the causal dependency network;

[0022] extract value ranges of the industrial control variables based on the industrial dataset, and construct a state space of the industrial control variables based on the value ranges.

[0023] In a preferred example, the application can be further configured to: the step of analyzing the process logic path by the pre-configured first intelligent agent to generate the path coverage test sequence for covering the process logic path, comprises the steps of:

[0024] identifying whether there is a parallel execution branch in the process logic path, if there is, analyzing the industrial control variables associated with the parallel execution branch, setting the industrial control variables associated with at least two parallel execution branches as shared control resources, and locating the access point of the shared control resources as a potential critical section;

[0025] defining timing constraint rules for the parallel execution branches associated with the shared control resources, the timing constraint rules including execution order constraints, time window constraints, and mutual exclusion access constraints;

[0026] generating an abnormal timing test sequence and a normal timing test sequence based on the timing constraint rules, wherein the abnormal timing test sequence is configured to violate the mutual exclusion access constraint to trigger competitive access to the potential critical section;

[0027] performing logical feasibility verification on the abnormal timing test sequence and the normal timing test sequence, and integrating the path coverage test sequence based on the verification result.

[0028] In a preferred example, the application can be further configured: the second intelligent agent includes a boundary analysis layer, an association analysis layer, and a boundary coupling layer, the step of analyzing the value range of the industrial control variable in the state space by the pre-configured second intelligent agent to generate the boundary value test dataset covering the boundary conditions of each industrial control variable, comprises the steps of:

[0029] the boundary analysis layer obtains the data type and value range of each industrial control variable in the state space, and generates boundary value test data for each industrial control variable, the boundary value test data including minimum value, slightly higher than minimum value, normal value, slightly lower than maximum value, and maximum value;

[0030] the association analysis layer identifies a variable group with constraint association based on the dependency relationship among the industrial control variables, constructs a joint effective domain corresponding to the variable group, and calculates the effective domain boundary of the joint effective domain;

[0031] The boundary coupling layer generates coupling test data covering the effective domain boundary based on the effective domain boundary, and merges the boundary value test data and the coupling test data to generate a boundary value test data set.

[0032] In a preferred example, the application can be further configured to: the association analysis layer identifies a variable group with constraint association based on the dependency relationship between the industrial control variables, constructs a joint effective domain corresponding to the variable group, and calculates the effective domain boundary of the joint effective domain, including the steps of:

[0033] Based on the dependency relationship between the industrial control variables, the process logic path of the industrial control variable is converted into a constraint expression corresponding to the associated control rule;

[0034] The value range of the variable group with constraint association and the corresponding constraint expression are input into a pre-set constraint solver, the variable value common space is solved, and the variable value common space is defined as the joint effective domain corresponding to the variable group;

[0035] The boundary point set of the joint effective domain is calculated by a pre-set search algorithm, and the boundary point set is defined as the effective domain boundary of the joint effective domain.

[0036] In a preferred example, the application can be further configured to: the third intelligent agent analyzes the dependency relationship between the industrial control variables to generate abnormal test scenario information simulating the failure of the dependency relationship, including the steps of:

[0037] Based on the dependency relationship between the industrial control variables, key nodes are identified, and abnormal test scenarios simulating the failure of the key nodes are generated for the identified key nodes, the abnormal test scenarios including single-point failure scenarios and composite failure scenarios;

[0038] Based on the single-point failure scenario, the propagation path of the failure in the dependency relationship is identified, and the key degree and influence range of the propagation path are analyzed;

[0039] Based on the analysis result of the propagation path, single-point failure scenarios with causal association are combined to generate cascading failure scenarios simulating failure diffusion;

[0040] The single-point failure scenarios and the cascading failure scenarios are encapsulated as abnormal test scenario information.

[0041] In a preferred example, the application can be further configured to: the association analysis layer identifies a variable group with constraint association based on the dependency relationship between the industrial control variables, constructs a joint effective domain corresponding to the variable group, and calculates the effective domain boundary of the joint effective domain, including the steps of:

[0042] identify a key node based on a dependency relationship between industrial control variables, and construct a common cause failure node group based on the identified key node;

[0043] generate a composite failure scenario simulating simultaneous failure of multiple key nodes for the common cause failure node group.

[0044] In a preferred example, the application can be further configured to: the step of generating a test case set suitable for the target industrial control system based on the path coverage test sequence, the boundary value test data set, and the abnormal test scenario information, includes the steps of:

[0045] identify boundary values in the boundary value test data set and fill them as input data into the corresponding variables in the path coverage test sequence to generate a basic test sequence;

[0046] identify the abnormal patterns defined in the abnormal test scenario information and use them as mutation rules to generate a strengthened test sequence based on the mutation rules;

[0047] perform conflict detection and redundancy elimination on the generated basic test sequence and strengthened test sequence, and set execution priorities based on the test target type to generate a test case set suitable for the target industrial control system.

[0048] The second invention purpose of the application is achieved by the following technical scheme:

[0049] An industrial intelligent agent-based test case generation system, comprising:

[0050] An instruction analysis module for analyzing the test target type corresponding to the received test case generation instruction, and obtaining the corresponding industrial data set from the target industrial control system based on the analyzed test target type;

[0051] A dependency model construction module for constructing a system dependency model based on the obtained industrial data set, the system dependency model including a state space composed of industrial control variables, a dependency relationship between industrial control variables, and a process logic path;

[0052] A test sequence generation module for analyzing the process logic path through a pre-configured first intelligent agent to generate a path coverage test sequence for covering the process logic path;

[0053] A test data generation module for analyzing the value range of the industrial control variables in the state space through a pre-configured second intelligent agent to generate a boundary value test data set covering the boundary conditions of each industrial control variable;

[0054] The test scenario generation module is configured to analyze the dependency relationship between the industrial control variables by a preconfigured third intelligent agent, and generate abnormal test scenario information simulating the failure of the dependency relationship.

[0055] The test case generation module is configured to generate a test case set applicable to the target industrial control system based on the path coverage test sequence, the boundary value test data set, and the abnormal test scenario information.

[0056] In summary, the test case generation method and system based on industrial intelligent agents provided in the present application can realize multi-dimensional coverage of the test scenarios of the industrial control system and automation of the generation of test cases by constructing a system dependency model and using multiple intelligent agents to collaboratively analyze the process logic path, boundary conditions, and dependency relationship, thereby improving the generation efficiency and enhancing the comprehensiveness of the test coverage, especially the coverage of boundary conditions, abnormal scenarios, and concurrent paths, reducing the dependence on manual work, and improving the reliability and consistency of the test. BRIEF DESCRIPTION OF DRAWINGS

[0057] Figure 1 is a flowchart of an embodiment of the test case generation method based on industrial intelligent agents provided in the present application;

[0058] Figure 2 is an implementation flowchart of step S10 in an embodiment of the test case generation method based on industrial intelligent agents provided in the present application;

[0059] Figure 3 is an implementation flowchart of step S20 in an embodiment of the test case generation method based on industrial intelligent agents provided in the present application. DETAILED DESCRIPTION

[0060] The following will be described in detail in combination with the accompanying Figures 1-3 The present application will be further described in detail.

[0061] In the field of industrial control system testing, the test case generation process highly depends on manual experience, resulting in low testing efficiency and poor reusability; further, the existing test method lacks panoramic dynamic analysis capability for the overall behavior logic of the system and the complex interaction between control variables, thereby causing insufficient coverage of the test cases, making it difficult to effectively verify complex scenarios such as parameter boundaries, abnormal sequences, and concurrent conditions, so that deep hidden defects are difficult to be systematically discovered; among them, the insufficient test sufficiency will directly affect the reliability and safety of the industrial system, specifically, the coupling effect of the control logic, parameter boundaries, and abnormal processing mechanism is not fully exposed, thereby restricting the safeguarding capability of the key performance indicators of the industrial control system in the test process.

[0062] For example, in a distributed control system of a chemical production process, a tester needs to verify the behavior logic of a temperature control module of a reactor. In this scenario, the industrial control variables include temperature sensor readings, cooling water flow, and pressure signals, and their interactions involve dynamic switching of the process logic path. However, the traditional testing method can only generate test cases that cover the preset normal working conditions. When the temperature sensor signal drifts and the cooling water flow anomaly occurs at the boundary value at the same time, the distributed control system may enter an unintended state. Since the existing method does not analyze the dependency relationship between the control variables comprehensively, the test case set does not contain such concurrent abnormal sequences, resulting in the cascading failure defects in the temperature control logic being not identified. Therefore, the distributed control system may trigger the misoperation of the safety interlock mechanism due to the unverified boundary condition combination in actual operation, affecting the production continuity and equipment integrity.

[0063] If the above problems are not solved, the behavior of the industrial control system under parameter boundaries or abnormal conditions cannot be fully verified, which may cause unforeseen system failures. Insufficient test coverage will lead to control logic defects being exposed in the running phase, thereby increasing the failure risk of the industrial control system. Further, the lack of verification of abnormal sequences and concurrent conditions will weaken the fault tolerance of the industrial control system, so that potential safety hazards cannot be discovered and eliminated in the testing phase, ultimately affecting the overall reliability and running stability of the industrial control system.

[0064] To this end, the present application discloses a test case generation method based on an industrial agent. In an embodiment, as shown in Figure 1 the specific steps include:

[0065] S10: In response to the received test case generation instruction, the test target type corresponding to the test case generation instruction is parsed, and the corresponding industrial data set is obtained from the target industrial control system based on the parsed test target type;

[0066] In the present embodiment, the industrial agent specifically refers to a software module configured to complete a specific test analysis task, which encapsulates specific domain knowledge (such as path coverage, boundary analysis, and exception injection) and algorithms. The industrial agent is different from a general artificial agent, but is a functional entity with high autonomy and professionalism specifically used in the field of industrial testing. The test case generation instruction is a trigger signal and a configuration carrier, which is issued by a user (such as a test engineer) or an upstream system (such as a continuous integration platform) to start the entire automated test case generation process. The test case generation instruction carries the intention or goal of this generation task, which can be specified through keywords, parameters or referenced configuration template IDs in the instruction. For example, it indicates that this test is for "new version function verification", "stress test" or "security compliance check". The test target type refers to the specific purpose classification of the test case generation activity, which determines the scope of data acquisition and the focus of subsequent analysis strategies. For example, the "function logic test" target requires acquiring logic programs to verify correctness, and the "boundary robustness test" target requires acquiring variable value ranges to test the behavior of the system under critical conditions. The target industrial control system refers to the object to be tested in the present method, and is also the source and attribution of all data and business logic in the present scheme process. It specifically refers to an automation system composed of computers, controllers (such as PLC, DCS), sensors, actuators, etc. used in industrial environments. For example, a car assembly line control system, a self-control system of a chemical production device or a scheduling system of an intelligent warehouse. The ultimate goal of all test cases generated by the present method is to verify the correctness of the functions, boundary safety and exception handling capability of the specific system. The industrial data set refers to the collection of raw data obtained from the target industrial control system, which is used to construct system models and perform analysis. It not only includes static configuration data such as control programs and variable lists, but also includes dynamic behavior data such as historical operation data and logs, which is the basis for analysis and generation.

[0067] S20: Construct a system dependency model based on the acquired industrial data set, wherein the system dependency model includes a state space composed of industrial control variables, dependency relationships between industrial control variables, and process logic paths.

[0068] In this embodiment, the system dependency model refers to an abstract representation of the behavior logic of the industrial control system, which includes a state space composed of industrial control variables, dependency relationships between industrial control variables, and process logic paths; in actual application, the system dependency model can be constructed by analyzing historical operation data, such as identifying relationships between variables based on statistical correlation, or defining process logic rules through an expert knowledge base, which is mainly to realize dynamic mapping of the overall behavior of the system; the industrial control variables refer to data units in the industrial control system that represent device states, process parameters, control logic conditions, and can be read or written by the control system; the industrial control variables are the smallest information carriers that constitute the behavior of the control system; the state space refers to a set composed of all possible and valid value combinations of all industrial control variables; each specific instant in the industrial control system corresponds to a point (state) in the state space; the state space is defined to systematically describe and analyze all possible behaviors of the industrial control system; the dependency relationship refers to the value or state of one or a group of industrial control variables that directly or indirectly affects or triggers the value or state of another or another group of industrial control variables in the logic of the industrial control system; this dependency relationship constitutes the logic chain and behavior rules of the industrial control system; the process logic path refers to a series of ordered state transition sequences that must be experienced in the industrial control system to complete a specific production process or business process; it describes the correct workflow from the initial state to the target state, and is the core basis for verifying the correctness of the function of the industrial control system.

[0069] S30: analyzing the process logic path by a preconfigured first intelligent agent to generate a path coverage test sequence for covering the process logic path;

[0070] In this embodiment, the preconfigured first intelligent agent refers to an automated module specifically used for analyzing the process logic path; specifically, the first intelligent agent can be implemented by a rule engine, such as generating a test sequence based on pre-defined path coverage rules, or simulating a process flow through a state machine model, which is mainly to generate a test sequence that covers the process logic path; the path coverage test sequence refers to a test step sequence generated by the first intelligent agent, which aims to drive the industrial control system to execute so that it can traverse the specified process logic path, thereby verifying whether the function on the flow is correctly implemented.

[0071] S40: analyzing the value range of the industrial control variables in the state space by a preconfigured second intelligent agent to generate a boundary value test data set covering the boundary conditions of each industrial control variable;

[0072] In the embodiment, the pre-configured second agent is used to analyze the value range of the industrial control variables in the state space, wherein the second agent can be implemented by using a boundary value analysis algorithm, for example, independently calculating the minimum value and the maximum value for each variable, or processing variable constraints by using a combination test method, which is mainly used to generate a test data set covering boundary conditions.

[0073] S50: analyzing the dependency relationship between the industrial control variables by using a pre-configured third agent to generate abnormal test scenario information simulating the failure of the dependency relationship;

[0074] In the embodiment, the pre-configured third agent is configured to analyze the dependency relationship between the industrial control variables. In actual application, the third agent can be implemented by using a fault tree analysis, for example, defining a basic failure event to generate an abnormal scenario, or simulating variable failure by random disturbance, which is mainly used to generate test scenario information simulating the failure of the dependency relationship. The abnormal test scenario information refers to the test specification generated by the third agent, which describes the conditions that make the industrial control system deviate from the normal work, that is, simulates the failure of the dependency relationship, including but not limited to simulating sensor failure, actuator sticking, signal interference, etc., and is used to test the fault tolerance and robustness of the system.

[0075] S60: generating a test case set suitable for the target industrial control system based on the path coverage test sequence, the boundary value test data set, and the abnormal test scenario information.

[0076] In the embodiment, the test case set refers to a set of executable test procedures generated based on the path coverage test sequence, the boundary value test data set, and the abnormal test scenario information, for verifying the specific properties of the target industrial control system. In the embodiment, the test case set is not simply a test case accumulation, but a set of test schemes that are structured and organized and have clear execution targets and sequences.

[0077] Specifically, the three pre-configured agents are divided and cooperated to dynamically construct a system dependency model and integrate the path coverage test sequence, the boundary value test data set, and the abnormal test scenario information, thereby generating a test case set suitable for the target industrial control system, so as to solve the problems of low efficiency caused by relying on manual experience and lack of dynamic analysis capability for the overall behavior logic of the industrial system and the complex interaction between the control variables in the test case generation, and to realize the systematic verification of the industrial control system under complex scenarios such as parameter boundary, abnormal sequence, and concurrent condition.

[0078] In the field of industrial control system testing, the scheme realizes intelligent generation of test cases through an automated process. The working principle starts from the reception and analysis of test case generation instructions. When a test case generation instruction is received, the instruction content is used to identify the test target type, which is directly related to the functional logic testing, boundary robustness testing, or abnormal fault testing requirements of the industrial control system. Then, the industrial data set matching the test target type is extracted from the target industrial control system. Subsequently, a system dependency model is constructed based on the obtained industrial data set. This model dynamically maps the actual operating state of the industrial control system, specifically including the state space composed of industrial control variables, the dependency relationship between variables, and the process logic path. On this basis, a pre-configured first intelligent agent performs in-depth analysis of the process logic path, identifies parallel execution branches and potential critical sections in the path, and generates a path coverage test sequence that covers the process logic path. Meanwhile, a pre-configured second intelligent agent analyzes the value range of the industrial control variables in the state space and generates test data that covers the boundary conditions in combination with the dependency relationship between variables. A pre-configured third intelligent agent focuses on the failure simulation of the dependency relationship and generates abnormal test scenario information by identifying key nodes and propagation paths. Finally, the path coverage test sequence, boundary value test data set, and abnormal test scenario information generated by the three intelligent agents are integrated, and after conflict detection and priority setting, a test case set suitable for the target industrial control system is formed.

[0079] Exemplarily, the scheme can be embodied as a test scenario of a chemical process control system in practical application. For example, in a chemical reaction device based on a distributed control system, the test target type is set as a boundary robustness test, and industrial data sets such as temperature, pressure and flow are obtained from the historical operation database of the device; in the system dependency model constructed based on the data sets, the state space is composed of temperature variables (-10℃ to 150℃), pressure variables (0 to 2.5 MPa), and the like, the dependency relationship is embodied as a causal chain that temperature rise leads to pressure rise, and the process logic path describes the sequential flow of feeding, heating and discharging of the reaction kettle; when the first intelligent agent analyzes the process logic path, it identifies that there is a parallel execution branch between the feeding and heating steps, and sets the shared temperature sensor as a critical section, and generates a test sequence including normal timing and abnormal timing; the second intelligent agent generates boundary value test data of the minimum value (-10℃), slightly higher than the minimum value (-9.5℃), the normal value (80℃), slightly lower than the maximum value (149.5℃) and the maximum value (150℃) of the temperature variable, and generates joint effective domain boundary points considering the coupling constraints of temperature and pressure; the third intelligent agent identifies the temperature sensor as a key node based on the dependency relationship, simulates its failure and generates a single-point failure scenario, for example, the sensor signal interruption leads to temperature control failure; thus, the integrated path coverage test sequence, boundary value test data set and abnormal test scenario information form a comprehensive test case set covering the process logic, parameter boundary and abnormal behavior.

[0080] Through the above technical scheme, the application effectively overcomes the low efficiency problem caused by the dependence on manual experience in traditional testing, and solves the defect that the existing method lacks panoramic dynamic analysis capability; specifically, the system dependency model is generated in real time based on actual industrial data, avoiding the static fragmentation of local functions of the industrial system, and realizing the global capture of the complex interaction between control variables; the dynamic analysis of the process logic path by the first intelligent agent ensures the behavior verification under concurrent conditions, the coupling processing of the boundary conditions by the second intelligent agent covers the implicit constraints of the parameter boundary, and the simulation of the dependency relationship failure by the third intelligent agent further explores the diffusion mechanism of the abnormal sequence; the test case set generated thereby not only covers the preset normal working condition, but also exposes the deep hidden defects under the parameter boundary, abnormal sequence and concurrent condition, thereby having the technical effects of improving the sufficiency and reliability of the test.

[0081] In practical applications, in some embodiments of the present application, the step of analyzing the test target type and obtaining the industrial dataset in response to the received test case generation instruction is proposed. However, in this process, there may be a problem that the analysis of the test instruction only relies on simple rules or manual experience, and the test target identifier (such as the combination of the instruction keyword and the configuration template identifier) implied in the instruction cannot be accurately identified, resulting in deviation of the test target type matching, and further causing errors in the determination of the industrial data category or the incompleteness of the dataset, which affects the coverage depth and accuracy of the subsequent test cases on the functional logic, boundary conditions and abnormal scenarios.

[0082] To this end, the present application further proposes that, in an embodiment, as shown in Figure 2 Step S10 includes:

[0083] S11: Analyzing the test case generation instruction to identify the test target identifier, the test target identifier including an instruction keyword and a configuration template identifier;

[0084] In the present embodiment, the test target identifier refers to the key element in the test instruction for identifying the test intention, which can be implemented by the combination of the instruction keyword and the configuration template identifier, and its purpose is to capture the implied intention and configuration context in the user instruction through the double identification mechanism, and to reduce or avoid the analysis errors caused by the diversity of instruction expression or semantic ambiguity; wherein, the test target identifier in the present embodiment includes the instruction keyword and the configuration template identifier; the instruction keyword refers to the word directly input by the user through natural language or command, such as the string "generate boundary test case", "test safety valve logic" in the user input instruction, and the user intention is understood by identifying these instruction keywords; the configuration template identifier refers to the ID or name of a certain pre-stored configuration scheme selected by the user, such as "pre-online strength test template", "daily regression test template", etc., and one template identifier usually corresponds to a set of pre-defined test strategies and data requirements.

[0085] S12: Matching the identified test target identifier with the pre-defined test target type, the test target type including functional logic test, boundary robustness test, abnormal fault test and full-scenario coverage test;

[0086] In the embodiment, the predefined test target type can be understood as a standardized test category library, which can be implemented in a classification manner of functional logic test, boundary robustness test, abnormal fault test, and full-scene coverage test, and aims to provide a standardized classification framework to overcome the coverage blind spot caused by the randomness of type definition in the traditional method. The test target types in the embodiment include functional logic test, boundary robustness test, abnormal fault test, and full-scene coverage test. The functional logic test aims to verify whether the industrial control system is correctly executed according to the preset process flowchart or sequential function chart, and focuses on the correctness of the business process. The boundary robustness test aims to verify whether the system behavior is still correct and controllable when the input parameters of the industrial control system are at the limit value of the allowed range, and focuses on the stability of the industrial control system under critical conditions. The abnormal fault test aims to simulate various hardware faults, signal abnormalities, illegal operations, and other scenes, and verifies whether the fault tolerance, diagnosis, and safety control mechanism of the industrial control system are effective, and focuses on the safety and reliability of the industrial control system. The full-scene coverage test is a composite test type, which can refer to the above three test targets at the same time, and aims to comprehensively verify the industrial control system.

[0087] S13: determining the industrial data category to be acquired from the preset type-data mapping relationship based on the matched test target type;

[0088] In the embodiment, the type-data mapping relationship refers to the rule of associating the test target type with the required industrial data category, which can be implemented by using a lookup table or a database mapping table, and aims to convert the abstract test target into specific data requirements to avoid the blindness and redundancy of data acquisition. The industrial data category refers to the data type divided according to the test requirements, which can be implemented by using specific data subsets such as historical running data and control logic information, and aims to ensure that the acquired data closely match the actual verification requirements of the test target, for example, control logic programs, process parameters, variable meta-information (name, type, range), historical running data, etc. can be different data categories.

[0089] For example, if the test type is functional logic test, the type-data mapping relationship can point to: control logic program, process flowchart.

[0090] If the test type is boundary robustness test, the type-data mapping relationship can point to: system variable list and its value range.

[0091] If the test type is abnormal fault test, the type-data mapping relationship can point to: system variable list and variable interdependence description.

[0092] S14: acquiring the corresponding industrial data set according to the determined industrial data category.

[0093] Specifically, first, the test case generation instruction is parsed to identify the test target identifier, and the dual mechanism of instruction keywords and configuration template identification is used to ensure accurate capture of user intent; then the identified identifier is matched with the predefined test target type, and the standardized type library is used to realize the standardized classification of the test target; then based on the matching result, the industrial data category is determined from the preset mapping relationship, and the abstract target is converted into a specific data requirement; finally, the industrial data set is obtained according to the determined data category; the above steps form a closed-loop data requirement accurate mapping mechanism, ensuring the accuracy and pertinence of the whole process from instruction parsing to data acquisition, thereby effectively reducing the problem of data acquisition deviation caused by ambiguous test target identification.

[0094] Exemplarily, as a specific implementation, the scheme of the present application is implemented as follows: when receiving the test case generation instruction "execute boundary robustness test, template identification: BRT-Template", first, the instruction is parsed to identify the instruction keywords "boundary robustness test" and the configuration template identification "BRT-Template"; then these identifiers are matched with the predefined test target type to determine the boundary robustness test; based on this type, the boundary data category to be obtained is found from the type-data mapping relationship; finally, the data interface of the industrial control system is called to obtain the industrial data set related to the boundary condition, such as the value range data of the control variable.

[0095] Through the above scheme, the present application ensures accurate identification of the test target type and accurate determination of the industrial data category, avoids deviation and incompleteness of data acquisition, thereby providing a highly adaptive input source for subsequent system dependency model construction and test case generation, effectively improving the coverage depth and accuracy of test cases for functional logic, boundary conditions and abnormal scenarios.

[0096] In practical applications, in some embodiments of the present application described above, a system dependency model is constructed to define the state space and dependency relationship. However, in the implementation process, there may be a problem that only based on the correlation analysis of the industrial data set, the causal relationship between the industrial control variables cannot be accurately distinguished, resulting in that the dependency network only reflects the surface association and ignores the dynamic influence direction, so that the process logic path modeling is distorted, and then the coverage ability of the subsequent test case for the real behavior of the industrial control system is affected, making it difficult to effectively verify the system reliability under complex working conditions.

[0097] To this end, the present application further proposes that, in an embodiment, as shown in Figure 3 Step S20 comprises:

[0098] S21: extracting control logic information based on the industrial dataset, and constructing a relevant dependency network of the industrial control variables according to the control logic information;

[0099] In the embodiment, the control logic information refers to programmed logic directly defining behaviors of the industrial control system, which is usually derived from programming codes or configuration logic of PLCs, and which explicitly specifies that what output actions should be generated under what input conditions, and is the basis for constructing the system behavior model; the relevant dependency network refers to a network structure representing statistical correlations between the industrial control variables, which can be implemented by using an undirected graph model, and nodes correspond to the industrial control variables, and edges represent correlation strengths between the variables.

[0100] S22: extracting historical running data based on the industrial dataset, and obtaining causal directions between the industrial control variables by using a preset causal discovery algorithm;

[0101] In the embodiment, the historical running data refers to original data sequences recorded continuously during actual running of the target industrial control system in a past period of time, which reflects dynamic behaviors, state transitions and interactions between variables of the industrial control system in a real environment; the causal discovery algorithm refers to a data-driven analysis algorithm, which can be implemented by using Granger causality test or constraint-based causal discovery algorithm, and its function is to analyze time sequence rules and statistical characteristics of variable changes in the historical running data, so as to infer directions of causal relationships between the variables, for example, it is determined by analyzing data that “temperature sensor reading increases” usually occurs before “cooling water valve opening increases”, so it is inferred that the temperature reading can be a “cause” of the valve opening; the causal direction is an output result of the causal discovery algorithm, and refers to a directionality of causal influences between two related variables, which can be upgraded from “A and B are related” to “A is a cause of B” or “B is a cause of A”, and the causal relationship is a key to upgrading the relevant dependency network to the causal dependency network.

[0102] S23: orienting edges in the relevant dependency network according to the causal directions, obtaining a causal dependency network, and constructing dependency relationships between the industrial control variables and process logic paths based on the causal dependency network;

[0103] In this embodiment, the orientation is a special graph operation, which specifically refers to the process of assigning directions to the edges connecting the nodes in the correlation dependency network according to the causal direction information, thereby converting it into a causal dependency network; the causal dependency network specifically refers to the directed network structure formed after the correlation dependency network is oriented by the causal direction, which can be represented by a directed acyclic graph model, and the direction of the edge clearly indicates the causal influence path between variables, for example, the edge from the "motor start signal" to the "motor speed feedback" indicates that the former is the reason for the latter, and the causal dependency network can describe the propagation path of the fault and is the basis for analysis and reasoning; in the causal dependency network, a key causal chain from the initial state to the target state, i.e., the process logic path, represents a series of causal events that must be experienced to complete a specific process step, for example, "press the start button" (cause) → "main contactor attraction" (effect / cause) → "motor starts to rotate" (effect) constitute a simple process logic path.

[0104] For example, the specific operation example about orientation is as follows:

[0105] Before orientation: in the correlation dependency network, there is an undirected edge between node A (temperature sensor) and node B (cooling water valve), which only indicates that A and B are related;

[0106] Obtain causal direction: after the causal discovery algorithm analyzes the historical operation data, it concludes that A is the cause of B;

[0107] Orientation operation: convert the undirected edge between A and B into a directed edge from A to B;

[0108] After orientation: in the causal dependency network, this directed edge indicates that "the temperature sensor reading (A) is the reason for the cooling water valve opening (B) to change".

[0109] S24: Extract the value range of the industrial control variable based on the industrial data set, and construct the state space of the industrial control variable based on the value range.

[0110] In this embodiment, the state space refers to a multi-dimensional mathematical space composed of all possible and effective values of all industrial control variables, and each point (i.e., a specific value combination) in the state space represents a complete snapshot or state of the industrial control system at a certain time. The state space is constructed to systematically describe and analyze all possible behaviors of the industrial control system.

[0111] Specifically, first, the relevant dependency network is constructed based on the control logic information extracted from the industrial dataset, to provide a basic framework for the dependency relationship of the industrial control system in accordance with engineering specifications; then, the historical operation data is processed by using a causal discovery algorithm to obtain the causal direction between variables, to ensure that the dependency relationship reflects the strict time-dependent characteristics in the industrial control system; then, the edges in the relevant dependency network are oriented according to the causal direction, to convert the undirected relevant network into a directed causal dependency network, so that the dependency relationship between the industrial control variables accurately expresses the driving and driven relationship; finally, the state space is constructed based on the value range of the industrial control variables extracted from the industrial dataset, to directly define the operation boundary of the variable from the actual operation data; through the sequential execution and information flow of the above steps, the scheme realizes the conversion from the static relevant network to the dynamic causal model, so that the system dependency model can accurately represent the time sequence behavior logic of the industrial control system.

[0112] Exemplarily, as a specific implementation, the scheme of the application is implemented as follows: considering an industrial control system of a certain water treatment plant, which involves industrial control variables such as liquid level, flow rate and valve opening. First, the control logic information is extracted from the configuration template of the industrial control system, to construct a relevant dependency network between variables such as liquid level-flow rate and flow rate-valve opening; then, the historical operation data is used to determine the causal direction of the liquid level change driving the flow rate change and the flow rate change affecting the valve opening by using the Granger causality test algorithm; then, the undirected relevant dependency network is converted into a directed causal dependency network according to the determined causal direction; finally, the value range of each variable is extracted from the actual operation data, to construct a state space for subsequent test case generation.

[0113] Through the above technical scheme, the system dependency model constructed can accurately distinguish the causal relationship between the industrial control variables rather than simple correlation, so that the process logic path modeling is more in line with the real dynamic behavior of the industrial control system, thereby improving the coverage ability of the test case for the system behavior under complex working conditions, and effectively verifying the reliability performance of the industrial control system under the parameter boundary and abnormal sequence conditions.

[0114] In practical applications, in some embodiments of the application described above, a path coverage test sequence is generated by the first intelligent agent to cover the process logic path. However, in the implementation process, there is still a lack of effective response mechanism for the shared control resource competition problem caused by parallel execution branches in the industrial control system, which makes it difficult for the test sequence to accurately trigger the competitive access behavior of the potential critical section, and makes it difficult to verify the behavior reliability and abnormal processing ability of the industrial control system under concurrent conditions, so as to fully expose the deep defects caused by the timing conflict.

[0115] In this regard, the application further proposes that, in an embodiment, step S30 comprises:

[0116] S31: identifying whether there exists parallel execution branch in the process logic path, if exists, analyzing industrial control variables associated with the parallel execution branch, setting industrial control variables associated with at least two parallel execution branches as shared control resources, and locating access points of the shared control resources as potential critical sections;

[0117] In the embodiment, the parallel execution branch refers to two or more independent control flows or task sequences that can be simultaneously started and concurrently run in the process logic of the industrial control system, for example, in a production line, "robot assembly process" and "conveyer belt moving process" can be two parallel execution branches, and identifying the parallel execution branch is a prerequisite for testing concurrent safety; further, identifying whether there exists parallel execution branch in the process logic path refers to dynamically analyzing the topology structure of the process logic path to detect the existence of concurrent execution branch, which can be realized by using directed acyclic graph traversal algorithm or state machine decomposition technology, and the purpose is to objectively locate the area that can cause resource competition in the industrial control system; the shared control resource refers to an entity that is commonly accessed and operated by multiple parallel execution branches in the industrial control system, which is usually a key industrial control variable, for example, a variable representing "current station number", which can be read and judged by "feeding mechanical arm" and "detection robot" two parallel branches at the same time, and the shared control resource is the root cause of concurrent conflict; the potential critical section specifically refers to a code area in the program code that accesses and modifies the shared control resource, if the access to the critical section is not correctly protected by mutual exclusion, when multiple parallel branches simultaneously enter, data competition, state inconsistency and other defects will be caused, and locating the potential critical section is to find the focus that needs to be tested concurrently.

[0118] S32: defining timing constraint rules for the parallel execution branch associated with the shared control resource, the timing constraint rules including execution order constraint, time window constraint and mutual exclusion access constraint;

[0119] In the embodiment, the timing constraint rule refers to a normalized constraint system for timing of parallel branches, which can be understood as a timing behavior specification defined to ensure correct operation of the industrial control system in a concurrent environment, and can be implemented by using a timed automaton model or a discrete event system description language, and the purpose is to establish a structured timing boundary for normal operation. The timing constraint rule includes an execution order constraint, a time window constraint, and a mutual exclusion access constraint. The execution order constraint refers to a constraint that specifies the order of starting or executing between branches, for example, "the initialization of branch A must be completed before starting branch B". The time window constraint refers to a constraint that specifies that a certain operation must be completed within a specific time range, for example, "branch B must be started within 5 seconds after branch A starts". The mutual exclusion access constraint refers to a constraint that specifies that at most one execution branch is allowed to access a shared resource in a critical section at the same time, and the mutual exclusion access constraint is a core rule constraint for ensuring data consistency.

[0120] S33: generating an abnormal timing test sequence and a normal timing test sequence based on the timing constraint rule, wherein the abnormal timing test sequence is configured to violate the mutual exclusion access constraint to trigger competitive access to the potential critical section;

[0121] In the embodiment, the abnormal timing test sequence is a test sequence designed to intentionally violate the timing constraint rule, in particular the mutual exclusion access constraint in this embodiment. For example, the abnormal timing test sequence can intentionally arrange two branches to access a shared resource at the same time to verify whether the behavior of the control system is correct when competitive access to the potential critical section is triggered, such as whether a mutual exclusion lock can be normally triggered, or whether a data error occurs, etc. Further, generating the abnormal timing test sequence specifically refers to constructing a test sequence that violates the mutual exclusion access constraint, which can be implemented by using a constraint violation injection algorithm or a directional disturbance strategy, and the purpose is to accurately simulate resource competition faults. The normal timing test sequence refers to a test step sequence generated according to the timing constraint rule, which is used to verify whether the behavior of the industrial control system under correct concurrent timing meets the expectation, and simulates the correct running process of the industrial control system under ideal conditions.

[0122] S34: performing logical feasibility verification on the abnormal timing test sequence and the normal timing test sequence, and integrating a path coverage test sequence based on the verification result.

[0123] In the embodiment, the logical feasibility verification refers to verifying the effectiveness of the test sequence according to the cause-effect relationship of the industrial control logic, which can be implemented by using formal model detection, a lightweight simulation engine, or symbolic execution, and the purpose is to verify whether the test sequence can really be executed in logic, i.e., whether the logic is reachable and whether the expected concurrent scenario such as a competition condition can be stably reproduced.

[0124] Specifically, first, parallel execution branches in the process logic path are identified and associated industrial control variables are analyzed, variables commonly associated with multiple branches are located as shared control resources, thereby objectively determining potential critical sections; then, based on the timing dependency characteristics of the industrial control process, timing constraint rules including execution order, time window and mutual exclusion access are defined to provide a benchmark for normal operation; on this basis, abnormal timing test sequences that violate mutual exclusion access constraints are generated to trigger competitive access behavior, and normal timing test sequences that comply with the constraints are generated; finally, invalid paths are excluded through logical feasibility verification and the two types of sequences are integrated to ensure that the generated path coverage test sequences not only completely cover normal conditions, but also accurately expose boundary abnormal behavior under concurrent conditions, thereby systematically improving the detection capability of timing conflict defects.

[0125] Exemplarily, as a specific implementation, the scheme of the application is implemented as follows: in the control system of a petroleum chemical production process, the process logic path includes two parallel branches of reaction kettle temperature regulation and feed flow control; the first intelligent agent identifies the temperature sensor signal and the flow regulating valve state as shared control resources by analyzing the topological structure of the process logic path, and locates the data acquisition point as a potential critical section; then, the timing constraint rule is defined to require that the temperature regulation branch must be executed before the feed flow control branch, and the execution time interval must meet a specific window range; based on the rule, abnormal timing test sequences are generated to make the feed flow control branch execute first to violate the mutual exclusion access constraint, and normal timing test sequences that comply with the rule are generated; finally, after simulation verification confirms that the sequences comply with the cause-effect relationship of the process logic, path coverage test sequences are integrated and generated.

[0126] Through the above scheme, the application can accurately trigger competitive access behavior in the potential critical section, effectively verify the behavior reliability and abnormal handling capability of the industrial control system under concurrent conditions, and fully expose possible deep defects caused by timing conflicts.

[0127] In practical applications, in some embodiments of the application described above, a second intelligent agent is proposed to generate boundary value test data sets covering the boundary conditions of each industrial control variable. However, in the implementation process, due to the complex process logic dependency relationship between industrial control variables, independent boundary value testing of a single variable may result in test data generated containing invalid combinations that violate system constraints. For example, when multiple variables are affected by coupling constraints, testing the boundary values of each variable individually cannot reflect the mutual restriction between variables in actual operation, so that the test case cannot effectively verify the behavior of the industrial control system under real boundary scenarios, thereby reducing the sufficiency and reliability of the test.

[0128] To this end, the application further proposes that, in an embodiment, the second intelligent agent comprises a boundary analysis layer, a correlation analysis layer, and a boundary coupling layer, and step S40 comprises:

[0129] S41: the boundary analysis layer acquires the data type and value range of each industrial control variable in the state space, and generates boundary value test data for each industrial control variable, the boundary value test data comprising a minimum value, a value slightly higher than the minimum value, a normal value, a value slightly lower than the maximum value, and a maximum value;

[0130] In this embodiment, the boundary analysis layer refers to a basic processing unit layer for performing single-variable boundary value extraction, which can be implemented based on a rule engine or a statistical distribution analysis algorithm, and the purpose is to independently generate basic boundary test data for each industrial control variable to ensure coverage of the variable value range endpoints; the data type and value range are basic definitions of the industrial control variable, which specify what the industrial control variable can be and what values it can take; among them, the data type defines the type and format of the information carried by the industrial control variable; the value range defines the set of valid values allowed for the industrial control variable under its data type, which explicitly defines the operating boundary of the industrial control system, for example, a floating-point pressure value variable may be designed to have a value range of [0.5, 10.0] MPa, i.e. values below 0.5 or above 10.0 are likely to cause an exception; the boundary value test data refers to test input values selected near the value range boundary of the industrial control variable, and the core is that the program is most likely to have errors at the boundary values.

[0131] Further, the data type comprises:

[0132] Boolean type: representing the on-off state, such as the emergency stop button state, with only true (1) / false (0) values;

[0133] Integer type: representing discrete quantities or states, such as conveyor speed gears, with a value range of 1, 2, 3, 4, 5;

[0134] Floating-point type: representing continuous physical quantities, such as reactor temperature, with a value range of 0.0~200.0 degrees Celsius;

[0135] Enumeration type: representing a limited number of predefined states, such as device operating modes, with values such as manual, automatic, and stop.

[0136] S42: the correlation analysis layer identifies a variable group with constraint correlation based on the dependency relationship between industrial control variables, constructs a joint valid domain corresponding to the variable group, and calculates the valid domain boundary of the joint valid domain;

[0137] In the embodiment, the correlation analysis layer refers to a logical processing module layer for identifying the process constraint relationship between variables, which can be implemented by using a constraint propagation algorithm or a graph theory analysis technique, and aims to accurately locate the variable group subject to the industrial control system logic rule and determine the feasible value range thereof; the constraint correlation refers to the mutually constrained and dependent relationship between multiple industrial control variables, generally, the constraint correlation is not a simple data flow, but is determined by the control logic or process safety requirement, for example, there is a constraint correlation between variable A (reactor pressure) and variable B (safety valve opening degree): when A is greater than 10 MPa, B must be greater than 50%, and such correlation causes the values of the variables not to be independent; the variable group refers to a set of industrial control variables identified by the correlation analysis layer, which have constraint correlations therebetween, and since the values are mutually influenced, the variables in the variable group cannot be tested at the boundary alone; the joint effective domain refers to the feasible value space under the joint action of multiple industrial control variables subject to the process logic rule, which can be expressed as a connected region in a multi-dimensional parameter space, and aims to accurately define the effective interaction range of the variable group in the operation of the industrial control system; the effective domain boundary refers to the critical point set of the joint effective domain, that is, the boundary of the joint effective domain, which can be determined by using a numerical optimization method or a geometric boundary extraction algorithm, and aims to identify the key test points at which the behavior of the industrial control system can be mutated.

[0138] For example, the range of variable A is [0, 100], the range of variable B is [0, 200], but the constraint is that A+B is less than or equal to 150, then { (A, B) | A∈[0, 100], B∈[0, 200], and A+B is less than or equal to 150} is the joint effective domain of variable A and variable B, and the straight line A+B=150 is a key effective domain boundary of the joint effective domain.

[0139] S43: The boundary coupling layer generates coupling test data covering the effective domain boundary based on the effective domain boundary, and merges the boundary value test data and the coupling test data to generate a boundary value test data set.

[0140] In the embodiment, the boundary coupling layer refers to a fusion processing unit layer for integrating single-variable and multi-variable boundary data, which can be implemented by using a data mapping matching or rule synthesis mechanism, and aims to eliminate invalid test combinations that violate the constraints of the industrial control system; the coupling test data refers to test data for testing the variable group generated by the boundary coupling layer, and the coupling test data is a combination of values, which is characterized in that at least one constraint condition of the variable group reaches a critical value, that is, is located on the effective domain boundary, for example, for the constraint A+B is less than or equal to 150, the coupling test data will be a combination of (A=75, B=75), rather than a boundary value of a single variable.

[0141] Specifically, first, the independent boundary values of each industrial control variable are obtained by the boundary analysis layer to provide basic data support for testing; the correlation analysis layer converts the process logic rules into mathematical constraint expressions based on the causal dependence network in the system dependence model, solves the common feasible space of variable values as the joint effective domain, and calculates the boundary point set of the effective domain; the boundary coupling layer generates targeted coupling test data according to the effective domain boundary, logically integrates these test data and the single-variable boundary data generated by the boundary analysis layer, and ensures that the test data covers both single-variable boundary characteristics and strictly complies with the overall process constraints of the industrial control system through the above hierarchical collaborative mechanism, effectively reducing the invalid test data caused by variable coupling, thereby constructing a complete test data set reflecting the real running boundary.

[0142] Exemplarily, as a specific implementation, the scheme of the application is implemented as follows: in a chemical process control system, for the two variables of the reaction kettle temperature control variable and the feed flow control variable that are associated by process constraints, the boundary analysis layer first generates-10℃, -9.9℃, 0℃, 99.9℃, 100℃ boundary value test data for the temperature variable, and 0L / min, 0.1L / min, 50L / min, 99.9L / min, 100L / min boundary value test data for the flow variable; the correlation analysis layer identifies that there is a process constraint relationship between temperature and flow that “when the temperature exceeds 50℃, the flow must be greater than 10L / min”, constructs the temperature-flow joint effective domain through a constraint solver, and calculates the boundary point set thereof; the boundary coupling layer generates coupling test data such as (50.1℃, 10.1L / min) and (49.9℃, 9.9L / min), and combines these data with the single-variable boundary data to form a complete boundary value test data set for verifying the behavior response of the industrial control system under the parameter boundary interaction scenario.

[0143] Through the above technical scheme, the application effectively solves the invalid boundary test data problem caused by variable coupling in the industrial control system, ensures that the generated test case set can accurately cover the running state of the industrial control system under real boundary conditions, significantly improves the verification ability of the test process to the parameter boundary interaction scenario, and makes the test result truly reflect the robustness performance of the industrial control system under complex boundary conditions.

[0144] In practical applications, in some embodiments of the present application, a correlation analysis layer is proposed to identify constraint correlation variable groups and construct joint valid domains. However, in this process, due to the highly complex dependency relationship between industrial control variables and the variety of constraint rules, there may be a lack of formal transformation mechanism and accurate solving method for control rules, resulting in the construction of variable group joint valid domains depending on artificial experience or simple rules, and the problem of being unable to accurately capture variable coupling boundaries; specifically, the control rules in the process logic path are difficult to be systematically transformed into computable constraint expressions, there are blind spots in solving the variable value common space, the boundary point set calculation is incomplete, so that the boundary value test data set cannot cover the key critical points of the constraint interaction between variables, thereby missing potential defects in the parameter boundary coupling scenario, affecting the depth and reliability of the test.

[0145] To this end, the present application further proposes that, in an embodiment, step S42 comprises:

[0146] S421: based on the dependency relationship between industrial control variables, transforming the control rules corresponding to the process logic path of the industrial control variables into constraint expressions;

[0147] In the present embodiment, the control rules corresponding to the process logic path refer to the prerequisites, state transition conditions and safety interlocking logic embedded in a specific process flow, which are used to ensure that the process flow can be correctly executed, and specifically refer to the specific control logic bound to the path node (process step), rather than generally referring to all rules of the entire industrial control system; the constraint expression refers to formalizing the control rules in the process logic path into a mathematical expression, which can be implemented in SMT-LIB format or linear inequality system, and the purpose is to accurately quantify the non-formalized process logic into constraint conditions that can be automatically reasoned and calculated by a computer, for example: transforming the textual process requirement of "when the pressure exceeds 10 MPa, the safety valve must be opened" into: pressure greater than 10.0→safety valve opening degree equal to 100.

[0148] S422: inputting the value range of the variable group with constraint correlation and its corresponding constraint expression into a pre-set constraint solver, solving the variable value common space, and defining the variable value common space as the joint valid domain corresponding to the variable group;

[0149] In the embodiment, the constraint solver refers to an automated solving tool, such as a mathematical tool or a software library, which can be implemented by using a Z3 solver or a CPLEX optimization engine, and aims to automatically calculate all variable value combinations that satisfy all constraints based on a set of variables, value ranges of the variables, and constraint expressions that the set of variables must satisfy; the variable value common space refers to a calculation result of the constraint solver, and specifically refers to a set of all legal combinations of variable value combinations that do not violate any process rule after considering the mutual constraint relationship between the variables. The variable value common space is usually much smaller than a simple value range Cartesian product without considering constraints. In the embodiment, the joint effective domain is the variable value common space.

[0150] S423: Calculate a boundary point set of the joint effective domain by using a preset search algorithm, and define the boundary point set as an effective domain boundary of the joint effective domain.

[0151] In the embodiment, the search algorithm refers to a calculation method for identifying the boundary of the joint effective domain, which can be implemented by using a grid search algorithm or a genetic algorithm, and aims to efficiently locate a key point set at the junction of the feasible domain and the infeasible domain; the boundary point set refers to an output of the search algorithm, and specifically refers to a set of a series of representative points on the boundary of the joint effective domain. The point set is most likely to discover deep logic defects of the industrial control system under multiple constraints through testing. In the embodiment, the effective domain boundary of the joint effective domain is the boundary point set.

[0152] Specifically, first, the control rules corresponding to the process logic path of the industrial control variables are systematically converted into constraint expressions, and the structured information of the dependency relationship is used to accurately quantify the constraint relationship; then, the value range of the variable group and the constraint expression are input into the constraint solver, and all feasible solutions are automatically solved to form a continuous region as the joint effective domain, so as to ensure that the domain strictly reflects the real feasible range of the constraint interaction between the variables; finally, the boundary point set is calculated by using a preset search algorithm for the geometric characteristics of the joint effective domain, and the mutation position of the parameter boundary coupling is identified. Through the sequential execution of the above steps, complete coverage of the variable coupling boundary is achieved.

[0153] Exemplarily, as a specific implementation, the scheme of the application is implemented as follows: in a chemical process control system, for the constraint relationship between a temperature variable and a pressure variable, the control rules in the process logic path are converted into linear inequality constraint expressions; the value range of the temperature variable and the value range of the pressure variable and the corresponding constraint expressions are input into a Z3 constraint solver, and the variable value common space is solved as the joint effective domain; a grid search algorithm is used to calculate the boundary point set of the joint effective domain as the effective domain boundary, so as to generate test data covering the boundary.

[0154] Through the above scheme, the application ensures that the boundary value test data can accurately cover the key critical points of constraint interaction between variables, effectively detects potential defects in the parameter boundary coupling scene, and improves the detection capability of test cases for deep defects.

[0155] In actual application, in some embodiments of the application, the third intelligent agent generates abnormal test scene information simulating the failure of the dependency relationship, however, in the implementation process, there may be a problem that only a basic single-point failure scene is generated without fully considering the propagation path and cascade effect of failure in the dependency relationship, resulting in that the test case cannot cover the system-level abnormal behavior and it is difficult to find deep defects caused by multi-variable coupling.

[0156] In this regard, the application further proposes that in an embodiment, step S50 includes:

[0157] S51: identifying a key node based on the dependency relationship between industrial control variables, and generating an abnormal test scene simulating failure of the key node for the identified key node, the abnormal test scene including a single-point failure scene and a composite failure scene;

[0158] In this embodiment, the key node refers to a node that has a significant impact on system function, safety or stability in the dependency relationship network composed of industrial control variables, which can be identified by an algorithm based on node degree, betweenness centrality or eigenvector centrality, the purpose being to accurately locate the system vulnerability and provide a targeted basis for generating high-value test scenes; generally, the key node includes a node with high connectivity, a functional core node, and a weak reliability node, etc.; the abnormal test scene refers to a complete test context description for simulating the failure or abnormal condition of a specific component in the industrial control system, which generally specifies how to make the industrial control system enter an abnormal state and what is expected to happen in the state, wherein the abnormal test scene includes a single-point failure scene and a composite failure scene; the single-point failure scene refers to a test scene simulating a specific failure of a single key node, which is used to verify the isolation and processing capability of the industrial control system to local faults, for example, simulating “temperature sensor reading stuck at maximum value” or “water pump start signal abnormal disconnection”; the composite failure scene refers to an abnormal mode in which multiple industrial control variables fail simultaneously or sequentially, which can be implemented by a failure combination method based on time correlation or functional coupling, the purpose being to cover complex scenes of multi-node cooperative failure and reflect multi-variable abnormal combinations in the actual operation of the industrial control system.

[0159] S52: identifying the propagation path of failure in the dependency relationship based on the single-point failure scene, and analyzing the criticality and impact range of the propagation path;

[0160] In this embodiment, the propagation path of failure refers to one or more chain paths along which the failure of a node (single-point failure) in the dependency network is transmitted to subsequent nodes after the failure of the node, and the analysis of the propagation path can predict the global impact of local failure; further, the propagation path analysis refers to tracking the diffusion trajectory of failure in the dependency network and quantifying its impact, which can be achieved by using a graph traversal algorithm combined with impact factor calculation, the purpose of which is to focus on high-risk areas and avoid invalid verification; the criticality and impact range analysis refers to the damage assessment of the propagation path of failure, wherein the criticality analysis refers to the importance of the nodes on the propagation path, the more critical nodes contained in the path, the higher the criticality; the impact range analysis refers to the assessment of the system function range that the failure can spread along the path, the more subsystems or functional modules affected, the greater the impact range.

[0161] S53: based on the analysis result of the propagation path, combining single-point failure scenarios with causal correlation to generate a cascading failure scenario simulating failure diffusion;

[0162] In this embodiment, the causal correlation refers to the causal relationship between the failures of the nodes before and after the failure propagation path, that is, the failure of the previous node is the direct cause of the failure of the subsequent node, and the causal correlation is the logical basis for combining multiple single-point failure scenarios; the cascading failure scenario refers to a chain reaction simulating the diffusion of failure along the causal chain, that is, multiple single-point failure scenarios with causal correlation are connected in time sequence and causal logic, which can be achieved by using a failure combination strategy based on the criticality sorting of the propagation path, the purpose of which is to capture the behavior boundary of the system under continuous failure, and the cascading failure scenario simulates the process of how an initial failure expands step by step and eventually leads to system function loss or accident.

[0163] S54: encapsulating the single-point failure scenario and the cascading failure scenario as abnormal test scenario information.

[0164] In this embodiment, the abnormal test scenario information is a standardized encapsulation product of the generated single-point failure scenario and the cascading failure scenario, which describes the conditions that make the industrial control system deviate from normal work, that is, simulates the failure of dependency relationship, including but not limited to simulating sensor failure, actuator sticking, signal interference, etc., for testing the fault tolerance and robustness of the system.

[0165] Specifically, first, key nodes are identified based on the dependency relationship between industrial control variables, and the failure propagation hub is located using the structured information of the system dependency model; then, single-point failure and composite failure scenarios are generated for the key nodes, covering a continuous spectrum from isolated anomalies to complex coupled failures; then, the propagation path of single-point failure is identified and keyness and impact range are analyzed to quantify the importance of the path and the scope of failure spread; on this basis, single-point failure scenarios with causal correlation are combined to generate cascading failure scenarios to simulate the chain reaction in the real industrial environment; finally, single-point failure and cascading failure scenarios are packaged as unified abnormal test scenario information to form a structured input. The systematic analysis of failure propagation mechanism in the above steps of the scheme realizes the comprehensive coverage of system-level abnormal behavior.

[0166] Exemplarily, as a preferred embodiment, the scheme of the application is implemented as follows: in a certain chemical process control system, the key node is identified as the temperature sensor of the reaction kettle; the single-point failure scenario simulates the interruption of the sensor data, and the composite failure scenario simulates the simultaneous failure of the temperature sensor and the pressure sensor; based on the single-point failure scenario, the failure propagation path is identified as temperature anomaly→cooling system failure→reaction out of control, and the keyness and impact range of the path are analyzed; the temperature sensor failure and the cooling system control signal failure are combined to generate a cascading failure scenario; finally, these scenarios are packaged as abnormal test scenario information for verifying the behavior of the system under cascading failure.

[0167] Through the above scheme, the application can cover system-level abnormal behavior, effectively find deep defects caused by multi-variable coupling, and significantly improve the verification ability of complex abnormal conditions.

[0168] In practical applications, in some embodiments of the application described above, abnormal test scenarios are generated to simulate the failure of the dependency relationship of industrial control variables, however, in the implementation process, the generation of composite failure scenarios may have the problem that due to the lack of a systematic construction mechanism for the common cause failure node group, it is difficult to effectively simulate the simultaneous failure of multiple key nodes caused by a common cause in the real industrial environment, making it difficult for the test case to cover the deep behavior of the system under multiple abnormal coupling conditions, thereby affecting the comprehensiveness of the test and the full verification of the robustness of the system.

[0169] In this regard, the application further proposes that, in an embodiment, step S51 comprises:

[0170] S511: identifying key nodes based on the dependency relationship between industrial control variables, and constructing a common cause failure node group based on the identified key nodes;

[0171] In the embodiment, the dependency relationship between the industrial control variables refers to a causal association or an influence relationship between the control variables in the industrial control system, which can be implemented by using a causal diagram model or a Bayesian network, and the purpose is to accurately depict the logical constraints and failure propagation paths between the variables; the key node refers to an industrial control variable that plays a decisive or key role in the stability of the system in the dependency relationship, which can be identified by using a node centrality algorithm or a fault tree analysis method, and the purpose is to locate the weak link that easily triggers a chain reaction in the industrial control system; and the common cause failure node group refers to a set of industrial control variables that can fail synchronously due to sharing upstream resources or common environmental factors. These nodes themselves can not be directly associated in function, but they are all affected by a common upstream event or parent node. The common cause failure node group can be constructed based on the topology structure of the failure propagation path or historical failure data clustering analysis, and the purpose is to capture multiple failure events triggered by a single root cause in a real industrial environment.

[0172] S512: generating a composite failure scenario simulating simultaneous failure of multiple key nodes for the common cause failure node group.

[0173] In the embodiment, the composite failure scenario can be understood as a test condition simulating simultaneous failure of multiple key nodes, specifically, a test scenario simulating occurrence of a common root cause, thereby causing simultaneous or near-simultaneous failure of multiple key nodes in the common cause failure node group. The composite failure scenario can be generated by using a failure mode and effects analysis framework or a discrete event simulation technology, and the purpose is to verify the fault tolerance capability and recovery mechanism of the system under concurrent abnormal conditions.

[0174] Specifically, first, the key nodes are accurately identified based on the dependency relationship between the industrial control variables. This process avoids the subjectivity of empirical screening by analyzing the connection strength and influence range of the variables in the network; then, the common cause failure node group is constructed based on the identified key nodes. This step traces the shared upstream trigger source in the failure propagation path, and nodes with close logical association are grouped into the same group, thereby ensuring that the failure scenario conforms to the actual operation risk of the industrial control system; finally, the composite failure scenario is generated for the common cause failure node group. This step converts the node group into an executable test instruction sequence, directly triggering the response logic of the industrial control system to concurrent failure. The above steps expand the isolated single-point failure test to multiple failure verification with causal association by using the structured information provided by the dependency relationship model, thereby systematically covering abnormal coupling scenarios that are difficult to reach by traditional methods.

[0175] Exemplarily, as a specific implementation, the scheme of the application is implemented as follows: in a chemical process control system, the dependency relationship between industrial control variables is constructed into a directed acyclic graph by a causal discovery algorithm, wherein a reactor temperature sensor and a pressure regulating valve are identified as key nodes; based on failure propagation path analysis of the key nodes, it is found that both are affected by a cooling water flow control module, thereby constructing a common cause failure node group containing the temperature sensor and the pressure regulating valve; subsequently, the common cause failure node group is configured to inject a composite failure scenario of temperature signal drift and pressure regulating instruction loss at the same time, for verifying the safety interlocking mechanism of the control system under the cooling water failure condition.

[0176] Further, in this embodiment, the key node identification can specifically adopt a node importance evaluation unit based on the PageRank algorithm, the common cause failure node group construction can be specifically implemented as a clustering analysis unit based on the fault propagation tree, and the composite failure scenario generation can be specifically configured as a test instruction arranger supporting multivariate synchronous disturbance.

[0177] Through the above technical scheme, the application effectively establishes a systematic generation mechanism of composite failure scenarios, significantly improves the coverage ability of test cases for multiple abnormal coupling conditions of industrial control systems, enables the test process to accurately simulate concurrent failure events caused by common causes, and fully verifies the behavior logic and robustness of industrial control systems under complex abnormal working conditions, thereby solving the technical problem that traditional test methods are difficult to detect deep hidden defects.

[0178] In practical applications, in some embodiments of the application described above, a test case set is generated based on path coverage test sequences, boundary value test data sets, and abnormal test scenario information to cover the behavior of the industrial control system. However, directly combining these test elements in this process may cause logical conflicts between test sequences (for example, boundary values and path logic are incompatible), the generation of redundant test cases (repeatedly covering the same scenario), and the inability to dynamically adjust the execution order according to the test target type, thereby reducing test efficiency, wasting resources, and affecting the priority coverage of key scenarios.

[0179] In this regard, the application further proposes that in an embodiment, step S60 includes:

[0180] S61: identifying the boundary values in the boundary value test data set and filling them as input data into the corresponding variables in the path coverage test sequence to generate a basic test sequence;

[0181] In the embodiment, identifying the boundary values in the boundary value test dataset refers to extracting the boundary condition values of the industrial control variables from the test dataset, which can be achieved by numerical range scanning or rule matching, with the purpose of ensuring that key boundary conditions are included in the test sequence; the basic test sequence refers to the specific test steps formed after filling the boundary value test data generated by the second agent into the corresponding variables of the path coverage test sequence generated by the first agent, which verifies whether the behavior of the industrial control system when processing boundary parameters under normal operation flow is correct, which is a combination of functional correctness and boundary robustness.

[0182] S62: Identify the abnormal mode defined in the abnormal test scenario information and use it as a mutation rule to generate a strengthened test sequence based on the mutation rule;

[0183] In the embodiment, the abnormal mode refers to the formal description of system component failure or abnormal condition defined by the third agent in the abnormal test scenario information, which is specifically defined as how to make the system error, for example: "forcibly set the reading of pressure sensor P101 to a large invalid value at time t"; further, identifying the abnormal mode defined in the abnormal test scenario information refers to parsing the specific failure mode description from the abnormal scenario information, which can be achieved by pattern matching or semantic analysis techniques, with the purpose of converting abstract abnormal scenarios into executable mutation rules; further, the mutation rule refers to the conversion logic of applying the abnormal mode to the normal test sequence, which defines the specific rules of how to convert the normal test steps into abnormal test steps, for example, the mutation rule can be: "find all'read' operations on 'pressure sensor P101' and replace the return value with the value defined in the abnormal mode"; the strengthened test sequence refers to the test sequence generated by applying the abnormal mode as a mutation rule to the basic test sequence or other normal sequences, which contains artificially injected faults or abnormal conditions, the purpose of which is to actively attack the industrial control system to verify its fault tolerance and safety, for example, a normal "start pump" sequence is strengthened to "inject an 'pressure sensor failure' abnormality before starting the pump, then observe whether the system's alarm and shutdown logic is correct".

[0184] S63: Perform conflict detection and redundancy elimination on the generated basic test sequence and strengthened test sequence, and set execution priorities based on the test target type to generate a test case set suitable for the target industrial control system.

[0185] In the embodiment, the conflict detection refers to an analysis process of checking whether there is an irreconcilable contradiction between all the test sequences when they are combined, for example, detecting whether there is a conflict between two test sequences on the initial state setting of the same system variable, which will cause the test to be unable to be continuously executed; the redundancy elimination refers to identifying and combining those test sequences with the same input data, execution path and expected result, and only keeping one or several of them, the purpose of which is to optimize the test set and reduce repetitive work, thereby significantly improving the test efficiency; further, the conflict detection and redundancy elimination on the generated basic test sequence and the enhanced test sequence specifically refer to checking the compatibility between the sequences by a logic verification algorithm and removing the repeated test cases, which can be realized by using a constraint satisfaction problem solving or a graph matching algorithm, the purpose of which is to ensure the simplification and effectiveness of the test case set; the execution priority refers to the execution order weight assigned to each test case in the optimized test case set, the setting of the priority is directly based on the test target type, for example, if the test target is "fast regression", the basic test sequence has the highest priority; if the target is "safety audit", the enhanced test sequence has the highest priority; further, the setting of the execution priority based on the test target type can be understood as dynamically adjusting the execution order of the test sequence according to the nature of the test target, which can be realized by using a priority queue or a scheduling algorithm, the purpose of which is to optimize the allocation of test resources and ensure that the key scenarios are covered in priority.

[0186] Specifically, the boundary value in the boundary value test data set is filled into the path coverage test sequence as input data to generate a basic test sequence, realizing the combination of boundary conditions and process paths; then the abnormal mode defined in the abnormal test scenario information is applied to the instantiated test sequence as a variation rule to generate an enhanced test sequence, realizing the dynamic injection of abnormal scenarios; finally, the basic test sequence and the enhanced test sequence are subjected to conflict detection and redundancy elimination, and the execution priority is set based on the test target type, forming a complete test case optimization process. Through the above process, firstly, the instantiation verification of boundary conditions in the process logic path is ensured, then the detection ability of hidden faults is enhanced through the variation rule of abnormal mode, and finally the logical inconsistency is eliminated and the resource allocation is optimized through conflict detection and priority setting, thereby systematically solving the logical conflict, redundancy and priority adaptation problems caused by the direct combination of test elements.

[0187] Exemplarily, as a specific implementation, in testing a certain chemical process control system, first, the boundary value of the temperature sensor is identified, which is filled into the process logic path sequence to generate a basic test sequence; then, the abnormal mode of the valve fault, such as valve sticking or response delay, is identified, which is applied to the test sequence as a variation rule to generate a strengthened test sequence; finally, the conflicts between the sequences (such as the logical contradiction between the temperature boundary value and the valve state) are detected, and the key abnormal scene is preferentially executed according to the abnormal fault test target type, and the final test case set is generated.

[0188] Through the technical solution, the logical conflicts between the test sequences and the generation of redundant test cases are effectively avoided, the priority coverage of the key test scene is ensured, and the test efficiency and resource utilization are improved.

[0189] It should be understood that the size of the serial number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0190] In an embodiment, a test case generation system based on an industrial agent is provided, which corresponds to the test case generation method based on an industrial agent in the above embodiment. The test case generation system based on an industrial agent comprises:

[0191] An instruction analysis module is configured to analyze the test target type corresponding to the received test case generation instruction, and acquire the corresponding industrial data set from the target industrial control system based on the analyzed test target type;

[0192] A dependency model construction module is configured to construct a system dependency model based on the acquired industrial data set, wherein the system dependency model comprises a state space composed of industrial control variables, a dependency relationship between the industrial control variables, and a process logic path;

[0193] A test sequence generation module is configured to analyze the process logic path by a preconfigured first agent, and generate a path coverage test sequence for covering the process logic path;

[0194] A test data generation module is configured to analyze the value range of the industrial control variables in the state space by a preconfigured second agent, and generate a boundary value test data set covering the boundary conditions of each industrial control variable;

[0195] A test scene generation module is configured to analyze the dependency relationship between the industrial control variables by a preconfigured third agent, and generate abnormal test scene information simulating the failure of the dependency relationship;

[0196] The test case generation module is used to generate a set of test cases suitable for the target industrial control system based on path coverage test sequences, boundary value test datasets, and abnormal test scenario information.

[0197] Specific limitations regarding a test case generation system based on industrial intelligent agents can be found in the limitations of a test case generation method based on industrial intelligent agents described above, and will not be repeated here. Each module in the aforementioned test case generation system based on industrial intelligent agents can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0198] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A test case generation method based on industrial intelligent agents, characterized in that, Including the following steps: In response to the received test case generation instruction, the test target type corresponding to the test case generation instruction is parsed, and the corresponding industrial dataset is obtained from the target industrial control system based on the parsed test target type. The test target types include functional logic testing, boundary robustness testing, abnormal fault testing, and full-scenario coverage testing. A system dependency model is constructed based on the acquired industrial dataset. The system dependency model includes a state space composed of industrial control variables, the dependencies between these industrial control variables, and the process logic path. The construction of the system dependency model includes the following steps: Control logic information is extracted from industrial datasets, and a dependency network of industrial control variables is constructed based on the control logic information. Historical operational data is extracted from industrial datasets, and the causal direction between industrial control variables is obtained through a pre-defined causal discovery algorithm. The edges in the relevant dependency network are oriented according to the causal direction to obtain the causal dependency network, and the dependency relationship between industrial control variables and the process logic path are constructed based on the causal dependency network. The range of values ​​for industrial control variables is extracted from industrial datasets, and the state space of industrial control variables is constructed based on the range of values. The process logic path is analyzed by a pre-configured first intelligent agent to generate a path coverage test sequence for covering the process logic path; The pre-configured second agent analyzes the range of values ​​of industrial control variables in the state space and generates a boundary value test dataset covering the boundary conditions of each industrial control variable. By analyzing the dependencies between industrial control variables through a pre-configured third-party intelligent agent, information on abnormal test scenarios simulating dependency failure is generated. Generate a test case set suitable for the target industrial control system based on path coverage test sequences, boundary value test datasets, and abnormal test scenario information, including the following steps: Identify boundary values ​​in the boundary value test dataset and use them as input data to populate the corresponding variables in the path coverage test sequence to generate the basic test sequence; Identify the abnormal patterns defined in the abnormal test scenario information and use them as mutation rules to generate reinforcement test sequences based on the mutation rules; The generated basic test sequences and enhanced test sequences are subjected to conflict detection and redundancy elimination, and execution priorities are set based on the test target type to generate a test case set suitable for the target industrial control system.

2. The test case generation method based on industrial intelligent agents according to claim 1, characterized in that: The step of responding to a received test case generation instruction, parsing the test target type corresponding to the test case generation instruction, and obtaining the corresponding industrial dataset from the target industrial control system based on the parsed test target type includes the following steps: Parse the test case generation instructions and identify the test target identifier, which includes instruction keywords and configuration template identifiers; The identified test target identifiers are matched with predefined test target types; Based on the matched test target type, the category of industrial data to be acquired is determined from the preset type-data mapping relationship; Obtain the corresponding industrial dataset based on the determined industrial data category.

3. The test case generation method based on industrial intelligent agents according to claim 1, characterized in that: The step of analyzing the process logic path through a pre-configured first intelligent agent and generating a path coverage test sequence to cover the process logic path includes the following steps: Identify whether there are parallel execution branches in the process logic path. If so, analyze the industrial control variables associated with the parallel execution branches, set the industrial control variables associated with at least two parallel execution branches as shared control resources, and locate the access point of the shared control resources as potential critical sections. Define timing constraint rules for parallel execution branches that are associated with shared control resources. The timing constraint rules include execution order constraints, time window constraints, and mutual exclusion access constraints. An abnormal timing test sequence and a normal timing test sequence are generated based on timing constraint rules. The abnormal timing test sequence is configured to violate the mutual exclusion access constraint to trigger competitive access to the potential critical section. Logical feasibility is verified for abnormal timing test sequences and normal timing test sequences, and path coverage test sequences are generated based on the verification results.

4. The test case generation method based on industrial intelligent agents according to claim 1, characterized in that: The second intelligent agent includes a boundary analysis layer, a correlation analysis layer, and a boundary coupling layer. The step of analyzing the value range of industrial control variables in the state space through a pre-configured second intelligent agent to generate a boundary value test dataset covering the boundary conditions of each industrial control variable includes the following steps: The boundary analysis layer obtains the data type and value range of each industrial control variable in the state space, and generates boundary value test data for each industrial control variable. The boundary value test data includes the minimum value, slightly higher than the minimum value, normal value, slightly lower than the maximum value, and maximum value. The correlation analysis layer identifies groups of variables with constrained correlations based on the dependencies between industrial control variables, constructs the joint effective domain corresponding to the variable groups, and calculates the effective domain boundary of the joint effective domain. The boundary coupling layer generates coupling test data that covers the effective domain boundary based on the effective domain boundary, and merges the boundary value test data with the coupling test data to generate the boundary value test dataset.

5. The test case generation method based on industrial intelligent agents according to claim 4, characterized in that: The correlation analysis layer identifies groups of variables with constrained correlations based on the dependencies between industrial control variables, constructs the joint effective domain corresponding to the variable groups, and calculates the effective domain boundary of the joint effective domain, including the following steps: Based on the dependencies between industrial control variables, the control rules corresponding to the process logic paths of industrial control variables are transformed into constraint expressions. Input the range of values ​​of the variable group with constraint associations and its corresponding constraint expression into the preset constraint solver to solve the common space of variable values, and define the common space of variable values ​​as the joint effective domain corresponding to the variable group; The set of boundary points of the joint effective domain is calculated using a pre-defined search algorithm, and the set of boundary points is defined as the effective domain boundary of the joint effective domain.

6. The test case generation method based on industrial intelligent agents according to claim 1, characterized in that: The step of analyzing the dependencies between industrial control variables through a pre-configured third-party intelligent agent and generating abnormal test scenario information simulating dependency failure includes the following steps: Based on the dependencies between industrial control variables, key nodes are identified, and abnormal test scenarios simulating the failure of the identified key nodes are generated. The abnormal test scenarios include single-point failure scenarios and compound failure scenarios. Based on the single-point failure scenario, identify the propagation path of the failure in the dependency relationship, and analyze the criticality and impact range of the propagation path; Based on the analysis results of the propagation path, single-point failure scenarios with causal correlation are combined to generate cascading failure scenarios that simulate the spread of failure. Single-point failure scenarios and cascading failure scenarios are encapsulated into abnormal test scenario information.

7. The test case generation method based on industrial intelligent agents according to claim 6, characterized in that: The process of identifying key nodes based on the dependencies between industrial control variables and generating abnormal test scenarios simulating the failure of these key nodes, including single-point failure scenarios and compound failure scenarios, includes the following steps: Key nodes are identified based on the dependencies between industrial control variables, and a common cause failure node group is constructed based on the identified key nodes. Generate a composite failure scenario simulating the simultaneous failure of multiple critical nodes for a group of nodes with common causes of failure.

8. A test case generation system based on industrial intelligent agents, used to execute the steps of the test case generation method based on industrial intelligent agents as described in any one of claims 1-7, characterized in that, include: The instruction parsing module is used to respond to the received test case generation instruction, parse the test target type corresponding to the test case generation instruction, and obtain the corresponding industrial dataset from the target industrial control system based on the parsed test target type. The dependency model building module is used to build a system dependency model based on the acquired industrial dataset. The system dependency model includes a state space composed of industrial control variables, the dependency relationships between industrial control variables, and the process logic path. The test sequence generation module is used to analyze the process logic path through a pre-configured first intelligent agent and generate a path coverage test sequence to cover the process logic path. The test data generation module is used to analyze the value range of industrial control variables in the state space through a pre-configured second intelligent agent and generate a boundary value test dataset covering the boundary conditions of each industrial control variable. The test scenario generation module is used to analyze the dependencies between industrial control variables through a pre-configured third-party intelligent agent and generate abnormal test scenario information that simulates the failure of dependencies. The test case generation module is used to generate a set of test cases suitable for the target industrial control system based on path coverage test sequences, boundary value test datasets, and abnormal test scenario information.

Citation Information

Patent Citations

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

    CN110597711A

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

    CN118427079A