Test case generation method and system based on industrial agent
By constructing a system dependency model and utilizing multi-agent analysis based on an industrial intelligent agent-based test case generation method, the problems of low efficiency and insufficient coverage of existing testing methods are solved, realizing automated testing of industrial control systems and improving the reliability and consistency of testing.
Patent Information
- Application Number
- CN202511993359.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-12-26
AI Technical Summary
Existing industrial control system testing methods rely on manual design, which is inefficient and lacks dynamic analysis of the overall behavior logic of the system and the complex interactions between control variables. This results in insufficient test case coverage, making it difficult to verify complex scenarios such as parameter boundaries, abnormal sequences, and concurrent conditions, thus affecting system reliability and security.
An industrial 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.
It automates test case generation, improving generation efficiency and coverage, especially in terms of coverage of boundary conditions, abnormal scenarios, and concurrent paths, thereby enhancing the reliability and consistency of testing.
Smart Images

Figure CN121386734A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of industrial control system testing, and 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 raised stringent requirements for 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, the manual design process is time-consuming and inefficient, which is difficult to match the rapid iteration development rhythm of modern industrial software, resulting in a serious lag of the testing 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 critically, 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 relationships and dynamic interaction characteristics among 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 regions, abnormal event continuous triggering sequences, and concurrent execution conditions is severely 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 achieved by the following technical scheme: A test case generation method based on an industrial agent, comprising the steps of: In response to the received test case generation instruction, parsing the test target type corresponding to the test case generation instruction, and based on the parsed test target type, acquiring the corresponding industrial data set from the target industrial control system; Based on the acquired industrial data set, a system dependency model is constructed, which includes a state space composed of industrial control variables, dependency relationships among industrial control variables, and process logic paths; analyzing the process logic path by a pre-configured first agent to generate a path coverage test sequence for covering the process logic path; analyzing the value range of the industrial control variables in the state space by a pre-configured second agent to generate a boundary value test dataset covering the boundary conditions of each industrial control variable; analyzing the dependency relationship between the industrial control variables by a pre-configured third agent to generate abnormal test scenario information simulating failure of the dependency relationship; generating a test case set applicable to the target industrial control system based on the path coverage test sequence, the boundary value test dataset, and the abnormal test scenario information.
[0006] In a preferred example, the application can be further configured to: in response to the received test case generation instruction, parsing the test target type corresponding to the test case generation instruction, and based on the parsed test target type, acquiring the corresponding industrial dataset from the target industrial control system, including the steps of: parsing the test case generation instruction to identify a test target identifier, the test target identifier including an instruction keyword and a configuration template identifier; matching the identified test target identifier with a pre-defined test target type, the test target type including functional logic testing, boundary robustness testing, abnormal fault testing, and full-scenario coverage testing; based on the matched test target type, determining the industrial data category to be acquired from the pre-set type-data mapping relationship; acquiring the corresponding industrial dataset according to the determined industrial data category.
[0007] In a preferred example, the application can be further configured to: based on the acquired industrial dataset, constructing a system dependency model, the system dependency model including a state space composed of industrial control variables, a dependency relationship between the industrial control variables, and a process logic path, including the steps of: extracting control logic information based on the industrial dataset, and constructing a related dependency network of the industrial control variables according to the control logic information; extracting historical operation data based on the industrial dataset, and acquiring the causal direction between the industrial control variables through a pre-set causal discovery algorithm; directing the edges in the related dependency network according to the causal direction to obtain a causal dependency network, and constructing the dependency relationship between the industrial control variables and the process logic path based on the causal dependency network; extracting the value range of the industrial control variables based on the industrial dataset, and constructing the state space of the industrial control variables based on the value range.
[0008] The application can be further configured in a preferred example that the step of analyzing the process logic path by the pre-configured first intelligent agent to generate the path coverage test sequence covering the process logic path comprises the steps of: 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; defining timing constraint rules for the parallel execution branches associated with the shared control resources, the timing constraint rules comprising execution order constraints, time window constraints, and mutual exclusion access constraints; generating abnormal timing test sequences and normal timing test sequences based on the timing constraint rules, wherein the abnormal timing test sequences are configured to violate the mutual exclusion access constraints to trigger competitive access to the potential critical section; performing logical feasibility verification on the abnormal timing test sequences and the normal timing test sequences, and integrating the path coverage test sequence based on the verification results.
[0009] The application can be further configured in a preferred example that the second intelligent agent comprises a boundary analysis layer, an association analysis layer, and a boundary coupling layer, and the step of analyzing the value range of the industrial control variables in the state space by the pre-configured second intelligent agent to generate the boundary value test data set covering the boundary conditions of each industrial control variable comprises the steps of: 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 comprising minimum value, slightly higher than minimum value, normal value, slightly lower than maximum value, and maximum value; the association analysis layer identifies variable groups with constraint associations based on the dependency relationship between the 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 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 the boundary value test data set.
[0010] The application can be further configured in a preferred example that the step of the association analysis layer identifying variable groups with constraint associations based on the dependency relationship between the industrial control variables, constructing the joint effective domain corresponding to the variable groups, and calculating the effective domain boundary of the joint effective domain comprises the steps of: based on the dependency relationship between the industrial control variables, converting the control rules corresponding to the process logic path of the industrial control variables into constraint expressions; Input the value range of the variable group with the constraint association and its corresponding constraint expression into a pre-configured constraint solver, solve the variable value common space, and define the variable value common space as the corresponding joint effective domain of the variable group; Calculate the boundary point set of the joint effective domain through a pre-configured search algorithm, and define the boundary point set as the effective domain boundary of the joint effective domain.
[0011] In a preferred example, the application can be further configured to: the step of generating abnormal test scenario information simulating the failure of the simulated dependency relationship by the pre-configured third intelligent agent analyzing the dependency relationship between the industrial control variables, comprising the steps of: Identify the key nodes based on the dependency relationship between the industrial control variables, and generate abnormal test scenarios simulating the failure of the key nodes, the abnormal test scenarios including single-point failure scenarios and composite 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 result of the propagation path, combine the single-point failure scenarios with causal association to generate a cascading failure scenario simulating failure diffusion; Encapsulate the single-point failure scenario and the cascading failure scenario as abnormal test scenario information.
[0012] In a preferred example, the application can be further configured to: the step of identifying key nodes based on the dependency relationship between industrial control variables and generating abnormal test scenarios simulating the failure of the key nodes, the abnormal test scenarios including single-point failure scenarios and composite failure scenarios, comprising the steps of: Identify the key nodes based on the dependency relationship between the industrial control variables, and construct a common cause failure node group based on the identified key nodes; Generate a composite failure scenario simulating the simultaneous failure of multiple key nodes for the common cause failure node group.
[0013] 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, comprising the steps of: Identify the 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; 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; The generated basic test sequence and the reinforced test sequence 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 applicable to the target industrial control system.
[0014] The second application purpose is achieved by the following technical scheme. The test case generation system based on industrial agents comprises: The instruction analysis module is configured to analyze the test target type corresponding to the received test case generation instruction, and acquire a corresponding industrial data set from the target industrial control system based on the analyzed test target type. The 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, dependency relationships between the industrial control variables, and a process logic path. The test sequence generation module is configured to analyze the process logic path by using a preconfigured first agent, and generate a path coverage test sequence for covering the process logic path. The test data generation module is configured to analyze the value range of the industrial control variables in the state space by using a preconfigured second agent, and generate a boundary value test data set covering the boundary conditions of the industrial control variables. The test scene generation module is configured to analyze the dependency relationships between the industrial control variables by using a preconfigured third agent, and generate abnormal test scene information simulating the failure of the dependency relationships. 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 scene information.
[0015] In summary, the test case generation method and system based on industrial agents provided by the present application can realize multi-dimensional coverage of the test scene of the industrial control system by constructing a system dependency model and using multiple agents to collaboratively analyze the process logic path, boundary conditions, and dependency relationships, and can realize the automation of test case generation, improve the generation efficiency, and enhance the comprehensiveness of test coverage, especially the coverage of boundary conditions, abnormal scenes, and concurrent paths, thereby reducing the dependence on manual work and improving the reliability and consistency of the test. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 is a flowchart of an embodiment of the test case generation method based on industrial agents provided by the present application; Figure 2 is an implementation flowchart of step S10 in an embodiment of the test case generation method based on industrial agents provided by the present application; Figure 3 is an implementation flowchart of step S20 in an embodiment of the test case generation method based on industrial agents. DETAILED DESCRIPTION
[0017] The following will be described in detail in combination with the accompanying drawings Figures 1-3 The application will be further described in detail.
[0018] 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 testing methods lack 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 testing sufficiency will directly affect the reliability and safety of the industrial system, which is specifically manifested as the coupling effect of control logic, parameter boundary and abnormal handling mechanism is not fully exposed, thereby restricting the protection capability of the testing process for the key performance indicators of the industrial control system.
[0019] For example, in a distributed control system of a chemical production process, a tester needs to verify the behavior logic of the temperature control module of the reaction kettle. In this scenario, the industrial control variables include temperature sensor readings, cooling water flow and pressure signals, and their interaction involves dynamic switching of the process logic path. However, the traditional testing method may only generate test cases covering the preset normal working conditions, when the temperature sensor signal drift and the abnormal cooling water flow occur concurrently at the boundary value, the distributed control system may enter an unintended state; since the existing method does not perform panoramic analysis on the dependency relationship between control variables, the test case set fails to contain such concurrent abnormal sequences, resulting in the cascading failure defect in the temperature control logic being unrecognized; thus, the distributed control system may trigger the misoperation of the safety interlocking mechanism due to unverified boundary condition combinations in actual operation, affecting production continuity and equipment integrity.
[0020] If the above problems are not solved, the behavior of the industrial control system under parameter boundaries or abnormal conditions will not be fully verified, which may cause unforeseen system failures; among them, insufficient test coverage will lead to exposure of control logic defects 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 capability 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.
[0021] To this end, the application discloses a test case generation method based on industrial agents, in an embodiment, as shown in Figure 1 the specific steps include: S10: in response to the received test case generation instruction, parsing the test target type corresponding to the test case generation instruction, and acquiring the corresponding industrial data set from the target industrial control system based on the parsed test target type; In the 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 a functional entity with high autonomy and professionalism dedicated to the industrial testing field; 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), and is a command for starting the entire automated test case generation process, wherein the test case generation instruction carries the intention or target of this generation task, which can be specified by keywords, parameters or referenced configuration template IDs in the instruction, for example, indicating 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 strategy; 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 of the method, and is also the source and attribution of all data and business logic in the scheme flow, which 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, all the test cases generated by the method are ultimately for verifying the function correctness, boundary safety and exception handling capability of the specific system; the industrial data set refers to a collection of raw data acquired from the target industrial control system for constructing system models and performing analysis, which not only includes control programs, variable lists and other static configuration data, but also includes historical running data, logs and other dynamic behavior data, and is the basis for analysis and generation.
[0022] S20: constructing a system dependency model based on the acquired 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; In the 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 a process logic path; 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 for representing device states, process parameters, control logic conditions, and can be read or written by the control system, and 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, and each specific moment in the industrial control system corresponds to a point (state) in the state space, and 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 directly or indirectly affecting or triggering the value or state of another or another group of industrial control variables in the logic of the industrial control system, and such 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, which 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.
[0023] 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; In the embodiment, the preconfigured first intelligent agent refers to an automated module specially 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 covering 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.
[0024] 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; In the embodiment, a 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.
[0025] 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; In the embodiment, the pre-configured third agent is configured to analyze the dependency relationship between the industrial control variables. In actual applications, 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.
[0026] 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.
[0027] 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 structured test scheme set with clear execution targets and sequences.
[0028] 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.
[0029] 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.
[0030] 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.
[0031] 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.
[0032] 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 instruction keywords and 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 industrial data category determination or incomplete data set acquisition, affecting the coverage depth and accuracy of subsequent test cases on functional logic, boundary conditions and abnormal scenarios.
[0033] To this end, the present application further proposes that, in an embodiment, as shown in Figure 2 Step S10 includes: S11: Analyzing the test case generation instruction to identify the test target identifier, the test target identifier including instruction keywords and configuration template identifier; 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 instruction keywords and 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 instruction keywords and configuration template identifier; the instruction keywords refer to the words 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.
[0034] 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; 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.
[0035] S13: Determine the industrial data category to be obtained from the preset type-data mapping relationship based on the matched test target type. In the embodiment, the type-data mapping relationship refers to a 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.
[0036] For example, if the test type is functional logic test, the type-data mapping relationship can point to: control logic program, process flowchart. If the test type is boundary robustness test, the type-data mapping relationship can point to: system variable list and its value range. If the test type is abnormal fault test, the type-data mapping relationship can point to: system variable list and variable interdependence description.
[0037] S14: Obtain the corresponding industrial data set according to the determined industrial data category.
[0038] Specifically, the solution first parses test case generation instructions to identify test target identifiers, utilizing a dual mechanism of instruction keywords and configuration template identifiers to ensure accurate capture of user intent. Then, the identified identifiers are matched with predefined test target types, using a standardized type library to achieve standardized classification of test targets. Next, based on the matching results, industrial data categories are determined from a pre-defined mapping relationship, transforming abstract targets into specific data requirements. Finally, industrial datasets are acquired in a targeted manner according to the determined data categories. This solution forms a closed-loop, precise data requirement mapping mechanism through the above steps, ensuring accuracy and relevance throughout the entire process from instruction parsing to data acquisition, thereby effectively reducing data acquisition deviations caused by ambiguous test target identification.
[0039] For example, as a specific implementation method, the solution of this application is implemented as follows: When the test case generation instruction "Execute boundary robustness test, template identifier: BRT-Template" is received, the instruction is first parsed to identify the instruction keywords "boundary robustness test" and the configuration template identifier "BRT-Template"; then these identifiers are matched with the predefined test target type to determine it as boundary robustness test; based on this type, the category of boundary data 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 dataset related to the boundary conditions, such as the value range data of the control variables.
[0040] Through the above scheme, this application ensures the accurate identification of test target types and the accurate determination of industrial data categories, avoiding deviations and incompleteness in data acquisition. This provides a highly adaptable 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.
[0041] In practical applications, some of the embodiments described above in this application propose to construct a system dependency model to define the state space and dependency relationships. However, in its implementation, there may be a problem that correlation analysis based solely on industrial datasets cannot accurately distinguish the causal relationships between industrial control variables. This results in the dependency network only reflecting surface associations while ignoring the direction of dynamic influences, causing the process logic path modeling to be distorted. Consequently, it affects the ability of subsequent test cases to cover the real behavior of the industrial control system, making it difficult to effectively verify the system reliability under complex operating conditions.
[0042] In this regard, this application further proposes that, in one embodiment, as Figure 3 As shown, step S20 includes: S21: Extract control logic information based on industrial datasets, and construct a dependency network of industrial control variables based on the control logic information; In the embodiment, the control logic information refers to the programmatic logic directly defining the behavior of the industrial control system parsed from the industrial dataset, which is usually derived from the programming code or configuration logic of the PLC, and specifies the output action that should be generated under certain input conditions, and is the basis for building the system behavior model; the relevant dependency network refers to the network structure representing the statistical correlation between industrial control variables constructed based on the industrial dataset, which can be implemented using an undirected graph model, with nodes corresponding to industrial control variables and edges representing the correlation strength between variables.
[0043] S22: Extract historical operation data based on the industrial dataset, and obtain the causal direction between industrial control variables through a preset causal discovery algorithm; In the embodiment, the historical operation data refers to the original data sequence recorded continuously during the actual operation of the target industrial control system in the past period of time, which reflects the dynamic behavior, state transition and interaction between variables of the industrial control system in the real environment; the causal discovery algorithm refers to a data-driven analysis algorithm, which can be implemented using Granger causality test or constraint-based causal discovery algorithm, and its function is to analyze the time sequence rule and statistical characteristics of variable changes in the historical operation data, so as to infer the direction of causal relationship between variables, for example, by analyzing the data to determine that "temperature sensor reading increases" usually occurs before "cooling water valve opening increases", so it is inferred that the temperature reading may be the "cause" of the valve opening; the causal direction is the output result of the causal discovery algorithm, which refers to the directionality of the causal influence between two related variables, which can be upgraded from "A and B are related" to "A is the cause of B" or "B is the cause of A", and the causal relationship is the key to upgrading the relevant dependency network to the causal dependency network.
[0044] S23: Direct the edges in the relevant dependency network according to the causal direction to obtain the causal dependency network, and build the dependency relationship between industrial control variables and the process logic path based on the causal dependency network; In this embodiment, orientation is a special graph operation, which refers to the process of assigning directions to the edges connecting nodes in the correlation dependency network according to the causal direction information, so as to convert 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., a process logic path, represents a series of causal events that must be experienced to complete a specific process step, for example, "pressing the start button" (cause) → "main contactor attraction" (effect / cause) → "motor starts to rotate" (effect) constitutes a simple process logic path.
[0045] For example, a specific operation example about orientation is as follows: 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; Obtain causal direction: after the causal discovery algorithm analyzes the historical operation data, it concludes that A is the cause of B; Orientation operation: convert the undirected edge between A and B into a directed edge from A to B; 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".
[0046] 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.
[0047] 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 moment, and the state space is constructed to systematically describe and analyze all possible behaviors of the industrial control system.
[0048] 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.
[0049] 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.
[0050] 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.
[0051] 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.
[0052] In this regard, the application further proposes that, in an embodiment, step S30 comprises: S31: 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; In the embodiment, the parallel execution branch refers to two or more independent control flows or task sequences that can be started and concurrently run at the same time in the process logic of the industrial control system, for example, in a production line, a "robot assembly process" and a "conveyer belt moving process" can be two parallel execution branches, and the identification of the parallel execution branch is a prerequisite for testing concurrent safety; further, the identification of whether there is a parallel execution branch in the process logic path refers to the dynamic analysis of the topological structure of the process logic path to detect the existence of the concurrent execution branch, which can be realized by using a directed acyclic graph traversal algorithm or a state machine decomposition technique, 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 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" can be read and judged by two parallel branches "loading robot arm" and "detection robot" at the same time, and the shared control resource is the root cause of concurrent conflict; the potential critical section specifically refers to the code area that accesses and modifies the shared control resource in the program code, and if the access to the critical section is not correctly protected by mutual exclusion, when multiple parallel branches enter at the same time, it will cause defects such as data competition and state inconsistency, and locating the potential critical section is to find the focus of concurrent testing.
[0053] 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; In the embodiment, the timing constraint rule refers to a normalized constraint system for the execution timing of the parallel branch, which can be understood as a timing behavior specification defined to ensure the correct operation of the industrial control system in a concurrent environment, which can be realized 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; wherein, the timing constraint rules include execution order constraint, time window constraint and mutual exclusion access constraint, the execution order constraint refers to the provision of the starting or execution order between branches, for example, "the initialization of branch A must be completed before the start of branch B"; the time window constraint refers to the provision 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 the constraint that at the same time, at most only one execution branch is allowed to enter the critical section to access the shared resource, and the mutual exclusion access constraint is the core rule constraint to ensure data consistency.
[0054] 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 the competitive access to the potential critical section; In this embodiment, the abnormal timing test sequence is a test sequence designed to intentionally violate the timing constraint rule, in this embodiment, the mutual exclusion access constraint; for example, the abnormal timing test sequence may deliberately arrange two branches to access the shared resource at the same time, to verify whether the behavior of the control system is correct when triggering the competitive access to the potential critical section, such as whether the mutual exclusion lock can be normally triggered, or whether data errors will occur, 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 achieved by using a constraint violation injection algorithm or a directed perturbation strategy, with the purpose of accurately simulating resource competition faults. The normal timing test sequence refers to a test step sequence generated according to the timing constraint rule, used to verify whether the behavior of the industrial control system under correct concurrent timing is as expected, which simulates the correct running process of the industrial control system under ideal conditions.
[0055] S34: performing logical feasibility verification on the abnormal timing test sequence and the normal timing test sequence, and generating a path coverage test sequence based on the verification result.
[0056] In this embodiment, logical feasibility verification refers to verifying the effectiveness of the test sequence according to the cause-and-effect relationship of the industrial control logic, which can be achieved by using formal model detection, lightweight simulation engine or symbolic execution, with the purpose of verifying 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 the race condition can be stably reproduced.
[0057] Specifically, first, the parallel execution branches in the process logic path are identified and the associated industrial control variables are analyzed, the variables associated with multiple branches are located as shared control resources, so as to objectively determine the potential critical section; then, the timing constraint rule including execution order, time window and mutual exclusion access is defined based on the timing dependency characteristics of the industrial control process, to provide a reference for normal operation; on this basis, the abnormal timing test sequence that violates the mutual exclusion access constraint is generated to trigger the competitive access behavior, and the normal timing test sequence that conforms to the constraint is 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 sequence not only completely covers the normal working condition, but also accurately exposes the boundary abnormal behavior under concurrent conditions, thereby systematically improving the detection ability of timing conflict defects.
[0058] Exemplarily, as a specific implementation, the scheme of the application is implemented as follows: in a control system of a petrochemical production process, a process logic path includes two parallel branches of reaction kettle temperature adjustment and feed flow control; a first agent identifies a temperature sensor signal and a flow regulating valve state as shared control resources by analyzing the topological structure of the process logic path, and locates a data acquisition point as a potential critical region; then, a timing constraint rule is defined to require that the temperature adjustment 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, an abnormal timing test sequence is generated to make the feed flow control branch execute first to violate the mutual exclusion access constraint, and a normal timing test sequence that meets the rule is generated; finally, after simulation verification confirms that the sequence meets the causality of the process logic, a path coverage test sequence is integrated and generated.
[0059] Through the above scheme, the application can accurately trigger the competitive access behavior of the potential critical region, effectively verify the behavior reliability and abnormal processing capability of the industrial control system under concurrent conditions, and fully expose possible deep defects caused by timing conflicts.
[0060] In practical applications, in some embodiments of the application described above, a second agent is proposed to generate a boundary value test data set 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.
[0061] To this end, the application further proposes that, in an embodiment, the second agent includes a boundary analysis layer, a correlation analysis layer, and a boundary coupling layer, and step S40 includes: S41: 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 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; In the 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, aiming to independently generate basic boundary test data for each industrial control variable, and ensure coverage of variable value range endpoints; the data type and the 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 can be designed to have a value range of [0.5, 10.0] MPa, i.e., values lower than 0.5 or higher than 10.0 can all cause exceptions; the boundary value test data refers to test input values selected for the value range boundaries and their neighbors of the industrial control variable, and the core is that the program is most likely to have errors at the boundary values.
[0062] Further, the data type includes: Boolean: represents the on-off state, such as the emergency stop button state, with only true (1) / false (0) values; Integer: represents discrete quantities or states, such as conveyor speed gears, with a value range of 1, 2, 3, 4, 5; Floating-point: represents continuous physical quantities, such as reactor temperatures, with a value range of 0.0 ~ 200.0 degrees Celsius; Enumeration: represents a limited number of predefined states, such as device operating modes, with values such as manual, automatic, and shutdown.
[0063] S42: The correlation analysis layer identifies variable groups with constraint correlations based on the dependency relationships between industrial control variables, constructs the joint effective domain corresponding to the variable groups, and calculates the effective domain boundaries of the joint effective domain; 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, and 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 a 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 represented 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.
[0064] 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.
[0065] 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.
[0066] 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 such as (A = 75, B = 75), rather than a boundary value of a single variable.
[0067] 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 with 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.
[0068] 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.
[0069] Through the above technical scheme, the application effectively solves the problem of invalid boundary test data 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.
[0070] 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 that the construction of variable group joint valid domains depends on artificial experience or simple rules, and the variable coupling boundary cannot be accurately captured. Specifically, the control rules in the process logic path are difficult to be systematically transformed into computable constraint expressions, there are blind areas 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.
[0071] To this end, the present application further proposes that, in an embodiment, step S42 comprises: S421: based on the dependency relationship between industrial control variables, the control rules corresponding to the process logic path of the industrial control variables are transformed into constraint expressions; 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. They specifically refer to specific control logic bound to path nodes (process steps), rather than 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. 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: converting the textual process requirement "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".
[0072] S422: input the value range of the variable group with constraint correlation and its corresponding constraint expression into the pre-set constraint solver, solve the variable value common space, and define the variable value common space as the joint valid domain corresponding to the variable group; 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.
[0073] 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.
[0074] 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.
[0075] 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 according to 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.
[0076] Exemplarily, as a specific implementation, the scheme of the application is implemented as follows: in a chemical process control system, the constraint relationship between a temperature variable and a pressure variable is considered, control rules in a 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 corresponding constraint expressions are input into a Z3 constraint solver, and a variable value common space is solved as a joint effective domain; a grid search algorithm is used to calculate a boundary point set of the joint effective domain as an effective domain boundary, so as to generate test data covering the boundary.
[0077] Through the above scheme, the application ensures that the boundary value test data can accurately cover the key critical points of the constraint interaction between variables, effectively detects potential defects in the parameter boundary coupling scenario, and improves the detection capability of test cases for deep defects.
[0078] In actual application, in some embodiments of the application, the third intelligent agent generates abnormal test scenario 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 scenario is generated without fully considering the propagation path and cascading 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.
[0079] To this end, the application further proposes that in an embodiment, step S50 includes: S51: identifying a key node based on the dependency relationship between industrial control variables, and generating an abnormal test scenario simulating failure of the key node for the identified key node, the abnormal test scenario including a single-point failure scenario and a composite failure scenario; 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 scenarios; generally, the key node includes a node with high connectivity, a functional core node, and a weak reliability node, etc.; the abnormal test scenario 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 scenario includes a single-point failure scenario and a composite failure scenario; the single-point failure scenario refers to a test scenario 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 scenario 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 scenarios of multi-node coordinated failure and reflect multi-variable abnormal combination in the actual operation of the industrial control system.
[0080] S52: identifying the propagation path of failure in the dependency relationship based on the single-point failure scenario, and analyzing the key degree and impact range of the propagation path; 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 realized by using a graph traversal algorithm combined with impact factor calculation, and the purpose is to focus on high-risk areas and avoid invalid verification; the key degree and impact range analysis refers to the damage assessment of the propagation path of failure, wherein the key degree analysis refers to the importance of the nodes on the propagation path, the more the key nodes contained in the path, the higher the key degree; the impact range analysis refers to the assessment of the system function range that the failure can spread along the path, the more the subsystems or functional modules affected, the greater the impact range.
[0081] S53: Based on the analysis result of the propagation path, the single-point failure scenarios with causal correlation are combined to generate a cascading failure scenario simulating failure diffusion; 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 the chain reaction of failure diffusion 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 realized by using a failure combination strategy based on the key degree sorting of the propagation path, and the purpose 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.
[0082] S54: Encapsulating the single-point failure scenario and the cascading failure scenario as abnormal test scenario information.
[0083] 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.
[0084] 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 analysis is performed to quantify the path importance and failure spread range; 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, the 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.
[0085] 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.
[0086] 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.
[0087] 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 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 common reasons 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.
[0088] In response to this, the application further proposes that in an embodiment, step S51 comprises: 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; In the embodiment, the dependency relationship between the industrial control variables refers to the causal association or 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; 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.
[0089] S512: Generate a composite failure scenario simulating simultaneous failure of multiple key nodes for the common cause failure node group.
[0090] 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.
[0091] 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 through the structured information provided by the dependency relationship model, thereby systematically covering abnormal coupling scenarios that are difficult to reach by traditional methods.
[0092] 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.
[0093] 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.
[0094] 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.
[0095] 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 (repeated coverage of 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.
[0096] In this regard, the application further proposes that in an embodiment, step S60 includes: 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; 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.
[0097] 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; 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".
[0098] 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.
[0099] In the embodiment, the conflict detection refers to an analysis process of checking whether there is an irreconcilable contradiction between all 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 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, and 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.
[0100] 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.
[0101] 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.
[0102] Through the above technical solution, the present application effectively avoids the logical conflicts between the test sequences and the generation of redundant test cases, ensures the priority coverage of the key test scenes, and improves the test efficiency and resource utilization.
[0103] 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.
[0104] 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: An instruction analysis module is configured to analyze the test target type corresponding to the test case generation instruction in response 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; 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; A test sequence generation module is configured to analyze the process logic path by a pre-configured first agent, and generate a path coverage test sequence for covering the process logic path; A test data generation module is configured to analyze the value range of the industrial control variables in the state space by a pre-configured second agent, and generate a boundary value test data set covering the boundary conditions of each industrial control variable; A test scene generation module is configured to analyze the dependency relationship between the industrial control variables by a pre-configured third agent, and generate abnormal test scene information simulating the failure of the dependency relationship; A test case generation module is configured to generate 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 scene information.
[0105] The specific limitation of the test case generation system based on the industrial agent can refer to the limitation of the test case generation method based on the industrial agent in the foregoing, and details are not described herein again. Each module in the test case generation system based on the industrial agent can be realized by software, hardware, and a combination thereof, in whole or in part. Each module can be embedded in or independent of a processor in a computer device in a hardware form, or can be stored in a memory in a computer device in a software form, so as to be called and executed by the processor to perform the operation corresponding to each module.
[0106] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. An industrial agent based test case generation method, characterized in that, The method comprises the steps of: 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; Based on the obtained industrial data set, a system dependency model is constructed, which includes a state space composed of industrial control variables, a dependency relationship between industrial control variables, and a process logic path; A first pre-configured agent is used to analyze the process logic path, and a path coverage test sequence for covering the process logic path is generated; A second pre-configured agent is used to analyze the value range of the industrial control variables in the state space, and a boundary value test data set covering the boundary conditions of each industrial control variable is generated; A third pre-configured agent is used to analyze the dependency relationship between industrial control variables, and abnormal test scenario information simulating the failure of the dependency relationship is generated; Based on the path coverage test sequence, the boundary value test data set, and the abnormal test scenario information, a test case set suitable for the target industrial control system is generated.
2. The test case generation method based on industrial agent according to claim 1, characterized in that: The step of parsing the test case generation instruction, identifying the test target identifier, and matching the identified test target identifier with the pre-defined test target type, which includes functional logic testing, boundary robustness testing, abnormal fault testing, and full-scenario coverage testing, is included. The step of determining the industrial data category to be obtained from the pre-set type-data mapping relationship based on the matched test target type is included. The step of obtaining the corresponding industrial data set according to the determined industrial data category is included. The step of constructing a system dependency model based on the obtained industrial data set, which includes a state space composed of industrial control variables, a dependency relationship between industrial control variables, and a process logic path, is included. The step of extracting control logic information based on the industrial data set and constructing a related dependency network of industrial control variables according to the control logic information is included.
3. The test case generation method based on industrial agent according to claim 1, characterized in that: The step of extracting historical operation data based on the industrial data set and obtaining the causal direction between industrial control variables through a pre-set causal discovery algorithm is included. The step of orienting the edges in the related dependency network according to the causal direction to obtain a causal dependency network, and constructing a dependency relationship between industrial control variables and a process logic path based on the causal dependency network is included. The step of extracting the value range of the industrial control variables based on the industrial data set and constructing a state space of the industrial control variables based on the value range is included. The step of constructing a system dependency model based on the obtained industrial data set, which includes a state space composed of industrial control variables, a dependency relationship between industrial control variables, and a process logic path, is included. The step of constructing a system dependency model based on the obtained industrial data set, which includes a state space composed of industrial control variables, a dependency relationship between industrial control variables, and a process logic path, is included.
4. The test case generation method based on industrial agent according to claim 1, characterized in that: identifying whether there is a parallel execution branch in the process logic path, if there is, 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; defining timing constraint rules for the parallel execution branch associated with the shared control resources, the timing constraint rules including execution order constraints, time window constraints, and mutual exclusion access constraints; generating abnormal timing test sequences and normal timing test sequences based on the timing constraint rules, wherein the abnormal timing test sequences are configured to violate the mutual exclusion access constraints to trigger competitive access to the potential critical sections; performing logical feasibility verification on the abnormal timing test sequences and the normal timing test sequences, and integrating and generating path coverage test sequences based on the verification results.
5. The test case generation method based on industrial agent according to claim 1, characterized in that: The second intelligent agent includes a boundary analysis layer, an association analysis layer, and a boundary coupling layer. The second intelligent agent analyzes the value range of the industrial control variables in the state space and generates a boundary value test data set covering the boundary conditions of each industrial control variable. The steps include: 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, including minimum value, slightly higher than minimum value, normal value, slightly lower than maximum value, and maximum value. The association analysis layer identifies variable groups with constraint associations based on the dependency relationship between industrial control variables, constructs the joint feasible domain corresponding to the variable group, and calculates the feasible domain boundary of the joint feasible domain. The boundary coupling layer generates coupling test data covering the feasible domain boundary based on the feasible domain boundary, and merges the boundary value test data and the coupling test data to generate the boundary value test data set.
6. The test case generation method based on industrial agent according to claim 5, characterized in that: The association analysis layer identifies variable groups with constraint associations based on the dependency relationship between industrial control variables, constructs the joint feasible domain corresponding to the variable group, and calculates the feasible domain boundary of the joint feasible domain. The steps include: Based on the dependency relationship between industrial control variables, the control rules corresponding to the process logic path of the industrial control variables are converted into constraint expressions; The value range of the variable group with constraint association and the corresponding constraint expression are input into a pre-set constraint solver to solve the variable value common space, and the variable value common space is defined as the joint feasible domain corresponding to the variable group. The boundary point set of the joint feasible domain is calculated by a pre-set search algorithm, and the boundary point set is defined as the feasible domain boundary of the joint feasible domain.
7. The test case generation method based on industrial agent according to claim 1, characterized in that: The third intelligent agent analyzes the dependency relationship between industrial control variables and generates abnormal test scenario information simulating dependency relationship failure. The steps include: Based on the dependency relationship between industrial control variables, key nodes are identified, and abnormal test scenarios simulating failure of the key nodes are generated for the identified key nodes. The abnormal test scenarios include single-point failure scenarios and composite failure scenarios. Identify the propagation path of the single-point failure scenario in the dependency relationship based on the single-point failure scenario, and analyze the criticality and impact range of the propagation path; Based on the analysis result of the propagation path, the single-point failure scenario with causal correlation is combined to generate a cascading failure scenario simulating failure diffusion; The single-point failure scenario and the cascading failure scenario are encapsulated as abnormal test scenario information.
8. The test case generation method based on industrial agent according to claim 6, characterized in that: The key nodes are identified based on the dependency relationship between the industrial control variables, and the abnormal test scenario simulating the failure of the key nodes is generated for the identified key nodes, and the steps of the abnormal test scenario include single-point failure scenario and composite failure scenario, including steps: Identify the key nodes based on the dependency relationship between the industrial control variables, and construct the common cause failure node group based on the identified key nodes; Generate a composite failure scenario simulating the simultaneous failure of multiple key nodes for the common cause failure node group.
9. The test case generation method based on industrial agent according to claim 1, characterized in that: The steps 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 include steps: Identify the 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; Identify the abnormal mode defined in the abnormal test scenario information and use it as a variation rule to generate a strengthened test sequence based on the variation rule; Perform conflict detection and redundancy elimination on the generated basic test sequence and strengthened test sequence, and set the execution priority based on the test target type to generate a test case set suitable for the target industrial control system.
10. An industry-agent based test case generation system, comprising: It includes: The instruction analysis module is used to analyze the test target type corresponding to the test case generation instruction in response to the received test case generation instruction, and to obtain the corresponding industrial data set from the target industrial control system based on the analyzed test target type; The dependency model construction module is used to construct 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; The test sequence generation module is used to analyze the process logic path by a preconfigured first intelligent agent to generate a path coverage test sequence for covering the process logic path; The test data generation module is used to analyze 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; The test scenario generation module is used to analyze the dependency relationship between the industrial control variables by a preconfigured third intelligent agent to generate abnormal test scenario information simulating the failure of the dependency relationship; The test case generation module is used to generate 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.
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
Multi-dimensional test case generation method and device
CN120743786A
Non-Intrusive Data Analytics in a Process Control System
US20150005903A1
Cited By
Industrial control software-oriented AI intelligent software evaluation index system construction method
CN121658350A
Construction method of AI intelligent software evaluation index system for industrial control software
CN121658350B
Composite sequence mandatory and logic association control method and system for die-casting machine and electronic equipment
CN122085980A
HRP system multi-module linkage test case self-adaptive generation method and system
CN122111874A
