Anomaly detection method and apparatus for industrial equipment, electronic device, and storage medium
Patent Information
- Application Number
- EP2021947476
- Authority / Receiving Office
- EP · EP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2021-06-29
- Publication Date
- 2025-02-26
Smart Images

Figure 1.1
Abstract
Description
ANOMALY DETECTION METHOD AND APPARATUS FOR INDUSTRIAL EQUIPMENT, ELECTRONIC DEVICE, AND STORAGE MEDIUMTECHNICAL FIELD
[0001] This application relates to the field of computer technologies, and in particular, to an anomaly detection method and apparatus, an electronic device, and a storage medium.BACKGROUND
[0002] Industrial equipment may have a fault during operating, and before the fault occurs, the industrial equipment has an anomaly. For example, before an electric spindle of a numerical control machine tool has a fault, the current of the electric spindle has an anomaly. If the anomaly occurring in the industrial equipment can be detected in time, the industrial equipment may be maintained in advance, to avoid occurrence of a severe fault. It is usually difficult for people to find an anomaly occurring before the industrial equipment has a fault, but the anomaly may be detected according to operating data of the industrial equipment.
[0003] Currently, a machine learning model used for anomaly detection is trained, operating data of industrial equipment is inputted into the trained machine learning model, and whether the industrial equipment has an anomaly is detected through the machine learning model. For example, a current value of an electric spindle during operating is inputted into a pre-trained machine learning model, and whether the electric spindle has an anomaly is determined through the machine learning model.
[0004] Pieces of operating data of the industrial equipment usually have a time sequence correlation, that is, pieces of operating data at neighboring moments are associated. However, in the existing anomaly detection method, the trained machine learning model does not consider the time sequence correlation between the pieces of operating data. As a result, accuracy of detecting an anomaly of the industrial equipment is relatively poor.
[0005] SUMMARY
[0006] In view of this, this application provides an anomaly detection method and apparatus for industrial equipment, an electronic device, and a storage medium, to improve accuracy of performing anomaly detection on industrial equipment.
[0007] According to a first aspect, an embodiment of this application provides an anomaly detection method for industrial equipment, including:
[0008] obtaining current operating data and historical operating data of to-be-detected industrial equipment, where the current operating data is operating data of the industrial equipment at a current moment, and the historical operating data is operating data of the industrial equipment at a historical moment;
[0009] obtaining predicted operating data of the industrial equipment according to the historical operating data, where the predicted operating data is a predicted value of the operating data of the industrial equipment at the current moment;
[0010] calculating a difference between the current operating data and the predicted operating data, and obtaining an operating data deviation;
[0011] determining a deviation range according to the operating data deviation and a pre-determined deviation distribution, where the deviation distribution is used for representing a data distribution met by a difference between an actual value and a predicted value of operating data of the industrial equipment during normal operating; and
[0012] determining, if the operating data deviation falls beyond the deviation range, that the industrial equipment has an anomaly.
[0013] According to a second aspect, an embodiment of this application provides an anomaly detection apparatus for industrial equipment, including:
[0014] an obtaining module, configured to obtain current operating data and historical operating data of to-be-detected industrial equipment, where the current operating data is operating data of the industrial equipment at a current moment, and the historical operating data is operating data of the industrial equipment at a historical moment;
[0015] a prediction module, configured to obtain predicted operating data of the industrial equipment according to the historical operating data obtained by the obtaining module, where the predicted operating data is a predicted value of the operating data of the industrial equipment at the current moment;
[0016] a calculation module, configured to calculate a difference between the current operating data obtained by the obtaining module and the predicted operating data obtained by the prediction module, and obtain an operating data deviation;
[0017] a determining module, configured to determine a deviation range according to the operating data deviation obtained by the calculation module and a pre-determined deviation distribution, where the deviation distribution is used for representing a data distribution met by a difference between an actual value and a predicted value of operating data of the industrial equipment during normal operating; and
[0018] a detection module, configured to determine, if the operating data deviation obtained by the calculation module falls beyond the deviation range determined by the determining module, that the industrial equipment has an anomaly.
[0019] According to a third aspect, an embodiment of this application further provides an electronic device, including: a processor and a memory, where the processor is connected to the memory, the memory stores a computer program, and the processor is configured to execute the computer program to implement the method according to the foregoing first aspect.
[0020] According to a fourth aspect, an embodiment of this application further provides a computer-readable medium, storing computer instructions, where the program instructions, when executed by a processor, cause the processor to perform the method according to the foregoing first aspect.
[0021] It can be known from the technical solutions provided in the first aspect to the fourth aspect that, after the current operating data and the historical operating data of the industrial equipment are obtained, the operating data of the industrial equipment at the current moment is predicted first based on the historical operating data, to obtain the predicted operating data, then the difference between the current operating data and the predicted operating data is calculated as the operating data deviation, then the deviation range corresponding to the current moment is determined according to the operating data deviation and the deviation distribution, then the operating data deviation is compared with the deviation range, and it is determined, if the operating data deviation falls beyond the deviation range, that the industrial equipment has an anomaly. Therefore, the anomaly of the industrial equipment is detected based on the operating data deviation, the operating data deviation is equal to the difference between the current operating data and the predicted operating data, and the predicted operating data is determined based on the historical operating data, that is, anomaly detection is performed on the industrial equipment according to the relationship between the historical operating data and the current operating data. Anomaly detection is performed on the industrial equipment by using the time sequence correlation between the pieces of operating data, to add a reference to which anomaly detection is applicable, thereby improving accuracy of performing anomaly detection on the industrial equipment.
[0022] In a first possible implementation, with reference to any one of the first aspect to the fourth aspect, when the predicted operating data of the industrial equipment is obtained according to the historical operating data, the historical operating data is inputted into a pre-trained predictive model, and predicted operating data outputted by the predictive model is obtained, where the predictive model is used for predicting the operating data of the industrial equipment at the current moment according to the historical operating data of the industrial equipment, and the predictive model is obtained by performing training through the operating data of the industrial equipment during the normal operating.
[0023] The predictive model is trained through the operating data of the industrial equipment during the normal operating, so that the predictive model can predict the operating data of the industrial equipment based on the time sequence correlation between the pieces of operating data. Therefore, after the historical operating data of the industrial equipment is obtained, the historical operating data may be inputted into the predictive model, so as to obtain the predicted operating data outputted by the predictive model, thereby predicting the operating data of the industrial equipment based on the time sequence correlation between the pieces of operating data, and ensuring accuracy of predicting the operating data of the industrial equipment.
[0024] In a second possible implementation, with reference to the foregoing first possible implementation, the historical operating data includes operating data of the industrial equipment at at least one historical moment successive to the current moment.
[0025] The operating data of the industrial equipment at the at least one historical moment successive to the current moment is obtained as the historical operating data corresponding to the current moment. Therefore, the current operating data of the industrial equipment may be predicted based on the operating data of the industrial equipment at the one or more most recent historical moments, the operating data of the industrial equipment is predicted by fully using the time sequence correlation between the pieces of operating data, and accuracy of predicting the operating data of the industrial equipment may be improved, thereby improving accuracy of performing anomaly detection on the industrial equipment.
[0026] In a third possible implementation, with reference to the foregoing first aspect or any possible implementation of the first aspect, a detection model used for representing the deviation distribution is trained in advance through the difference between the actual value and the predicted value of the operating data of the industrial equipment during the normal operating, the operating data deviation is inputted into the pre-trained detection model, an a posteriori probability of the detection model for the operating data deviation is obtained, and then the deviation range is determined based on the a posteriori probability.
[0027] The detection model is trained by using the difference between the actual value and the predicted value of the operating data of the industrial equipment during the normal operating, and the trained detection model defines the data distribution that the operating data deviation of the industrial equipment during the normal operating should meet. Therefore, the obtained a posteriori probability of the detection model for the operating data deviation may verify a deviating extent of the operating data deviation relative to the difference between the actual value and the predicted value of the operating data of the industrial equipment during the normal operating, then whether the industrial equipment has an anomaly may be determined according to the deviating extent, and the anomaly of the industrial equipment is detected in a statistical manner, to ensure accuracy of detecting the anomaly of the industrial equipment.
[0028] In a fourth possible implementation, with reference to the foregoing third possible implementation, after the a posteriori distribution of the detection model for the operating data deviation is obtained, an expected value and a standard deviation of the a posteriori distribution are obtained, and then a value interval greater than μ-hσand less than μ+hσ is determined as the deviation range, where μ is the obtained expected value, σ is the obtained standard deviation, and h is a coefficient greater than zero.
[0029] The value interval greater than μ-hσand less than μ+hσ is determined as the deviation range, and whether the industrial equipment has an anomaly is determined according to whether the operating data deviation falls within the deviation range, so that a data volume that needs to be processed when anomaly detection is performed on the industrial equipment may be reduced, thereby improving efficiency of performing anomaly detection on the industrial equipment, detecting a fault occurring in the industrial equipment in time, and preventing a severe fault from occurring in the industrial equipment.BRIEF DESCRIPTION OF THE DRAWINGS
[0030] FIG. 1 is a flowchart of an anomaly detection method for industrial equipment according to Embodiment 1 of this application;
[0031] FIG. 2 is a flowchart of an anomaly detection method for industrial equipment according to Embodiment 2 of this application;
[0032] FIG. 3 is a schematic diagram of an anomaly detection result of industrial equipment according to Embodiment 2 of this application;
[0033] FIG. 4 is a schematic diagram of an anomaly detection result of an existing technology according to an embodiment of this application;
[0034] FIG. 5 is a schematic diagram of an anomaly detection apparatus for industrial equipment according to Embodiment 3 of this application;
[0035] FIG. 6 is a schematic diagram of another anomaly detection apparatus for industrial equipment according to Embodiment 3 of this application; and
[0036] FIG. 7 is a schematic diagram of an electronic device according to Embodiment 4 of this application.
[0037] List of reference numerals:
[0038] 101: Obtain current operating data and historical operating data of to-be-detected industrial equipment
[0039] 102: Obtain predicted operating data of the industrial equipment according to the historical operating data
[0040] 103: Calculate a difference between the current operating data and the predicted operating data, and obtain an operating data deviation
[0041] 104: Determine a deviation range according to the operating data deviation and a pre-determined deviation distribution
[0042] 105: Determine, if the operating data deviation falls beyond the deviation range, that the industrial equipment has an anomaly
[0043] 201: Obtain historical operating data of industrial equipment
[0044] 202: Predict operating data of the industrial equipment at a current moment according to the historical operating data, and obtain predicted operating data
[0045] 203: Obtain current operating data of the industrial equipment
[0046] 204: Calculate a difference between the current operating data and the predicted operating data, and obtain an operating data deviation
[0047] 205: Input the operating data deviation into a detection model, and obtain an a posteriori distribution of the detection model for the operating data deviation
[0048] 206: Calculate a deviation range according to the a posteriori distribution of the detection model for the operating data deviation
[0049] 207: Determine, if the operating data deviation falls beyond the deviation range, that the industrial equipment has an anomaly
[0050] 301: Actual-value curve 302: Predicted-value curve 303: Data point
[0051] 401: Actual-value curve 402: Predicted-value curve 501: Obtaining module
[0052] 502: Prediction module 503: Calculation module 504: Determining module
[0053] 505: Detection module 5041: Obtaining sub-module 5042: Calculation
[0054] sub-module
[0055] 5043: Determining 701: Processor 702: Memory
[0056] sub-moduleDETAILED DESCRIPTION
[0057] As described above, according to an anomaly occurring before industrial equipment has a fault, the industrial equipment may be maintained in advance, and therefore a severe fault may be prevented from occurring in the industrial equipment. Currently, an anomaly of industrial equipment is detected through a machine learning model, which is specifically as follows: The machine learning model used for detection an anomaly is trained, operating data of the industrial equipment during operating is inputted into the trained machine learning model, and the machine learning model determines, based on the inputted operating data, whether the industrial equipment has an anomaly. However, when detecting the anomaly of the industrial equipment, the current machine learning model used for detection the anomaly of the industrial equipment does not consider a time sequence correlation between pieces of operating data, causing accuracy of detecting the anomaly of the industrial equipment to be relatively poor. For example, when a part is machined through a numerical control machine tool, if the part is made of a relatively hard material, the current of an electric spindle of the numerical control machine tool is increased, and the current of the electric spindle is too large during the entire part machining. Currently, when the anomaly of the industrial equipment is detected through the machine learning model, provided that the current of the electric spindle at a moment is greater than a current threshold determined through training, it is determined that the numerical control machine tool has an anomaly, causing anomaly detection misjudgment.
[0058] In the embodiments of this application, a predictive model used for predicting operating data of industrial equipment according to historical operating data is trained in advance, the historical operating data of the industrial equipment is inputted into the predictive model to obtain predicted operating data at a current moment, current operating data of the industrial equipment at the current moment is captured, and then a difference between the current operating data and the predicted operating data is used as an operating data deviation; and if the operating data deviation falls beyond a corresponding deviation range, it is determined that the industrial equipment has an anomaly. Therefore, it can be seen that, the predictive model obtains the predicted operating data according to the historical operating data, and then determines, based on the deviation between the current operating data and the predicted operating data, whether the industrial equipment has an anomaly, that is, detects, according to a relationship between the historical operating data and the current operating data, whether the industrial equipment has an anomaly. The anomaly detection process is performed based on a time sequence correlation between the pieces of operating data, thereby improving accuracy of performing anomaly detection on the industrial equipment.
[0059] An anomaly detection method and apparatus for industrial equipment provided in the embodiments of this application are described in detail below with reference to the accompanying drawings.
[0060] Embodiment 1
[0061] FIG. 1 is a flowchart of an anomaly detection method for industrial equipment according to Embodiment 1 of this application. As shown in FIG. 1, the anomaly detection method for industrial equipment includes the following steps:
[0062] 101: Obtain current operating data and historical operating data of to-be-detected industrial equipment.
[0063] The to-be-detected industrial equipment is industrial equipment on which anomaly detection needs to be performed. The current operating data is operating data of the to-be-detected industrial equipment at a current moment, and the historical operating data is operating data of the to-be-detected industrial equipment at a historical moment before the current moment.
[0064] The operating data of the industrial equipment can reflect an operating state of the industrial equipment. For example, the operating data may be current, voltage, speed, temperature, vibration frequency, vibration amplitude, or sound frequency. The operating data may be data captured by a data sensor disposed on the industrial equipment, or may be data obtained by processing data captured by the data sensor.
[0065] 102: Obtain predicted operating data of the industrial equipment according to the historical operating data.
[0066] After the historical operating data of the industrial equipment is obtained, the operating data of the industrial equipment at the current moment is predicted according to the historical operating data, to obtain the predicted operating data of the industrial equipment. Because operating data of the industrial equipment has a time sequence correlation, that is, operating data of the industrial equipment at two neighboring moments has a correlation, the predicted operating data may be obtained according to the historical operating data.
[0067] It should be understood that, the historical operating data and the current operating data have a time sequence correlation, and a historical moment corresponding to the historical operating data may be a moment neighboring to the current moment, or may be a moment not neighboring to the current moment. For example, it is defined that the current moment is t, and the historical moment is t-k, where k is a positive integer. Therefore, the current operating data is yt, and the historical operating data is yt-k. According to the time sequence correlation between the pieces of operating data of the industrial equipment, the historical operating data may be yt-1, or the historical operating data may be yt-n, where n is a positive integer greater than 1, or the historical operating data may be a data set including yt-1, yt-2…yt-k.
[0068] 103: Calculate a difference between the current operating data and the predicted operating data, and obtain an operating data deviation.
[0069] After the current operating data and the predicted operating data of the industrial equipment are obtained, the difference between the current operating data and the predicted operating data is calculated as the operating data deviation of the industrial equipment at the current moment. For example, if the current operating data is yt, the predicted operating data is E (yt) , and the operating data deviation is Δyt, Δyt=yt-E (yt) .
[0070] The predicted operating data is determined based on the time sequence correlation between the pieces of operating data, the current operating data is actual operating data of the industrial equipment, and the difference between the current operating data and the predicted operating data is determined as the operating data deviation, so that the operating data deviation may represent a deviation between an actually measured value and a predicted value of the operating data; and an anomaly occurring in the industrial equipment causes the actually measured value and the predicted value of the operating data to have a relatively large deviation, and therefore whether the industrial equipment has an anomaly may be determined based on the operating data deviation.
[0071] 104: Determine a deviation range according to the operating data deviation and a pre-determined deviation distribution.
[0072] The deviation distribution of the industrial equipment may be determined according to the actual value and the predicted value of the operating data of the industrial equipment during the normal operating, where the deviation distribution is used for representing a data distribution met by a difference between an actual value and a predicted value of operating data of the industrial equipment during normal operating.
[0073] After the operating data deviation is obtained, the deviation range corresponding to the current moment is determined according to the operating data deviation and the pre-determined deviation distribution. The deviation range is a value range that the operating data deviation corresponding to the current moment should meet when the industrial equipment is in the normal operating, and therefore whether the industrial equipment has an anomaly may be determined according to the deviation range and the operating data deviation.
[0074] 105: Determine, if the operating data deviation falls beyond the deviation range, that the industrial equipment has an anomaly.
[0075] After the deviation range corresponding to the current moment is determined, the operating data deviation is compared with the deviation range. If the operating data deviation falls within the deviation range, it is determined that the industrial equipment has no anomaly; or if the operating data deviation falls beyond the deviation range, it is determined that the industrial equipment has an anomaly.
[0076] In this embodiment of this application, after the current operating data and the historical operating data of the industrial equipment are obtained, the operating data of the industrial equipment at the current moment is predicted first based on the historical operating data, to obtain the predicted operating data, then the difference between the current operating data and the predicted operating data is calculated as the operating data deviation, then the deviation range corresponding to the current moment is determined according to the operating data deviation and the deviation distribution, then the operating data deviation is compared with the deviation range, and it is determined, if the operating data deviation falls beyond the deviation range, that the industrial equipment has an anomaly. Therefore, the anomaly of the industrial equipment is detected based on the operating data deviation, the operating data deviation is equal to the difference between the current operating data and the predicted operating data, and the predicted operating data is determined based on the historical operating data, that is, anomaly detection is performed on the industrial equipment according to the relationship between the historical operating data and the current operating data. Anomaly detection is performed on the industrial equipment by using the time sequence correlation between the pieces of operating data, to add a reference to which anomaly detection is applicable, thereby improving accuracy of performing anomaly detection on the industrial equipment.
[0077] It should be noted that, the deviation distribution is determined in advance, the deviation range corresponding to the current moment is determined according to the operating data deviation and the deviation distribution, and then when the operating data deviation falls beyond the deviation range, it is determined that the industrial equipment has an anomaly. Because the deviation distribution has a specific statistical meaning, a statistical idea is used during anomaly detection of the industrial equipment. When the actual value and the predicted value of the operating data have a notable deviation, it is determined that the industrial equipment has an anomaly, and accuracy of performing anomaly detection on the industrial equipment may be further improved.
[0078] Embodiment 2
[0079] FIG. 2 is a flowchart of an anomaly detection method for industrial equipment according to Embodiment 2 of this application. As shown in FIG. 2, the anomaly detection method for industrial equipment includes the following steps:
[0080] 201: Obtain historical operating data of industrial equipment.
[0081] Operating data of the industrial equipment at a historical moment before a current moment is obtained as the historical operating data of the industrial equipment at the current moment. In a possible implementation, operating data of the industrial equipment at at least one historical moment successive to the current moment is obtained as the historical operating data of the industrial equipment at the current moment. If the current moment is defined as t, operating data of the industrial equipment at historical moments t-1, t-2, …, t-k successive to the current moment t is obtained as the historical operating data of the industrial equipment at the current moment, where k is a positive integer greater than or equal to 1, the operating data obtained at the historical moment t-1 is yt-1, the operating data obtained at the historical moment t-2 is yt-2, and the operating data obtained at the historical moment t-k is yt-k. For example, when anomaly detection is performed on an electric spindle of a numerical control machine tool, spindle currents of the electric spindle at 10 most recent historical moments are obtained as the historical operating data, to obtain the historical operating data including 10 pieces of operating data.
[0082] The operating data of the industrial equipment at the at least one historical moment successive to the current moment is obtained as the historical operating data of the industrial equipment, and when the operating data of the industrial equipment at the current moment is predicted based on the historical operating data, the operating data of the industrial equipment at the current moment may be predicted through operating data of the industrial equipment at one or more most recent historical moments, and a time sequence correlation between pieces of operating data is fully used, thereby improving accuracy of predicting the operating data of the industrial equipment at the current moment.
[0083] 202: Predict operating data of the industrial equipment at a current moment according to the historical operating data, and obtain predicted operating data.
[0084] By using the operating data of the industrial equipment during the normal operating, a predictive model used for predicting the operating data of the industrial equipment at the current moment according to the historical operating data is trained in advance. The pieces of operating data of the industrial equipment have the time sequence correlation, and the predictive model is trained to learn the time sequence correlation between the pieces of operating data, so that the predictive model can predict the operating data of the industrial equipment at the current moment according to the historical operating data of the industrial equipment.
[0085] In a possible implementation, by using the operating data of the industrial equipment during the normal operating, a long short-term memory (LSTM) neural network is trained, to obtain a predictive model capable of predicting the operating data of the industrial equipment at the current moment according to the historical operating data. The LSTM neural network is a time recurrent network, and the predictive model is trained through the LSTM neural network, so that the predictive model can more accurately learn the time sequence correlation between the pieces of operating data, to further ensure that the predictive model can more accurately predict the operating data of the industrial equipment at the current moment.
[0086] After the historical operating data of the industrial equipment is obtained, the obtained historical operating data is inputted into the pre-trained predictive model, and predicted operating data outputted by the predictive model is obtained, where the predicted operating data is a predicted value of the operating data of the industrial equipment at the current moment. The predictive model trained through the LSTM neural network may be represented as E (yt|yt-1, yt-2... yt-k) =LSTM (yt-1, yt-2... yt-k) , where E (yt|yt-1, yt-2... yt-k) represents the predicted operating data outputted by the predictive model, and yt-1, yt-2... yt-k represents k pieces of historical operating data inputted into the predictive model.
[0087] For example, when the numerical control machine tool is in normal operating, a spindle current of the electric spindle of the numerical control machine tool is obtained, and the LSTM neural network is trained through the obtained spindle current, to obtain a predictive model capable of predicting a spindle current at a current moment according to a spindle current at a historical moment.
[0088] The predictive model is trained in advance, so that the predictive model can predict the operating data of the industrial equipment based on the time sequence correlation between the pieces of operating data. Then, after the historical operating data is inputted into the predictive model, the predictive model can output the predicted operating data, thereby predicting the operating data of the industrial equipment based on the time sequence correlation between the pieces of operating data, ensuring that the obtained predicted operating data matches the operating data of the industrial equipment during the normal operating, and further ensuring accuracy of detecting the anomaly of the industrial equipment.
[0089] 203: Obtain current operating data of the industrial equipment.
[0090] The operating data of the industrial equipment at the current moment is obtained as the current operating data of the industrial equipment. The current operating data and the historical operating data are data of the industrial equipment at the same index, that is, the current operating data and the historical operating data are data of the industrial equipment at different moments at the same index. For example, when anomaly detection is performed on an electric spindle of a numerical control machine tool, a spindle current of the electric spindle of the numerical control machine tool at a current moment is obtained as the current operating data.
[0091] It should be noted that, step 201 and step 203 may be performed synchronously or performed in the current order; or step 203 is first performed and then step 201 and step 202 are performed.
[0092] 204: Calculate a difference between the current operating data and the predicted operating data, and obtain an operating data deviation.
[0093] After the current operating data and the predicted operating data of the industrial equipment are obtained, the difference between the current operating data and the predicted operating data is calculated, and the calculated difference is used as the operating data deviation. For example, if the obtained current operating data is yt, the predicted operating data predicted through the predictive model is E (yt|yt-1, yt-2... yt-k) , and the operating data deviation is Δyt, Δyt=yt-E (yt|yt-1, yt-2... yt-k) .
[0094] 205: Input the operating data deviation into a pre-trained detection model, and obtain an a posteriori distribution of the detection model for the inputted operating data deviation.
[0095] During the normal operating of the industrial equipment, an actual value of operating data of the industrial equipment is obtained, a predicted value of operating data obtained through the predictive model is obtained (that is, the predicted operating data outputted by the predictive model during the normal operating of the industrial equipment) , a difference between the actual value and the predicted value of the operating data of the industrial equipment during the normal operating is calculated, and the detection model is trained by using the difference, so that the detection model can represent a data distribution that is met by the difference between the actual value and the predicted value of the operating data of the industrial equipment during the normal operating.
[0096] In a possible implementation, by using the difference between the actual value and the predicted value of the operating data of the industrial equipment during the normal operating, a Gaussian mixture model (GMM) is trained, to obtain a detection model capable of representing a data distribution that is met by the difference between the actual value and the predicted value of the operating data of the industrial equipment during the normal operating. The detection model obtained by training the Gaussian mixture model may be represented as p (Δxt) =GMM (Δxt|π, μ, Φ) , where Δxt represents the difference between the actual value and the predicted value of the operating data of the industrial equipment during the normal operating, and π, μ and Φ are used for representing model parameters of the Gaussian mixture model.
[0097] Because the Gaussian mixture model may precisely quantize a thing through a Gaussian probability density function (normal distribution curve) , the Gaussian mixture model may decompose the thing into a plurality of models formed based on the Gaussian probability density function (normal distribution curve) . The detection model obtained based on training the Gaussian mixture model can reflect the data distribution that is met by the difference between the actual value and the predicted value of the operating data, so that the detection model has a specific statistical meaning, and then whether the industrial equipment has an anomaly may be detected according to a difference between the data distribution met by the operating data deviation and the data distribution represented by the detection model, thereby ensuring accuracy of detecting the anomaly of the industrial equipment.
[0098] After the operating data deviation is obtained, the operating data deviation is inputted into the pre-trained detection model, to obtain an a posteriori probability of the detection model for the inputted operating data deviation. A process of calculating the a posteriori probability of the detection model for the inputted operating data deviation may be represented as Δyt=Δxt+εt, where Δyt represents the operating data deviation, εt represents Gaussian noise, Δxt meets the data distribution represented by the detection model, and p (εt) =N (0, Ψ) , that is, εt obeys a normal distribution.
[0099] The detection model represents the data distribution of the actual value and the predicted value of the operating data of the industrial equipment during the normal operating, and the operating data deviation is the difference between the current operating data and the predicted operating data. Therefore, the obtained a posteriori probability of the detection model for the operating data deviation may verify a deviating extent of the operating data deviation relative to the difference between the actual value and the predicted value of the operating data of the industrial equipment during the normal operating, then whether the industrial equipment has an anomaly may be determined according to the deviating extent, and the anomaly of the industrial equipment is detected in a statistical manner, to ensure accuracy of detecting the anomaly of the industrial equipment.
[0100] 206: Calculate a deviation range according to the a posteriori distribution of the detection model for the operating data deviation.
[0101] After the a posteriori distribution of the detection model for the operating data deviation is obtained, an expected value μand a standard deviation σ of the a posteriori distribution are obtained, and then a value interval greater than μ-hσ and less than μ+hσ is determined as the deviation range, that is, the deviation range is (μ-hσ, μ+hσ) , where h is a coefficient greater than zero, for example, h may be a value of 0.5, 1, 5, or 10.
[0102] 207: Determine, if the operating data deviation falls beyond the deviation range, that the industrial equipment has an anomaly.
[0103] After the deviation range is obtained, the deviation range is compared with the operating data deviation. If the operating data deviation falls beyond the deviation range, that is, Δyt<μ-hσ or Δyt>μ+hσ, it is determined that the industrial equipment has an anomaly. Correspondingly, if the operating data deviation falls within the deviation range, that is, μ-hσ<Δyt<μ+hσ, it is determined that the industrial equipment has no anomaly.
[0104] After the a posteriori distribution of the predictive model is obtained, the expected value and the standard deviation of the a posteriori distribution are obtained, and a value interval greater than a difference between the expected value and the standard deviation and less than a sum of the expected value and the standard deviation is determined as the deviation range. If the operating data deviation falls within the deviation range within, it indicates that a deviating extent of the operating data deviation relative to the difference between the actual value and the predicted value of the operating data of the industrial equipment during the normal operating is relatively small, thereby determining that the industrial equipment has no anomaly. If the operating data deviation falls beyond the deviation range within, it indicates that a deviating extent of the operating data deviation relative to the difference between the actual value and the predicted value of the operating data of the industrial equipment during the normal operating is relatively large, which is usually caused because the industrial equipment has an anomaly, thereby determining that the industrial equipment has an anomaly.
[0105] The value interval greater than the difference between the expected value and the standard deviation and less than the sum of the expected value and the standard deviation is determined as the deviation range, and whether the industrial equipment has an anomaly is determined according to whether the operating data deviation falls within the deviation range, so that a data volume that needs to be processed when anomaly detection is performed on the industrial equipment may be reduced, thereby improving efficiency of performing anomaly detection on the industrial equipment, detecting a fault occurring in the industrial equipment in time, and preventing a severe fault from occurring in the industrial equipment.
[0106] In a possible implementation, after the operating data deviation is obtained, the operating data deviation may be inputted into the detection model, the process may be identified as Δyt=Δxt+εt, then the a posteriori distribution of Δxt|Δyt may be calculated based on Δyt=Δxt+εt, and then whether εt is sufficiently large to indicate that the current operating data has an evident deviation relative to the predicted operating data is detected; and if yes, it is determined that the industrial equipment has an anomaly.
[0107] The anomaly detection method for industrial equipment provided in Embodiment 2 and an existing anomaly detection method for industrial equipment are comparatively described below.
[0108] In the existing anomaly detection method for industrial equipment, it is assumed that pieces of operating data of the industrial equipment independently follow a global distribution and there is no time sequence correlation between pieces of operating data at different moments, and therefore a Gaussian mixture model is trained to predict operating data of the industrial equipment at a current moment, that is, p (x) =GMM (x|π, μ, Φ) . At an anomaly detection stage of the industrial equipment, a model is yt=xt+εt, and p (εt) =N (0, Ψ) , where yt represents an actual value of the operating data of the industrial equipment at the current moment, εt represents Gaussian noise, xt follows the trained Gaussian mixture model, an a posteriori estimation xt|yt may be calculated based on the model, and then whether εt is sufficiently large to indicate that the operating data of the industrial equipment at the current moment has a notable deviation is detected; and when the operating data of the industrial equipment at the current moment has a notable deviation, it is determined that the industrial equipment has an anomaly.
[0109] To compare the anomaly detection method provided in Embodiment 2 of this application and the anomaly detection method in the existing technology in efficiency and accuracy, a data set is set as follows: each of training data and test data includes two parts, where data corresponding to a small period of time is generated through a function yt=sin (t) *8, data corresponding to the remaining time is generated through a function yt=sin (t) *10, the data generated through the function yt=sin (t) *8 represents abnormal data, and the data generated through the function yt=sin (t) *10 represents normal data. It can be seen that, the normal data and the abnormal data both fall within an interval (-10, 10) .
[0110] FIG. 3 is a schematic diagram of a detection result of detecting an anomaly through the anomaly detection method provided in Embodiment 2 of this application, and FIG. 4 is a schematic diagram of a detection result of detecting an anomaly through the anomaly detection method in the existing technology. In FIG. 3 and FIG. 4, each horizontal coordinate is time, each vertical coordinate is a data value, a curve 301 and a curve 401 represent actual values of data, a curve 302 represents predicted values of data that are obtained through the anomaly detection method provided in Embodiment 2 of this application, a curve 403 represents predicted values of data that are obtained through the anomaly detection method in the existing technology, and a data point 303 represents that occurrence of an anomaly is determined.
[0111] It can be seen from FIG. 3 and FIG. 4 that, for the normal data, each predicted value of data obtained through the anomaly detection method provided in Embodiment 2 of this application and through the anomaly detection method in the existing technology is close to an actual value, indicating that both of the two follow a data change law learned from the training stage. For the abnormal data, a predicted value obtained through the anomaly detection method in the existing technology is close to the actual value since the predicted value still follows the data change law learned from the training stage. The predicted value of data still falls within the interval (-10, 10) , and therefore occurrence of an anomaly is not determined. However, in the anomaly detection method provided in Embodiment 2 of this application, after a time sequence correlation of data is considered, the operating data deviation Δytno longer follows the predictive model learned from the training stage, and at each data point 303, occurrence of an anomaly is determined, thereby more effectively detecting changes during data generation, and more accurately detecting the anomaly of the industrial equipment.
[0112] Embodiment 3
[0113] FIG. 5 is a schematic diagram of an anomaly detection apparatus for industrial equipment according to Embodiment 3 of this application. As shown in FIG. 5, the anomaly detection apparatus for industrial equipment includes:
[0114] an obtaining module 501, configured to obtain current operating data and historical operating data of to-be-detected industrial equipment, where the current operating data is operating data of the industrial equipment at a current moment, and the historical operating data is operating data of the industrial equipment at a historical moment;
[0115] a prediction module 502, configured to obtain predicted operating data of the industrial equipment according to the historical operating data obtained by the obtaining module 501, where the predicted operating data is a predicted value of the operating data of the industrial equipment at the current moment;
[0116] a calculation module 503, configured to calculate a difference between the current operating data obtained by the obtaining module 501 and the predicted operating data obtained by the prediction module 502, and obtain an operating data deviation;
[0117] a determining module 504, configured to determine a deviation range according to the operating data deviation obtained by the calculation module 503 and a pre-determined deviation distribution, where the deviation distribution is used for representing a data distribution met by a difference between an actual value and a predicted value of operating data of the industrial equipment during normal operating; and
[0118] a detection module 505, configured to determine, if the operating data deviation obtained by the calculation module 503 falls beyond the deviation range determined by the determining module 504, that the industrial equipment has an anomaly.
[0119] In this embodiment of this application, the obtaining module 501 may be configured to perform step 101 in Embodiment 1, the prediction module 502 may be configured to perform step 102 in Embodiment 1, the calculation module 503 may be configured to perform step 103 in Embodiment 1, the determining module 504 may be configured to perform step 104 in Embodiment 1, and the detection module 505 may be configured to perform step 105 in Embodiment 1.
[0120] In a possible implementation, the prediction module 502 is configured to input the historical operating data into a pre-trained predictive model, and obtain predicted operating data outputted by the predictive model, where the predictive model is used for predicting the operating data of the industrial equipment at the current moment according to the historical operating data of the industrial equipment, and the predictive model is obtained by performing training through the operating data of the industrial equipment during the normal operating.
[0121] In a possible implementation, the historical operating data includes operating data of the industrial equipment at at least one historical moment successive to the current moment.
[0122] In a possible implementation, in an anomaly detection apparatus for industrial equipment shown in FIG. 6, a determining module 504 includes:
[0123] an obtaining sub-module 5041, configured to obtain a detection model used for representing the deviation distribution, where the detection model is obtained by performing training through the difference between the actual value and the predicted value of the operating data of the industrial equipment during the normal operating;
[0124] a calculation sub-module 5042, configured to input the operating data deviation into the detection model obtained by the obtaining sub-module 5041, and obtain an a posteriori distribution of the detection model for the operating data deviation; and
[0125] a determining sub-module 5043, configured to determine the deviation range according to the a posteriori distribution obtained by the calculation sub-module 5042.
[0126] In a possible implementation, the determining sub-module 5043 is configured to obtain an expected value and a standard deviation of the a posteriori distribution, and determine a value interval greater than μ-hσand less than μ+hσ as the deviation range, where μ is the expected value, σ is the standard deviation, and h is a coefficient greater than zero.
[0127] It should be noted that content such as information exchange and an execution process between the modules and sub-modules in the anomaly detection apparatus for industrial equipment is based on the same idea as the foregoing embodiments of the anomaly detection method for industrial equipment. Therefore, for detailed content, refer to descriptions in the foregoing embodiments of the anomaly detection method for industrial equipment, and details are not described herein again.
[0128] Embodiment 4
[0129] FIG. 7 is a schematic diagram of an electronic device according to Embodiment 4 of this application. Referring to FIG. 7, the electronic device provided in this embodiment of this application includes: a processor 701 and a memory 702, where the processor 701 is connected to the memory 702, the memory 702 stores a computer program, and the processor 701 is configured to execute the computer program to implement the anomaly detection method for industrial equipment according to any one of the foregoing embodiments.
[0130] It should be noted that content such as information exchange and an execution process between the modules in the electronic device is based on the same idea as the foregoing embodiments of the anomaly detection method for industrial equipment. Therefore, for detailed content, refer to descriptions in the foregoing embodiments of the anomaly detection method for industrial equipment, and details are not described herein again.
[0131] This application further provides a computer-readable medium, storing instructions used for causing a machine to perform an anomaly detection method for industrial equipment described in this specification. Specifically, a system or an apparatus provided with a storage medium may be provided. The storage medium stores software program code for implementing the functions of any one of the foregoing embodiments, and a computer (or GPU or CPU or MPU) of the system or the apparatus is enabled to read and execute program code stored in the storage medium.
[0132] In this case, program code read from the storage medium can implement the functions of any one of the foregoing embodiments, and therefore the program code and the storage medium storing the program code constitute a part of this application.
[0133] Embodiments of the storage medium used for providing program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disc (for example, a CD-ROM, a CD-R, a CD-RW, a DVD-ROM, a DVD-RAM, a DVD-RW, or a DVD+RW) , a magnetic tape, a non-volatile storage card, and a ROM. Optionally, the program code may be downloaded from a server computer by using a communication network.
[0134] Furthermore, it should be made clear that the functions in any one of the foregoing embodiments may be accomplished not only by executing program code read out by a computer, but also by causing an operating system or the like which operates on the computer to perform a part or all of the actual operations based on instructions of the program code.
[0135] Furthermore, it may be understood that the functions of any one of the foregoing embodiments may be accomplished by writing program code read out from the storage medium into a memory provided in an expansion board inserted into a computer or a memory provided in an expansion module connected to the computer and then causing the GPU, CPU, or the like mounted in the expansion board or the expansion module to perform a part or all of the actual operations based on instructions of the program code.
[0136] Not all steps and modules in the procedures and the system structure diagrams are necessary, and some steps or modules may be omitted according to an actual need. An execution sequence of the steps is not fixed and may be adjusted according to needs. The system structure described in the embodiments may be a physical structure or a logical structure. That is, some modules may be implemented by the same physical entity, or some modules may be implemented by a plurality of physical entities, or may be implemented by some components in a plurality of independent devices together.
[0137] In the foregoing embodiments, the hardware modules may be implemented mechanically or electrically. For example, a hardware module may include a permanent dedicated circuit or logic (for example, a dedicated processor, FPGA or ASIC) to complete a corresponding operation. The hardware module may further include programmable logic or a circuit (for example, a general-purpose processor or another programmable processor) , which may be temporarily set by software to complete a corresponding operation. A specific implementation (a mechanical manner, a dedicated permanent circuit, or a temporarily set circuit) may be determined based on costs and time considerations.
[0138] This application is presented and described above in detail through the accompanying drawings and exemplary embodiments. However, this application is not limited to these disclosed embodiments. Based on the foregoing embodiments, a person skilled in the art can know that, more embodiments of this application may be obtained by combining code review means of the foregoing different embodiments, and these embodiments also fall within the protection scope of this application.
Claims
1.An anomaly detection method for industrial equipment, comprising:obtaining current operating data and historical operating data of to-be-detected industrial equipment, wherein the current operating data is operating data of the industrial equipment at a current moment, and the historical operating data is operating data of the industrial equipment at a historical moment;obtaining predicted operating data of the industrial equipment according to the historical operating data, wherein the predicted operating data is a predicted value of the operating data of the industrial equipment at the current moment;calculating a difference between the current operating data and the predicted operating data, and obtaining an operating data deviation;determining a deviation range according to the operating data deviation and a pre-determined deviation distribution, wherein the deviation distribution is used for representing a data distribution met by a difference between an actual value and a predicted value of operating data of the industrial equipment during normal operating; anddetermining, if the operating data deviation falls beyond the deviation range, that the industrial equipment has an anomaly.2.The method according to claim 1, wherein the obtaining predicted operating data of the industrial equipment according to the historical operating data comprises:inputting the historical operating data into a pre-trained predictive model, and obtaining predicted operating data outputted by the predictive model, wherein the predictive model is used for predicting the operating data of the industrial equipment at the current moment according to the historical operating data of the industrial equipment, and the predictive model is obtained by performing training through the operating data of the industrial equipment during the normal operating.3.The method according to claim 2, wherein the historical operating data comprises operating data of the industrial equipment at at least one historical moment successive to the current moment.4.The method according to any one of claims 1 to 3, wherein the determining a deviation range according to the operating data deviation and a pre-determined deviation distribution comprises:obtaining a detection model used for representing the deviation distribution, wherein the detection model is obtained by performing training through the difference between the actual value and the predicted value of the operating data of the industrial equipment during the normal operating;inputting the operating data deviation into the detection model, and obtaining an a posteriori distribution of the detection model for the operating data deviation; anddetermining the deviation range according to the a posteriori distribution.5.The method according to claim 4, wherein the determining the deviation range according to the a posteriori distribution comprises:obtaining an expected value and a standard deviation of the a posteriori distribution; anddetermining a value interval greater than μ-hσand less than μ+hσ as the deviation range according to the expected value and the standard deviation, wherein μ is the expected value, σ is the standard deviation, and h is a coefficient greater than zero.6.An anomaly detection apparatus for industrial equipment, comprising:an obtaining module (501) , configured to obtain current operating data and historical operating data of to-be-detected industrial equipment, wherein the current operating data is operating data of the industrial equipment at a current moment, and the historical operating data is operating data of the industrial equipment at a historical moment;a prediction module (502) , configured to obtain predicted operating data of the industrial equipment according to the historical operating data obtained by the obtaining module (501) , wherein the predicted operating data is a predicted value of the operating data of the industrial equipment at the current moment;a calculation module (503) , configured to calculate a difference between the current operating data obtained by the obtaining module (501) and the predicted operating data obtained by the prediction module (502) , and obtain an operating data deviation;a determining module (504) , configured to determine a deviation range according to the operating data deviation obtained by the calculation module (503) and a pre-determined deviation distribution, wherein the deviation distribution is used for representing a data distribution met by a difference between an actual value and a predicted value of operating data of the industrial equipment during normal operating; anda detection module (505) , configured to determine, if the operating data deviation obtained by the calculation module (503) falls beyond the deviation range determined by the determining module (504) , that the industrial equipment has an anomaly.7.The apparatus according to claim 6, whereinthe prediction module (502) is configured to input the historical operating data into a pre-trained predictive model, and obtain predicted operating data outputted by the predictive model, wherein the predictive model is used for predicting the operating data of the industrial equipment at the current moment according to the historical operating data of the industrial equipment, and the predictive model is obtained by performing training through the operating data of the industrial equipment during the normal operating.8.The apparatus according to claim 7, wherein the historical operating data comprises operating data of the industrial equipment at at least one historical moment successive to the current moment.9.The apparatus according to any one of claims 6 to 8, wherein the determining module (504) comprises:an obtaining sub-module (5041) , configured to obtain a detection model used for representing the deviation distribution, wherein the detection model is obtained by performing training through the difference between the actual value and the predicted value of the operating data of the industrial equipment during the normal operating;a calculation sub-module (5042) , configured to input the operating data deviation into the detection model obtained by the obtaining sub-module (5041) , and obtain an a posteriori distribution of the detection model for the operating data deviation; anda determining sub-module (5043) , configured to determine the deviation range according to the a posteriori distribution obtained by the calculation sub-module (5042) .10.The apparatus according to claim 9, whereinthe determining sub-module (5043) is configured to obtain an expected value and a standard deviation of the a posteriori distribution, and determine a value interval greater than μ-hσand less than μ+hσ as the deviation range according to the expected value and the standard deviation, wherein μ is the expected value, σ is the standard deviation, and h is a coefficient greater than zero.11.An electronic device, comprising: a processor (701) and a memory (702) , wherein the processor (701) is connected to the memory (702) , the memory (702) stores a computer program, and the processor (701) is configured to execute the computer program to implement the method according to any one of the claims 1 to 5.12.A computer-readable storage medium, storing computer instructions, wherein the computer instructions, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Detection and use of anomalies in an industrial environment
US20190325328A1