Abnormality detection method, device, electronic equipment, medium and product
By calculating the offset degree and coefficient of variation in the first time period data of the device, combining sliding window processing and threshold determination, the problem of degradation of detection accuracy caused by changes in the use time of the device in the prior art is solved, and higher abnormalities are achieved Inspection accuracy and accuracy.
Patent Information
- Application Number
- CN202410932435.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-07-12
AI Technical Summary
The existing equipment abnormality detection method is based on the model. When the equipment usage time varies, the detection accuracy decreases, and the operational abnormality caused by use losses cannot be effectively avoided.
By obtaining multiple data of the target device in the first time period, sorting and preprocessing, calculating the data offset, determining whether there is an abnormality in the operation of the second time period based on the offset degree and the coefficient of variation, using sliding window processing and threshold value Decide to improve detection accuracy.
It improves the accuracy of equipment operating status abnormality detection, avoids loss interference in use, reduces misjudgment, and enhances the accuracy of detection.
Smart Images

Figure CN118468206B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an anomaly detection method, device, electronic equipment, medium and product. Background Art
[0002] At present, most of the methods for detecting abnormalities in equipment are based on model methods. For example, modeling is performed for normal data, and the preset normal value data is compared with the actual collected data through the model to determine whether the equipment is abnormal. However, as the equipment is used for a longer time, the equipment condition may change accordingly, and the data during equipment operation will also change. In this case, if the previous model is still used for abnormality detection, the accuracy of abnormality detection will be low. Summary of the invention
[0003] The present application provides an anomaly detection method, device, electronic device, medium and product, which can improve the accuracy of anomaly detection on the operating status of a device.
[0004] In a first aspect, the present application provides an anomaly detection method, comprising:
[0005] Acquire a plurality of first data of the target device running in a first time period;
[0006] Sorting the plurality of first data according to the collection time to obtain a first sequence;
[0007] The data in the first sequence is intercepted according to a second time period to obtain a second sequence, wherein the duration of the first time period is greater than the duration of the second time period, and the start time or the end time of the second time period is within the first time period;
[0008] Acquire a data offset of the data in the second sequence relative to the data in the first sequence;
[0009] Based on the data deviation, determining whether there is an abnormality in the operation of the target device in the second time period;
[0010] The determining, based on the data deviation, whether operation of the target device in the second time period is abnormal includes:
[0011] Based on the data deviation, performing abnormality determination on the data in the second sequence to obtain abnormal data in the second sequence;
[0012] Determining whether the operation of the target device in the second time period is abnormal according to the amount of the abnormal data;
[0013] The step of performing abnormality determination on the data in the second sequence based on the data deviation to obtain abnormal data in the second sequence includes:
[0014] For each data to be tested in the second sequence, taking the data to be tested as the starting data and performing sliding window processing on the first sequence with a first window length, to obtain a plurality of first windows;
[0015] Calculate the mean based on the sum of the data of the plurality of first windows and the number of the first windows to obtain a first average value;
[0016] For each data to be tested in the second sequence, taking the data to be tested as the starting data and performing sliding window processing on the first sequence with a second window length to obtain a plurality of second windows, wherein the second window length is greater than the first window length;
[0017] Calculate the mean based on the sum of the data of the plurality of second windows and the number of the second windows to obtain a second average value;
[0018] For each of the data to be tested, if the data deviation is greater than or equal to a first threshold, the data to be tested is determined to be the abnormal data, wherein the data deviation is the difference between the second mean value and the coefficient of variation and the first mean value, and the coefficient of variation is the ratio of the mean of the multiple first data in the first sequence to the standard deviation.
[0019] In the embodiment of the present application, the operation data of the target device in the first time period is used to compare the operation data of the target device in the second time period to determine whether the operation of the target device is abnormal, that is, whether the target device is abnormal in the second time period can be determined. This abnormality detection method can avoid interference from abnormal operation caused by the use and wear of the target device, and can improve the accuracy of abnormality detection.
[0020] In an embodiment of the present application, by analyzing the data offset of the data in the second sequence relative to the data in the first sequence, an abnormality determination is performed on the data in the second sequence to obtain abnormal data in the second sequence, and based on the amount of the abnormal data, it is determined whether there is an abnormality in the operation of the target device in the second time period, so as to determine whether the target device is abnormal based on the data of the target device's most recent operation. This abnormality detection method can avoid interference from operational abnormalities caused by wear and tear on the target device, and can improve the accuracy of abnormality detection.
[0021] In an embodiment of the present application, two window lengths are selected to calculate the first average value and the second average value. The first average value and the second average value can respectively reflect the data deviation of the data in the first window and the data deviation of the data in the second window. The first average value plus the coefficient of variation can correct the error caused by the volatility of the data itself used to calculate the first average value, so that the value after the first average value plus the coefficient of variation is more accurate. The sum of the first average value and the coefficient of variation is used as a threshold to participate in subsequent judgments. If the second average value is greater than or equal to the sum of the first average value and the coefficient of variation, it means that the data deviation of the data in the second window is large and the data change trend is large. In this case, the data to be tested is determined to be abnormal data, which can minimize misjudgment and improve the accuracy of abnormal data judgment.
[0022] In an embodiment of the present application, obtaining a plurality of first data of a target device running in a first time period includes:
[0023] Collecting a plurality of sampling data of the target device running in the first time period;
[0024] The plurality of sampling data are sorted according to the collection time, and the sampling data with adjacent collection time and the same data are deduplicated to obtain a third sequence;
[0025] The multiple first data are obtained based on the data in the third sequence and the normalized model.
[0026] In an embodiment of the present application, multiple first data are obtained by performing data preprocessing on multiple sampling data, such as sorting, deduplication, normalization, etc., to facilitate subsequent anomaly detection based on the obtained multiple first data and improve the accuracy of detection.
[0027] In an embodiment of the present application, the plurality of first data are obtained based on the data in the third sequence and the normalization model, including:
[0028] Processing the data in the third sequence using the normalization model to obtain a plurality of second data;
[0029] Determine an upper limit value and a lower limit value according to the average value of the plurality of second data;
[0030] The plurality of first data are obtained by intercepting data that is smaller than the upper limit value and larger than the lower limit value among the plurality of second data.
[0031] In the embodiment of the present application, by using upper and lower limits to intercept the plurality of second data obtained after normalization, the most representative data can be obtained while reducing the amount of subsequent data processing.
[0032] In an embodiment of the present application, determining whether there is an abnormality in the operation of the target device in the second time period according to the amount of the abnormal data includes:
[0033] If the amount of the abnormal data is greater than or equal to a second threshold, determining that the operation of the target device in the second time period is abnormal;
[0034] or
[0035] If the number of abnormal data is greater than or equal to the second threshold, and the absolute value of the difference between the maximum value and the minimum value in the sampling data corresponding to multiple abnormal moments is greater than the third threshold, it is determined that there is an abnormality in the operation of the target device in the second time period, wherein the abnormal moment is the collection moment corresponding to the abnormal data.
[0036] In an embodiment of the present application, in one case, there is a deviation in the operating data of the target device under certain special circumstances, which satisfies the situation that the amount of abnormal data is large, but the operating data is still normal data. For such cases, the above-mentioned judgment criteria can be used to effectively avoid misjudgment.
[0037] In another case, there are deviations in the operating data of the target device under certain special circumstances, which meets the situation where the number of abnormal data is large. In order to further avoid misjudgment, a judgment is further made based on the difference between the maximum and minimum values in the sampling data corresponding to multiple abnormal moments. If the absolute value of the difference is greater than the third threshold, it means that the deviation between the maximum and minimum values of the sampling data corresponding to multiple abnormal moments is large, and the possibility of an abnormality in the device is high. In this case, it is determined that there is an abnormality in the operation of the target device in the second time period. The above-mentioned judgment criteria can effectively avoid misjudgment and improve the accuracy of abnormality detection of the target device.
[0038] In an embodiment of the present application, when the plurality of first data are vector data, the plurality of first data have the same direction.
[0039] In the embodiment of the present application, since some target devices have a direction of operation, for example, the direction of motor rotation includes forward rotation and reverse rotation, in order to accurately analyze the data obtained when the target device rotates forward or reversely, the first data is vector data, and the first data with the same direction can be analyzed to determine whether the target device has an abnormal forward rotation or an abnormal reverse rotation.
[0040] In one embodiment of the present application, the data deviation is calculated based on multiple groups of data sequences intercepted from the first sequence, the starting data of each group of the data sequence is the data in the second sequence, and the number of data included in each group of the data sequence is the same or different.
[0041] In the embodiment of the present application, the accuracy of the data deviation can be improved by performing statistical analysis on multiple groups of data sequences intercepted from the first sequence.
[0042] In a second aspect, an embodiment of the present application provides an abnormality detection device, including:
[0043] A first acquisition module, used to acquire a plurality of first data of a target device running in a first time period;
[0044] A sorting module, used for sorting the plurality of first data according to the collection time to obtain a first sequence;
[0045] an interception module, configured to intercept the data in the first sequence according to a second time period to obtain a second sequence, wherein the duration of the first time period is greater than the duration of the second time period, and the start time or the end time of the second time period is within the first time period;
[0046] A second acquisition module, used to acquire a data offset of the data in the second sequence relative to the data in the first sequence;
[0047] A determination module, based on the data deviation, determines whether the operation of the target device in the second time period is abnormal;
[0048] The determination module comprises:
[0049] A first determination submodule, configured to perform an abnormality determination on the data in the second sequence based on the data deviation degree, to obtain abnormal data in the second sequence;
[0050] A second determination submodule, configured to determine whether the operation of the target device in the second time period is abnormal according to the amount of the abnormal data;
[0051] The first determination submodule includes:
[0052] A first acquisition unit is configured to perform sliding window processing on the first sequence with the data to be tested as the starting data and with a first window length for each data to be tested in the second sequence, so as to obtain a plurality of first windows;
[0053] a first calculating unit, configured to perform mean calculation based on the sum of the data of the plurality of first windows and the number of the first windows to obtain a first average value;
[0054] a second acquisition unit, configured to, for each data to be tested in the second sequence, perform sliding window processing on the first sequence with the data to be tested as the starting data and with a second window length, to obtain a plurality of second windows, wherein the second window length is greater than the first window length;
[0055] a second calculating unit, configured to perform mean calculation based on the sum of the data of the plurality of second windows and the number of the second windows to obtain a second average value;
[0056] A determination unit is used to determine, for each of the data to be tested, that the data to be tested is the abnormal data if the data deviation is greater than or equal to a first threshold, wherein the data deviation is the difference between the second mean value and the coefficient of variation and the first mean value, and the coefficient of variation is the ratio of the mean value to the standard deviation of the multiple first data in the first sequence.
[0057] In the embodiment of the present application, whether there is any abnormality in the operation of the target device is determined by comparing the operation data of the target device in the first time period with the operation data of the target device in the second time period. That is, whether the target device is abnormal can be determined by comparing the target device's most recent operation data. This abnormality detection method can avoid interference from operational abnormalities caused by wear and tear of the target device, and can improve the accuracy of abnormality detection.
[0058] In an embodiment of the present application, by analyzing the data offset of the data in the second sequence relative to the data in the first sequence, an abnormality determination is performed on the data in the second sequence to obtain abnormal data in the second sequence, and based on the amount of the abnormal data, it is determined whether there is an abnormality in the operation of the target device in the second time period, so as to determine whether the target device is abnormal based on the data of the target device's most recent operation. This abnormality detection method can avoid interference from operational abnormalities caused by wear and tear on the target device, and can improve the accuracy of abnormality detection.
[0059] In an embodiment of the present application, two window lengths are selected to calculate the first average value and the second average value. The first average value and the second average value can respectively reflect the data deviation of the data in the first window and the data deviation of the data in the second window. The first average value plus the coefficient of variation can correct the error caused by the volatility of the data itself used to calculate the first average value, so that the value after the first average value plus the coefficient of variation is more accurate. The sum of the first average value and the coefficient of variation is used as a threshold to participate in subsequent judgments. If the second average value is greater than or equal to the sum of the first average value and the coefficient of variation, it means that the data deviation of the data in the second window is large and the data change trend is large. In this case, the data to be tested is determined to be abnormal data, which can minimize misjudgment and improve the accuracy of abnormal data judgment.
[0060] In an embodiment of the present application, the acquisition module includes:
[0061] A collection submodule, used for collecting a plurality of sampled data of the target device running in the first time period;
[0062] A sorting submodule, used to sort the plurality of sampled data according to the collection time, and perform a deduplication process on the sampled data with adjacent collection time and the same data, so as to obtain a third sequence;
[0063] A normalization submodule is used to obtain the multiple first data based on the data in the third sequence and a normalization model.
[0064] In an embodiment of the present application, multiple first data are obtained by performing data preprocessing on multiple sampling data, such as sorting, deduplication, normalization, etc., to facilitate subsequent anomaly detection based on the obtained multiple first data and improve the accuracy of detection.
[0065] In one embodiment of the present application, the normalization submodule includes:
[0066] A processing unit, configured to process the data in the third sequence using the normalization model to obtain a plurality of second data;
[0067] a determining unit, configured to determine an upper limit value and a lower limit value according to an average value of the plurality of second data;
[0068] The interception unit is used to intercept the data that is smaller than the upper limit value and larger than the lower limit value among the plurality of second data to obtain the plurality of first data.
[0069] In the embodiment of the present application, by using upper and lower limits to intercept the plurality of second data obtained after normalization, the most representative data can be obtained while reducing the amount of subsequent data processing.
[0070] In one embodiment of the present application, the second determination submodule is used to:
[0071] If the amount of the abnormal data is greater than or equal to a second threshold, determining that the operation of the target device in the second time period is abnormal;
[0072] or
[0073] If the number of abnormal data is greater than or equal to the second threshold, and the absolute value of the difference between the maximum value and the minimum value in the sampling data corresponding to multiple abnormal moments is greater than the third threshold, it is determined that there is an abnormality in the operation of the target device in the second time period, wherein the abnormal moment is the collection moment corresponding to the abnormal data.
[0074] In an embodiment of the present application, in one case, there is a deviation in the operating data of the target device under certain special circumstances, which satisfies the situation that the amount of abnormal data is large, but the operating data is still normal data. For such cases, the above-mentioned judgment criteria can be used to effectively avoid misjudgment.
[0075] In another case, there are deviations in the operating data of the target device under certain special circumstances, which meets the situation where the number of abnormal data is large. In order to further avoid misjudgment, a judgment is further made based on the difference between the maximum and minimum values in the sampling data corresponding to multiple abnormal moments. If the absolute value of the difference is greater than the third threshold, it means that the deviation between the maximum and minimum values of the sampling data corresponding to multiple abnormal moments is large, and the possibility of an abnormality in the device is high. In this case, it is determined that there is an abnormality in the operation of the target device in the second time period. The above-mentioned judgment criteria can effectively avoid misjudgment and improve the accuracy of abnormality detection of the target device.
[0076] In an embodiment of the present application, when the plurality of first data are vector data, the plurality of first data have the same direction.
[0077] In the embodiment of the present application, since some target devices have a direction of operation, for example, the direction of motor rotation includes forward rotation and reverse rotation, in order to accurately analyze the data obtained when the target device rotates forward or reversely, the first data is vector data, and the first data with the same direction can be analyzed to determine whether the target device has an abnormal forward rotation or an abnormal reverse rotation.
[0078] In one embodiment of the present application, the data deviation is calculated based on multiple groups of data sequences intercepted from the first sequence, the starting data of each group of the data sequence is the data in the second sequence, and the number of data included in each group of the data sequence is the same or different.
[0079] In the embodiment of the present application, the accuracy of the data deviation can be improved by performing statistical analysis on multiple groups of data sequences intercepted from the first sequence.
[0080] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the anomaly detection method described in the first aspect.
[0081] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the anomaly detection method described in the first aspect are implemented.
[0082] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the anomaly detection method as described in the first aspect.
[0083] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] The features, advantages and technical effects of exemplary embodiments of the present application will be described below with reference to the accompanying drawings.
[0085] Figure 1 A schematic diagram of a process flow of an anomaly detection method provided in an embodiment of the present application;
[0086] Figure 2 Another schematic diagram of the process of anomaly detection method provided in an embodiment of the present application;
[0087] Figure 3 Another flowchart of the anomaly detection method provided in the embodiment of the present application;
[0088] Figure 4 A schematic diagram of a process flow of an anomaly detection method provided in an embodiment of the present application;
[0089] Figure 5 Another schematic diagram of the process of anomaly detection method provided in an embodiment of the present application;
[0090] Figure 6 A schematic diagram of sliding window processing provided in an embodiment of the present application;
[0091] Figure 7 Another flowchart of the anomaly detection method provided in the embodiment of the present application;
[0092] Figure 8 A schematic diagram of a process flow of an anomaly detection method provided in an embodiment of the present application;
[0093] Fig. 9 A schematic diagram of the structure of an anomaly detection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0094] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0095] Unless otherwise defined, all technical and scientific terms used in this application have the same meanings as those commonly understood by technicians in the technical field of this application; the terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned drawings and any variations thereof are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order or a primary and secondary relationship.
[0096] Predictive maintenance has evolved from the concept of "condition monitoring". "Condition monitoring" collects real-time information on the condition of the monitored parts; however, condition monitoring fails to proactively predict machine interruptions and wear and tear. Therefore, the emergence of predictive maintenance is a major turning point: more sophisticated sensors, more efficient communication networks, and powerful computing platforms that can handle large amounts of data, and predictive comparisons of data with data patterns of machine problems through algorithms, make the entire process of product production and service and related decisions more proactive.
[0097] In the current industrial system, equipment maintenance still takes up a lot of time for engineers and workers. Irregular equipment damage will affect normal production delivery, wasting a lot of money and manpower. Servo motors and cylinders are the most typical equipment transmission components. They are very prone to failure under high load and high speed conditions for a long time. Traditional maintenance methods rely on experienced engineers to regularly inspect and maintain equipment, but this method relies on specific engineers and is inefficient. For large-scale factories, many experienced engineers are often required. With the wave of intelligent manufacturing, it is of great significance to intelligently identify abnormalities in advance and perform maintenance.
[0098] At present, most of the predictive maintenance systems are based on the model method, which models normal data and compares the normal value data predicted by the model with the actual data to determine whether the current equipment is abnormal. This idea is not applicable to some existing equipment that cannot determine when the data is normal. In addition, with the life cycle of the equipment, the equipment condition may change and the data may also change, but the equipment is still in a normal state at this time. At this time, the model may need to be adjusted accordingly, wasting a lot of resources, and the use of the original model for detection will also lead to a decrease in detection accuracy. Based on the above problems, the embodiment of the present application provides an abnormality detection method, which can detect whether the equipment has an abnormality based on the operating data of the equipment, thereby improving the accuracy of abnormality detection.
[0099] Figure 1A flowchart of an abnormality detection method provided by an embodiment of the present application is shown in FIG. Figure 1 As shown, the anomaly detection method provided by the present application includes the following steps 101 to 104, wherein:
[0100] Step 101: Acquire a plurality of first data of a target device running in a first time period.
[0101] The target device may refer to a device such as a motor or a cylinder, or other device that needs to be detected, which is not limited here. The duration, start time, and end time of the first time period can be set according to actual conditions. For example, the first time period is the operating data of the target device collected 3 days before the current time. There are multiple data in the first time period. Further, the data collected in the first time period is preprocessed to obtain multiple first data. The preprocessing may include sorting, deduplication, and normalization of the multiple data in the order of collection time, which is not limited here.
[0102] It should be noted that if the target device has a direction of operation, for example, the direction of motor rotation includes forward rotation and reverse rotation, in this case, the motor operation data includes positive data corresponding to forward rotation and negative data corresponding to reverse rotation. The positive and negative here are used to identify the rotation direction. For this case, it is necessary to analyze the positive data of the first time period as multiple first data, or to analyze the negative data of the first time period as multiple first data.
[0103] Step 102: sort the plurality of first data according to the collection time to obtain a first sequence.
[0104] For example, if the collection time of the first data A is adjacent to the collection time of the first data B, and the collection time of the first data A is earlier than the collection time of the first data B, then the sorting positions of the first data A and the first data B are adjacent, and the first data A is arranged before the first data B.
[0105] Step 103: intercept the data in the first sequence according to a second time period to obtain a second sequence, wherein the duration of the first time period is greater than the duration of the second time period, and the start time or the end time of the second time period is within the first time period. For example, the second time period is a sub-time period in the first time period.
[0106] The duration, start time, and end time of the second time period can be set according to actual conditions. For example, the second time period is 2 hours before the current time. The end time of the first time period and the end time of the second time period can be the same.
[0107] The data collected at the second time period is cut out from the first sequence to obtain the second sequence. For example, if the first time period is the data of the previous three days and the second time period is the data of the previous two hours, the cut out second sequence includes the data of the previous two hours in the first sequence.
[0108] For another example, the first time period is from 12:00 on January 1 to 12:00 on January 3, and the second time period is from 12:00 on January 2 to 12:00 on January 3. The second time period is used to intercept the data in the first sequence, that is, the data collected in the second time period is obtained from the first sequence to obtain the second sequence, and the data in the second sequence is also sorted according to the collection time.
[0109] Step 104, obtaining a data offset of the data in the second sequence relative to the data in the first sequence;
[0110] The data deviation degree can be understood as the deviation degree of the data in the second sequence relative to the data in the first sequence.
[0111] The data deviation is calculated based on multiple data sequences intercepted from the first sequence, the starting data of each data sequence is the data in the second sequence, and the number of data included in each data sequence is the same or different, for example, the number of data included in each data sequence is 6 or 12. By performing statistical analysis on multiple data sequences intercepted from the first sequence, the accuracy of the data deviation can be improved.
[0112] For example, for any test data in the second sequence, a data group is intercepted in the first sequence with the test data as the starting data, for example, 6 data as a group, or 12 data as a group, and mean statistics are performed to calculate the data deviation, wherein the data deviation can be determined based on the mean calculated based on the 6 data as a group and the mean calculated based on the 12 data as a group.
[0113] Step 105: Based on the data deviation, determine whether there is any abnormality in the operation of the target device in the second time period.
[0114] When the data deviation meets the preset standard, for example, when the data deviation is greater than or equal to the first threshold, the data to be tested is determined to be abnormal data, and whether there is abnormality in the operation of the target device in the second time period is determined according to the amount of abnormal data.
[0115] Since the length of the second time period is shorter than that of the first time period, through the above process, it is possible to use the operating data of the target device in a longer time period to predict the operating data in a shorter time period. During the entire process, it is only necessary to collect the operating data of the target device. There is no need to build a detection model or update the model. The implementation process is simple and efficient, saving labor costs.
[0116] Furthermore, after step 105, the method further includes sending an alarm message, wherein the alarm message includes the second time period, the abnormal data, and the collection time corresponding to the abnormal data. When it is determined that the target device has an abnormality, an alarm message may be issued to facilitate maintenance personnel to perform abnormality inspection and equipment maintenance on the target device.
[0117] In this embodiment, the operation data of the target device in the first time period is used to compare the operation data of the target device in the second time period to determine whether there is any abnormality in the operation of the target device. That is, the target device can be determined to be abnormal based on the target device's most recent operation data. This abnormality detection method can avoid interference from operational abnormalities caused by wear and tear of the target device, and can improve the accuracy of abnormality detection.
[0118] Figure 2 Another flowchart of an abnormality detection method provided by an embodiment of the present application is as follows: Figure 2 As shown, the anomaly detection method provided by the present application includes the following steps:
[0119] Step 201: Acquire a plurality of first data of a target device running in a first time period.
[0120] Step 202: sort the plurality of first data according to the collection time to obtain a first sequence.
[0121] Step 203: intercept the data in the first sequence according to a second time period to obtain a second sequence, wherein the duration of the first time period is greater than the duration of the second time period. The start time or the end time of the second time period is within the first time period, for example, the second time period is a sub-time period in the first time period.
[0122] For details of steps 201 to 203, please refer to the relevant records of steps 101 to 103, which will not be described in detail here.
[0123] Step 204, obtaining a data offset of the data in the second sequence relative to the data in the first sequence;
[0124] Step 205: Based on the data deviation, perform an abnormality determination on the data in the second sequence to obtain abnormal data in the second sequence.
[0125] For example, for any test data in the second sequence, a data group is intercepted in the first sequence with the test data as the starting data, for example, 6 data as a group, or 12 data as a group, and mean statistics are performed to calculate the data deviation, wherein the data deviation can be determined based on the mean calculated based on the 6 data as a group and the mean calculated based on the 12 data as a group. When the data deviation meets the preset standard, for example, when the data deviation is greater than or equal to the first threshold, the test data is determined to be abnormal data.
[0126] Step 206: Determine whether there is any abnormality in the operation of the target device during the second time period according to the amount of the abnormal data.
[0127] For example, the number of abnormal data is compared with the second threshold value. The second threshold value can be set according to the actual situation and is not limited here. For example, the second threshold value can be 4 or 5, etc., or the second threshold value can be 10% of the number of data included in the second sequence. If the number of abnormal data is greater than or equal to the second threshold value, it means that the density of abnormal data when the target device is running in the second time period is large, then it is determined that there is an abnormality in the operation of the target device in the second time period. Otherwise, it is determined that there is no abnormality in the operation of the target device in the second time period. Further, in the case of determining that the target device is abnormal, an alarm message can be issued, such as sending an alarm message to maintenance personnel. The alarm message may include the start time and end time of the second time period, abnormal data and the collection time corresponding to the abnormal data, etc., so as to facilitate the maintenance personnel to check the abnormality of the target device and perform equipment maintenance.
[0128] Step 205 - Step 206 is a specific implementation of step 105 .
[0129] In the above, the data offset of the data in the second sequence relative to the data in the first sequence is obtained, and based on the data offset, the data in the second sequence is judged to be abnormal, and the abnormal data in the second sequence is obtained. According to the amount of the abnormal data, it is judged whether there is any abnormality in the operation of the target device in the second time period, so as to determine whether the target device is abnormal through the data of the target device's most recent operation. This abnormality detection method can avoid the interference of abnormal operation caused by the use wear of the target device, and can improve the accuracy of abnormality detection.
[0130] Figure 3 Another flowchart of an abnormality detection method provided by an embodiment of the present application is as follows: Figure 3 As shown, the anomaly detection method provided by the present application includes the following steps:
[0131] Step 301: Collect a plurality of sample data of the target device running in the first time period.
[0132] Exemplarily, in this step, a plurality of sampling data of the target device running in the first time period is obtained from the host computer at preset time intervals, and the host computer stores the sampling data collected by the target device during operation.
[0133] For example, a programmable logic controller (PLC) regularly collects torque, speed or current data of the motor, and then the PLC transmits it to the host computer through the CLINK protocol. The data middle station (which can be considered as a device running the abnormality detection method provided in the embodiment of the present application) consumes the data in the host computer in real time through Kafka, and stores the data in the data middle station. The preset duration can be set according to actual conditions, such as one day, three days, etc., which is not limited here. Data is acquired once every preset time period, and subsequent processing is performed based on the data to determine whether the operation of the target device is abnormal. While determining whether the operation of the target device is abnormal, the determination frequency can be controlled to reduce computing resource expenditure.
[0134] Step 302: sort the plurality of sample data according to the collection time, and perform deduplication processing on the sample data with adjacent collection time and the same data to obtain a third sequence.
[0135] Specifically, the plurality of sampling data are sorted according to the collection time, and then, the continuous and adjacent data in the plurality of sampling data are deduplicated to obtain a third sequence.
[0136] Step 303: Obtain the plurality of first data based on the data in the third sequence and the normalized model.
[0137] The data in the third sequence are processed using a normalization model to transform each data in the third sequence into the same interval, which is convenient for subsequent data processing.
[0138] Step 301 to step 303 are a specific implementation of step 101 .
[0139] Step 304: sort the plurality of first data according to the collection time to obtain a first sequence.
[0140] For details of step 304, please refer to the description in step 102, which will not be repeated here.
[0141] Step 305: intercept the data in the first sequence according to a second time period to obtain a second sequence, wherein the duration of the first time period is greater than the duration of the second time period, and the start time or the end time of the second time period is within the first time period. For example, the second time period is a sub-time period in the first time period.
[0142] For details of step 305, please refer to the description in step 103, which will not be repeated here.
[0143] Step 306, obtaining a data offset of the data in the second sequence relative to the data in the first sequence;
[0144] Step 307: Based on the data deviation, determine whether there is any abnormality in the operation of the target device in the second time period.
[0145] In the above, the details of step 306-step 307 can refer to the records in step 104-step 105, which will not be repeated here.
[0146] In the above, by performing data preprocessing on multiple sample data, such as sorting, deduplication, normalization, etc., multiple first data are obtained, which facilitates subsequent anomaly detection based on the obtained multiple first data and improves the accuracy of detection.
[0147] Figure 4 A flowchart of an abnormality detection method provided by an embodiment of the present application is shown in FIG. Figure 4 As shown, the anomaly detection method provided by this application includes the following:
[0148] Step 401: Collect a plurality of sample data of the target device running in the first time period.
[0149] In the above, the details of step 401 can refer to the description in step 301, which will not be repeated here.
[0150] Step 402: sort the plurality of sample data according to the collection time, and perform deduplication processing on the sample data with adjacent collection time and the same data to obtain a third sequence.
[0151] In the above, the details of step 402 can refer to the record in step 302, which will not be repeated here.
[0152] Step 403: Use the normalization model to process the data in the third sequence to obtain a plurality of second data.
[0153] Exemplarily, each data in the third sequence is normalized according to formula (1), where: is the mean of all data in the third series, is the standard deviation of all data in the third series, the second data For the data in the third sequence The data after standardization.
[0154]
[0155] It should be noted that after normalizing each data in the third sequence, the data obtained by the normalization process is not directly used as the first data, but the data sequence obtained by the normalization process is truncated (for example, the data between the upper limit value and the lower limit value is truncated, for details, please refer to the records in steps 404-405 below) to obtain multiple first data.
[0156] Specifically, each data in the third sequence is normalized using the above formula (1) to obtain the second data corresponding to each data. Multiple second data can also form an ordered sequence. The order of each data in this sequence is the same as the order between the data in the corresponding third sequence. For example, the data in the third sequence are sequentially ordered as a1, a2, a3, and a4. After normalization, these four data are respectively converted into second data b1 (normalized result of first data a1), b2 (normalized result of first data a2), b3 (normalized result of first data a3), and b4 (normalized result of first data a4). The order of these four second data is b1, b2, b3, and b4.
[0157] Step 404: determine an upper limit value and a lower limit value according to the average value of the plurality of second data.
[0158] Step 405 , intercepting data that is smaller than the upper limit value and larger than the lower limit value among the plurality of second data to obtain the plurality of first data.
[0159] The average of the plurality of second data is calculated, and the upper limit and the lower limit are determined according to the average. For example, is the mean value of the plurality of second data. In one embodiment, the upper limit value= +Adjustment value, lower limit value = -Adjustment value: The adjustment value can be selected according to the actual situation and is not limited here.
[0160] In another embodiment, the upper limit value= , lower limit = , A and B are adjustment coefficients, and A is greater than B. The adjustment coefficient can be selected according to actual conditions and is not limited here.
[0161] In another embodiment, the upper limit value is determined as I times, the lower limit is determined as J times of , where I is greater than J.
[0162] Exemplarily, the upper limit value is determined according to the following expression (2): :
[0163] (2)
[0164] According to the following expression (3), the lower limit is determined :
[0165] (3)
[0166] It has been verified that the upper limit value and the lower limit value are determined by the above expression, which can make the multiple first data obtained by subsequently intercepting the multiple second data more representative, thereby facilitating the subsequent anomaly detection based on the multiple first data and improving the accuracy of the detection.
[0167] Step 403 to step 405 are a specific implementation of step 303 .
[0168] Step 406: sort the plurality of first data according to the collection time to obtain a first sequence.
[0169] For details of step 406, please refer to the description in step 102, which will not be repeated here.
[0170] Step 407: intercept the data in the first sequence according to a second time period to obtain a second sequence, wherein the duration of the first time period is greater than the duration of the second time period, and the start time or the end time of the second time period is within the first time period. For example, the second time period is a sub-time period in the first time period.
[0171] For details of step 407, please refer to the description in step 103, which will not be repeated here.
[0172] Step 408, obtaining a data offset of the data in the second sequence relative to the data in the first sequence;
[0173] Step 409: determine whether there is any abnormality in the operation of the target device during the second time period.
[0174] In the above, the details of step 408-step 409 can refer to the records in step 104-step 105, which will not be repeated here.
[0175] In this embodiment, by using upper and lower limits to intercept the plurality of second data obtained after normalization, the most representative data can be obtained while reducing the amount of subsequent data processing.
[0176] Figure 5 Another flowchart of an abnormality detection method provided by an embodiment of the present application is as follows: Figure 5 As shown, the anomaly detection method provided by the present application includes the following steps:
[0177] Step 501: Collect a plurality of sample data of the target device running in the first time period.
[0178] For details of step 501, please refer to the description in step 301, which will not be repeated here.
[0179] Step 502: sort the plurality of sample data according to the collection time, and perform deduplication processing on the sample data with adjacent collection time and the same data to obtain a third sequence.
[0180] For details of step 502, please refer to the description in step 302, which will not be repeated here.
[0181] Step 503: Obtain the plurality of first data based on the data in the third sequence and the normalized model.
[0182] For details of step 503, please refer to the description in step 303, which will not be repeated here.
[0183] Step 504: sort the plurality of first data according to the collection time to obtain a first sequence.
[0184] For details of step 504, please refer to the description in step 102, which will not be repeated here.
[0185] Step 505: intercept the data in the first sequence according to a second time period to obtain a second sequence, wherein the duration of the first time period is greater than the duration of the second time period, and the start time or the end time of the second time period is within the first time period. For example, the second time period is a sub-time period in the first time period.
[0186] For details of step 505, please refer to the description in step 103, which will not be repeated here.
[0187] Step 506, obtaining a data offset of the data in the second sequence relative to the data in the first sequence;
[0188] Step 507: for each data to be tested in the second sequence, use the data to be tested as the starting data and perform sliding window processing on the first sequence with a first window length to obtain a plurality of first windows;
[0189] Step 508, performing mean calculation based on the sum of the data of the plurality of first windows and the number of the first windows to obtain a first average value;
[0190] Step 509: for each data to be tested in the second sequence, use the data to be tested as the starting data and perform sliding window processing on the first sequence with a second window length to obtain multiple second windows, where the second window length is greater than the first window length;
[0191] Step 510, performing mean calculation based on the sum of the data of the plurality of second windows and the number of the second windows to obtain a second average value;
[0192] Step 511, for each of the data to be tested, if the data deviation is greater than or equal to a first threshold, the data to be tested is determined to be the abnormal data, wherein the data deviation is the difference between the second mean value and the coefficient of variation and the first mean value, and the coefficient of variation is the ratio of the mean value to the standard deviation of the multiple first data in the first sequence.
[0193] Step 507 to step 511 are a specific implementation of step 205 .
[0194] Step 512: Determine whether there is any abnormality in the operation of the target device during the second time period according to the amount of the abnormal data.
[0195] For details of step 512, please refer to the description in step 206, which will not be repeated here.
[0196] Specifically, since the second sequence is intercepted from the first sequence, the data in the second sequence is also the data in the first sequence. For ease of description, the data in the second sequence is referred to as the data to be tested. For any data to be tested, the data to be tested is used as the starting data, and the first sequence is intercepted by sliding window with the first length as the window length of the first window to obtain a set of sliding window data, and then the first window is slid one data backward to obtain another set of sliding window data, and so on, until the last data in the first sequence is intercepted by the sliding window, and the sliding window is stopped, so that multiple sets of sliding window data are obtained, and each set of sliding window data is summed, and each sum is averaged to obtain the first average value.
[0197] Exemplarily, the motor operation data includes positive data corresponding to forward rotation and negative data corresponding to reverse rotation, where the positive and negative are used to identify the direction of rotation. In this case, it is necessary to analyze the positive data of the first time period as multiple first data, or to analyze the negative data of the first time period as multiple first data. In this embodiment, the positive data of the motor forward rotation is used as an example. The positive data obtained by the motor forward rotation is sorted, deduplicated, normalized, and processed as described above to obtain a first sequence.
[0198] The first sequence includes 200 data a1, a2, a3, a4, a5, a6, a7, a8, ..., a100, b1, b2, b3, b4, b5, b6, b7, b8, ..., b100. The first sequence is intercepted according to the second time period to obtain a second sequence. The second sequence includes 100 data b1, b2, b3, b4, b5, b6, b7, b8 ... b100. For each data to be tested in the second sequence, sliding window processing is performed, such as Figure 6 As shown, Figure 6 The first sequence 1 is shown in FIG. 1 . For the first data b1 in the second sequence, b1 is used as the starting data of the first window. The window length of the first window is 6, that is, the first window includes 6 data. Figure 6 In the example, the first group of sliding window data 61 includes b1, b2, b3, b4, b5, and b6. The first window is slid one data backward, and the second group of sliding window data 62 obtained includes b2, b3, b4, b5, b6, and b7. The first window is continuously slid one data backward, and the third group of sliding window data 63 obtained includes b3, b4, b5, b6, b7, and b8. This is repeated until the sliding window data includes b100, and the sliding stops. Thus, 95 groups of sliding window data are obtained. One calculation method is: the sum of all data in each group of sliding windows is calculated. Thus, the data in each group of sliding windows is first summed to obtain a sum value, and then the average value of the sum value of each group of sliding windows is calculated. When calculating the average value, the numerator is the sum value of each group of sliding window data, and the denominator is the number of sliding windows. The average value is the first average value. Another calculation method is: directly adding the data in 95 groups of sliding windows, using the added value as the numerator, and using the number of the first window 95 as the denominator, and performing mean calculation to obtain the first average value.
[0199] For any data to be tested, the data to be tested is taken as the starting data, and the first sequence is subjected to sliding window interception with the second length being the window length of the second window to obtain a group of sliding window data, and then the second window is slid to the next data to obtain another group of sliding window data, and so on, until the last data in the first sequence is intercepted by the sliding window, and the sliding window is stopped, so that multiple groups of sliding window data are obtained, and each group of sliding window data is summed, and each sum is averaged to obtain a second average value.
[0200] The process of calculating the second average value can be specifically referred to the process of calculating the first average value, the difference being that the window lengths of the second window and the first window are different, the second length is greater than the first length, and the second window includes more data. For example, the second length is 12, the first length is 6, and the first length and the second length can also select other values according to actual conditions, which are not limited here.
[0201] Data deviation = second average value - (first average value + coefficient of variation). For each data to be tested, if the data deviation is greater than or equal to the first threshold, the data to be tested is determined to be the abnormal data. The first threshold can be set according to actual conditions, for example, 0.1, 0.5, etc., and is not limited here.
[0202] The coefficient of variation is the ratio of the mean value to the standard deviation of the first sequence. Specifically, the coefficient of variation is Calculate according to the following formula (4):
[0203]
[0204] in, is the standard deviation of the first series, is the mean of the first series.
[0205] It has been verified that since the data in the first sequence is volatile, there will be a certain offset between it and the theoretical data of the target device operation. The coefficient of variation is determined by the above expression and can effectively adjust the calculation error caused by the volatility of the data when participating in the abnormal judgment of the subsequent data to be tested.
[0206] The larger the amount of data in the window, the larger the data deviation, and the more it can reflect the changing trend of the data. In the above, by selecting two window lengths to calculate the first average value and the second average value, the first average value and the second average value can respectively reflect the data deviation of the data in the first window and the data deviation of the data in the second window. Adding the coefficient of variation to the first average value can correct the error caused by the volatility of the data itself used to calculate the first average value, so that the value after adding the coefficient of variation to the first average value is more accurate. The sum of the first average value and the coefficient of variation is used as the threshold for subsequent judgment. If the second average value is greater than or equal to the sum of the first average value and the coefficient of variation, it means that the data deviation of the data in the second window is large and the changing trend of the data is large. In this case, judging the data to be tested as abnormal data can minimize misjudgment and improve the accuracy of abnormal data judgment.
[0207] Figure 7 Another flowchart of an abnormality detection method provided by an embodiment of the present application is as follows: Figure 7 As shown, the anomaly detection method provided by the present application includes the following steps:
[0208] Step 701: Acquire a plurality of first data of a target device running in a first time period.
[0209] Step 702: sort the plurality of first data according to the collection time to obtain a first sequence.
[0210] Step 703: intercept the data in the first sequence according to a second time period to obtain a second sequence, wherein the duration of the first time period is greater than the duration of the second time period, and the start time or the end time of the second time period is within the first time period. For example, the second time period is a sub-time period in the first time period.
[0211] For details of steps 701 to 703, please refer to the relevant records of steps 101 to 103, which will not be repeated here.
[0212] Step 704, obtaining a data offset of the data in the second sequence relative to the data in the first sequence;
[0213] Step 705: Based on the data deviation, perform an abnormality determination on the data in the second sequence to obtain abnormal data in the second sequence.
[0214] For details of step 704-step 705, please refer to the relevant records of step 204-step 205, which will not be repeated here.
[0215] Step 706: If the amount of the abnormal data is greater than or equal to the second threshold, it is determined that the operation of the target device in the second time period is abnormal;
[0216] Step 707: If the number of abnormal data is greater than or equal to the second threshold, and the absolute value of the difference between the maximum value and the minimum value in the sampling data corresponding to multiple abnormal moments is greater than the third threshold, it is determined that there is an abnormality in the operation of the target device in the second time period, wherein the abnormal moment is the collection moment corresponding to the abnormal data.
[0217] Step 706 and step 707 are respectively a specific implementation manner of step 206 .
[0218] In the above, the second threshold and the third threshold can be set according to actual conditions and are not limited here.
[0219] In one case, the operating data of the target device in certain special situations has deviations, which satisfies the situation that the amount of abnormal data is large, but the operating data is still normal data. For such cases, the above judgment criteria can be used to effectively avoid misjudgment.
[0220] In another case, there are deviations in the operating data of the target device under certain special circumstances, which meets the situation where the number of abnormal data is large. In order to further avoid misjudgment, a judgment is further made based on the difference between the maximum and minimum values in the sampling data corresponding to multiple abnormal moments. If the absolute value of the difference is greater than the third threshold, it means that the deviation between the maximum and minimum values of the sampling data corresponding to multiple abnormal moments is large, and the possibility of an abnormality in the device is high. In this case, it is determined that there is an abnormality in the operation of the target device in the second time period. The above-mentioned judgment criteria can effectively avoid misjudgment and improve the accuracy of abnormality detection of the target device.
[0221] The following examples are given to illustrate the embodiments of the present application. Figure 8 As shown, the anomaly detection method provided in the embodiment of the present application includes the following process:
[0222] 1.1. Servo motor 1 and servo motor 2 are running, and PLC regularly collects data such as torque, speed, current, etc. of each motor.
[0223] 1.2. PLC transmits data to the host computer through CLINK protocol for temporary storage.
[0224] 1.3. After that, the data center consumes the host computer in real time through Kafka and temporarily stores the data.
[0225] 1.4. In the data center, the local anomaly detection algorithm is triggered regularly, for example, once every preset time. The specific process is as follows:
[0226] 1.4.1. Read the data of the previous three days with the current time as the end point.
[0227] 1.4.2. Preprocess Data:
[0228] 1.4.2.1. Sort the data according to the sampling time;
[0229] 1.4.2.2. Delete the consecutive repeated data points in the data. That is, if two adjacent data points are repeated, only one data point is retained. In this way, the data sequence is obtained. ;
[0230] 1.4.2.3. Normalize the data according to formula (1).
[0231] 1.4.2.4. Group the data according to positive and negative values, and record each group of data as .
[0232] 1.4.3. For each set of data , calculate the upper limit up_limit and the lower limit down_limit according to equation (2) and equation (3).
[0233] 1.4.4. Find z_sum_6_avg. For the first sequence Use 6 points as windows to perform sliding window summation to obtain a sequence z_sum_6 consisting of multiple sums, and then calculate the average value z_sum_6_avg of the sequence z_sum_6.
[0234] 1.4.5. Find z_sum_12_avg. For the first sequence Use 12 points as the window to perform sliding window summation to obtain a sequence z_sum_12 consisting of multiple sums, and then calculate the average value z_sum_12_avg of the sequence z_sum_12.
[0235] 1.4.6. Calculate the coefficient of variation according to formula (4) .
[0236] 1.4.7. For the first sequence In the example, the data sequence of the last two hours is intercepted and recorded as the second sequence n. For each data in n, if z_sum_6_avg and z_sum_12_avg starting from the data satisfy the following expression:
[0237]
[0238] The collection time corresponding to the data is recorded as an abnormal point, and all abnormal points are added to the sequence abn.
[0239] 1.4.8. If the abnormal point sequence abn satisfies:
[0240] Contains more than or equal to 4 outliers;
[0241] If the absolute value of the difference between the maximum abnormal point and the minimum abnormal point is greater than 4, a work order alarm is triggered, that is, an alarm message is sent.
[0242] 1.5. The data center sends messages to the user client, and the engineer will inspect and maintain the corresponding servo motor to ensure that there is no abnormality in the equipment.
[0243] The anomaly detection method provided in the embodiment of the present application is based on the idea of local anomalies. It assumes that the data is in a normal state most of the time. By analyzing the change trend of the current data relative to the previous period, it analyzes whether the current data is abnormal, performs maintenance inspections on the equipment in advance, and reduces the scenarios where sudden shutdowns disrupt production plans. When it is determined that the equipment is abnormal, combined with engineer detection to form a closed-loop process, it can greatly improve maintenance efficiency and has a higher accuracy rate than other detection methods.
[0244] The method of the embodiment of the present application can obtain the operating data of the equipment through sensors, consume it to the data middle platform through Clink and KafKa, and then run the algorithm data on the data middle platform to determine whether the alarm condition is met through the algorithm. Then, it is displayed to the corresponding engineer in the work order system, and the engineer checks the equipment to ensure the stable operation of the equipment.
[0245] See also Fig. 9 , is a schematic diagram of the structure of an abnormality detection device provided in an embodiment of the present application, such as Fig. 9 As shown, the abnormality detection device 900 includes:
[0246] The present application provides an abnormality detection device, including:
[0247] A first acquisition module 901 is used to acquire a plurality of first data of a target device running in a first time period;
[0248] A sorting module 902 is used to sort the plurality of first data according to the collection time to obtain a first sequence;
[0249] The interception module 903 is used to intercept the data in the first sequence according to a second time period to obtain a second sequence, wherein the duration of the first time period is greater than the duration of the second time period, and the start time or the end time of the second time period is within the first time period;
[0250] A second acquisition module, 904, acquires a data offset of the data in the second sequence relative to the data in the first sequence;
[0251] The determination module 905 is configured to determine whether there is any abnormality in the operation of the target device in the second time period based on the data deviation.
[0252] In the embodiment of the present application, whether there is any abnormality in the operation of the target device is determined by comparing the operation data of the target device in the first time period with the operation data of the target device in the second time period. That is, whether the target device is abnormal can be determined by comparing the target device's most recent operation data. This abnormality detection method can avoid interference from operational abnormalities caused by wear and tear of the target device, and can improve the accuracy of abnormality detection.
[0253] In one embodiment of the present application, the determination module 905 includes:
[0254] A first determination submodule is configured to perform an abnormality determination on the data in the second sequence based on the data deviation degree to obtain abnormal data in the second sequence;
[0255] The second determination submodule is configured to determine whether there is any abnormality in the operation of the target device during the second time period according to the amount of the abnormal data.
[0256] In an embodiment of the present application, a data deviation of data in the second sequence relative to data in the first sequence is obtained, and based on the data deviation, an abnormality determination is performed on the data in the second sequence to obtain abnormal data in the second sequence, and based on the amount of the abnormal data, it is determined whether there is an abnormality in the operation of the target device in the second time period, so as to determine whether the target device is abnormal based on the data of the target device's most recent operation. This abnormality detection method can avoid interference from operational abnormalities caused by wear and tear on the target device, and can improve the accuracy of abnormality detection.
[0257] In an embodiment of the present application, the first acquisition module 901 includes:
[0258] A collection submodule, used for collecting a plurality of sampled data of the target device running in the first time period;
[0259] A sorting submodule, used to sort the plurality of sampled data according to the collection time, and perform a deduplication process on the sampled data with adjacent collection time and the same data, so as to obtain a third sequence;
[0260] A normalization submodule is used to obtain the multiple first data based on the data in the third sequence and a normalization model.
[0261] In an embodiment of the present application, multiple first data are obtained by performing data preprocessing on multiple sampling data, such as sorting, deduplication, normalization, etc., to facilitate subsequent anomaly detection based on the obtained multiple first data and improve the accuracy of detection.
[0262] In one embodiment of the present application, the normalization submodule includes:
[0263] A processing unit, configured to process the data in the third sequence using the normalization model to obtain a plurality of second data;
[0264] a determining unit, configured to determine an upper limit value and a lower limit value according to an average value of the plurality of second data;
[0265] The interception unit is used to intercept the data that is smaller than the upper limit value and larger than the lower limit value among the plurality of second data to obtain the plurality of first data.
[0266] In the embodiment of the present application, by using upper and lower limits to intercept the plurality of second data obtained after normalization, the most representative data can be obtained while reducing the amount of subsequent data processing.
[0267] In one embodiment of the present application, the first determination submodule includes:
[0268] A first acquisition unit is configured to perform sliding window processing on the first sequence with the data to be tested as the starting data and with a first window length for each data to be tested in the second sequence, so as to obtain a plurality of first windows;
[0269] a first calculating unit, configured to perform mean calculation based on the sum of the data of the plurality of first windows and the number of the first windows to obtain a first average value;
[0270] a second acquisition unit, configured to, for each data to be tested in the second sequence, perform sliding window processing on the first sequence with the data to be tested as the starting data and with a second window length, to obtain a plurality of second windows, wherein the second window length is greater than the first window length;
[0271] a second calculating unit, configured to perform mean calculation based on the sum of the data of the plurality of second windows and the number of the second windows to obtain a second average value;
[0272] A determination unit is used to determine, for each of the data to be tested, that the data to be tested is the abnormal data if the data deviation is greater than or equal to a first threshold, wherein the data deviation is the difference between the second mean value and the coefficient of variation and the first mean value, and the coefficient of variation is the ratio of the mean value to the standard deviation of the multiple first data in the first sequence.
[0273] In an embodiment of the present application, two window lengths are selected to calculate the first average value and the second average value. The first average value and the second average value can respectively reflect the data deviation of the data in the first window and the data deviation of the data in the second window. The first average value plus the coefficient of variation can correct the error caused by the volatility of the data itself used to calculate the first average value, so that the value after the first average value plus the coefficient of variation is more accurate. The sum of the first average value and the coefficient of variation is used as a threshold to participate in subsequent judgments. If the second average value is greater than or equal to the sum of the first average value and the coefficient of variation, it means that the data deviation of the data in the second window is large and the data change trend is large. In this case, the data to be tested is determined to be abnormal data, which can minimize misjudgment and improve the accuracy of abnormal data judgment.
[0274] In one embodiment of the present application, the second determination submodule is used to:
[0275] If the amount of the abnormal data is greater than or equal to a second threshold, determining that the operation of the target device in the second time period is abnormal;
[0276] or
[0277] If the number of abnormal data is greater than or equal to the second threshold, and the absolute value of the difference between the maximum value and the minimum value in the sampling data corresponding to multiple abnormal moments is greater than the third threshold, it is determined that there is an abnormality in the operation of the target device in the second time period, wherein the abnormal moment is the collection moment corresponding to the abnormal data.
[0278] In an embodiment of the present application, in one case, there is a deviation in the operating data of the target device under certain special circumstances, which satisfies the situation that the amount of abnormal data is large, but the operating data is still normal data. For such cases, the above-mentioned judgment criteria can be used to effectively avoid misjudgment.
[0279] In another case, there are deviations in the operating data of the target device under certain special circumstances, which meets the situation where the number of abnormal data is large. In order to further avoid misjudgment, a judgment is further made based on the difference between the maximum and minimum values in the sampling data corresponding to multiple abnormal moments. If the absolute value of the difference is greater than the third threshold, it means that the deviation between the maximum and minimum values of the sampling data corresponding to multiple abnormal moments is large, and the possibility of an abnormality in the device is high. In this case, it is determined that there is an abnormality in the operation of the target device in the second time period. The above-mentioned judgment criteria can effectively avoid misjudgment and improve the accuracy of abnormality detection of the target device.
[0280] In an embodiment of the present application, when the plurality of first data are vector data, the plurality of first data have the same direction.
[0281] In the embodiment of the present application, since some target devices have a direction of operation, for example, the direction of motor rotation includes forward rotation and reverse rotation, in order to accurately analyze the data obtained when the target device rotates forward or reversely, the first data is vector data, and the first data with the same direction can be analyzed to determine whether the target device has an abnormal forward rotation or an abnormal reverse rotation.
[0282] In one embodiment of the present application, the data deviation is calculated based on multiple groups of data sequences intercepted from the first sequence, the starting data of each group of the data sequence is the data in the second sequence, and the number of data included in each group of the data sequence is the same or different.
[0283] In the embodiment of the present application, the accuracy of the data deviation can be improved by performing statistical analysis on multiple groups of data sequences intercepted from the first sequence.
[0284] An embodiment of the present application provides an electronic device, including a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements any one of the anomaly detection methods described in the above embodiments.
[0285] In addition, the embodiments of the present application may be implemented by providing a computer storage medium having computer program instructions stored thereon; when the computer program instructions are executed by a processor, any one of the anomaly detection methods in the above embodiments is implemented.
[0286] An embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0287] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0288] The functional blocks shown in the above structural block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier. "Machine-readable medium" may include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memory, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0289] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0290] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device, equipment and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0291] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and they should all be included in the scope of the claims and specification of the present application. In particular, as long as there is no structural conflict, the various technical features mentioned in the various embodiments can be combined in any way. The present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions that fall within the scope of the claims.
Claims
1. An anomaly detection method, characterized in that: include: Acquire a plurality of first data of the target device running in a first time period; Sorting the plurality of first data according to the collection time to obtain a first sequence; The data in the first sequence is intercepted according to a second time period to obtain a second sequence, wherein the duration of the first time period is greater than the duration of the second time period, and the start time or the end time of the second time period is within the first time period; Acquire a data offset of the data in the second sequence relative to the data in the first sequence; Based on the data deviation, determining whether there is an abnormality in the operation of the target device in the second time period; The determining, based on the data deviation, whether operation of the target device in the second time period is abnormal includes: Based on the data deviation, performing abnormality determination on the data in the second sequence to obtain abnormal data in the second sequence; Determining whether the operation of the target device in the second time period is abnormal according to the amount of the abnormal data; The step of performing abnormality determination on the data in the second sequence based on the data deviation to obtain abnormal data in the second sequence includes: For each data to be tested in the second sequence, taking the data to be tested as the starting data and performing sliding window processing on the first sequence with a first window length, to obtain a plurality of first windows; Calculate the mean based on the sum of the data of the plurality of first windows and the number of the first windows to obtain a first average value; For each data to be tested in the second sequence, taking the data to be tested as the starting data and performing sliding window processing on the first sequence with a second window length to obtain a plurality of second windows, wherein the second window length is greater than the first window length; Calculate the mean based on the sum of the data of the plurality of second windows and the number of the second windows to obtain a second average value; For each of the data to be tested, if the data deviation is greater than or equal to a first threshold, the data to be tested is determined to be the abnormal data, wherein the data deviation is the difference between the second mean value and the coefficient of variation and the first mean value, and the coefficient of variation is the ratio of the mean of the multiple first data in the first sequence to the standard deviation.
2. The anomaly detection method according to claim 1, characterized in that: Acquiring a plurality of first data of a target device running in a first time period, including: Collecting a plurality of sampling data of the target device running in the first time period; The plurality of sampling data are sorted according to the collection time, and the sampling data with adjacent collection time and the same data are deduplicated to obtain a third sequence; The multiple first data are obtained based on the data in the third sequence and the normalized model.
3. The anomaly detection method according to claim 2, characterized in that: Based on the data in the third sequence and the normalized model, the plurality of first data are obtained, including: Processing the data in the third sequence using the normalization model to obtain a plurality of second data; Determine an upper limit value and a lower limit value according to the average value of the plurality of second data; The plurality of first data are obtained by intercepting data that is smaller than the upper limit value and larger than the lower limit value among the plurality of second data.
4. The anomaly detection method according to claim 1, characterized in that: Determining, according to the amount of the abnormal data, whether operation of the target device in the second time period is abnormal includes: If the amount of the abnormal data is greater than or equal to a second threshold, determining that the operation of the target device in the second time period is abnormal; or If the number of abnormal data is greater than or equal to the second threshold, and the absolute value of the difference between the maximum value and the minimum value in the sampling data corresponding to multiple abnormal moments is greater than the third threshold, it is determined that there is an abnormality in the operation of the target device in the second time period, wherein the abnormal moment is the collection moment corresponding to the abnormal data.
5. The anomaly detection method according to any one of claims 1 to 4, characterized in that: When the plurality of first data are vector data, the plurality of first data have the same direction.
6. The anomaly detection method according to any one of claims 1 to 4, characterized in that: The data deviation is calculated based on multiple groups of data sequences intercepted from the first sequence, the starting data of each group of the data sequence is the data in the second sequence, and the number of data included in each group of the data sequence is the same or different.
7. An abnormality detection device, characterized in that: The device comprises: A first acquisition module, used to acquire a plurality of first data of a target device running in a first time period; A sorting module, used for sorting the plurality of first data according to the collection time to obtain a first sequence; an interception module, configured to intercept the data in the first sequence according to a second time period to obtain a second sequence, wherein the duration of the first time period is greater than the duration of the second time period, and the start time or the end time of the second time period is within the first time period; A second acquisition module, used to acquire a data offset of the data in the second sequence relative to the data in the first sequence; A determination module, based on the data deviation, determines whether the operation of the target device in the second time period is abnormal; The determination module comprises: A first determination submodule, configured to perform an abnormality determination on the data in the second sequence based on the data deviation degree, to obtain abnormal data in the second sequence; A second determination submodule, configured to determine whether the operation of the target device in the second time period is abnormal according to the amount of the abnormal data; The first determination submodule includes: A first acquisition unit is configured to perform sliding window processing on the first sequence with the data to be tested as the starting data and with a first window length for each data to be tested in the second sequence, so as to obtain a plurality of first windows; a first calculating unit, configured to perform mean calculation based on the sum of the data of the plurality of first windows and the number of the first windows to obtain a first average value; a second acquisition unit, configured to, for each data to be tested in the second sequence, perform sliding window processing on the first sequence with the data to be tested as the starting data and with a second window length, to obtain a plurality of second windows, wherein the second window length is greater than the first window length; a second calculating unit, configured to perform mean calculation based on the sum of the data of the plurality of second windows and the number of the second windows to obtain a second average value; A determination unit is used to determine, for each of the data to be tested, that the data to be tested is the abnormal data if the data deviation is greater than or equal to a first threshold, wherein the data deviation is the difference between the second mean value and the coefficient of variation and the first mean value, and the coefficient of variation is the ratio of the mean value to the standard deviation of the multiple first data in the first sequence.
8. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the abnormality detection method as claimed in any one of claims 1 to 6.
9. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the abnormality detection method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the abnormality detection method according to any one of claims 1 to 6 are implemented.
