Sample generation method and device for industrial protocol analysis model

By parsing configuration files to generate control command sequences and verifying their execution results in a laboratory environment, the problem of insufficient accuracy in training samples for industrial protocol analysis models was solved, achieving efficient and accurate sample generation.

CN121967283APending Publication Date: 2026-05-01SICHUAN XUANHUANG SAFETY TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SICHUAN XUANHUANG SAFETY TECHNOLOGY CO LTD
Filing Date
2026-01-19
Publication Date
2026-05-01

Smart Images

  • Figure CN121967283A_ABST
    Figure CN121967283A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a sample generation method and device for an industrial protocol analysis model. The method comprises the steps of obtaining a configuration file of a target industrial control system; analyzing the configuration file to generate a feature parameter set of the target industrial control system; generating a control instruction sequence according to the characteristic parameter set, and generating an expected execution result corresponding to the control instruction sequence; sending the control instruction sequence to a controller of a target industrial control system in the laboratory environment; acquiring a communication message between the controller and the controlled terminal, and acquiring an actual execution result of the control instruction sequence; generating an initial sample according to the control instruction sequence and the corresponding communication message; judging whether the actual execution result is consistent with the expected execution result or not; and if yes, determining the initial sample as an effective sample. The sample for the industrial protocol analysis model generated by adopting the scheme is matched with a real industrial system, and the authenticity and the sample precision of the training sample are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, specifically to a sample generation method, apparatus, computing device, computer storage medium, and computer program product for industrial protocol analysis models. Background Technology

[0002] Industrial protocols are standardized rules followed by different devices and / or systems for communication and data exchange in the field of industrial automation. With the continuous development of industrial control technology, the types of industrial protocols are increasing, and their structures are becoming more complex and opaque, posing significant challenges to the maintenance and control of industrial control systems.

[0003] Currently, industrial protocol analysis models are widely used in industrial protocol analysis due to their high processing efficiency and high analytical accuracy. In existing technologies, the training samples for industrial protocol analysis models are obtained by generating simulated data using software simulation environments.

[0004] However, during implementation, the inventors discovered the following defects in the prior art: the training samples generated using the prior art differ from the responses of real physical devices, resulting in insufficient sample accuracy. Summary of the Invention

[0005] In view of the above problems, this application is made in order to provide a sample generation method, apparatus, computing device, computer storage medium and computer program product for industrial protocol analysis models that overcomes or at least partially solves the above problems.

[0006] According to a first aspect of this application, a sample generation method for an industrial protocol analysis model is provided, comprising: Obtain the configuration file of the target industrial control system; The configuration file is parsed to generate a set of characteristic parameters for the target industrial control system; Generate a control instruction sequence based on the feature parameter set, and generate the expected execution result corresponding to the control instruction sequence; The control command sequence is sent to the controller of the target industrial control system in a laboratory environment; Obtain the communication messages between the controller and the controlled terminal, and obtain the actual execution results of the control command sequence; An initial sample is generated based on the control command sequence and the corresponding communication message; Determine whether the actual execution result is consistent with the expected execution result; if so, determine the initial sample as a valid sample.

[0007] In one optional implementation, generating the control command sequence based on the feature parameter set includes: Extract the signal type and operation state space of any point from the set of feature parameters; For any given point, if the signal type of that point is digital, then a sequence of control instructions corresponding to each operational state value within the operational state space of that point is generated; if the signal type of that point is analog, then a sequence of control instructions uniformly covering the operational state space of that point is generated.

[0008] In an optional implementation, the method further includes: If the signal type of the point is analog, then determine the boundary operation state value of the operation state space of the point and generate the control command sequence corresponding to the boundary operation state value; and / or, determine the over-amplitude operation state value of the operation state space of the point and generate the control command sequence corresponding to the over-amplitude operation state value.

[0009] In one optional implementation, generating the control command sequence based on the feature parameter set includes: Extract the controller type and / or protocol type from the set of feature parameters; Invoke the driver that matches the controller type and / or protocol type to generate a sequence of control instructions.

[0010] In one optional implementation, generating the expected execution result corresponding to the control instruction sequence includes: Parse the control instruction sequence and extract the operational semantics; Obtain the associated feature parameters of the control command sequence; Based on the operational semantics of the control instruction sequence and the associated feature parameters, the expected execution result corresponding to the control instruction sequence is generated.

[0011] In an optional implementation, the method further includes: If the actual execution result is inconsistent with the expected execution result, then the deviation category of the control instruction sequence is determined; The control command sequence is corrected according to the deviation category to obtain a corrected control command sequence, and then the step of sending the control command sequence to the controller of the target industrial control system in a laboratory environment is further executed.

[0012] According to a second aspect of this application, a sample generation apparatus for an industrial protocol analysis model is provided, comprising: The first acquisition module is used to acquire the configuration file of the target industrial control system; The file parsing module is used to parse the configuration file to generate a set of characteristic parameters for the target industrial control system. The first generation module is used to generate a control instruction sequence based on the feature parameter set, and to generate the expected execution result corresponding to the control instruction sequence; A sending module is used to send the sequence of control commands to the controller of the target industrial control system in a laboratory environment; The second acquisition module is used to acquire the communication messages between the controller and the controlled terminal, and to acquire the actual execution results of the control command sequence; The second generation module is used to generate an initial sample based on the control command sequence and the corresponding communication message. The verification module is used to determine whether the actual execution result is consistent with the expected execution result; if so, the initial sample is determined as a valid sample.

[0013] In one optional implementation, the first generation module is used to: extract the signal type and operation state space of any point from the feature parameter set; For any given point, if the signal type of that point is digital, then a sequence of control instructions corresponding to each operational state value within the operational state space of that point is generated; if the signal type of that point is analog, then a sequence of control instructions uniformly covering the operational state space of that point is generated.

[0014] In one optional implementation, the first generation module is configured to: if the signal type of the point is an analog quantity, determine the boundary operation state value of the operation state space of the point and generate a control command sequence corresponding to the boundary operation state value; and / or, determine the over-amplitude operation state value of the operation state space of the point and generate a control command sequence corresponding to the over-amplitude operation state value.

[0015] In one optional implementation, the first generation module is configured to: extract the controller type and / or protocol type from the set of feature parameters; Invoke the driver that matches the controller type and / or protocol type to generate a sequence of control instructions.

[0016] In one optional implementation, the first generation module is used to: parse the control instruction sequence and extract operational semantics; Obtain the associated feature parameters of the control command sequence; Based on the operational semantics of the control instruction sequence and the associated feature parameters, the expected execution result corresponding to the control instruction sequence is generated.

[0017] In one optional implementation, the verification module is used to: determine the deviation category of the control instruction sequence if the actual execution result is inconsistent with the expected execution result; The control command sequence is corrected according to the deviation category to obtain a corrected control command sequence, and then the step of sending the control command sequence to the controller of the target industrial control system in a laboratory environment is further executed.

[0018] According to a third aspect of this application, a computing device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus; The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the sample generation method for the industrial protocol analysis model described above.

[0019] According to a fourth aspect of this application, a computer storage medium is provided, the storage medium storing at least one executable instruction that causes a processor to perform the operations corresponding to the sample generation method for the industrial protocol analysis model described above.

[0020] According to a fifth aspect of this application, a computer program product is provided, comprising at least one executable instruction that causes a processor to perform the operations corresponding to the sample generation method for the industrial protocol analysis model described above.

[0021] The present application provides a sample generation method, apparatus, computing device, computer storage medium, and computer program product for industrial protocol analysis models. The method involves parsing the configuration file of the target industrial control system to generate a set of characteristic parameters, then generating a control command sequence and expected execution results based on the characteristic parameter set. The control command sequence is sent to the controller of the target industrial control system in a laboratory environment, and the communication messages between the controller and the controlled terminal are obtained, as well as the actual execution results of the control command sequence. An initial sample is generated based on the control command sequence and the corresponding communication messages. Only when the actual execution results match the expected execution results are the initial sample determined as a valid sample. In this scheme, the communication messages in the valid samples are the actual messages generated in the controller and controlled terminal channels of the target industrial control system in the laboratory environment, thereby improving the matching degree between the samples and the real situation. Moreover, each part in the laboratory environment is controllable and will not have an adverse impact on actual production. Furthermore, the initial sample is only considered a valid sample when the actual execution result is consistent with the expected execution result, thereby further ensuring the accuracy of the valid samples. In addition, this scheme does not rely on manual intervention, improving the efficiency of sample generation and saving costs. Moreover, the control commands in this scheme are generated based on the feature parameter set, which makes it easy to adjust the coverage of the control commands, thereby facilitating the improvement of the sample coverage.

[0022] The above description is merely an overview of the technical solutions of the embodiments of this application. In order to better understand the technical means of the embodiments of this application and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of this application more obvious and understandable, specific implementation methods of the embodiments of this application are described below. Attached Figure Description

[0023] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the embodiments of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 A schematic flowchart of a sample generation method for an industrial protocol analysis model provided in an embodiment of this application is shown. Figure 2 A flowchart illustrating a control instruction sequence generation method provided in an embodiment of this application is shown. Figure 3 A flowchart illustrating a method for generating expected execution results provided in an embodiment of this application is shown. Figure 4 This illustration shows a schematic diagram of a sample generation device for an industrial protocol analysis model provided in an embodiment of this application; Figure 5 A schematic diagram of the structure of a computing device provided in an embodiment of this application is shown. Detailed Implementation

[0024] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0025] Figure 1 The illustration shows a schematic flowchart of a sample generation method for an industrial protocol analysis model provided in an embodiment of this application.

[0026] Specifically, such as Figure 1 As shown, the method includes the following steps: Step S101: Obtain the configuration file of the target industrial control system.

[0027] The target industrial control system is a real control system used for industrial control. It includes controllers (such as PLCs) and controlled terminals (such as sensors and actuators) that have established communication connections with the controllers.

[0028] To ensure the safety of the industrial system and avoid interfering with actual production, this embodiment of the application pre-builds a miniaturized physical system in a laboratory environment that is equivalent to the target industrial control system in terms of hardware, network, and logic. Specifically, a controller entity of the target industrial control system is set up in the laboratory environment, along with a controlled terminal identical to the target industrial control system. This controlled terminal can be a real physical entity (such as a temperature sensor entity) or a simulated terminal (such as a simulated temperature sensor). Furthermore, the connection architecture between the controller and the controlled terminal in the laboratory environment is the same as that of the actual target industrial control system. After the target industrial control system in the laboratory environment is built, a sample generation process can be performed.

[0029] During sample generation, the configuration file of the target industrial control system is first obtained. This configuration file is the standard engineering document of the target industrial control system and is the foundation for the control system's programming, debugging, and operation and maintenance. The configuration file may specifically include: a control point table, an input / output list, etc. This implementation method primarily relies on the control point table for subsequent operations. This control point table summarizes the key information of all detection points, control points, and interlocking points in the industrial field, and records the process parameters, signal types, control requirements, installation locations, etc., for each point. It may also include controller information, protocol information, etc.

[0030] Taking the control point table shown in Table 1 as an example, the control point table includes point address, point name, signal type, data type, range (upper limit and lower limit) and related descriptions.

[0031] Table 1

[0032] Step S102: Parse the configuration file to generate a set of characteristic parameters for the target industrial control system.

[0033] The configuration file of the target industrial control system is parsed to extract corresponding feature parameters, which are then used to construct a feature parameter set. This feature parameter set is a structured data object, such as a JSON dictionary. The feature parameter set describes the communication and control characteristics of the target industrial control system. For example, the feature parameter set may include: controller type (such as Siemens S7-1200, Rockwell ControlLogix, etc., specific manufacturers and models), signal type (such as motor start / stop, valve switch, etc., and / or analog quantities such as temperature, pressure, flow, etc.), industrial protocol type (such as Modbus TCP / IP, PROFINET, S7comm, etc.), range, semantic description, point address, point name, etc.

[0034] In the specific implementation process, the configuration file can be standardized, such as mapping the column names of the control point table to standard column names. Then, each point data, including point address, point name, signal type, data type, and measurement range, is parsed using algorithms such as regular expressions and keyword matching. This data is then structured to obtain point features. Finally, the feature parameters of the target industrial control system are obtained by aggregating the features of each point, along with controller features and protocol features.

[0035] Step S103: Generate a control command sequence based on the feature parameter set.

[0036] The feature parameter set includes controller features, protocol features, and location features. Based on the feature parameter set, a corresponding control command sequence is generated. This control command sequence is the specific communication command sent to the actual controller. Each control command sequence contains at least one control command, and each control command sequence is used to complete a control task.

[0037] In one alternative implementation, specifically, it can be adopted Figure 2 The steps S1031-S1036 shown generate the control command sequence: S1031, Obtain the feature parameter set.

[0038] S1032 extracts the signal type and operation state space of any point from the feature parameter set.

[0039] If the feature parameter set includes point features, then the signal type and operating state space of each point are determined based on these point features. The signal type can be either digital or analog.

[0040] The operation state space is the complete set of executable operations for a given point. It contains a series of operation state values, which are concrete instances of the operation state space. The operation state space can consist of operation types and corresponding value ranges for those operation types. Operation types include read, write, start, and stop operations. For example, the operation state space of a digital point might include {0, 1}, where 0 and 1 represent operation state values. Specifically, 0 could mean closing a valve, and 1 could mean starting a valve. Alternatively, the operation state space of an analog point might include [0, 100]. In this case, 0 and 100 are boundary operation state values, representing outputs of 0% and 100% power respectively, and 50 is also an operation state value, representing an output of 50% power.

[0041] S1033, Identify the signal type at any point; if the signal type is digital, proceed to step S1034; if the signal type is analog, proceed to step S1035.

[0042] Digital signals represent states, events, or logical judgments; they are discrete in both time and value. Analog signals represent the intensity or degree of a physical quantity; they are continuously changing in both time and value. This implementation method employs different control command sequence generation methods for different signal types.

[0043] S1034, Generate the sequence of control instructions corresponding to each operation state value in the operation state space of this point.

[0044] If the signal type of the point is digital, then generate the control instruction sequence corresponding to each operation state value in the operation state space of the point.

[0045] Furthermore, for points with digital signals, a sequence of control commands corresponding to each operational state value within the operational state space of that point is generated. Since the operational state space of a digital point is composed of discrete operational state values, a sequence of control commands corresponding to each operational state value within that operational state space can be generated. The operation type and operation value of this control command sequence are matched with the operational state value. For example, if the operational state space of a digital point includes {0, 1}, then a valve closing control command sequence corresponding to 0 and a valve opening control command sequence corresponding to 1 are generated. This method can generate a control command sequence that completely covers the operational state space of the digital point, improving the coverage of subsequent samples.

[0046] S1035, Generate a sequence of control instructions that uniformly covers the operation state space of the point.

[0047] For points with analog signals, a control command sequence that uniformly covers the operational state space of that point is generated. Since the operational state space of analog points is a continuous space, a uniform sampling algorithm can be used to sample this operational state space, obtaining each sampled operational state value and generating a control command sequence corresponding to each sampled operational state value. This method can generate a control command sequence that uniformly covers the operational state space of analog points, improving the coverage of subsequent samples.

[0048] Optionally, if the signal type at the point is analog, then the boundary operational state values ​​of the operational state space at that point are determined, and the control command sequence corresponding to the boundary operational state values ​​is generated; and / or, the over-amplitude operational state values ​​of the operational state space at that point are determined, and the control command sequence corresponding to the over-amplitude operational state values ​​is generated. Here, the boundary operational state values ​​are the operational state values ​​corresponding to the boundaries of the operational state space, and the control command sequence corresponding to the boundary operational state values ​​facilitates the subsequent generation of training samples under boundary states; the over-amplitude operational state values ​​are the operational state values ​​exceeding the operational state space, and the control command sequence corresponding to the over-amplitude operational state values ​​facilitates the subsequent generation of training samples under abnormal states. This further improves the sample coverage.

[0049] S1036 generates a sequence of control instructions based on preset processing logic.

[0050] For example, based on the heating process, "read the current temperature, and if it is lower than the set value, increase the heater output by the slope", generate a temperature control command sequence of "read temperature → determine if the temperature is lower than the set value → increase power".

[0051] Steps S1032-S1035 constitute control command sequence generation method one, while S1036 constitutes control command sequence generation method two. Control command sequence generation method one and control command sequence generation method two can be combined or executed separately.

[0052] In practical implementation, instruction templates can be generated in advance based on the controller type and / or protocol type, and then a control instruction sequence can be generated based on the matching instruction template and operation status value.

[0053] In one alternative implementation, this step extracts the controller type and / or protocol type from the feature parameter set during execution; and calls the driver that matches the controller type and / or protocol type to generate a sequence of control instructions.

[0054] Specifically, this application pre-builds a driver library, which is a collection of pluggable software modules. The driver library contains multiple drivers, each used to process a specific set of characteristic parameters for a particular controller type and / or protocol type. Each driver is an independent code unit, which may include a protocol stack, template library, and communication interface adapter. Compiled drivers can be registered, meaning they are registered to the driver library, which then records the correspondence between each driver and the controller type and / or protocol type. In practical implementation, after extracting the controller type and / or protocol type from the characteristic parameter set, the driver matching the extracted controller type and / or protocol type is determined through a maintained registry, etc., and then the matching driver is called to process the characteristic parameter set, thereby generating a control instruction sequence.

[0055] Furthermore, in an alternative implementation, for unknown protocols, a large model interface can be invoked to generate a sequence of control commands using the large model. For example, corresponding prompts can be generated, such as "Based on the following hexadecimal message example, identify the protocol structure, function, and data fields, and generate a tentative command template," thereby generating a sequence of control commands for the unknown protocol.

[0056] Step S104: Generate the expected execution result corresponding to the control instruction sequence.

[0057] For any given sequence of control commands, the expected execution result is generated. Specifically, the mapping relationship between commands and expected results can be determined in advance based on the set of characteristic parameters, equipment technical specifications, process design documents, physical laws, and prior knowledge. Then, the expected execution result corresponding to the current sequence of control commands is obtained based on the generated mapping relationship between commands and expected results.

[0058] In one alternative implementation, specifically, it can be adopted Figure 3 The steps shown generate the expected execution result: S1041, parse the control instruction sequence and extract the operation semantics.

[0059] The control instruction sequence is parsed to extract the operation semantics, which includes operation type (such as read, write, etc.), operation object (such as the point being operated on), operation value, etc.

[0060] For example, the operation semantics of {“address”: “DB10.DBD4”, “value”: 50.0, “operation”: “write”} is: write the power value 50.0 to the analog output point at address DB10.DBD4.

[0061] S1042, obtain the associated feature parameters of the control command sequence.

[0062] To further improve the accuracy of determining the expected execution result, the associated feature parameters of the control command sequence can be obtained. Specifically, based on the point address or point name in the control command sequence, the feature parameters corresponding to that point address or point name are searched in the feature parameter set. These feature parameters are the associated feature parameters of the control command sequence, such as signal type, engineering range, semantic description, etc.

[0063] S1043, Based on the operational semantics of the control instruction sequence and the associated feature parameters, generate the expected execution result corresponding to the control instruction sequence.

[0064] Specifically, the expected execution result can be directly determined based on the operational semantics and associated feature parameters. For example, if the control instruction sequence is "open valve A", then the expected execution result is "open valve A".

[0065] Furthermore, result mapping curves or result mapping tables can be generated in advance based on process parameters and physical models. For example, a curve showing the change between sensor temperature and output power can be constructed in advance based on the heating process and heating physical model. If the power value in the control command sequence is B, the temperature value corresponding to the power value B can be determined by looking up the curve. Thus, the sensor temperature value is the expected execution result.

[0066] Alternatively, a specific instruction-result mapping table can be pre-generated. If the operational semantics and associated features of the current control instruction sequence match a specific instruction in the result mapping table, then the corresponding result in the result mapping table is taken as the expected execution result. For example, the result mapping table can record the mapping relationship between over-range control instruction sequences (operation values ​​exceeding the range of the point) and the result of the warning device generating a warning signal. When the current control instruction sequence is determined to be an over-range control instruction sequence based on its operational semantics and associated features, then the warning device generating a warning signal is taken as the corresponding expected execution result.

[0067] Step S105: Send the control command sequence to the controller of the target industrial control system in the laboratory environment.

[0068] The generated control command sequence is sent to the controller deployed in the laboratory environment of the target industrial control system. The controller will then send the control command sequence to the controlled terminal that it is communicating with, according to its own logic.

[0069] Step S106: Obtain the communication messages between the controller and the controlled terminal, and obtain the actual execution results of the control command sequence.

[0070] The system acquires communication messages, such as protocol data packets, along the communication link between the controller and the controlled terminal. These messages are authentic and complete, reflecting the actual communication between the controller and the controlled terminal in the target industrial control system. This ensures that the subsequently generated samples match the real-world situation. For example, the generated control command sequence is sent to a real S7-1500 PLC in a laboratory environment, and network messages between the S7-1500 PLC and controlled terminals such as simulated heaters / sensors are captured.

[0071] Furthermore, the actual execution result of the controlled terminal after the control command sequence is sent is obtained. This actual execution result is the feedback made by the controlled terminal after executing the control command sequence. This actual execution result may include the status data of the controlled terminal, such as the valve opening status and the measurement value of the temperature sensor; it may also be the response data obtained after the controller sends the control command sequence, such as address error feedback.

[0072] Step S107: Generate an initial sample based on the control command sequence and the corresponding communication message.

[0073] For any control command sequence, the control command sequence can be used as the command output, and the communication message between the controller and the controlled terminal obtained from executing the control command sequence can be used as the response. Then, a set of command outputs + responses forms an initial sample, that is, the control command sequence and its corresponding communication message constitute a set of initial samples.

[0074] Specifically, for any initial sample, a sample label is generated for the communication message of that initial sample based on the control command sequence of that initial sample, thus achieving automatic labeling of the sample labels. When generating operating condition labels, the sample labels are generated based on the operational semantics of the control command sequence and associated feature parameters. For example, the operational semantics of the control command sequence and associated feature parameters such as operation type, point address, signal type, range, and semantic description are extracted as sample labels.

[0075] Step S108: Determine whether the actual execution result is consistent with the expected execution result; if so, proceed to step S109.

[0076] For any sequence of control instructions, compare the actual execution result of the sequence with the expected execution result.

[0077] If the actual execution result is consistent with the expected execution result, then step S109 is executed, thereby taking the initial sample corresponding to the control instruction sequence as a valid sample.

[0078] If the actual execution result is inconsistent with the expected execution result, it indicates that the communication message and sample label in the current initial sample do not match, and the verification fails. It is then necessary to further determine the type of deviation between the actual and expected execution results; correct the control command sequence according to the deviation type to obtain the corrected control command sequence, and further execute step S105.

[0079] In the specific implementation process, for any control command sequence that fails verification, the deviation category corresponding to that control command sequence is determined. The deviation categories include: communication layer deviation, semantic layer deviation, and logic layer deviation. Specifically, if the actual execution result is a response data indicating that the actual network is unreachable, connection is refused, protocol handshake fails, or function code is rejected, then the deviation category is determined to be a communication layer deviation; if the actual execution result is a response data indicating an address error or data type / encoding mismatch, then the deviation category is determined to be a semantic layer deviation; if the actual execution result is compared with the expected execution result, and it is determined that the state of the controlled terminal is different, such as the actual temperature value not matching the expected temperature value, or the actual valve opening / closing state not matching the expected valve opening / closing state, then the deviation category is determined to be a logic layer deviation.

[0080] To address communication layer deviations, the function codes and handshake parameters of the original control instruction sequence are corrected to obtain the corrected control instruction parameters. To address semantic layer deviations, the address format and encoding format of the original control instruction parameters are corrected to obtain the corrected control instruction parameters. To address logic layer deviations, the specific operation status values ​​in the original control instruction sequence are corrected or the instruction timing is adjusted to obtain the corrected control instruction sequence.

[0081] Step S109: Determine the initial sample as a valid sample.

[0082] If the actual execution result is consistent with the expected execution result, the initial sample is determined as a valid sample, a sample ID is assigned to it, and it is added to the sample library for training of the industrial protocol analysis model.

[0083] Therefore, the sample generation method for industrial protocol analysis models provided in this application parses the configuration file of the target industrial control system to generate a feature parameter set, then generates a control command sequence and expected execution results based on the feature parameter set, sends the control command sequence to the controller of the target industrial control system in a laboratory environment, and obtains the communication messages between the controller and the controlled terminal, as well as the actual execution results of the control command sequence; generates an initial sample based on the control command sequence and the corresponding communication messages; and only when the actual execution results are consistent with the expected execution results is the initial sample determined as a valid sample. In this solution, the communication messages in the valid samples are the actual messages generated in the channel between the controller and the controlled terminal of the target industrial control system in the laboratory environment, thereby improving the matching degree between the sample and the real situation. Moreover, each part in the laboratory environment is controllable and will not have an adverse impact on actual production. Furthermore, the initial sample is only considered a valid sample when the actual execution results are consistent with the expected execution results, thereby further ensuring the accuracy of the valid samples. In addition, this solution does not rely on manual intervention, improving sample generation efficiency and saving costs. Moreover, the control commands in this solution are generated based on the feature parameter set, which facilitates the adjustment of the coverage of the control commands, thereby facilitating the improvement of the sample coverage.

[0084] Figure 4 This illustration shows a schematic diagram of a sample generation device for an industrial protocol analysis model provided in an embodiment of this application.

[0085] like Figure 4 As shown, the device 400 includes: a first acquisition module 410, a file parsing module 420, a first generation module 430, a sending module 440, a second acquisition module 450, a second generation module 460, and a verification module 470.

[0086] The first acquisition module 410 is used to acquire the configuration file of the target industrial control system; The file parsing module 420 is used to parse the configuration file to generate a set of characteristic parameters for the target industrial control system. The first generation module 430 is used to generate a control instruction sequence based on the feature parameter set, and to generate the expected execution result corresponding to the control instruction sequence; The sending module 440 is used to send the control command sequence to the controller of the target industrial control system in a laboratory environment; The second acquisition module 450 is used to acquire the communication messages between the controller and the controlled terminal, and to acquire the actual execution results of the control command sequence; The second generation module 460 is used to generate an initial sample based on the control instruction sequence and the corresponding communication message; The verification module 470 is used to determine whether the actual execution result is consistent with the expected execution result; if so, the initial sample is determined as a valid sample.

[0087] In one optional implementation, the first generation module 430 is used to: extract the signal type and operation state space of any point from the feature parameter set; For any given point, if the signal type of that point is digital, then a sequence of control instructions corresponding to each operational state value within the operational state space of that point is generated; if the signal type of that point is analog, then a sequence of control instructions uniformly covering the operational state space of that point is generated.

[0088] In one optional implementation, the first generation module 430 is configured to: if the signal type of the point is an analog quantity, determine the boundary operation state value of the operation state space of the point and generate a control command sequence corresponding to the boundary operation state value; and / or, determine the over-amplitude operation state value of the operation state space of the point and generate a control command sequence corresponding to the over-amplitude operation state value.

[0089] In one optional implementation, the first generation module 430 is configured to: extract the controller type and / or protocol type from the set of feature parameters; Invoke the driver that matches the controller type and / or protocol type to generate a sequence of control instructions.

[0090] In one optional implementation, the first generation module 430 is used to: parse the control instruction sequence and extract operational semantics; Obtain the associated feature parameters of the control command sequence; Based on the operational semantics of the control instruction sequence and the associated feature parameters, the expected execution result corresponding to the control instruction sequence is generated.

[0091] In one optional implementation, the verification module 470 is used to: determine the deviation category of the control instruction sequence if the actual execution result is inconsistent with the expected execution result; The control command sequence is corrected according to the deviation category to obtain a corrected control command sequence, and then the step of sending the control command sequence to the controller of the target industrial control system in a laboratory environment is further executed.

[0092] Therefore, the sample generation device for industrial protocol analysis models provided in this application parses the configuration file of the target industrial control system to generate a feature parameter set, then generates a control command sequence and expected execution results based on the feature parameter set, sends the control command sequence to the controller of the target industrial control system in a laboratory environment, and obtains the communication messages between the controller and the controlled terminal, as well as the actual execution results of the control command sequence; generates an initial sample based on the control command sequence and the corresponding communication messages; and only when the actual execution results are consistent with the expected execution results is the initial sample determined as a valid sample. In this solution, the communication messages in the valid samples are the actual messages generated in the channel between the controller and the controlled terminal of the target industrial control system in the laboratory environment, thereby improving the matching degree between the sample and the real situation. Moreover, each part in the laboratory environment is controllable and will not have an adverse impact on actual production. Furthermore, the initial sample is only considered a valid sample when the actual execution results are consistent with the expected execution results, thereby further ensuring the accuracy of the valid samples. In addition, this solution does not rely on manual intervention, improving sample generation efficiency and saving costs. Moreover, the control commands in this solution are generated based on the feature parameter set, which facilitates the adjustment of the coverage of the control commands, thereby facilitating the improvement of the sample coverage.

[0093] This application provides a non-volatile computer storage medium storing at least one executable instruction or computer program that enables a processor to perform the operation corresponding to the sample generation method for the industrial protocol analysis model in any of the above method embodiments.

[0094] This application provides a computer program product comprising at least one executable instruction or computer program that enables a processor to perform operations corresponding to the sample generation method for industrial protocol analysis models in any of the above method embodiments.

[0095] Figure 5 The diagram shows a structural schematic of a computing device provided in an embodiment of this application. The specific embodiments of this application do not limit the specific implementation of the computing device.

[0096] like Figure 5 As shown, the computing device may include: a processor 502, a communications interface 504, a memory 506, and a communications bus 508.

[0097] The processor 502, communication interface 504, and memory 506 communicate with each other via communication bus 508. Communication interface 504 is used to communicate with other network elements such as clients or other servers. Processor 502 executes program 510, specifically performing the relevant steps in the above-described embodiment of the sample generation method for industrial protocol analysis models for computing devices.

[0098] Specifically, program 510 may include program code that includes a sequence of computer control instructions.

[0099] The processor 502 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The computing device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0100] Memory 506 is used to store program 510. Memory 506 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0101] Specifically, program 510 can be used to cause processor 502 to execute the sample generation method for industrial protocol analysis models in any of the above method embodiments. The specific implementation of each step in program 510 can be found in the corresponding descriptions of the steps and units in the above-described sample generation method embodiments for industrial protocol analysis models, and will not be repeated here. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be repeated here.

[0102] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, the embodiments of this application are not directed to any particular programming language. It should be understood that the contents of the embodiments of this application described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best implementation of the embodiments of this application.

[0103] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0104] Similarly, it should be understood that, in order to streamline this disclosure and aid in understanding one or more of the various inventive aspects, features of the embodiments of this application are sometimes grouped together in a single embodiment, figure, or description thereof in the foregoing description of exemplary embodiments of the present application. However, this approach to disclosure should not be construed as reflecting an intention that the claimed embodiments of the present application require more features than expressly recited in each claim. Rather, as reflected in the claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of the present application.

[0105] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0106] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the embodiments of this application and form different embodiments. For example, in the claims, any one of the claimed embodiments can be used in any combination.

[0107] The various component embodiments of this application can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components according to the embodiments of this application. The embodiments of this application can also be implemented as device or apparatus programs (e.g., computer programs and computer program products) for performing part or all of the methods described herein. Such programs implementing the embodiments of this application can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

[0108] It should be noted that the above embodiments are illustrative of the embodiments of this application and not limiting of the embodiments of this application, and those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. Embodiments of this application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

Claims

1. A sample generation method for an industrial protocol analysis model, characterized in that, include: Obtain the configuration file of the target industrial control system; The configuration file is parsed to generate a set of characteristic parameters for the target industrial control system; Generate a control instruction sequence based on the feature parameter set, and generate the expected execution result corresponding to the control instruction sequence; The control command sequence is sent to the controller of the target industrial control system in a laboratory environment; Obtain the communication messages between the controller and the controlled terminal, and obtain the actual execution results of the control command sequence; An initial sample is generated based on the control command sequence and the corresponding communication message; Determine whether the actual execution result is consistent with the expected execution result; If so, the initial sample is determined as a valid sample.

2. The method according to claim 1, characterized in that, The step of generating a control command sequence based on the feature parameter set includes: Extract the signal type and operation state space of any point from the set of feature parameters; For any given point, if the signal type of that point is digital, then a sequence of control instructions corresponding to each operational state value within the operational state space of that point is generated; if the signal type of that point is analog, then a sequence of control instructions uniformly covering the operational state space of that point is generated.

3. The method according to claim 2, characterized in that, The method further includes: If the signal type of the point is analog, then determine the boundary operation state value of the operation state space of the point and generate the control command sequence corresponding to the boundary operation state value; and / or, determine the over-amplitude operation state value of the operation state space of the point and generate the control command sequence corresponding to the over-amplitude operation state value.

4. The method according to claim 2 or 3, characterized in that, The step of generating a control command sequence based on the feature parameter set includes: Extract the controller type and / or protocol type from the set of feature parameters; Invoke the driver that matches the controller type and / or protocol type to generate a sequence of control instructions.

5. The method according to any one of claims 1-3, characterized in that, The expected execution result corresponding to the generated control instruction sequence includes: Parse the control instruction sequence and extract the operational semantics; Obtain the associated feature parameters of the control command sequence; Based on the operational semantics of the control instruction sequence and the associated feature parameters, the expected execution result corresponding to the control instruction sequence is generated.

6. The method according to any one of claims 1-3, characterized in that, The method further includes: If the actual execution result is inconsistent with the expected execution result, then the deviation category of the control instruction sequence is determined; The control command sequence is corrected according to the deviation category to obtain a corrected control command sequence, and then the step of sending the control command sequence to the controller of the target industrial control system in a laboratory environment is further executed.

7. A sample generation device for industrial protocol analysis models, characterized in that, include: The first acquisition module is used to acquire the configuration file of the target industrial control system; The file parsing module is used to parse the configuration file to generate a set of characteristic parameters for the target industrial control system. The first generation module is used to generate a control instruction sequence based on the feature parameter set, and to generate the expected execution result corresponding to the control instruction sequence; A sending module is used to send the sequence of control commands to the controller of the target industrial control system in a laboratory environment; The second acquisition module is used to acquire the communication messages between the controller and the controlled terminal, and to acquire the actual execution results of the control command sequence; The second generation module is used to generate an initial sample based on the control command sequence and the corresponding communication message. The verification module is used to determine whether the actual execution result is consistent with the expected execution result; if so, the initial sample is determined as a valid sample.

8. A computing device, characterized in that, include: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the operation corresponding to the sample generation method for the industrial protocol analysis model as described in any one of claims 1-6.

9. A computer storage medium, characterized in that, The storage medium stores at least one executable instruction that causes the processor to perform the operation corresponding to the sample generation method for the industrial protocol analysis model as described in any one of claims 1-6.

10. A computer program product, characterized in that, It includes at least one executable instruction that causes the processor to perform the operation corresponding to the sample generation method for the industrial protocol analysis model as described in any one of claims 1-6.