A method and device for processing and detecting data collected by industrial equipment
Through the double-layer LSTM model and LOF algorithm, the problem of attribute relationships and pattern anomaly detection in industrial equipment data processing is solved, high-accuracy data filling and anomaly detection are achieved, more accurate equipment status information is provided, and maintenance costs are reduced. and improved product quality.
Patent Information
- Application Number
- CN202010760728.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-31
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-07-31
AI Technical Summary
When processing data collected by industrial equipment, the existing technology fails to effectively consider the relationship between data attributes and cannot accurately detect pattern abnormality, resulting in misleading data cleaning and analysis results.
Using a method based on the double-layer LSTM model, combined with the local anomaly detection algorithm (LOF) of density, the data collected by industrial equipment is corrected for invalid values, missing values completed, duplicate data merged and outliers detected to distinguish between short-term and long-term Missing data, and detect outliers and pattern anomalies in time series.
It improves the accuracy of data filling and anomaly detection, can effectively process data under high missing rate conditions, provides more accurate equipment status information, reduces factory maintenance costs, and improves product quality.
Smart Images

Figure CN111967509B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of industrial data processing, and in particular to a method and device for processing and detecting data collected by industrial equipment. Background Art
[0002] Industrial big data consists of massive amounts of data generated by information technology applications in the industrial field. Due to defects in the data acquisition system, link problems, hardware failures, human factors and other reasons, data quality problems are widespread. Poor data may lead to deviations in analysis results and cause production accidents. Therefore, there is an urgent need to clean industrial big data.
[0003] The principle of data cleaning is to use mathematical statistics, data mining or predefined cleaning rules to transform dirty data into data that meets data quality requirements. The main processing methods include: correction of invalid values, completion of missing values, merging of duplicate data, and detection of outliers.
[0004] Invalid values refer to erroneous data whose format does not conform to the specification or whose values are meaningless. In the data collected by industrial equipment, abnormal values are usually mixed with invalid values.
[0005] Missing values refer to data that is missing due to subjective or objective reasons such as storage device damage, violation of data input rules, or data acquisition equipment capacity limitations. The existing technology is to retain complete records for analysis and query, but this method is only applicable to situations where the missing rate is very low. If a large amount of data is missing, it will lead to deviations in data distribution and misleading data analysis results. A more reasonable processing method should be to restore as much lost information as possible. A common processing method for restoring lost information is to replace it with the mean or the most frequently occurring value. However, the above processing method ignores the relationship between the attributes of the data collected by industrial equipment, and it is not advisable to fill a fixed value for all missing data of the same attribute. There are also many statistical and machine learning models used to solve the problem of missing data. Common statistical filling methods include EM algorithm, regression prediction method, interpolation method, etc. The field of machine learning includes KNN clustering method, classification algorithm and neural network algorithm, but the models based on statistics and machine learning do not take into account the relationship between the attributes of data collected by industrial equipment. That is, the traditional method of processing missing values usually only considers the autocorrelation of data, and does not consider the impact of changes in other related dimensional data.
[0006] Duplicate data refers to data with the same name or attribute value. Pre-set judgment criteria are used to detect whether there are duplicate records in the data collected by industrial equipment. Merging or eliminating is the basic method for processing duplicate data.
[0007] An outlier refers to a data point or data segment in a time series that has a significantly different fluctuation from other parts. Currently, the commonly used anomaly detection methods include statistical-based methods, clustering-based methods, and neighbor-based methods. The statistical-based method assumes that normal data is generated by a statistical model that conforms to a certain distribution, and data that violates the law is an outlier; it can also be described by assuming that the probability of normal values appearing in a high-probability area in a random model, while outliers appear in a low-probability area. The disadvantage of this method is that it is highly dependent on the model assumptions of the data. The clustering-based method creates a data model by clustering, and divides similar data into the same cluster, making the intra-cluster similarity as large as possible and the inter-cluster similarity as small as possible. If a data does not belong to any cluster or is far away from other clusters, it can be judged that the data is an outlier. The clustering-based method is more suitable for detecting global outliers. The neighbor-based method assumes that normal data is located in a neighborhood with a higher density, while outliers are usually far away from their neighborhood and located in a sparse area. The neighbor-based method includes two methods: distance-based and density-based. However, the existing technology can only detect outliers, but cannot detect abnormal state of the pattern. Summary of the invention
[0008] In order to solve the above technical problems, the present invention proposes a method and device for processing and detecting data collected by industrial equipment. The method and device are used to solve the technical problems in the prior art of data cleaning, especially the cleaning of data collected by industrial equipment, without considering the relationship between the attributes of the data collected by industrial equipment, and the inability to detect abnormal mode conditions.
[0009] According to a first aspect of the present invention, a method for processing and detecting data collected by industrial equipment is provided, the method comprising the following steps:
[0010] Step S101: Step S101: receiving data collected by sensors of industrial equipment;
[0011] Step S102: correcting the invalid values of the data. If the format of a certain data item in the collected data does not meet the requirements, or the data value of a certain data item exceeds the allowed threshold, the data item is deleted and marked as missing data.
[0012] Step S103: for the corrected data, determine the missing data value, and classify the missing data into two categories: short-term missing and long-term missing according to the data missing situation and the data sampling comparison relationship with the sensor of the industrial equipment, and use a double-layer LSTM-based model to complete the missing data;
[0013] Step S104: merging the repeated values in the corrected data that fills in all the missing data;
[0014] Step S105: Detecting anomalies of the time series for the data after merging and processing duplicate values, wherein the anomalies of the time series include anomalies of points and pattern anomalies; detecting anomalies of points by using a density-based local anomaly detection algorithm (LOF), and detecting pattern anomalies based on a double-layer LSTM model;
[0015] Step S106: Generate a report based on the abnormal point and pattern abnormal data.
[0016] Furthermore, the method of completing long-term missing data based on a double-layer LSTM model includes:
[0017] Step S201: determine the location of missing data;
[0018] According to the sampling interval of the industrial equipment data collection, the position of the missing data value is determined from the corrected data; according to the data position where the invalid value is deleted, the position of the missing data value is determined; the positions of all the missing data values are recorded, and the positions of all the missing data values are sorted in chronological order; the current processing position is marked as the position of the first missing data value;
[0019] Step S202: determine whether all missing data are filled, if so, output the corrected data that fills all missing data, and the method ends; if not, proceed to step S203;
[0020] Step S203: Determine n other attributes related to the missing data by correlation calculation, where n≥1.
[0021] The calculation formula is:
[0022] The data collected by the sensors of industrial equipment has multiple attributes, X is the attribute set containing missing data collected by the industrial equipment, and Y is the attribute set without missing data collected by the industrial equipment at the same time; X i is any attribute in the attribute set with missing data, Y j is any attribute of the attribute set without missing data; generate a replica data set without missing data, delete the missing data in the data collected by the industrial equipment, generate a replica data set, and calculate Cov(X) based on the replica data set. i ,Y j )、D(X i )、D(Y j ), Cov(X i ,Y) is X i ,Y j The covariance of i )、D(Y j ) are X i , Y j The variance of
[0023] When X i With Y j The correlation coefficient between The absolute value of When X i With Y j is the relevant attribute and will be i The related attributes are sorted by correlation value, and the top n attributes with the highest correlation are selected as other attributes related to the missing data;
[0024] Step S204: taking the time_step data preceding the missing data as input, calling the trained LSTM model, calculating the missing data, and filling the missing data with the calculated data; time_step is a predetermined step length;
[0025] Step S205: Move the current processing position backward by one position and proceed to step S202.
[0026] Furthermore, the training process of the LSTM model is:
[0027] The data collected by the multidimensional sensor with missing data deleted is selected in proportion as the training data in the training set, and the two-layer LSTM model is trained to obtain the values of the training parameters;
[0028] Step S304: Adjust the training parameters according to the test results of the test set.
[0029] Furthermore, the outliers are detected by using the density-based local anomaly detection algorithm (LOF), and the pattern anomalies are detected based on the two-layer LSTM model, including:
[0030] The density-based local anomaly detection algorithm (LOF) detects anomalies, including:
[0031] Step S401: The data after merging and processing duplicate values is used as the data to be detected, and the data corresponding to the data to be detected and other n attributes related to the attributes of the data to be detected are packaged into a tuple as the input of the LOF algorithm;
[0032] Step S402: Set the range of parameter k, k∈[min,max], k is an integer; for each k value, take each data to be detected as a point, execute the LOF algorithm once for each point to obtain an outlier factor value, and after running all values of k respectively, calculate the average of the outlier factor values of each point as the outlier factor mean of the point, and the calculation formula is:
[0033]
[0034] Among them, min and max are preset range values, LOFk (p) is the outlier factor value corresponding to k, point p;
[0035] Step S403: output the points whose outlier factor mean is greater than the threshold as abnormal points;
[0036] The method of detecting pattern anomalies based on the double-layer LSTM model includes:
[0037] Step S501: Call the trained LSTM model to perform time series prediction and obtain the prediction result y_predict;
[0038] Step S502: Calculate the difference e between the predicted result y_predict and the actual result y_test;
[0039] Step S503: Set the range interval error_buffer. If the difference value e is not within the range interval error_buffer, the point corresponding to the difference value e is regarded as an abnormal point.
[0040] According to a second aspect of the present invention, there is provided a device for processing and detecting data collected by industrial equipment, the device comprising:
[0041] Acquisition module: receives data collected by sensors of industrial equipment;
[0042] Correction module: corrects the invalid value of the data. If the format of a certain data item in the collected data does not meet the requirements, or the data value of a certain data item exceeds the allowed threshold, the data item is deleted and marked as missing data.
[0043] Data filling module: for the corrected data, determine the missing data value, and divide the missing data into short-term missing and long-term missing according to the data missing situation and the data sampling comparison relationship with the sensor of the industrial equipment, and use a double-layer LSTM-based model to fill the missing data;
[0044] Duplicate processing module: merge the duplicate values in the corrected data that fills in all the missing data;
[0045] Anomaly detection module: detects anomalies in the time series for the data after merging and processing duplicate values. The anomalies in the time series include anomalies at points and pattern anomalies. The anomalies are detected by using a density-based local anomaly detection algorithm (LOF) and pattern anomalies are detected based on a double-layer LSTM model.
[0046] Report generation module: Generate reports based on abnormal point and pattern abnormal data.
[0047] Furthermore, the data filling module includes:
[0048] Determine location submodule: determine the location of missing data;
[0049] According to the sampling interval of the industrial equipment data collection, the position of the missing data value is determined from the corrected data; according to the data position where the invalid value is deleted, the position of the missing data value is determined; the positions of all the missing data values are recorded, and the positions of all the missing data values are sorted in chronological order; the current processing position is marked as the position of the first missing data value;
[0050] The first judgment submodule: judge whether all missing data are filled;
[0051] Correlation calculation submodule: Determine n other attributes related to missing data through correlation calculation, n ≥ 1,
[0052] The calculation formula is:
[0053] The data collected by the sensors of industrial equipment has multiple attributes, X is the attribute set containing missing data collected by the industrial equipment, and Y is the attribute set without missing data collected by the industrial equipment at the same time; X i is any attribute in the attribute set with missing data, Y j is any attribute of the attribute set without missing data; generate a replica data set without missing data, delete the missing data in the data collected by the industrial equipment, generate a replica data set, and calculate Cov(X) based on the replica data set. i ,Y j )、D(X i )、D(Y j ), Cov(X i ,Y) is X i ,Y j The covariance of i )、D(Y j ) are X i , Y j The variance of
[0054] When X i With Y j The correlation coefficient between The absolute value of When X i With Y j is the relevant attribute and will be i The related attributes are sorted by correlation value, and the top n attributes with the highest correlation are selected as other attributes related to the missing data;
[0055] Filling submodule: takes the time_step data preceding the missing data as input, calls the trained LSTM model, calculates the missing data, and fills the missing data with the calculated data; time_step is the predetermined step length;
[0056] Shift submodule: Move the current processing position one position backward.
[0057] Furthermore, the training of the LSTM model includes:
[0058] Determine the parameter submodule: configure a two-layer LSTM model, with the model's input layer input_size = n, and the output layer output_size = 1; determine the training parameters of the two-layer LSTM model, including the number of nodes in the hidden layer rnn_unit, the number of inputs for each training batch_size, and the size of each batch of data time_step; where n is the number of attributes with the highest correlation;
[0059] The second determination submodule: determining the training set and test set data, and determining the data ratio of the training set and the test set;
[0060] Training value determination submodule: selects data collected by multidimensional sensors with missing data deleted in proportion as training data in the training set, trains the two-layer LSTM model, and obtains the values of various training parameters;
[0061] Adjustment submodule: adjust the training parameters according to the test results of the test set.
[0062] Furthermore, the anomaly detection module includes an anomaly point detection submodule and a pattern anomaly detection submodule:
[0063] The outlier detection submodule includes:
[0064] Packing submodule: The data after merging and processing duplicate values is used as the data to be detected, and the data corresponding to the data to be detected and other n attributes related to the attributes of the data to be detected are packaged into a tuple as the input of the LOF algorithm;
[0065] Setting range submodule: Set the range of parameter k, k∈[min,max], k is an integer; for each k value, take each data to be detected as a point, and execute the LOF algorithm once for each point to obtain an outlier factor value. After running all values of k separately, calculate the average of the outlier factor values of each point as the outlier factor mean of the point. The calculation formula is:
[0066]
[0067] Among them, min and max are preset range values, LOFk (p) is the outlier factor value corresponding to k, point p;
[0068] The first output submodule: outputs points whose outlier factor mean is greater than the threshold as abnormal points;
[0069] The pattern anomaly detection submodule includes:
[0070] Call submodule: call the trained LSTM model to perform time series prediction and obtain the prediction result y_predict;
[0071] The third calculation submodule: calculates the difference e between the predicted result y_predict and the actual result y_test;
[0072] The second output submodule: sets the range interval error_buffer. If the difference value e is not within the range interval error_buffer, the point corresponding to the difference value e is taken as an abnormal point.
[0073] According to a third aspect of the present invention, there is provided a system for processing and detecting data collected by industrial equipment, comprising:
[0074] A processor, which is used to execute multiple instructions;
[0075] A memory for storing a plurality of instructions;
[0076] The plurality of instructions are used to be stored by the memory, and loaded and executed by the processor to implement the aforementioned method for processing and detecting data collected by industrial equipment.
[0077] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein a plurality of instructions are stored in the storage medium; the plurality of instructions are used for a processor to load and execute the aforementioned method for processing and detecting data collected by industrial equipment.
[0078] According to the above scheme of the present invention, combined with the characteristics of industrial data, a multi-dimensional time series data missing value filling method and an outlier classification detection processing method are used for the data of industrial equipment, and the time series of industrial data and the correlation between dimensions are comprehensively utilized to fill the missing values and detect long-term pattern anomalies. The above scheme of the present invention has a higher accuracy rate for filling missing values than the Lagrange interpolation method and the KNNI algorithm, and as the missing rate increases, the advantages of the algorithm are also expanding. In addition, LSTM can fit the trend of data well, and can also fill in the case of long-term missing data. The scheme of the present application can find all abnormal points and pattern abnormal points respectively, and provide more accurate equipment abnormality information for the factory. Through the above scheme, accurate equipment status change information is provided to the factory. Potential faults of industrial equipment can be mined, and pre-maintenance and performance degradation assessment of equipment can be realized, which is of great significance to reducing factory maintenance costs and improving product quality.
[0079] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present invention in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention, and the present invention is described by providing the following accompanying drawings. In the accompanying drawings:
[0081] Figure 1 A flow chart of a method for processing and detecting data collected by industrial equipment according to an embodiment of the present invention;
[0082] Figure 2 Data acquired by a temperature sensor according to one embodiment of the present invention;
[0083] Figure 3 This is an example diagram of additive outliers;
[0084] Figure 4 This is an example diagram of the model height anomaly;
[0085] Figure 5 This is an example diagram of pattern length anomaly;
[0086] Figure 6 Example graph of mean and standard deviation
[0087] Figure 7 This is a structural block diagram of a device for processing and detecting data collected by industrial equipment according to an embodiment of the present invention. DETAILED DESCRIPTION
[0088] First combine Figure 1The following is a flow chart of a method for processing and detecting data collected by industrial equipment according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0089] Step S101: receiving data collected by sensors of industrial equipment;
[0090] Step S102: correcting the invalid values of the data. If the format of a certain data item in the collected data does not meet the requirements, or the data value of a certain data item exceeds the allowed threshold, the data item is deleted and marked as missing data.
[0091] Step S103: for the corrected data, determine the missing data value, and classify the missing data into two categories: short-term missing and long-term missing according to the data missing situation and the data sampling comparison relationship with the sensor of the industrial equipment, and use a double-layer LSTM-based model to complete the missing data;
[0092] Step S104: merging the repeated values in the corrected data that fills in all the missing data;
[0093] Step S105: Detecting anomalies of the time series for the data after merging and processing duplicate values, wherein the anomalies of the time series include anomalies of points and pattern anomalies; detecting anomalies of points by using a density-based local anomaly detection algorithm (LOF), and detecting pattern anomalies based on a double-layer LSTM model;
[0094] Step S106: Generate a report based on the abnormal point and pattern abnormal data.
[0095] In the step S102, the format of a certain data does not meet the requirements, which means that the format of the data does not meet the pre-defined valid format. For example, if the value representing the number, level and other indicators does not meet the integer requirement, the value is invalid. Specifically, Python regular expressions can be used to batch process the data collected by sensors of industrial equipment, and each data in the attribute column of the specified data format is matched. If a certain data does not meet the preset conditions, the data is set to empty.
[0096] In step S102, the data value size of a certain data item exceeds the allowed threshold value, which means whether the data value size of the data item is within a preset valid value range. If it is not within the valid value range, the value of the item is invalid. Specifically, a range can be set for the data size of the specified attribute column. If a certain data value is not within the set range, the data item is set to empty.
[0097] The step S103: determining the missing data value for the corrected data, dividing the missing data into short-term missing and long-term missing according to the missing data situation and the data sampling comparison relationship with the sensor of the industrial equipment, and using a double-layer LSTM-based model to complete the missing data, including:
[0098] The time interval for collecting data by industrial machinery and equipment is usually fixed. If the time interval between the latter data and the previous data in the collected data is greater than the fixed time interval, then there are missing values in the data collected by the industrial machinery and equipment.
[0099] like Figure 2 As shown, Figure 2 This is the temperature data curve collected by the temperature sensor in the industrial equipment of a certain factory on November 8, 2018. The collection frequency under normal circumstances is once every 2 minutes. Figure 2 It can be seen that at A, B, and C, the time difference between the two points exceeds the sampling period of the temperature sensor, indicating that there is data missing at A, B, and C. The time interval between the data at A is 2 hours, 2 minutes, and 52 seconds, the time interval between the data at B is 24 minutes and 45 seconds, and the time interval between the data at C is 4 minutes and 1 second.
[0100] The reasons for data loss may be unstable sensor performance, system downtime, data transmission link failure, database read and write anomalies, etc. According to the data loss situation and the data sampling comparison relationship with the sensor of the industrial equipment, for example, based on the analysis of historical data, the multiple threshold of the sampling period of the sensor of the industrial equipment is determined. When the time interval of data loss exceeds the multiple threshold multiplied by the sampling period, the missing data is long-term loss, otherwise, the missing data is short-term loss. Based on the above method, the missing data is divided into two categories: short-term loss and long-term loss.
[0101] For short-term missing data, the data trend of industrial equipment and various related systems will not change significantly during the missing time interval. A two-layer LSTM-based model can be used to complete the short-term missing data, or other methods can be used to complete the short-term missing data.
[0102] For long-term missing, the missing time length of long-term missing is greater than the missing time length critical value of the predictable system trend change. Therefore, in this embodiment, the missing data is supplemented by a trend fitting method for long-term missing data, and a model based on time series analysis is adopted. Recurrent neural network (RNN) uses the chain rule for gradient tuning. When training long-span time series, it will encounter the problem of gradient disappearance or gradient explosion. Therefore, the RNN model is not suitable for long-term memory calculation. Long-Short Term Memory (LSTM) is an improved RNN model proposed by Hochreiter et al. and improved and promoted by Alex Graves. Three control units, input gate, output gate, and forget gate, are added to LSTM. When information enters the model, the control unit in LSTM will judge the information, retain the information that meets the rules, and forget the information that does not meet the rules. With this principle, the dependency problem of long sequences in neural networks can be solved. In this embodiment, the LSTM model is used to supplement long-term missing data.
[0103] The method of completing long-term missing data based on a double-layer LSTM model includes:
[0104] Step S201: determine the location of missing data;
[0105] According to the sampling interval of the industrial equipment data collection, the position of the missing data value is determined from the corrected data; according to the data position where the invalid value is deleted, the position of the missing data value is determined; the positions of all the missing data values are recorded, and the positions of all the missing data values are sorted in chronological order; the current processing position is marked as the position of the first missing data value;
[0106] Step S202: determine whether all missing data are filled, if so, output the corrected data that fills all missing data, and the method ends; if not, proceed to step S203;
[0107] Step S203: Determine n other attributes related to the missing data by correlation calculation, where n≥1.
[0108] The calculation formula is:
[0109] The data collected by the sensors of industrial equipment has multiple attributes, X is the attribute set containing missing data collected by the industrial equipment, and Y is the attribute set without missing data collected by the industrial equipment at the same time; X i is any attribute in the attribute set with missing data, Y jis any attribute of the attribute set without missing data; generate a replica data set without missing data, delete the missing data in the data collected by the industrial equipment, generate a replica data set, and calculate Cov(X) based on the replica data set. i ,Y j )、D(X i )、D(Y j ), Cov(X i ,Y) is X i ,Y j The covariance of i )、D(Y j ) are X i , Y j The variance of
[0110] When X i With Y j The correlation coefficient between The absolute value of When X i With Y j is the relevant attribute and will be i The related attributes are sorted by correlation value, and the top n attributes with the highest correlation are selected as other attributes related to the missing data;
[0111] Step S204: take the time_step data preceding the missing data as input, call the trained LSTM model, calculate the missing data, and fill the missing data with the calculated data; time_step is the size of each batch of data;
[0112] time_step is a predetermined step length, and in this embodiment, the value of time_step is 100. The specific value of time_step is related to the size of the data set and can be adjusted as needed.
[0113] Step S205: Move the current processing position backward by one position and proceed to step S202.
[0114] The training process of the LSTM model is:
[0115] Step S301: Select a two-layer LSTM model, the input layer input_size=n, the output layer output_size=1; determine the training parameters of the two-layer LSTM model, including the number of nodes in the hidden layer rnn_unit, the number of inputs for each training batch_size, and the size of each batch of data time_step; where n is the number of attributes with the highest correlation;
[0116] Step S302: Determine the training set and the test set data, and determine the data ratio of the training set and the test set;
[0117] In this example, 70% of the data is selected as the training set and 30% of the data is selected as the test set;
[0118] Step S303: Selecting data collected by the multidimensional sensor with missing data deleted in proportion as training data in the training set, training the two-layer LSTM model, and obtaining various values of the training parameters;
[0119] Step S304: Adjust the training parameters according to the test results of the test set.
[0120] In this embodiment, because the single-layer LSTM filling effect is not ideal and is prone to underfitting problems, a double-layer LSTM model is selected. If the data collected by the industrial equipment is one-dimensional data, it is only necessary to change the LSTM model input to a single variable.
[0121] Furthermore, the effect of filling missing data can be evaluated through subjective observation or by calculating an objective evaluation index. The root mean square error (RMSE) can be used as an evaluation index, which can intuitively reflect the deviation between the filled value and the actual value. The smaller the root mean square error value, the better the fitting degree and the higher the accuracy of the filling result. A complete data set can be selected, a certain proportion of data can be artificially removed, missing data can be artificially created, and the above artificially created missing data can be calculated through the trained two-layer LSTM model, and then the root mean square error can be calculated. The calculation formula of the root mean square error is:
[0122]
[0123] Among them, X pre (i) is the imputed value, X(i) is the actual value, and n is the total number of missing values.
[0124] The step S104: merging the repeated values in the corrected data that fills in all the missing data, includes:
[0125] If the values of the single attribute columns corresponding to different rows in the corrected data that fills in all the missing data are the same, first find the duplicate data according to the specified attribute column and return the location, then extract the duplicate data according to the returned value, and finally delete the duplicate data in the corrected data that fills in all the missing data;
[0126] If the values of multiple attribute columns in different rows of the corrected data that fill in all missing data are the same, first find the duplicate data according to the specified attribute column and return the location, then extract the duplicate data according to the returned value, and finally delete the duplicate data in the corrected data that fills in all missing data;
[0127] In the case where the same attribute columns exist in the revised data that fills in all the missing data, first check whether there are columns with the same name, and then determine whether each row of data in the column with the same name is the same. If each row of data is the same, delete the duplicate attribute columns; if they are different, retain the column data and modify the column name.
[0128] The step S105: detecting anomalies of the time series for the data after merging and processing duplicate values, wherein the anomalies of the time series include anomalies and pattern anomalies; detecting anomalies by using a density-based local anomaly detection algorithm (LOF), and detecting pattern anomalies based on a double-layer LSTM model, including:
[0129] According to the different manifestations of anomalies, time series anomalies can be divided into two types: outliers and outlier patterns. Point anomalies can also be regarded as pattern anomalies with a length of 1.
[0130] The abnormal points of industrial time series data are mainly additive outliers (AO), such as Figure 3 Additive outliers usually refer to isolated outliers that will not affect subsequent observations. The main reasons for additive outliers include: (1) abnormal equipment health. Such data has practical guiding significance for equipment maintenance; (2) large data measurement errors or link transmission abnormalities. It is necessary to detect whether the measuring instrument and transmission link are faulty.
[0131] Pattern anomalies refer to patterns that are significantly different from other patterns in a time series, including discretized symbols, Fourier coefficients, etc. There are three main forms of pattern anomalies in industrial time series data: height anomalies, length anomalies, and mean and standard deviation anomalies, such as Figure 4-Figure 6 The reason for the abnormal pattern is often the change in the working state of the industrial equipment. This part of the abnormal value can accurately reflect the special stage that the industrial equipment is currently in.
[0132] It can be seen that the anomalies of industrial machine equipment data include abnormal points and pattern anomalies, and both have their specific industrial significance, but conventional anomaly detection algorithms can only detect isolated abnormal points and cannot detect long-term pattern abnormalities.
[0133] The density-based local anomaly detection algorithm (LOF) can show the degree of outliers in the data, but the accuracy of the LOF algorithm in identifying outliers is too dependent on the choice of parameter k. For industrial data sets collected by industrial equipment with an unknown number of outliers, it is difficult to directly select a parameter k to ensure a reasonable number of outliers detected. A large amount of normal data may be treated as outliers, or a large number of outliers may be treated as normal points. In order to reduce the impact of the k value on the results and improve the accuracy of LOF in detecting outliers, in this embodiment, a range is set for the parameter k, and the final outlier factor result of each point is the average of all running results.
[0134] Specifically, in this embodiment, the density-based local anomaly detection algorithm (LOF) detects anomalies, including:
[0135] Step S401: The data after merging and processing duplicate values is used as the data to be detected, and the data corresponding to the data to be detected and other n attributes related to the attributes of the data to be detected are packaged into a tuple as the input of the LOF algorithm;
[0136] Step S402: Set the range of parameter k, k∈[min,max], k is an integer; for each k value, take each data to be detected as a point, execute the LOF algorithm once for each point to obtain an outlier factor value, and after running all values of k respectively, calculate the average of the outlier factor values of each point as the outlier factor mean of the point, and the calculation formula is:
[0137]
[0138] Among them, min and max are preset range values. In this embodiment, the min value is 4 and the max value is 10, which can be applied to the data collected by most industrial equipment sensors. k (p) is the outlier factor value corresponding to point p, k.
[0139] Step S403: output the points whose outlier factor mean is greater than the threshold as abnormal points.
[0140] In industrial data, because the abnormal state of the pattern will last for a period of time, the data characteristics during this period, such as the mean, standard deviation, etc., will change, and the trend will also be different from the previous data. In this embodiment, the previously trained two-layer LSTM model is used to compare the predicted value trained by the model with the true value, and the difference is used to determine whether the point is in an abnormal state, specifically, including:
[0141] Step S501: Call the trained LSTM model to perform time series prediction and obtain the prediction result y_predict;
[0142] In this embodiment, time_step data is input into the trained LSTM model, and the output of the LSTM model is used as the input of the trained LSTM model to obtain the prediction result y_predict.
[0143] Step S502: Calculate the difference e between the predicted result y_predict and the actual result y_test;
[0144] Step S503: Set the range interval error_buffer. If the difference value e is not within the range interval error_buffer, the point corresponding to the difference value e is regarded as an abnormal point.
[0145] For example, if the data follows a normal distribution, the data that is more than 3 times the standard deviation away from the mean value is taken as an outlier. That is, if the data is more than 3 times the standard deviation away from the mean value, it can be regarded as an outlier and the data is recorded as a pattern anomaly state. If the data does not follow a normal distribution, the Z-score is used to judge, and the data that exceeds the normal value range of the Z-score is recorded as a pattern anomaly state.
[0146] For example, if the data follows a normal distribution, you can use the Laida criterion exist In principle, an outlier can be considered an outlier if it is more than 3 standard deviations away from the mean. The probability between is 99.7%, so the data is The probability of occurrence outside the normal distribution is 0.003, which is a very rare low-probability event. If the data does not follow the normal distribution, the Z-score can also be used to judge, that is, the number of times the standard deviation away from the mean. The calculation formula of the Z-score is to subtract the sample mean from each data in the sample, and then divide it by the sample standard deviation. The normal range of the Z-score is [-3, +3]. Data outside this range may be an outlier. Therefore, our standard for outlier detection is the mean ± 3 times the standard deviation. Data whose difference between the predicted result and the actual result is outside the mean ± 3 times the standard deviation will be recorded as a pattern abnormality.
[0147] The embodiment of the present invention further provides a device for processing and detecting data collected by industrial equipment, such as Figure 7 As shown, the device comprises:
[0148] Acquisition module: receives data collected by sensors of industrial equipment;
[0149] Correction module: corrects the invalid value of the data. If the format of a certain data item in the collected data does not meet the requirements, or the data value of a certain data item exceeds the allowed threshold, the data item is deleted and marked as missing data.
[0150] Data filling module: for the corrected data, determine the missing data value, and divide the missing data into short-term missing and long-term missing according to the data missing situation and the data sampling comparison relationship with the sensor of the industrial equipment, and use a double-layer LSTM-based model to fill the missing data;
[0151] Duplicate processing module: merge the duplicate values in the corrected data that fills in all the missing data;
[0152] Anomaly detection module: detects anomalies in the time series for the data after merging and processing duplicate values. The anomalies in the time series include anomalies at points and pattern anomalies. The anomalies are detected by using a density-based local anomaly detection algorithm (LOF) and pattern anomalies are detected based on a double-layer LSTM model.
[0153] Report generation module: Generate reports based on abnormal point and pattern abnormal data.
[0154] The embodiment of the present invention further provides a system for processing and detecting data collected by industrial equipment, including:
[0155] A processor, which is used to execute multiple instructions;
[0156] A memory for storing a plurality of instructions;
[0157] The plurality of instructions are used to be stored by the memory, and loaded and executed by the processor to implement the aforementioned method for processing and detecting data collected by industrial equipment.
[0158] The embodiment of the present invention further provides a computer-readable storage medium, in which a plurality of instructions are stored; the plurality of instructions are used by a processor to load and execute the method for processing and detecting data collected by industrial equipment as described above.
[0159] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0160] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0161] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0162] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0163] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a physical server, or a network cloud server, etc., which needs to be installed with Windows or Windows Server operating system) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (RandomAccess Memory, RAM), disk or optical disk and other media that can store program codes.
[0164] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention still falls within the scope of the technical solution of the present invention.
Claims
1. A method for processing and detecting data collected by industrial equipment, characterized in that: The following steps are involved: Step S101: receiving data collected by sensors of industrial equipment; Step S102: correcting the invalid values of the data. If the format of a certain data item in the collected data does not meet the requirements, or the data value of a certain data item exceeds the allowed threshold, the data item is deleted and marked as missing data. Step S103: for the corrected data, determine the missing data value, and classify the missing data into two categories: short-term missing and long-term missing according to the data missing situation and the data sampling comparison relationship with the sensor of the industrial equipment, and use a double-layer LSTM-based model to complete the missing data; Step S104: merging the repeated values in the corrected data that fills in all the missing data; Step S105: Detecting anomalies of the time series for the data after merging and processing duplicate values, wherein the anomalies of the time series include anomalies of points and pattern anomalies; detecting anomalies of points by using a density-based local anomaly detection algorithm (LOF), and detecting pattern anomalies based on a double-layer LSTM model; Step S106: Generate a report based on the abnormal point and pattern abnormal data; Among them, in step 103, the method of completing long-term missing data based on a double-layer LSTM model includes: Step S201: determine the location of missing data; According to the sampling interval of the industrial equipment data collection, the position of the missing data value is determined from the corrected data; according to the data position where the invalid value is deleted, the position of the missing data value is determined; the positions of all the missing data values are recorded, and the positions of all the missing data values are sorted in chronological order; the current processing position is marked as the position of the first missing data value; Step S202: determine whether all missing data are filled, if so, output the corrected data that fills all missing data, and the method ends; if not, proceed to step S203; Step S203: Determine n other attributes related to the missing data by correlation calculation, where n≥1. The calculation formula is: The data collected by the sensors of industrial equipment has multiple attributes, X is the attribute set containing missing data collected by the industrial equipment, and Y is the attribute set without missing data collected by the industrial equipment at the same time; X i is any attribute in the attribute set X with missing data, Y j is any attribute of the attribute set Y without missing data; generate a replica data set without missing data, delete the missing data in the data collected by the industrial equipment, generate a replica data set, and calculate Cov(X i ,Y j )、D(X i )、D(Y j ), Cov(X i ,Y j ) is X i ,Y j The covariance of i )、D(Y j ) are X i , Y j The variance of When X i With Y j The correlation coefficient between The absolute value of When X i With Y j is the relevant attribute and will be i The related attributes are sorted by correlation value, and the top n attributes with the highest correlation are selected as other attributes related to the missing data; Step S204: taking the time_step data preceding the missing data as input, calling the trained LSTM model, calculating the missing data, and filling the missing data with the calculated data; time_step is a predetermined step length; Step S205: Move the current processing position backward by one position and go to step S202; Wherein, in step 105, the detecting pattern anomaly based on the double-layer LSTM model includes: Step S501: Call the trained LSTM model to perform time series prediction and obtain the prediction result y_predict; Step S502: Calculate the difference e between the predicted result y_predict and the actual result y_test; Step S503: Set the range interval error_buffer. If the difference value e is not within the range interval error_buffer, the point corresponding to the difference value e is regarded as an abnormal point.
2. The method for processing and detecting data collected by industrial equipment according to claim 1, characterized in that: The training process of the LSTM model is: Step S301: configure a two-layer LSTM model, the input layer input_size=n, the output layer output_size=1; determine the training parameters of the two-layer LSTM model, including the number of nodes in the hidden layer rnn_unit, the number of inputs for each training batch_size, and the size of each batch of data time_step; where n is the number of attributes with the highest correlation; Step S302: Determine the training set and the test set data, and determine the data ratio of the training set and the test set; Step S303: Selecting data collected by the multidimensional sensor with missing data deleted in proportion as training data in the training set, training the two-layer LSTM model, and obtaining various values of the training parameters; Step S304: Adjust the training parameters according to the test results of the test set.
3. The method for processing and detecting data collected by industrial equipment according to claim 2, characterized in that: Detect outliers through the density-based local outlier detection algorithm (LOF), including: The density-based local anomaly detection algorithm (LOF) detects anomalies, including: Step S401: The data after merging and processing duplicate values is used as the data to be detected, and the data corresponding to the data to be detected and other n attributes related to the attributes of the data to be detected are packaged into a tuple as the input of the LOF algorithm; Step S402: Set the range of parameter k, k∈[min,max], k is an integer; for each k value, take each data to be detected as a point, execute the LOF algorithm once for each point to obtain an outlier factor value, and after running all values of k respectively, calculate the average of the outlier factor values of each point as the outlier factor mean of the point, and the calculation formula is: Among them, min and max are preset range values, LOF k (p) is the outlier factor value corresponding to k, point p; Step S403: output the points whose outlier factor mean is greater than the threshold as abnormal points.
4. A device for processing and detecting data collected by industrial equipment, characterized in that: The device comprises: Acquisition module: receives data collected by sensors of industrial equipment; Correction module: corrects the invalid value of the data. If the format of a certain data item in the collected data does not meet the requirements, or the data value of a certain data item exceeds the allowed threshold, the data item is deleted and marked as missing data. Data filling module: for the corrected data, determine the missing data value, and divide the missing data into short-term missing and long-term missing according to the data missing situation and the data sampling comparison relationship with the sensor of the industrial equipment, and use a double-layer LSTM-based model to fill the missing data; Duplicate processing module: merge the duplicate values in the corrected data that fills in all the missing data; Anomaly detection module: detects anomalies in the time series for the data after merging and processing duplicate values. The anomalies in the time series include anomalies at points and pattern anomalies. The anomalies are detected by using a density-based local anomaly detection algorithm (LOF) and pattern anomalies are detected based on a double-layer LSTM model. Report generation module: Generate reports based on abnormal point and pattern abnormal data; The data filling module comprises: Determine location submodule: determine the location of missing data; According to the sampling interval of the industrial equipment data collection, the position of the missing data value is determined from the corrected data; according to the data position where the invalid value is deleted, the position of the missing data value is determined; the positions of all the missing data values are recorded, and the positions of all the missing data values are sorted in chronological order; the current processing position is marked as the position of the first missing data value; The first judgment submodule: judge whether all missing data are filled; Correlation calculation submodule: Determine n other attributes related to missing data through correlation calculation, n ≥ 1, The calculation formula is: The data collected by the sensors of industrial equipment has multiple attributes, X is the attribute set containing missing data collected by the industrial equipment, and Y is the attribute set without missing data collected by the industrial equipment at the same time; X i is any attribute in the attribute set X with missing data, Y j is any attribute of the attribute set Y without missing data; generate a replica data set without missing data, delete the missing data in the data collected by the industrial equipment, generate a replica data set, and calculate Cov(X i ,Y j )、D(X i )、D(Y j ), Cov(X i ,Y j ) is X i ,Y j The covariance of i )、D(Y j ) are X i , Y j The variance of When X i With Y j The correlation coefficient between The absolute value of When X i With Y j is the relevant attribute and will be i The related attributes are sorted by correlation value, and the top n attributes with the highest correlation are selected as other attributes related to the missing data; Filling submodule: takes the time_step data preceding the missing data as input, calls the trained LSTM model, calculates the missing data, and fills the missing data with the calculated data; time_step is the predetermined step length; Shift submodule: moves the current processing position backward by one position; The anomaly detection module includes a pattern anomaly detection submodule, and the pattern anomaly detection submodule includes: Call submodule: call the trained LSTM model to perform time series prediction and obtain the prediction result y_predict; The third calculation submodule: calculates the difference e between the predicted result y_predict and the actual result y_test; The second output submodule: sets the range interval error_buffer. If the difference value e is not within the range interval error_buffer, the point corresponding to the difference value e is taken as an abnormal point.
5. The device for processing and detecting data collected by industrial equipment according to claim 4, characterized in that: The training of the LSTM model includes: Determine the parameter submodule: configure a two-layer LSTM model, with the model's input layer input_size = n, and the output layer output_size = 1; determine the training parameters of the two-layer LSTM model, including the number of nodes in the hidden layer rnn_unit, the number of inputs for each training batch_size, and the size of each batch of data time_step; where n is the number of attributes with the highest correlation; The second determination submodule: determining the training set and test set data, and determining the data ratio of the training set and the test set; Training value determination submodule: selects data collected by multidimensional sensors with missing data deleted in proportion as training data in the training set, trains the two-layer LSTM model, and obtains the values of various training parameters; Adjustment submodule: adjust the training parameters according to the test results of the test set.
6. The device for processing and detecting data collected by industrial equipment according to claim 5, characterized in that: The anomaly detection module also includes an anomaly point detection submodule, and the anomaly point detection submodule includes: Packing submodule: The data after merging and processing duplicate values is used as the data to be detected, and the data corresponding to the data to be detected and other n attributes related to the attributes of the data to be detected are packaged into a tuple as the input of the LOF algorithm; Setting range submodule: Set the range of parameter k, k∈[min,max], k is an integer; for each k value, take each data to be detected as a point, and execute the LOF algorithm once for each point to obtain an outlier factor value. After running all values of k separately, calculate the average of the outlier factor values of each point as the outlier factor mean of the point. The calculation formula is: Among them, min and max are preset range values, LOF k (p) is the outlier factor value corresponding to k, point p; The first output submodule: outputs points whose outlier factor mean is greater than the threshold as abnormal points.
7. A system for processing and detecting data collected by industrial equipment, characterized in that: include: A processor, which is used to execute multiple instructions; A memory for storing a plurality of instructions; The plurality of instructions are used to be stored by the memory, and loaded and executed by the processor to implement the method for processing and detecting data collected by industrial equipment as described in any one of claims 1 to 3.
8. A computer-readable storage medium, characterized in that: The storage medium stores a plurality of instructions; the plurality of instructions are used by the processor to load and execute the method for processing and detecting data collected by industrial equipment as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Distribution transformer data acquisition anomaly discrimination method based on multi-criterion fusion
CN110458230A
