Method for detecting hidden attacks on a numerical control system and related device

By acquiring the state variables of the tool in the CNC system, reconstructing the observed motion trajectory and comparing it with the expected trajectory, and using an extended Kalman filter and a long short-term memory neural network to detect covert attacks on the CNC system, the problem of the inability to detect covert attacks in existing technologies is solved, ensuring machining quality and safety.

CN117008531BActive Publication Date: 2026-11-27INSTITUTE OF INFORMATION ENGINEERING CHINESE ACADEMY OF SCIENCES
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310788016.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-29
Publication Date
2026-11-27
Estimated Expiration
2043-06-29

AI Technical Summary

Technical Problem

Existing technologies cannot effectively detect covert attacks in CNC systems, leading to risks such as production interruptions, leakage of sensitive information, and personal injury. Existing protective measures are unable to counter attackers' covert attacks achieved by evading detection techniques.

Method used

By acquiring the state variables of the cutting tool, reconstructing the observed motion trajectory, and comparing it with the expected motion trajectory, the contour error is determined using an extended Kalman filter and a long short-term memory neural network, thus achieving accurate detection of covert attacks.

Benefits of technology

It enables accurate detection of covert attacks on CNC systems, ensuring machining quality and safety, and preventing physical damage and information leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117008531B_ABST
    Figure CN117008531B_ABST
Patent Text Reader

Abstract

The application provides a numerical control system covert attack detection method and related equipment, and relates to the technical field of information security of numerical control systems.The method comprises the following steps: acquiring a state quantity of a tool; acquiring an observed motion trajectory of the tool according to the state quantity; and determining a covert attack detection result according to the observed motion trajectory and an expected motion trajectory.The application realizes accurate detection of covert attacks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information security technology for CNC systems, and in particular to a method and related equipment for detecting covert attacks on CNC systems. Background Technology

[0002] As one of the core systems of the Industrial Internet, CNC systems play a crucial role. The security of CNC systems has become an urgent problem to solve. Industrial viruses and cyberattacks can lead to production interruptions, leaks of sensitive information, machine tool damage, and even personal injury, posing significant risks to normal business operations, trade secrets, and the safety of personnel and property. Therefore, protecting the security and stability of CNC systems, strengthening information security awareness, and implementing information security measures are of paramount importance.

[0003] Currently, the more mature related protection mechanisms include the following: Before the processing, encryption and authentication mechanisms are used to protect the security of data and command transmission and storage. After the processing, existing manufacturing systems typically use quality control systems, such as coordinate measuring machines, to inspect the quality of the workpiece.

[0004] Because quality control employs a sampling approach, attackers can bypass inspections by launching attacks outside of the sampled workpieces or inspection points without tampering with the quality control system. Furthermore, there are currently no readily applicable online inspection technologies for the manufacturing process; only some related research exists, mostly used for fault diagnosis, and not suitable for attack detection.

[0005] Attackers often combine detection evasion techniques to achieve covert attacks, such as replaying normal motion data or tampering with quality control data. Existing protection and detection measures, such as Supervisory Control and Data Acquisition (SCADA) software, online diagnostic modules, and quality control methods, are powerless against these covert attacks. Summary of the Invention

[0006] This invention provides a method and related equipment for detecting covert attacks on CNC systems, which solves the shortcomings of existing technologies that cannot detect covert attacks faced by CNC systems, and achieves accurate detection of covert attacks faced by CNC systems.

[0007] This invention provides a method for detecting covert attacks on CNC systems, comprising:

[0008] Obtain the tool's state variables;

[0009] Based on the state variables, the observed motion trajectory of the cutting tool is obtained;

[0010] Based on the observed and expected motion trajectories, the results of the covert attack detection are determined.

[0011] In some embodiments, determining the covert attack detection result based on the observed motion trajectory and the expected motion trajectory includes:

[0012] Determine the contour error between the observed motion trajectory and the desired motion trajectory;

[0013] The contour error is compared with an error threshold.

[0014] If the contour error is greater than the error threshold, the covert attack detection result is determined to be that the CNC system has encountered a covert attack.

[0015] In some embodiments, determining the contour error between the observed motion trajectory and the desired motion trajectory includes:

[0016] Determine the shortest distance from each trajectory point on the observed motion trajectory to the desired motion trajectory;

[0017] The contour error between the observed motion trajectory and the desired motion trajectory is determined based on the shortest distance from each trajectory point on the observed motion trajectory to the desired motion trajectory.

[0018] In some embodiments, obtaining the observed motion trajectory of the tool based on the state quantity includes:

[0019] The state variables are input into the correlation model to obtain the observed motion trajectory; the correlation model is based on the extended Kalman filter and is used to characterize the correlation between the motion trajectory of the tool and the state variables.

[0020] In some embodiments, before determining the covert attack detection result based on the observed motion trajectory and the expected motion trajectory, the method further includes:

[0021] The original digital control code is parsed to obtain the initial desired motion trajectory;

[0022] The initial desired motion trajectory is densified using a data sampling interpolation method to obtain the desired motion trajectory.

[0023] In some embodiments, before comparing the contour error with an error threshold, the method further includes:

[0024] The state variables are input into the prediction model to obtain the predicted state variables; the prediction model is obtained by training historical state variables based on a long short-term memory neural network.

[0025] The difference between the state quantity and the predicted state quantity is used as the error threshold.

[0026] The present invention also provides a covert attack detection device for CNC systems, comprising:

[0027] The first acquisition module is used to acquire the tool's status variables;

[0028] The second acquisition module is used to acquire the observed motion trajectory of the tool based on the state quantity;

[0029] The determination module is used to determine the covert attack detection result based on the observed motion trajectory and the expected motion trajectory.

[0030] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the above-described methods for detecting covert attacks on CNC systems.

[0031] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the covert attack detection method for CNC systems as described above.

[0032] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the above-described methods for detecting covert attacks on CNC systems.

[0033] The method and related equipment for detecting covert attacks on CNC systems provided by this invention estimate the observed motion trajectory of the tool by using the immutable tool state variables of the CNC system, and achieve accurate detection of covert attacks by comparing the observed motion trajectory with the expected motion trajectory. Attached Figure Description

[0034] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0035] Figure 1 This is an operation flowchart for an intelligent manufacturing production line;

[0036] Figure 2 This is a diagram illustrating a cross-network attack scenario targeting CNC machining operations.

[0037] Figure 3 This is one of the flowcharts of a method for detecting covert attacks on CNC systems provided in an exemplary embodiment of the present invention;

[0038] Figure 4 This is a second flowchart illustrating a method for detecting covert attacks on CNC systems provided in an exemplary embodiment of the present invention.

[0039] Figure 5 This is a schematic diagram of the structure of the concealed attack detection device for CNC systems provided by the present invention;

[0040] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0041] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. It should be noted that, unless otherwise specified, the embodiments and features of the embodiments of this invention can be combined with each other. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0042] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.

[0043] It should be further noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0044] In this invention, "at least one" means one or more, and "more than one" means two or more. The terms "first," "second," "third," "fourth," etc. (if present) in this invention are used to distinguish similar objects, rather than to describe a specific order or sequence.

[0045] In embodiments of the present invention, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in embodiments of the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0046] A Smart Manufacturing Production Line (SMPL) includes a design terminal, a Manufacturing Execution System (MES), a Distributed Numerical Control (DNC) / Manufacturing Data Collection (MDC) server, an engineering workstation, and multiple CNC machine tools.

[0047] Based on the business process and part drawings, process engineers use computer-aided manufacturing (CAM) and other design software to write numerical control (NC) code for the CNC system and transmit it to the DNC server. The DNC server sends the NC code to the CNC system and performs version management and backup operations on the program. The CNC system uses the NC code to control the relative movement between the tool and the workpiece, as well as the cutting depth and force, to complete the machining task. To monitor the execution of the NC code, the MDC server uses the data acquisition interface within the CNC system to collect the operating status and machining data of the CNC machine tool in real time or at regular intervals.

[0048] Please refer to Figure 1 , Figure 1 This is the operation flowchart of an intelligent manufacturing production line. The SMPL operation flow is completed collaboratively by multiple controllers and numerous sensors and actuators, and can be divided into the information domain, control domain, and physical domain. The operation flow consists of the following parts:

[0049] The CNC program writing and transmission process: Programmers use engineering design software in the process engineer's workstation to write NC code, and then transmit the code to the DNC server to distribute machining tasks among multiple CNC systems. Operators can also perform simple programming on the machine tool's Human Machine Interface (HMI) and transmit it to the CNC device for calculation and processing via the internal network.

[0050] The configuration process for CNC system parameters is as follows: The operator configures CNC system parameters, such as interpolation cycle and Proportional-Integral-Differential (PID) parameters, through the HMI. The configuration file is then sent to the CNC device, and some parameters are sent to the servo drive. Engineers can also remotely operate the configuration file from the operator station and send it to the CNC device.

[0051] Machine tool operating status monitoring process: The CNC system reads real-time system status data, such as spindle speed, tool position, and temperature, through internal sensors, and transmits this data to the machine tool HMI for operator monitoring and observation of the machining process. Simultaneously, the status data is transmitted to the MDC server for storage and display, also allowing engineers to monitor and control the machining process.

[0052] The interpolation control process of a CNC device: The motion control software in the CNC system fits the required motion trajectory based on the data provided in the NC code, such as the type of curve, the starting point, the ending point, and the predetermined speed, and sends command pulses to the servo systems corresponding to each coordinate axis to form the feed motion.

[0053] Feedback control process of servo system: The position loop, speed loop and current loop algorithms in the servo system adjust the error between the interpolation result and the position measurement value, and amplify the command pulse from the CNC device into the drive current to control the motor through power amplification.

[0054] The process of driving the servo motor: The servo drive outputs three-phase alternating current with a specific frequency and phase, forming a synchronous magnetic field in the stator coils of the motor according to Faraday's law of electromagnetic induction. The permanent magnet rotor rotates synchronously under the influence of the stator magnetic field. The rotation of the servo motor is transmitted through mechanical structures such as ball screws, driving the worktable to make corresponding movements, so that the tool and the workpiece move relative to each other according to predetermined parameters such as trajectory and speed, completing the machining task specified in the program.

[0055] Please refer to Figure 2 , Figure 2 This is a diagram illustrating a cross-network attack scenario targeting CNC machining operations. The enterprise management network includes design terminals and Manufacturing Execution System (MES) servers. The enterprise management network connects to the local control network via a firewall. The local control network includes DNC / MDC servers and engineer / operator stations. The local control network controls the field network via industrial Ethernet. The field network includes various CNC machine tools, including the machine tool bodies. Attackers can launch covert attacks on the local control network to disrupt the machining process. This typically involves the following steps:

[0056] Payload Delivery: The processing document reviewer accesses the DNC server on the DNC client and downloads a malicious spreadsheet (Excel) file. Opening the malicious Excel file on the DNC client triggers a stack overflow vulnerability (CVE-2018-0798) in the Office software, releasing the attack payload to the CNC system.

[0057] Lateral movement: CNC system attack payloads utilize the Secure Shell Protocol (SSH) of the CNC system's debugging interface to remotely log in to the CNC system, masquerading as traffic from remote CNC software (Access MyMachine, AMM) to complete malicious script uploads, privilege escalation, and malicious script execution operations.

[0058] Machining process disruption: Malicious scripts in the CNC system tamper with the internal NC code, causing deviations in the machining trajectory and reducing the quality of the workpiece, thereby decreasing the dimensional accuracy, positional accuracy, and shape accuracy of the machined workpiece.

[0059] To address the shortcomings of existing technologies in detecting covert attacks on CNC systems, this invention provides a method for detecting covert attacks on CNC systems. The following will describe in detail the method for detecting covert attacks on CNC systems provided by this invention.

[0060] Please refer to Figure 3 , Figure 3 This is one of the flowcharts illustrating a method for detecting covert attacks on a CNC system according to an exemplary embodiment of the present invention. The present invention provides a method for detecting covert attacks on a CNC system, wherein the executing entity of the method can be a detection server for detecting covert attacks, and the detection server establishes a communication connection with the CNC system. For example... Figure 3 As shown, the method for detecting covert attacks on CNC systems provided in this embodiment includes:

[0061] Step 310: Obtain the tool status variables.

[0062] Specifically, CNC systems are typical cyber-physical systems, characterized by the coupling and mutual influence between their information and physical components. This characteristic means that a significant portion of attacks targeting CNC systems no longer aim to compromise the confidentiality, integrity, and availability of the information system, but rather directly impact the physical production process, causing physical damage. Typical attacks that can cause physical damage include NC code tampering, configuration parameter tampering, and firmware tampering.

[0063] In CNC machine tools, tool motion serves as a crucial bridge connecting information domain attacks and physical domain effects. Attacks that disrupt physical machining results often achieve their purpose by influencing the tool's trajectory. Therefore, this invention leverages the characteristics of physical destruction attacks and employs active monitoring technology in the physical domain to monitor the tool's state. The CNC system then transmits the acquired state data to a detection server. Deploying the detection server in a bypass manner allows it to perceive anomalies in the machined workpiece without interference, thereby enabling more accurate detection of covert attacks.

[0064] The machining information *u* is defined as describing the geometric information of the workpiece and the state information of the machining process. Geometric information includes dimensions, shape, and position, while state information includes feed rate and spindle speed. The machining information *u* flows and transforms within the CNC machining workflow, ultimately forming control commands *y* sent to the actuators. The actuators execute corresponding actions according to the control commands *y*, thereby changing the state variables *s* of the machining process.

[0065] The state variable s describes the feed motion and the main motion. The main motion and feed motion together constitute the machine tool's machining actions on the workpiece, and jointly affect the workpiece's machining quality q = {q1, q2, ... q}. j}, where q j It describes the machining accuracy of geometric element j in the workpiece.

[0066] Define the state variables s = [d, v, p, r], where d = [d x d y d z ] represents the direction of motion on the feed axes in the X, Y, and Z directions, d i∈{x,y,z} ∈{0, 1}, d = 0 represents movement along the feed axis towards the origin, d = 1 represents movement away from the origin along the feed axis. v = [v x v y v z ] represents the motion speed of the feed axes in the X, Y, and Z directions, v i∈{x,y,z} ∈R≥0. p=[p x p y p z ] represents the position of the feed axes in the X, Y, and Z directions, p i∈{x,y,z} ∈R≥0. r represents a real number.

[0067] Suppose an attacker can penetrate any stage of the CNC machining process, compromising the integrity of software, firmware, and communication, and tampering with the machining information transmitted in the CNC machining process, i.e., u becomes u′=u+e, where e is the error signal injected by the attacker. The attack causes the machining quality of the workpiece to decrease by q′.

[0068] A grating ruler is installed on the three feed axes X, Y and Z. The grating ruler is used to collect state variables such as feed speed and position.

[0069] Step 320: Obtain the observed motion trajectory of the tool based on the state variables.

[0070] Specifically, the detection server reconstructs the tool's motion trajectory based on the tool's state parameters, and uses the reconstructed trajectory as the observed motion trajectory.

[0071] Optionally, the detection server can fit the tool's running trajectory based on the tool's state variables to obtain the observed motion trajectory.

[0072] Optionally, the detection server can determine the correlation between state variables and running trajectories, and determine the motion trajectory corresponding to the state variables based on the correlation. The motion trajectory corresponding to the state variables is the observed motion trajectory.

[0073] In some embodiments, before obtaining the observed motion trajectory of the tool based on the state variables, the detection server can sample the state variables of the tool, preprocess the sampled data using a low-pass filter, and remove data noise and harmonic effects.

[0074] Step 330: Determine the covert attack detection result based on the observed motion trajectory and the expected motion trajectory.

[0075] Specifically, optionally, the detection server can compare the observed motion trajectory with the expected motion trajectory, and confirm the covert attack detection result based on the comparison result.

[0076] For example, if the observed motion trajectory does not match the expected motion trajectory, the detection server confirms that the CNC system has been subjected to a covert attack; if the observed motion trajectory matches the expected motion trajectory, the detection server confirms that the CNC system has not been subjected to a covert attack.

[0077] Optionally, the detection server can confirm the covert attack detection results based on the contour error between the observed motion trajectory and the expected motion trajectory.

[0078] For example, a preset error threshold is set based on expert experience. If the contour error is less than or equal to the preset error threshold, the detection server confirms that the CNC system has not been attacked by a covert attack. If the contour error is greater than the preset error threshold, the detection server confirms that the CNC system has been attacked by a covert attack.

[0079] The CNC system covert attack detection method provided in this embodiment estimates the observed motion trajectory of the tool by using the immutable tool state variables of the CNC system, and achieves accurate detection of covert attacks by comparing the observed motion trajectory with the expected motion trajectory.

[0080] Please refer to Figure 4 , Figure 4 This is a second schematic flowchart of a covert attack detection method for CNC systems provided in an exemplary embodiment of the present invention. This embodiment further illustrates the foregoing embodiment, mainly describing the specific process of determining the covert attack detection result based on the observed motion trajectory and the desired motion trajectory. Figure 4 As shown, the method for detecting covert attacks on CNC systems provided in this embodiment includes:

[0081] Step 410: Determine the contour error between the observed motion trajectory and the desired motion trajectory.

[0082] Specifically, the contour error between the observed trajectory and the desired trajectory can be the shortest distance from each trajectory point on the observed trajectory to the desired trajectory, or it can be the average of the shortest distances from all trajectory points to the desired trajectory.

[0083] In some embodiments, before determining the contour error between the observed motion trajectory and the desired motion trajectory, the detection server may also perform temporal alignment of the observed motion trajectory and the desired motion trajectory based on a dynamic time warping algorithm.

[0084] Step 420: Compare the contour error with the error threshold.

[0085] Specifically, the error threshold can be preset or obtained based on state variables. The contour error is compared with the error threshold to determine the magnitude relationship between the two.

[0086] Step 430: If the contour error is greater than the error threshold, determine that the covert attack detection result is that the CNC system has encountered a covert attack.

[0087] Specifically, if the contour error is less than or equal to the error threshold, the covert attack detection result is determined to be that the CNC system has not encountered a covert attack; if the contour error is greater than the error threshold, the covert attack detection result is determined to be that the CNC system has encountered a covert attack.

[0088] The covert attack detection method for CNC systems provided in this embodiment determines the contour error between the observed motion trajectory and the desired motion trajectory, compares the contour error with an error threshold, and determines the covert attack detection result based on the comparison result, thereby achieving accurate detection of covert attacks.

[0089] Optionally, the CNC system covert attack detection method provided in this embodiment is a further explanation of the foregoing embodiments, mainly illustrating the specific process of determining the contour error between the observed motion trajectory and the desired motion trajectory. The CNC system covert attack detection method provided in this embodiment includes:

[0090] Determine the shortest distance from each trajectory point on the observed motion trajectory to the desired motion trajectory;

[0091] The contour error between the observed and desired motion trajectories is determined based on the shortest distance from each trajectory point on the observed trajectory to the desired trajectory.

[0092] Specifically, the shortest distance from each trajectory point on the observed motion trajectory to the desired motion trajectory is calculated.

[0093] In some embodiments, after obtaining the desired motion trajectory, the desired motion trajectory can be decomposed into multiple segments to determine the start and end points of each segment. For example, if the desired motion trajectory is a square, the square trajectory can be decomposed into four segments, each of which is a side of the square trajectory.

[0094] The starting coordinates s of each desired motion trajectory segment i =[x si ,y si ,z si End point coordinates e i =[x ei ,y ei ,z ei ], Reverse point coordinates r i =[x ri ,y ri ,z ri A whitelist of trajectory segments is formed by multiple expected motion trajectories.

[0095] The equation of the curve for each segment of the desired trajectory can be expressed as:

[0096]

[0097] In the formula, t s Let t represent the starting time of each desired trajectory segment. e Let u denote the endpoint time of each desired motion trajectory segment. x (t) represents the position of the trajectory point in the X direction at time t, u y (t) represents the position of the trajectory point in the Y direction at time t, and uz(t) represents the position of the trajectory point in the Z direction at time t.

[0098] Assume that the trajectory point o on the observed motion trajectory is This represents the position of trajectory point o in the X direction at time t. This indicates the position of trajectory point o in the Y direction at time t. This represents the position of trajectory point o in the Z direction at time t. The process of calculating the shortest distance from trajectory point o on the observed trajectory to the desired trajectory is as follows:

[0099] Using the start and end times of each desired trajectory segment as constraints, the parameter t is found using an iterative method. q , parameter t q This represents the time corresponding to the trajectory point q that is closest to trajectory point o on the desired trajectory. The parameter t... q Substituting the equation of the expected trajectory for the corresponding segment, we can calculate the coordinates [x] of the trajectory point q. q y q z q ].

[0100] The shortest distance between point o on the observed trajectory and point q on the desired trajectory is calculated using the distance formula, as shown below:

[0101]

[0102] In the formula, e t This represents the shortest distance between point o on the observed trajectory and point q on the desired trajectory. This represents the position of trajectory point o in the X direction at time t. This indicates the position of trajectory point o in the Y direction at time t. The x represents the position of trajectory point o in the Z direction at time t. q The x-axis represents the position of the trajectory point q, which is closest to trajectory point o on the desired trajectory. q z represents the position of the trajectory point q, which is closest to trajectory point o on the expected trajectory, in the Y direction. q This represents the position of the trajectory point q, which is closest to trajectory point o on the desired trajectory, in the Z direction.

[0103] After determining the shortest distance from each trajectory point on the observed motion trajectory to the desired motion trajectory, the detection server can use the shortest distance from each trajectory point on the observed motion trajectory to the desired motion trajectory as the contour error.

[0104] If the shortest distance from a point on the observed motion trajectory to the desired motion trajectory is greater than the error threshold, it indicates that the contour error is greater than the error threshold. In this case, the covert attack detection result is determined to be that the CNC system has encountered a covert attack.

[0105] If the shortest distance from all trajectory points on the observed motion trajectory to the desired motion trajectory is not greater than the error threshold, it indicates that the contour error is less than or equal to the error threshold. In this case, the result of the covert attack detection is determined to be that the CNC system has not encountered a covert attack.

[0106] Optionally, the detection server can first average the shortest distances from all trajectory points on the observed motion trajectory to the desired motion trajectory, and use the average of the shortest distances as the contour error.

[0107] The CNC system covert attack detection method provided in this embodiment determines the shortest distance from each trajectory point on the observed motion trajectory to the desired motion trajectory, and determines the contour error between the observed motion trajectory and the desired motion trajectory based on the shortest distance from each trajectory point on the observed motion trajectory to the desired motion trajectory, thereby realizing the contour error acquisition, which is beneficial for subsequent covert attack detection.

[0108] Optionally, the CNC system covert attack detection method provided in this embodiment is a further explanation of the foregoing embodiments, mainly illustrating the specific process of obtaining the observed motion trajectory of the tool based on state variables. The CNC system covert attack detection method provided in this embodiment includes:

[0109] The state variables are input into the correlation model to obtain the observed motion trajectory. The correlation model is based on the extended Kalman filter and is used to characterize the correlation between the tool's motion trajectory and the state variables.

[0110] Specifically, the Extended Kalman Filter (EKF) further applies Kalman filtering theory to the nonlinear domain. The basic idea of ​​EKF is to linearize the nonlinear system and then perform Kalman filtering. EKF performs a first-order linearization truncation on the Taylor expansion of the nonlinear function, ignoring higher-order terms, thus transforming the nonlinear problem into a linear one, allowing the Kalman linear filtering algorithm to be applied to nonlinear systems.

[0111] The detection server establishes an association module through an extended Kalman filter. The association module is used to characterize the relationship between the tool's motion trajectory and state variables.

[0112] The process of establishing the correlation model includes: (1) Determining the state transition equation of the system: Establishing a state transition equation that describes the law of state change of the system. The equation should include the dynamic model of the system and the relationship between the state variables; (2) Collecting training data: Using speed and position data collected by machine tool motor encoders, etc., to train the model and estimate parameters; (3) Parameter estimation: Estimating the model parameters in the state transition equation through the least squares method or other optimization methods.

[0113] The state variables are input into the correlation model, which outputs the motion trajectory corresponding to the state variables. This motion trajectory is then used as the observed motion trajectory.

[0114] The CNC system covert attack detection method provided in this embodiment establishes an association module to characterize the relationship between the tool's motion trajectory and state variables. By inputting the state variables into the association model, the observed motion trajectory can be accurately determined, which further improves the accuracy of subsequent covert attack detection.

[0115] Optionally, the CNC system covert attack detection method provided in this embodiment is a further explanation of the foregoing embodiments, mainly illustrating the specific process of obtaining the desired motion trajectory before determining the covert attack detection result based on the observed motion trajectory and the desired motion trajectory. The CNC system covert attack detection method provided in this embodiment includes:

[0116] The original digital control code is parsed to obtain the initial desired motion trajectory;

[0117] The initial desired motion trajectory is densified using a data sampling interpolation method to obtain the desired motion trajectory.

[0118] Specifically, NC codes include various part contour information (such as start point, end point, straight line or arc, etc.), machining speed information (F code for controlling cutting feed rate) and other auxiliary information (M code for controlling machine tool functions and actions, S code for controlling spindle speed, T code for selecting tools, etc.).

[0119] The detection server parses the original NC code through lexical and syntactic analysis, extracts key parameters and processes contained in the code, such as feature point coordinates and motion speed, and then fits the extracted key parameters and processes to obtain the initial expected motion trajectory.

[0120] The data sampling interpolation method first samples the initial desired motion trajectory, then obtains interpolated data based on the sampled data, and finally combines the interpolated data to fit the desired motion trajectory again, which is to obtain a series of desired motion trajectory coordinates.

[0121] The CNC system covert attack detection method provided in this embodiment obtains the initial expected motion trajectory through the original NC code to ensure the reliability of the initial expected motion trajectory. Based on the data sampling interpolation method, the initial expected motion trajectory is data densified. On the one hand, this enriches the amount of data for fitting the expected motion and improves the accuracy of the expected motion trajectory. On the other hand, it can smooth the expected motion trajectory.

[0122] Optionally, the CNC system covert attack detection method provided in this embodiment is a further explanation of the foregoing embodiments, mainly illustrating the specific process of obtaining the error threshold before comparing the contour error with the error threshold. The CNC system covert attack detection method provided in this embodiment includes:

[0123] The state variables are input into the prediction model to obtain the predicted state variables; the prediction model is obtained by training historical state variables based on a long short-term memory neural network.

[0124] The difference between the state variable and the predicted state variable is used as the error threshold.

[0125] Specifically, the acquisition module of the Open Platform Communications Unified Architecture (OPC UA) is used to acquire the tool coordinate system position value of the CNC system at a period of 100ms. The historical state of the tool under different feed rates, different motion trajectory types, and different strokes is collected, realizing the traversal collection of historical state values, laying the foundation for improving the generalization ability and robustness of the prediction module.

[0126] For example, the feed rate ranges from [50mm / min, 100mm / min, 500mm / min, 1000mm / min, 2000mm / min, 5000mm / min], and the length of the motion curve ranges from [0.5mm, 1mm, 5mm, 10mm, 50mm, 100mm].

[0127] The input to the prediction model is the historical state quantity. The historical state quantity is trained using a Long Short-Term Memory (LSTM) neural network, and the output is the predicted state quantity at the current time step or the next time step.

[0128] For example, the window size is w s , w before time t s The prediction model takes historical tool positions as input and outputs the predicted tool position at time t.

[0129] The following objective function is used to optimize the prediction model during the training phase.

[0130]

[0131] In the formula, L mse T represents the output of the objective function. train p represents the number of training iterations. t This indicates the historical tool position at time t. This indicates the predicted tool position at time t.

[0132] In L mse When the value reaches the preset threshold, training the prediction model stops, and the trained prediction module is obtained.

[0133] The state quantity is input into the prediction model, the prediction model outputs the predicted state quantity, and the difference between the state quantity and the predicted state quantity is used as the error threshold.

[0134] The CNC system covert attack detection method provided in this embodiment obtains a prediction module by training historical state quantities based on a long short-term memory neural network. The state quantities are input into the prediction model to obtain the predicted state quantities, and the difference between the state quantities and the predicted state quantities is used as the error threshold to achieve accurate acquisition of the error threshold.

[0135] The following describes the covert attack detection device for CNC systems provided by the present invention. The covert attack detection device for CNC systems described below can be referred to in correspondence with the covert attack detection method for CNC systems described above.

[0136] Figure 5 This is a schematic diagram of the structure of the covert attack detection device for CNC systems provided by the present invention, as shown below. Figure 5 As shown, the present invention provides a covert attack detection device for CNC systems, comprising: a first acquisition module 510, a second acquisition module 520, and a determination module 530; wherein:

[0137] The first acquisition module 510 is used to acquire the status variables of the tool;

[0138] The second acquisition module 520 is used to acquire the observed motion trajectory of the tool based on the state quantity;

[0139] The determination module 530 is used to determine the covert attack detection result based on the observed motion trajectory and the expected motion trajectory.

[0140] In some embodiments, the determining module 530 includes: a first determining submodule, a comparison submodule, and a second determining submodule; wherein:

[0141] The first determining submodule is used to determine the contour error between the observed motion trajectory and the desired motion trajectory;

[0142] The comparison submodule is used to compare the contour error with an error threshold;

[0143] The second determining submodule is used to determine that the covert attack detection result is that the CNC system has encountered a covert attack when the contour error is greater than the error threshold.

[0144] In some embodiments, the first determining submodule includes: a first determining unit and a second determining unit; wherein:

[0145] The first determining unit is used to determine the shortest distance from each trajectory point on the observed motion trajectory to the desired motion trajectory;

[0146] The second determining unit is used to determine the contour error between the observed motion trajectory and the desired motion trajectory based on the shortest distance from each trajectory point on the observed motion trajectory to the desired motion trajectory.

[0147] In some embodiments, the second acquisition module 520 is specifically used to: input the state quantity into the correlation model to acquire the observed motion trajectory; the correlation model is established based on the extended Kalman filter and is used to characterize the correlation between the motion trajectory of the tool and the state quantity.

[0148] In some embodiments, the apparatus further includes: a third acquisition module and a fourth acquisition module; wherein:

[0149] The third acquisition module is used to parse the original digital control code and obtain the initial expected motion trajectory;

[0150] The fourth acquisition module is used to densify the initial expected motion trajectory based on the data sampling interpolation method to acquire the expected motion trajectory.

[0151] In some embodiments, the apparatus further includes: a fifth acquisition module and a sixth acquisition module; wherein:

[0152] The fifth acquisition module is used to input the state quantity into the prediction model to obtain the predicted state quantity; the prediction model is obtained by training historical state quantities based on a long short-term memory neural network.

[0153] The sixth acquisition module is used to use the difference between the state quantity and the predicted state quantity as the error threshold.

[0154] It should be noted that the above-mentioned CNC system covert attack detection device provided by the present invention can implement all the method steps implemented in the above method embodiments and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiments and the beneficial effects will not be described in detail.

[0155] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 6As shown, the electronic device may include a processor 610, a communication interface 620, a memory 630, and a communication bus 640. The processor 610, communication interface 620, and memory 630 communicate with each other via the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute a method for detecting covert attacks on a CNC system. This method includes: acquiring the state variables of the tool; acquiring the observed motion trajectory of the tool based on the state variables; and determining the covert attack detection result based on the observed motion trajectory and the desired motion trajectory.

[0156] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0157] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the CNC system covert attack detection method provided by the above methods. The method includes: acquiring the state quantity of the tool; acquiring the observed motion trajectory of the tool according to the state quantity; and determining the covert attack detection result according to the observed motion trajectory and the expected motion trajectory.

[0158] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program implements the method for detecting covert attacks on a CNC system provided by the methods described above. The method includes: acquiring a state quantity of a tool; acquiring an observed motion trajectory of the tool based on the state quantity; and determining a covert attack detection result based on the observed motion trajectory and a desired motion trajectory.

[0159] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0160] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0161] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting covert attacks on CNC systems, characterized in that, include: The state variables of the cutting tool are obtained, which are used to describe the feed motion and the main motion. The main motion and the feed motion together constitute the machining action of the machine tool on the workpiece. The state variables are input into the correlation model to obtain the observed motion trajectory; the correlation model is based on the extended Kalman filter and is used to characterize the correlation between the motion trajectory of the tool and the state variables. The desired motion trajectory is decomposed into multiple segments to determine the start and end points of each segment. Determine the shortest distance from each trajectory point on the observed motion trajectory to the desired motion trajectory; wherein, with the start time and end time of each segment of the desired motion trajectory as constraints, determine the time corresponding to the trajectory point on the desired motion trajectory that is the closest to the trajectory point on the observed motion trajectory, and determine the shortest distance based on the coordinates of the trajectory point on the desired trajectory at the time. The contour error between the observed motion trajectory and the desired motion trajectory is determined based on the shortest distance from each trajectory point on the observed motion trajectory to the desired motion trajectory. The state variables are input into the prediction model to obtain the predicted state variables; the prediction model is obtained by training historical state variables based on a long short-term memory neural network. The difference between the state quantity and the predicted state quantity is used as the error threshold. The contour error is compared with an error threshold. If the contour error is greater than the error threshold, the covert attack detection result is determined to be that the CNC system has encountered a covert attack.

2. The method for detecting covert attacks on CNC systems according to claim 1, characterized in that, Before determining the results of the covert attack detection, the following is also included: The original digital control code is parsed to obtain the initial desired motion trajectory; The initial desired motion trajectory is densified using a data sampling interpolation method to obtain the desired motion trajectory.

3. A covert attack detection device for CNC systems, characterized in that, include: The first acquisition module is used to acquire the state variables of the tool. The state variables are used to describe the feed motion and the main motion. The main motion and the feed motion together constitute the machining action of the machine tool on the workpiece. The second acquisition module is used to input the state variables into the correlation model to acquire the observed motion trajectory; the correlation model is established based on the extended Kalman filter and is used to characterize the correlation between the motion trajectory of the tool and the state variables; The determination module is used to decompose the desired motion trajectory into multiple segments of desired motion trajectory in order to determine the start and end points of each segment of desired motion trajectory; The determining module is further configured to determine the shortest distance from each trajectory point on the observed motion trajectory to the desired motion trajectory; wherein, with the start time and end time of each desired motion trajectory as constraints, the time corresponding to the trajectory point on the desired motion trajectory that is the closest to the trajectory point on the observed motion trajectory is determined, and the shortest distance is determined based on the coordinates of the trajectory point on the desired trajectory at the time. The determining module is further configured to determine the contour error between the observed motion trajectory and the desired motion trajectory based on the shortest distance from each trajectory point on the observed motion trajectory to the desired motion trajectory; The determining module is further configured to input the state quantity into the prediction model to obtain the predicted state quantity; the prediction model is obtained by training historical state quantities based on a long short-term memory neural network. The determining module is further configured to use the difference between the state quantity and the predicted state quantity as an error threshold. The determining module is further configured to compare the contour error with an error threshold; The determining module is further configured to determine, when the contour error is greater than the error threshold, that the covert attack detection result is that the CNC system has encountered a covert attack.

4. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the covert attack detection method for CNC systems as described in any one of claims 1 to 2.

5. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the covert attack detection method for CNC systems as described in any one of claims 1 to 2.

6. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the covert attack detection method for CNC systems as described in any one of claims 1 to 2.

Citation Information

Patent Citations

  • Hidden attack real-time detection method and device of industrial control system

    CN108803565A