Programmable controller for discrete manufacturing process protection, control task data processing method, medium and product
By designing a multi-processor structure and virtual machine module in PLC and using the asynchronous interrupt signal mechanism to collect and process on-site data, the problems of poor real-time and low security in PLC in discrete manufacturing are solved, and industrial control with high real-time and high security are achieved.
Patent Information
- Application Number
- CN202510293959.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2045-03-13
AI Technical Summary
When existing PLCs realize automated control of discrete manufacturing industrial processes, there are problems of poor real-time control and low safety.
Design a programmable controller for discrete manufacturing process protection, adopting a structure of multiple processors, real-time domain virtual machines, non-real-time domain virtual machines and shared memory. Through the asynchronous interrupt signal mechanism of the task module and the data acquisition task module in real time, on-site data is collected periodically and stored in shared memory. The non-real-time domain abnormality detection module performs abnormal analysis and processing, improving security.
It realizes improving the security of industrial control systems without affecting the real-time nature of control tasks, and avoids data access conflicts between data acquisition instructions and control instructions.
Smart Images

Figure CN119806941A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of manufacturing process technology, specifically to the field of discrete manufacturing process control technology, and in particular to a programmable controller, control task data processing method, medium and product for discrete manufacturing process protection. Background Art
[0002] Discrete manufacturing is experiencing rapid technological innovation, and as the core of production line automation, programmable logic controllers (PLCs) are responsible for monitoring and controlling key equipment and operations in the manufacturing process. The real-time control tasks in PLCs are carried out regularly according to the scanning cycle, including input sampling, user control program execution, and output update.
[0003] The inventors have discovered that in the prior art, the process of using PLC to achieve automated control of industrial processes in discrete manufacturing includes: the PLC reads the status signal of an external input device and writes it into the PLC memory; then the PLC reads the data in the memory for processing according to a pre-programmed program, and finally generates corresponding control instructions and writes them into the memory; finally, the PLC reads the control instructions in the memory and executes signal conversion to control the action of the external output device, thereby achieving automated control.
[0004] However, the inventors have found that the above-mentioned prior art still has problems of poor real-time control and low security. Summary of the invention
[0005] The embodiments of the present application provide a programmable controller, a control task data processing method, a medium and a product for discrete manufacturing process protection, so as to achieve the effect of ensuring the real-time performance of task control while improving safety.
[0006] In a first aspect, an embodiment of the present application provides a programmable controller for discrete manufacturing process protection, the programmable controller comprising a plurality of processors, a real-time domain virtual machine, a non-real-time domain virtual machine and a shared memory deployed in the programmable controller;
[0007] The real-time domain virtual machine and the non-real-time domain virtual machine share data through shared memory;
[0008] The real-time domain virtual machine includes a real-time control task module and a data acquisition task module, and the non-real-time domain virtual machine includes an anomaly detection module. The real-time control task module is connected to one of the multiple processors, the data acquisition task module is connected to another processor of the multiple processors, and the anomaly detection module is connected to other processors of the multiple processors, and any two processors of the multiple processors are independent of each other.
[0009] In a second aspect, an embodiment of the present application provides a control task data processing method, which is applied to the programmable controller described in the first aspect, and the method includes:
[0010] Execute the control task cyclically according to a preset period by a real-time control task module, wherein the preset period includes the time taken for the input sampling phase, the time taken for the program execution phase and the time taken for the output updating phase;
[0011] At the starting point of the input sampling phase, a first asynchronous interrupt signal is sent to the data acquisition task module through the real-time control task module, so that the data acquisition task module reads the output image table data of the previous preset cycle;
[0012] At the starting point of the output update phase, a second asynchronous interrupt signal is sent to the data acquisition task module through the real-time control task module, so that the data acquisition task module reads the input image table data of the preset period;
[0013] The output image table data of the previous preset cycle and the input image table data of the preset cycle are stored as field data in the shared memory to obtain a buffer queue;
[0014] The abnormality detection module reads the field data from the buffer queue according to a preset reading strategy, and performs abnormality analysis on the field data to obtain an abnormality detection result.
[0015] In a possible implementation, in the step of cyclically executing the control task according to a preset period through the real-time control task module and the step of sending a first asynchronous interrupt signal to the data acquisition task module through the real-time control task module at the starting point of the input sampling phase so that the data acquisition task module reads the output image table data of the previous preset period and generates the accumulated number of received signals, the computing resource scheduling of the processors corresponding to the real-time control task module and the data acquisition task module do not interfere with each other.
[0016] In a possible implementation, the output image table data of the previous preset cycle and the input image table data of the preset cycle are stored as field data in the shared memory to obtain a cache queue, including: storing the output image table data of the previous preset cycle and the input image table data of the preset cycle as field data and using a fixed-size lock-free circular queue into the shared memory to obtain a cache queue.
[0017] In a possible implementation, the first asynchronous interrupt signal is sent to the data acquisition task module through the real-time control task module at the starting point of the input sampling phase so that the data acquisition task module reads the output image table data of the previous preset cycle, and it also includes: counting processing is performed by the data acquisition task module to accumulate the number of times recorded each time the data acquisition task module receives the first asynchronous interrupt signal to obtain the accumulated number of received signals; when the output image table data and input mapping table data read by the data acquisition task module within the preset cycle corresponding to the first asynchronous interrupt signal are stored as field data in the shared memory, a first cycle label is attached to the input image table data, and a second cycle label is attached to the output image table data, wherein the difference between the first cycle label and the second cycle label is 1.
[0018] In a possible implementation, the method further includes: acquiring training field data during the execution of multiple training control tasks; and constructing a training input-output correlation weight table according to the training field data.
[0019] In a possible implementation, the field data includes input image table data and output image table data read from the cache queue by the exception detection module according to a preset reading strategy within a detection sampling period, wherein the detection sampling period is at least two of the preset periods; accordingly, the exception analysis processing of the field data to obtain the exception detection result includes: constructing a runtime input-output correlation weight table according to the input image table data and the output image table data read from the cache queue by the exception detection module according to the preset reading strategy within the detection sampling period; performing weight coefficient comparison processing according to the runtime input-output correlation weight table and the training input-output correlation weight table to obtain multiple weight coefficient differences; when it is detected that the weight coefficient difference exceeds a preset threshold range, obtaining an exception detection result of the control task execution exception corresponding to the weight coefficient difference.
[0020] In a possible implementation, it further includes: when it is detected that the abnormal detection result triggers an alarm condition, it is sent to a host computer through the abnormal detection module, so that the host computer performs an alarm operation.
[0021] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the above second aspect and / or various possible implementations of the second aspect.
[0022] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above second aspect and / or various possible implementations of the second aspect.
[0023] The programmable controller, control task data processing method, medium and product for discrete manufacturing process protection provided by the embodiment of the present application, wherein the method first executes the control task cyclically according to a preset period through a real-time control task module, wherein the preset period includes the time used in the input sampling phase, the time used in the program execution phase and the time used in the output update phase. Then, at the starting point of the input sampling phase, a first asynchronous interrupt signal is sent to the data acquisition task module through the real-time control task module, so that the data acquisition task module reads the output image table data of the previous preset period. Then, at the starting point of the output update phase, a second asynchronous interrupt signal is sent to the data acquisition task module through the real-time control task module, so that the data acquisition task module reads the input image table data of the preset period. Then, the output image table data of the previous preset period and the input image table data of the preset period are stored in a shared memory as field data to obtain a buffer queue. Finally, the field data is read from the buffer queue according to a preset reading strategy through an abnormality detection module, and abnormal analysis and processing is performed on the field data to obtain an abnormality detection result. This periodic use of field data for anomaly detection improves safety while not affecting the execution of control tasks. The asynchronous interrupt signal mechanism is then used to completely avoid data access conflicts between data acquisition instructions and control instructions to ensure the real-time nature of control tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0025] Figure 1 A schematic diagram of the structure of a programmable controller for discrete manufacturing process protection provided in an embodiment of the present application;
[0026] Figure 2 A flowchart of the control task data processing method provided in this application;
[0027] Figure 3 A schematic diagram of the relationship between the scanning cycle and the control task execution process provided in the embodiment of the present application;
[0028] Figure 4 A schematic diagram of a sending node of a first asynchronous interrupt signal and a second asynchronous interrupt signal provided in an embodiment of the present application;
[0029] Figure 5 A schematic diagram of reading data through a shared memory between a real-time domain virtual machine and a non-real-time domain virtual machine provided in an embodiment of the present application.
[0030] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0031] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0032] In the prior art, the real-time control task in the programmable controller (PLC) is carried out in three stages: input sampling, user control program execution and output update according to the scanning cycle. In the input sampling stage, the PLC reads the status signals of external input devices (such as sensors, switches, etc.), converts these status signals into binary data that can be processed internally, and writes them into the input image table located in the PLC memory; in the user program execution stage, the PLC reads the data in the input image table according to the pre-written user program, performs logical operations, sequential control and other processing, and finally writes the calculated control commands into the output image table; in the output update stage, the PLC reads the values in the output image table, performs signal conversion to control the actions of external output devices (such as actuators, motors, etc.), thereby realizing the automatic control of industrial processes.
[0033] However, the inventors found that during the execution of real-time control tasks of existing PLCs, although PLCs have greatly improved production efficiency and flexibility, they are also exposed to increasingly complex network security threats, including tampering attacks by malicious firmware / control programs, unauthorized access, and data leakage. If an attack invades the PLC to tamper with discrete manufacturing process parameters and related control variables, and at the same time forges the normal operation of the field data acquisition message and transmits it back to the SCADA (supervisory control and data acquisition system) and HMI (human-machine interface) layer through the network, the operator and even the anomaly detection system deployed on the network side will not be able to detect that the PLC is currently under attack, which will affect the production process of discrete manufacturing and have low security. In addition, the PLC anomaly detection function is deployed on the industrial network side equipment (such as the PLC host computer) where the PLC is located, which performs anomaly detection on the PLC based on the network traffic interacting with the PLC. This type of network-side anomaly detection module is far away from the field data on the IO side of the PLC. Due to the delay in network communication, there is a detection delay, which leads to low real-time performance. At the same time, if an attack invades the PLC to tamper with the process parameters and related control variables, and forge the field status information of normal operation and transmit it to the upper network, the network-side anomaly detection module cannot recognize that the PLC is currently under attack because it has been detected based on the forged data. Therefore, there is a problem of low security.
[0034] Combined with the above scenario, it can be seen that in the prior art, by dividing the PLC into real-time domain and non-real-time domain, and then deploying the anomaly detection in the internal non-real-time domain of the PLC, the data acquisition task module deployed in the real-time domain is used to run in parallel with the real-time task, and periodically collect the PLC real-time domain field data. Then send it to the non-real-time domain anomaly detection payload, and at the same time use the asynchronous interrupt signal mechanism to completely avoid the data orientation conflict between the data acquisition task and the control task to ensure real-time performance. It also uses the lightweight anomaly detection payload deployed in the non-real-time domain, which directly provides protection for the process parameters and related control variables involved in the discrete manufacturing industrial control task through the IO data of the PLC site, thereby improving safety.
[0035] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0036] Figure 1 A schematic diagram of the structure of a programmable controller for discrete manufacturing process protection provided in an embodiment of the present application.
[0037] like Figure 1As shown, the programmable controller for discrete manufacturing process protection provided by the embodiment of the present application includes multiple processors, and a real-time domain virtual machine, a non-real-time domain virtual machine and a shared memory are deployed in the programmable controller;
[0038] Data sharing is achieved between real-time domain virtual machines and non-real-time domain virtual machines through shared memory;
[0039] The real-time domain virtual machine includes a real-time control task module and a data acquisition task module, and the non-real-time domain virtual machine includes an anomaly detection module. The real-time control task module is connected to one of the multiple processors, the data acquisition task module is connected to another processor of the multiple processors, and the anomaly detection module is connected to other processors of the multiple processors, and any two processors of the multiple processors are independent of each other.
[0040] like Figure 1 As shown, in this embodiment, the local deployment of the anomaly detection payload can be achieved by using embedded virtualization technology to divide the programmable controller PLC into real-time domain virtual machines and non-real-time domain virtual machines. Among them, the real-time domain virtual machine RTVM can use real-time systems such as RT-Linux, Vxworks, QNX, etc. to run industrial control tasks with strict real-time requirements. The non-real-time domain virtual machine (GPVM) runs non-real-time systems such as Linux and Windows, deploys anomaly detection payloads, and collects, analyzes, makes decisions, and triggers security response measures for field data in the process of real-time industrial control tasks. The local deployment of anomaly detection payloads can deal with deception attacks caused by the monitoring / detection system being far away from the field data source. In addition, in order to deal with covert attacks on process parameters in PLCs.
[0041] In this embodiment, two processor CPU cores can be allocated to the real-time domain virtual machine running on the programmable controller by using a static allocation virtualization management program. Both processor cores are exclusive processors, one exclusive processor is exclusively occupied by the real-time control task module, and the other exclusive processor is exclusively occupied by the data acquisition task module. When the real-time control task module and the data acquisition task module run control tasks, they are on their respective processor cores, and the computing resource scheduling does not affect each other, so the real-time performance of the industrial control tasks can be guaranteed.
[0042] like Figure 1 As shown, in this embodiment, the multiple processors include a central processing unit CPU0, a central processing unit CPU1, a central processing unit CPU2, a central processing unit CPU3 and a graphics processing unit GPU0. Among them, the central processing unit CPU0, the central processing unit CPU1 and the graphics processing unit GPU0 correspond to non-real-time domain virtual machines, and the central processing unit CPU2 and the central processing unit CPU3 correspond to real-time domain virtual machines.
[0043] In summary, the programmable controller for discrete manufacturing process protection provided in the embodiment of the present application can enable the data acquisition task module to run in parallel with the real-time control task, and periodically collect the field data generated by the real-time domain virtual machine of the programmable controller PLC and send it to the non-real-time domain anomaly detection load through shared memory to ensure the security of the control task. At the same time, with the help of the asynchronous interrupt signal mechanism, data access conflicts between data acquisition tasks and control tasks are completely avoided to ensure the real-time performance of industrial control.
[0044] Figure 2 A flowchart of the control task data processing method provided in this application.
[0045] The following will be combined Figure 1 and Figure 2 The control task data processing method provided in the embodiment of the present application is described. The execution subject of the method can be Figure 1 The programmable controller PLC shown in the figure is Figure 1 and Figure 2 As shown, the method includes:
[0046] S201: cyclically executing a control task according to a preset period through a real-time control task module, wherein the preset period includes the time taken for an input sampling phase, the time taken for a program execution phase, and the time taken for an output updating phase.
[0047] In this embodiment, the preset cycle can be the duration of the entire process from the beginning to the end of a control task. In this embodiment, the input sampling phase refers to the process in which the programmable controller PLC reads the status signals of external input devices (such as sensors, switches, etc.) through the real-time control task module, converts these status signals into binary data that can be processed internally, and writes them into the input image table located in the shared memory of the PLC. The program execution phase refers to the process in which the PLC reads the data in the input image table according to the pre-written user program, performs logical operations, sequential control, etc., and finally writes the calculated control commands into the output image table. The output update phase refers to the process in which the programmable controller PLC reads the values in the output image table through the real-time control task module, performs signal conversion to control the actions of external output devices (such as actuators, motors, etc.), thereby realizing automated control of industrial processes.
[0048] Figure 3 A schematic diagram of the relationship between the scan cycle and the control task execution process provided in an embodiment of the present application.
[0049] like Figure 3 As shown, the i-th scanning cycle includes the time spent in the input sampling phase, the time spent in the program execution phase, and the time spent in the output updating phase.
[0050] S202: At the starting point of the input sampling phase, a first asynchronous interrupt signal is sent to the data acquisition task module through the real-time control task module, so that the data acquisition task module reads the output image table data of the previous preset cycle.
[0051] In this embodiment, the first asynchronous interrupt signal can be a non-blocking interrupt signal to ensure that the real-time control task module can execute the next instruction without waiting for interrupt processing after sending the first asynchronous interrupt signal, thereby ensuring the normal execution of the control task. After receiving the first asynchronous interrupt signal, the data acquisition task module starts to read the output image table data of the previous preset cycle of the preset cycle at the current moment.
[0052] S203: At the starting point of the output update phase, a second asynchronous interrupt signal is sent to the data acquisition task module through the real-time control task module, so that the data acquisition task module reads the input image table data of a preset period.
[0053] In this embodiment, the second asynchronous interrupt signal can be a non-blocking interrupt signal to ensure that the real-time control task module can execute the next instruction without waiting for interrupt processing after sending the first asynchronous interrupt signal, thereby ensuring the normal execution of the control task. After receiving the second asynchronous interrupt signal, the data acquisition task module starts to read the input image table data of the preset period corresponding to the current moment.
[0054] Figure 4 A schematic diagram of sending nodes of a first asynchronous interrupt signal and a second asynchronous interrupt signal provided in an embodiment of the present application.
[0055] like Figure 4 As shown, the real-time control task module sends a first asynchronous interrupt signal to the data acquisition task module at the starting point of the input sampling phase in the i+1 preset cycle, so that the data acquisition task module collects the output image table data of the i-th preset cycle. The real-time control task module sends a second asynchronous interrupt signal to the data acquisition task module at the starting point of the output update phase of the i+1 preset cycle, so that the data acquisition task module collects the input image table data of the i+1 cycle.
[0056] In an optional embodiment of the present application, in the steps of cyclically executing the control task according to a preset period by the real-time control task module and sending a first asynchronous interrupt signal to the data acquisition task module through the real-time control task module at the starting point of the input sampling phase so that the data acquisition task module reads the output image table data of the previous preset period and generates the accumulated number of received signals, the computing resource scheduling of the processors corresponding to the real-time control task module and the data acquisition task module do not interfere with each other.
[0057] In this embodiment, the principle of non-interference in the computing resource scheduling of the processors corresponding to the control task module and the data acquisition task module has been Figure 1 The above has been described in the embodiment shown, so this embodiment will not be described in detail here.
[0058] S204: storing the output image table data of the previous preset cycle and the input image table data of the preset cycle as field data into the shared memory to obtain a buffer queue.
[0059] In this embodiment, after each control task is executed within a preset cycle, the preset cycle is recorded as the current preset cycle, and the output image table data of the previous preset cycle of the current preset cycle and the input image table data of the current preset cycle are stored in the shared memory as the field data of the current preset cycle. The storage method of the shared memory can be through a queue, from the write start pointer to the write end pointer to write to the shared memory to form a queue, so as to obtain the final cache area queue.
[0060] In an optional embodiment of the present application, step S204 includes:
[0061] The output image table data of the previous preset cycle and the input image table data of the preset cycle are used as field data and stored in the shared memory by adopting a fixed-size lock-free circular queue to obtain a buffer area queue.
[0062] In this embodiment, the fixed-size lock-free circular queue refers to a concurrent data structure that can efficiently store and read data in a multi-threaded environment without using a traditional lock mechanism. It avoids the performance bottleneck and potential deadlock problems caused by locks and improves the storage and reading efficiency of data. In this embodiment, the cache queue is a lock-free circular queue.
[0063] S205: The anomaly detection module reads the field data from the buffer queue according to a preset reading strategy, and performs an anomaly analysis on the field data to obtain an anomaly detection result.
[0064] In this embodiment, the preset reading strategy may be to periodically read field data from the buffer queue of the shared memory, and the field data may include sensor status and control task commands. At this time, the abnormal detection module, as a queue consumer, takes out the field data from the buffer queue of the shared memory for processing and analysis.
[0065] In this embodiment, since a lock-free circular queue is used, the data collection task module in the real-time domain virtual machine RTVM as the queue producer and the anomaly detection module in the non-real-time domain virtual machine GPVM as the queue consumer will not conflict in queue operations and affect real-time performance.
[0066] Based on the above embodiment, in an optional embodiment of the present application, when step S202 is executed, it also includes:
[0067] Step A: Perform counting processing through the data acquisition task module to accumulate the number of times recorded each time the data acquisition task module receives the first asynchronous interrupt signal, so as to obtain the accumulated number of received signals.
[0068] Step B: When the output image table data and input mapping table data read by the data acquisition task module within the preset period corresponding to the first asynchronous interrupt signal are stored in the shared memory as field data, a first cycle label is attached to the input image table data and a second cycle label is attached to the output image table data, wherein the difference between the first cycle label and the second cycle label is 1.
[0069] In this embodiment, in order to provide support for the abnormal detection module after step S202 to perform correlation analysis based on the data correlation characteristics within the same preset period, the data collection task module also identifies the field data within the same preset period.
[0070] Specifically, a counter for counting preset cycles can be deployed in the data acquisition task module. When the data acquisition task module receives a first asynchronous interrupt signal, the counter is incremented by 1. At the same time, a cycle tag is attached to the field data based on the value generated by the counter each time the field data is stored in the shared memory.
[0071] Figure 5 A schematic diagram of reading data through a shared memory between a real-time domain virtual machine and a non-real-time domain virtual machine provided in an embodiment of the present application.
[0072] like Figure 5 As shown, the real-time domain virtual machine RTVM, as a queue producer, writes input mapping table data into the shared memory according to the write queue pointer, the cumulative number of received signals, and the first cycle tag to generate an input mapping table queue. The real-time domain virtual machine RTVM, as a queue producer, writes output mapping table data into the shared memory according to the write queue pointer, the cumulative number of received signals, and the second cycle tag to generate an output mapping table queue. Conversely, the non-real-time domain virtual machine GPVM, as a queue consumer, reads input mapping table data from the input mapping table queue in the shared memory according to the write queue pointer, the cumulative number of received signals, and the first cycle tag. The non-real-time domain virtual machine GPVM, as a queue consumer, can also read output mapping table data from the output mapping table queue in the shared memory according to the write queue pointer, the cumulative number of received signals, and the second cycle tag.
[0073] For example, when the counter counts to i, the first cycle label of the input image table data of the i-th preset cycle is i, and the second cycle label corresponding to the output image table data is i-1.
[0074] In an optional embodiment of the present application, before the programmable controller is put into use for discrete manufacturing processes, the control task data processing method provided in the embodiment of the present application further includes:
[0075] Step C: Acquire training field data during the execution of multiple training control tasks.
[0076] Step D: Construct a training input-output correlation weight table based on the training site data.
[0077] In this embodiment, multiple training control tasks correspond to multiple training cycles. For example, the training sampling time for obtaining training field data is T1=XT, where X is a sufficiently large value, T is a training cycle, and the training cycle can be the same as the preset cycle. The field data stored in the shared memory is read within T1, and the value of X should ensure that the training field data obtained within T1 can cover all input mapping table data and output mapping table data during the production and use of the programmable controller.
[0078] In this embodiment, the input mapping table and the output mapping table data in the same training cycle can be matched one by one by using the first cycle label and the second cycle label. Therefore, the weight w from a specific input to a specific output in the training sampling time T1 can be calculated. The training input-output correlation weight table finally constructed is shown in Table 1 below:
[0079] Table 1
[0080]
[0081] On the basis of the above embodiment, as an optional embodiment of the present application, a control task data processing method is provided, wherein the field data includes input image table data and output image table data read from the cache queue by the abnormality detection module according to a preset reading strategy within the detection sampling period, wherein the detection sampling period is at least two preset periods, and accordingly, in step S205, abnormality analysis processing is performed on the field data to obtain an abnormality detection result, including:
[0082] S205a: Constructing a runtime input-output relevance weight table according to the input image table data and the output image table data read from the cache queue by the anomaly detection module according to a preset reading strategy within the detection sampling period.
[0083] S205b: Perform weight coefficient comparison processing according to the runtime input-output relevance weight table and the training input-output relevance weight table to obtain multiple weight coefficient differences.
[0084] S205c: When it is detected that the weight coefficient difference exceeds the preset threshold range, an abnormality detection result of the control task execution abnormality corresponding to the weight coefficient difference is obtained.
[0085] In this embodiment, when the programmable logic controller is officially put into use in the discrete manufacturing process, the detection sampling period is much smaller than the training sampling period. At this time, the process of constructing the runtime input-output correlation weight table is similar to the principle of constructing the training input-output correlation weight table in the above embodiment, so it will not be elaborated here in this embodiment.
[0086] Exemplarily, assume that the detection sampling period T2 = YT, where Y << X and Y is an integer. The constructed runtime input-output correlation weight table is shown in Table 2 below:
[0087] Table 2
[0088]
[0089] Among them, p ≤ m, q ≤ n. By comparing the weight coefficients at the same positions in Table 1 and Table 2, the weight coefficient difference is obtained, such as the comparison between w11 in Table 1 and w11 in Table 2 to obtain the weight coefficient difference of w11. When the weight coefficient difference of w11 exceeds the preset threshold range, an abnormal detection result indicating abnormal execution of the control task can be generated; otherwise, a detection result indicating normal execution of the control task can be generated.
[0090] In this embodiment, for the stealthy attack on process parameters in discrete manufacturing, if the attacker makes a slight tampering with the relevant control variables related to the production line process parameters in the programmable logic controller, although it will not cause the production line to stop, and the parameter change at a single observation time point does not reach the preset stop threshold, it will be mistaken for a change caused by normal system disturbances and cannot trigger emergency response measures. However, as the time of discrete manufacturing increases, long-term accumulation will easily cause greater and even immeasurable impacts. Therefore, in the embodiments of the present application, an abnormal detection is performed for each execution of the control task, and the weight coefficients of the runtime input-output correlation weight table and the training input-output correlation weight table constructed during the execution of the control task are compared to obtain the weight coefficient difference, which makes the result of the abnormal detection more accurate, avoids the stealthy attack on the fine-tuning of process parameters for discrete manufacturing processes, and improves security.
[0091] Based on the above embodiment, as a control task data processing method provided in an optional embodiment of the present application, it further includes: when it is detected that the abnormal detection result triggers an alarm condition, it is sent to the host computer through the abnormal detection module so that the host computer performs an alarm operation.
[0092] In this embodiment, the alarm condition may be relevant information or parameters indicating abnormal execution of the control task in the abnormal detection result. For example: 0 indicates abnormal execution of the control task.
[0093] In summary, the control task data processing method provided by the embodiment of the present application first executes the control task cyclically according to a preset period through the real-time control task module, wherein the preset period includes the time used in the input sampling phase, the time used in the program execution phase, and the time used in the output update phase. Then, at the starting point of the input sampling phase, the real-time control task module sends a first asynchronous interrupt signal to the data acquisition task module, so that the data acquisition task module reads the output image table data of the previous preset period. Then, at the starting point of the output update phase, the real-time control task module sends a second asynchronous interrupt signal to the data acquisition task module, so that the data acquisition task module reads the input image table data of the preset period. Then, the output image table data of the previous preset period and the input image table data of the preset period are stored in the shared memory as field data to obtain a buffer queue. Finally, the field data is read from the buffer queue according to the preset reading strategy by the abnormal detection module, and the field data is subjected to abnormal analysis and processing to obtain an abnormal detection result. This periodic use of field data for abnormal detection does not affect the execution of the control task while improving the safety of the abnormal detection, and then completely avoids the data access conflict between the data acquisition instruction and the control instruction through the asynchronous interrupt signal mechanism to ensure the real-time performance of the control task.
[0094] An embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above control task data processing method is implemented.
[0095] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above control task data processing method when executed by a processor.
[0096] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor.
[0097] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.
[0098] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0099] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0100] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0101] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0102] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0103] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0104] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0105] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0106] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0107] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0108] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A programmable controller for discrete manufacturing process protection, characterized in that: The programmable controller includes a plurality of processors, and a real-time domain virtual machine, a non-real-time domain virtual machine and a shared memory are deployed in the programmable controller; The real-time domain virtual machine and the non-real-time domain virtual machine share data through shared memory; The real-time domain virtual machine includes a real-time control task module and a data acquisition task module, and the non-real-time domain virtual machine includes an anomaly detection module. The real-time control task module is connected to one of the multiple processors, the data acquisition task module is connected to another processor of the multiple processors, and the anomaly detection module is connected to other processors of the multiple processors, and any two processors of the multiple processors are independent of each other.
2. A control task data processing method, applied to the programmable controller as claimed in claim 1, characterized in that: The method comprises: Execute the control task cyclically according to a preset period by a real-time control task module, wherein the preset period includes the time taken for the input sampling phase, the time taken for the program execution phase and the time taken for the output updating phase; At the starting point of the input sampling phase, a first asynchronous interrupt signal is sent to the data acquisition task module through the real-time control task module, so that the data acquisition task module reads the output image table data of the previous preset cycle; At the starting point of the output update phase, a second asynchronous interrupt signal is sent to the data acquisition task module through the real-time control task module, so that the data acquisition task module reads the input image table data of the preset period; The output image table data of the previous preset cycle and the input image table data of the preset cycle are stored as field data in the shared memory to obtain a buffer queue; The abnormality detection module reads the field data from the buffer queue according to a preset reading strategy, and performs abnormality analysis on the field data to obtain an abnormality detection result.
3. The method according to claim 2, characterized in that In the step of executing the control task cyclically according to a preset period through the real-time control task module and the step of sending a first asynchronous interrupt signal to the data acquisition task module through the real-time control task module at the starting point of the input sampling stage so that the data acquisition task module reads the output image table data of the previous preset period and generates the accumulated number of received signals, the computing resource scheduling of the processors corresponding to the real-time control task module and the data acquisition task module do not interfere with each other.
4. The method according to claim 2, characterized in that: The step of storing the output image table data of the previous preset cycle and the input image table data of the preset cycle as field data into the shared memory to obtain a buffer queue includes: The output image table data of the previous preset cycle and the input image table data of the preset cycle are used as field data and stored in the shared memory in a fixed-size lock-free circular queue to obtain a cache queue.
5. The method according to claim 2, characterized in that: The starting point of the input sampling phase sends a first asynchronous interrupt signal to the data acquisition task module through the real-time control task module so that the data acquisition task module reads the output image table data of the previous preset cycle, and also includes: The data acquisition task module performs counting processing to accumulate the number of times recorded each time the data acquisition task module receives the first asynchronous interrupt signal, thereby obtaining an accumulated number of received signals; When the output image table data and input mapping table data read by the data acquisition task module within the preset period corresponding to the first asynchronous interrupt signal are stored as field data in the shared memory, a first cycle label is attached to the input image table data, and a second cycle label is attached to the output image table data, wherein the difference between the first cycle label and the second cycle label is 1.
6. The method according to claim 2, characterized in that Also includes: Acquire training site data during the execution of multiple training control tasks; A training input-output relevance weight table is constructed based on the training field data.
7. The method according to claim 6, characterized in that The field data includes the input image table data and the output image table data read from the cache queue by the abnormality detection module according to a preset reading strategy within a detection sampling period, wherein the detection sampling period is at least two of the preset periods; Accordingly, performing abnormal analysis on the field data to obtain an abnormal detection result includes: Constructing a runtime input-output relevance weight table according to the input image table data and the output image table data read from the cache queue by the anomaly detection module according to a preset reading strategy within the detection sampling period; Performing a weight coefficient comparison process according to the runtime input-output relevance weight table and the training input-output relevance weight table to obtain a plurality of weight coefficient differences; When it is detected that the weight coefficient difference exceeds a preset threshold range, an abnormality detection result of abnormal execution of the control task corresponding to the weight coefficient difference is obtained.
8. The method according to any one of claims 2 to 7, characterized in that Also includes: When it is detected that the abnormal detection result triggers an alarm condition, it is sent to the host computer through the abnormal detection module so that the host computer performs an alarm operation.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 2 to 8 when executed by a processor.
10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 2 to 8 when being executed by a processor.
Citation Information
Patent Citations
Industrial internet operating system-based heterogeneous field equipment control management system
CN106941516A
PLC safety real-time monitoring method and system
CN111007796A
Real-time scheduling method based on soft PLC
CN114755991A
Control system and control method
CN119513857A
A computer system and method for controlling and / or monitoring a wind power plant
WO2011150929A1