A sensor gradual change abnormality interpretation method based on sequence time series correlation modeling
Patent Information
- Application Number
- CN202311509411.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-13
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2043-11-13
AI Technical Summary
[0013]本发明提出了一种基于序列时序关联建模的传感器缓变异常判读方法,解决了现有异常检测方法所存在的缓变异常特征难提取、缓变异常判读能力较弱的问题
[0064] 1. The present invention discloses a sensor gradual anomaly identification method based on sequence time-series correlation modeling. It uses the sudden anomaly detection threshold and the time series segment prediction model of the sensed data to obtain the identification residual and sequence, and uses the comparison result of the identification residual and the gradual anomaly detection threshold to identify the gradual anomaly. It can extract the features of the gradual anomaly on a longer time scale, overcome the problems of difficult extraction of gradual anomaly features and weak identification ability of gradual anomaly in traditional anomaly detection methods, and improve the accuracy of gradual anomaly detection.
Smart Images

Figure CN117591976B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sensor data gradual change anomaly detection technology, and in particular to the use of sequence-to-sequence models to interpret sensor gradual change anomalies. Background Technology
[0002] Sensors are the only means by which complex systems perceive their own state and the external environment. Therefore, obtaining accurate and reliable sensor data is crucial to ensuring the successful execution of complex system tasks. However, with increasing usage time, sensors may experience degradation, drift, and other problems, leading to anomalies in their sensing parameters (sensor data, perceived data, and perceived data). If these anomalies cannot be identified and detected in real time, the availability and reliability of the sensor's sensing parameters cannot be guaranteed.
[0003] Based on the speed of abnormal evolution, anomalies in perceived parameters can be divided into two categories: slow-evolution anomalies and abrupt anomalies. Among them, abrupt anomalies are relatively obvious, with short evolution times and obvious abnormal characteristics, making them easy to detect by traditional anomaly detection methods. Conversely, slow-evolution anomalies refer to those that evolve slowly over a longer time scale, characterized by long-term slow changes and fragmentation, with less obvious abnormal characteristics, making them difficult to detect by existing anomaly detection methods.
[0004] Traditional anomaly detection methods typically employ the following approaches:
[0005] First, a prediction model is built based on neural networks (such as Long Short Term Memory (LSTM) networks).
[0006] Secondly, the prediction model is used to predict the perceived data to obtain the predicted value of the perceived data; wherein, when using the prediction model to predict the perceived data, a single-step prediction strategy or a multi-step prediction strategy can be adopted; when a single-step prediction strategy is adopted, the value of the current perceived data at the next time point is predicted;
[0007] Next, calculate the difference between the actual value of the perceived data and the predicted value of the perceived data;
[0008] Finally, by comparing the difference with a threshold, abnormal data can be identified or detected.
[0009] Traditional anomaly detection methods are effective at detecting general mutational anomalies; however, they are less effective at interpreting or detecting slowly evolving anomalies. The specific problems they face are as follows:
[0010] (1) Slowly changing anomalies often evolve over a longer timescale and are characterized by long-term slow change and fragmentation. Traditional anomaly detection methods based on single-step prediction are difficult to discover the anomaly representation (anomaly features) of slowly changing anomalies, and thus it is difficult to effectively interpret such anomalies.
[0011] (2) For traditional anomaly detection methods that employ multi-step prediction strategies, the data input into the model may have (mutation) abnormal features. They cannot process the abnormal features in the model input data, which in turn affects the stability of the model prediction results and reduces the accuracy of anomaly identification.
[0012] (3) The perceptual data prediction models used in traditional anomaly detection methods, such as those based on long short-term memory networks, are too complex and too large, making training and porting of the models difficult and even affecting the accuracy of the model's judgment. Summary of the Invention
[0013] This invention proposes a sensor slowly changing anomaly interpretation method based on sequence temporal correlation modeling, which solves the problems of difficulty in extracting slowly changing anomaly features and weak slowly changing anomaly interpretation ability in existing anomaly detection methods.
[0014] The present invention discloses a sensor slowly varying anomaly identification method based on sequence temporal correlation modeling, the technical solution of which is as follows:
[0015] The method includes the following steps:
[0016] Step 1: Obtain the test sample set of the sensing data of the complex system to be tested. The test sample set contains several test samples.
[0017] Step 2: Process the sample set to be tested to obtain the input set; the input set includes several time series segments to be tested arranged in order; the lengths of the several time series segments to be tested are equal and all are set lengths;
[0018] Step 3: Based on the input set, mutation anomaly detection threshold, and the time series segment prediction model of the perceived data, obtain the interpretation residuals and sequences; the interpretation residuals and sequences are composed of several interpretation residuals arranged in chronological order;
[0019] The sum of the ith residuals in the sequence is the sum of the residuals between the ith time series segment to be tested and the predicted value of the ith time series segment to be tested after removing mutations;
[0020] Step 4: Compare the sum of the i-th interpretation residuals with the slowly varying anomaly detection threshold to obtain the slowly varying anomaly interpretation result:
[0021] If the sum of the i-th read residuals is not greater than the slowly changing anomaly detection threshold, then the i-th time series segment to be tested does not contain a slowly changing anomaly.
[0022] If the sum of the i-th read residuals is greater than the slowly varying anomaly detection threshold, then the i-th time series segment to be tested contains a slowly varying anomaly.
[0023] Furthermore, in a preferred embodiment, the time series segment prediction model for the sensed data in step 3 is obtained using the following construction method:
[0024] S1. Obtain a sample set of sensing data of the complex system to be detected under an abnormal state, wherein the sample set contains several samples.
[0025] S2. Process the sample set to obtain a training set; the training set includes several time series segments arranged in order; the several time series segments have equal lengths and are all of a set length;
[0026] S3. Establish a sequence-to-sequence model; the sequence-to-sequence model is used to obtain the predicted value of the next time sequence segment of any time sequence segment in the training set.
[0027] S4. The sequence-to-sequence model is trained using the training set to obtain a perceptual data time series segment prediction model, thus completing the construction method.
[0028] Furthermore, a preferred embodiment is provided, wherein the sample set of sensing data of the complex system to be detected under anomaly-free conditions is obtained using the following method:
[0029] STEP 1: Obtain raw sensing data from the sensors of the complex system to be tested under normal conditions; the raw sensing data contains several samples.
[0030] STEP 2: Using linear interpolation, new samples are inserted into the original sensing data to obtain linearly interpolated sensing data; the sampling time interval of the linearly interpolated sensing data is the greatest common divisor of the actual sampling time interval of the original sensing data and the standard sampling time interval of the sensor of the complex system to be detected.
[0031] STEP 3: Sample the linearly interpolated sensing data according to the standard sampling time interval of the sensor of the complex system to be tested, and obtain a sample set of sensing data of the complex system to be tested under the condition of no abnormality.
[0032] Furthermore, in a preferred embodiment, step S2 includes:
[0033] S2.1 Represent the sample set as a time series;
[0034] S2.2 Divide the time series into time series segments at intervals of a set length, starting from the first sample, to obtain several time series segments; use the set of the several time series segments as the training set.
[0035] Furthermore, in a preferred embodiment, the mutation anomaly detection threshold in step 3 is obtained using the following method:
[0036] ST1. Based on the training set and the time series segment prediction model of the perceived data, obtain the mutation anomaly residual and sequence; the mutation anomaly residual and sequence is composed of several mutation anomaly residuals arranged in chronological order;
[0037] The sum of the residuals of the i-th mutation anomaly in the sequence is the sum of the residuals between the i-th time series segment and the predicted value of the i-th time series segment, where i is a positive integer;
[0038] The predicted value of the i-th time series segment is obtained using the following method:
[0039] The (i-1)th time series segment in the training set is used as the input to the perceptual data time series segment prediction model, and the output of the perceptual data time series segment prediction model is used as the predicted value of the ith time series segment.
[0040] ST2. Obtain the mean and confidence interval of the sum of the residuals of the several mutation anomalies, and use the supremum of the sum of the mean of the residuals of the several mutation anomalies and the radius of their confidence intervals as the mutation anomaly detection threshold.
[0041] Furthermore, in a preferred embodiment, the slowly varying anomaly detection threshold in step 4 is obtained using the following method:
[0042] STE1. Based on the training set, the mutation anomaly detection threshold, and the time series segment prediction model of the perceived data, obtain the slow-change anomaly residual and sequence; the slow-change anomaly residual and sequence is composed of several slow-change anomaly residuals arranged in chronological order;
[0043] The residual sum of the i-th slowly changing anomaly in the sequence is the sum of the residuals between the i-th time series segment and the predicted value of the i-th time series segment after removing the mutation anomaly;
[0044] STE2: Obtain the mean and confidence interval of the sum of the residuals of the several slowly changing anomalies, and use the supremum of the sum of the mean of the residuals of the several slowly changing anomalies and the radius of their confidence intervals as the slowly changing anomaly detection threshold.
[0045] Furthermore, in a preferred embodiment, the predicted value of the i-th time series segment after removing mutational anomalies in step STE1 is obtained using the following method:
[0046] When i equals 1:
[0047] The first time series segment is used as the predicted value after removing mutation anomalies from the first time series segment;
[0048] When i equals 2:
[0049] The first time series segment is used as the input to the perception data time series segment prediction model, and the output of the perception data time series segment prediction model is used as the predicted value of the second time series segment after removing mutation anomalies.
[0050] When i is greater than 2:
[0051] The residuals between the (i-1)th time series segment and the predicted value of the (i-1)th time series segment after removing mutation anomalies are compared with the mutation anomaly detection threshold:
[0052] If the sum of the residuals between the (i-1)th time series segment and the predicted value of the (i-1)th time series segment after removing mutation anomalies is not greater than the mutation anomaly detection threshold, then the (i-1)th time series segment is used as the input of the perception data time series segment prediction model, and the output of the perception data time series segment prediction model is used as the predicted value of the i-th time series segment after removing mutation anomalies.
[0053] If the sum of the residuals between the (i-1)th time series segment and the predicted value of the (i-1)th time series segment after removing mutation anomalies is greater than the mutation anomaly detection threshold, then the predicted value of the (i-1)th time series segment after removing mutation anomalies is used as the input of the perceived data time series segment prediction model, and the output of the perceived data time series segment prediction model is used as the predicted value of the i-th time series segment after removing mutation anomalies.
[0054] Furthermore, in a preferred embodiment, the predicted value of the i-th time series segment to be tested after removing anomalous mutations in step Step 3 is obtained using the following method:
[0055] When i equals 1:
[0056] The first time series segment to be tested is used as the predicted value of the first time series segment after removing mutation anomalies;
[0057] When i equals 2:
[0058] The first time series segment to be tested is used as the input of the perceived data time series segment prediction model, and the output of the perceived data time series segment prediction model is used as the predicted value of the second time series segment to be tested after removing mutation anomalies.
[0059] When i is greater than 2:
[0060] The residuals between the (i-1)th test time series segment and the predicted values of the (i-1)th test time series segment after removing mutation anomalies are compared with the mutation anomaly detection threshold:
[0061] If the sum of the residuals between the (i-1)th test time series segment and the predicted value of the (i-1)th test time series segment after removing mutation anomalies is not greater than the mutation anomaly detection threshold, then the (i-1)th test time series segment is used as the input of the perception data time series segment prediction model, and the output of the perception data time series segment prediction model is used as the predicted value of the i-th test time series segment after removing mutation anomalies.
[0062] If the sum of the residuals between the (i-1)th test time series segment and the predicted value of the (i-1)th test time series segment after removing mutation anomalies is greater than the mutation anomaly detection threshold, then the predicted value of the (i-1)th test time series segment after removing mutation anomalies is used as the input of the perceived data time series segment prediction model, and the output of the perceived data time series segment prediction model is used as the predicted value of the i-th test time series segment after removing mutation anomalies.
[0063] The present invention has the following beneficial effects:
[0064] 1. The present invention discloses a sensor gradual anomaly identification method based on sequence time-series correlation modeling. It uses the sudden anomaly detection threshold and the time series segment prediction model of the sensed data to obtain the identification residual and sequence, and uses the comparison result of the identification residual and the gradual anomaly detection threshold to identify the gradual anomaly. It can extract the features of the gradual anomaly on a longer time scale, overcome the problems of difficult extraction of gradual anomaly features and weak identification ability of gradual anomaly in traditional anomaly detection methods, and improve the accuracy of gradual anomaly detection.
[0065] 2. The sensor gradual anomaly identification method based on sequence time-series correlation modeling described in this invention selects the previous time series segment to be tested or the predicted value of the previous time series segment after removing abrupt anomalies as the input of the sensor data time series segment prediction model by comparing the identification residual with the abrupt anomaly detection threshold, thereby obtaining the predicted value of the current time series segment after removing abrupt anomalies. This method eliminates the time series segments with abrupt anomalies in the input set, overcomes the model mismatch problem caused by directly inputting the time series segment to be tested into the prediction model in traditional anomaly identification methods, and thus improves the stability and accuracy of gradual anomaly identification.
[0066] 3. The sensor slow-change anomaly judgment method based on sequence time-series correlation modeling described in this invention uses a gated cyclic unit as the encoder and encoder of the time series segment prediction model of the sensing data, which can improve the modeling capability of the prediction model and simplify the model structure of the prediction model, making the prediction model less complex, smaller in size, and easier to port and train.
[0067] The present invention provides a sensor slow-change anomaly identification method based on sequence temporal correlation modeling, which is applicable to the slow-change anomaly identification of sensors in complex systems. Attached Figure Description
[0068] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0069] Figure 1 A flowchart of a sensor slowly changing anomaly identification method based on sequence temporal correlation modeling is provided in one embodiment of the present invention.
[0070] Figure 2 In one embodiment of the present invention, a comparison diagram of the sample set of the sensing data of the complex system to be detected under the condition of no abnormality and the sample set under the condition of abnormality.
[0071] Figure 3 This is a schematic diagram of the slowly varying anomaly detection result of a sensor slowly varying anomaly detection method based on sequence temporal correlation modeling, as one embodiment of the present invention. Detailed Implementation
[0072] To make the technical solutions and advantages of the present invention clearer, the specific embodiments of the present invention will be described in further detail and completely below with reference to the accompanying drawings. The various embodiments described below are only some preferred embodiments of the present invention, and not all of them; the various embodiments described below are intended to explain the present invention and should not be construed as limiting the present invention; reasonable combinations of the technical features defined in the various embodiments of the present invention, as well as all other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort, are all within the scope of protection of the present invention.
[0073] Implementation Method 1: Combination Figure 1 -3 This embodiment describes a method for constructing a prediction model for time series segments of sensed data. The specific implementation details are as follows:
[0074] The method includes:
[0075] S1. Obtain a sample set of sensing data of the complex system to be detected under an abnormal state, wherein the sample set contains several samples.
[0076] S2. Process the sample set to obtain a training set; the training set includes several time series segments arranged in order; the several time series segments have equal lengths and are all of a set length;
[0077] S3. Establish a sequence-to-sequence model; the sequence-to-sequence model is used to obtain the predicted value of the next time sequence segment of any time sequence segment in the training set.
[0078] S4. The sequence-to-sequence model is trained using the training set to obtain a perceptual data time series segment prediction model, thus completing the construction method.
[0079] In this embodiment, the perceived data time series segment prediction model is used to obtain the predicted value of the next time series segment of any time series segment in a set of time series segments composed of samples arranged in chronological order of sampling time.
[0080] For example, if the time series collected by the sensor is divided into several time series segments, then any one time series segment can be taken as the input of the perception data time series segment prediction model, and the output obtained by the perception data time series segment prediction model is the predicted value of the next time series segment of the arbitrary time series segment.
[0081] In this embodiment, the sensing data, also called sensing parameters, refers to the data measured by the sensors of a complex system, and can also be called sensing data or sensor data.
[0082] In this embodiment, the time series segment refers to a segment extracted from a time series. The time series, or simply time sequence, refers to a sequence formed by arranging data (i.e., samples) collected by the sensor in chronological order of sampling time.
[0083] The length of a time series is the number of samples contained in the time series.
[0084] Furthermore, a preferred embodiment is provided, wherein the sample set of sensing data of the complex system to be detected under anomaly-free conditions is obtained using the following method:
[0085] STEP 1: Obtain raw sensing data from the sensors of the complex system to be tested under normal conditions; the raw sensing data contains several samples.
[0086] The actual sampling time interval of the raw sensing data is different from the standard sampling time interval of the sensor of the complex system to be detected.
[0087] STEP 2: Using linear interpolation, new samples are inserted into the original sensing data to obtain linearly interpolated sensing data; the sampling time interval of the linearly interpolated sensing data is the greatest common divisor of the actual sampling time interval of the original sensing data and the standard sampling time interval of the sensor of the complex system to be detected.
[0088] STEP 3: Sample the linearly interpolated sensing data according to the standard sampling time interval of the sensor of the complex system to be tested, and obtain a sample set of the sensing data of the complex system to be tested under the condition of no abnormality.
[0089] The actual sampling time interval of the sample set of the perceived data of the complex system under test in an abnormal state is the same as the standard sampling time interval of the sensor of the complex system under test.
[0090] More specifically, the raw sensing data collected by the sensors of the complex system under the condition of no abnormality is P′:
[0091] P′={P1′,P2′,…,P n ′ ′};
[0092] Among them, P i ′ represents the i-th sample in P′, and n′ represents the number of samples in P′;
[0093] set up:
[0094] The actual sampling time interval of P′ is S. b The standard sampling time interval of the sensor in the complex system to be tested is S. a And S b ≠S a ;
[0095] Then, using linear interpolation, new samples are inserted into P′ to obtain the linearly interpolated P′; the actual sampling time interval of the linearly interpolated P′ is S. b With S a The greatest common divisor;
[0096] Finally, according to the standard sampling time interval S a The linearly interpolated P′ is sampled to obtain a sample set of the sensing data of the complex system to be detected under anomaly-free conditions.
[0097] The actual sampling time interval of the sample set of the sensing data of the complex system under test in an anomaly-free state is S. a .
[0098] In this embodiment, the sensor of the complex system to be detected may suffer from data loss or data duplication when collecting sensing parameters due to interference from its own performance and operating environment. This results in the actual sampling time interval of the collected data being different from the standard sampling time interval of the sensor.
[0099] Inconsistent sampling time intervals may affect the accuracy of subsequent anomaly detection. To ensure accurate anomaly detection, the raw sensor data collected by the sensor needs to be processed using linear interpolation combined with sampling methods, so that the actual sampling time interval of the processed sample set is the same as the standard sampling time interval of the sensor.
[0100] Furthermore, in a preferred embodiment, step S2 includes:
[0101] S2.1 Represent the sample set as a time series;
[0102] Specifically, if a number of samples in the sample set are arranged into a sequence according to the order of their sampling time, then the sample set is represented as a time series.
[0103] S2.2 Divide the time series into time series segments at intervals of a set length, starting from the first sample, to obtain several time series segments; use the set of the several time series segments as the training set.
[0104] It should be noted that the training set includes several time series segments; each time series segment includes several samples; and the several time series segments have the same length (i.e., a set length);
[0105] In the training set, the samples are still arranged in the order of sampling time; in each time series segment, the samples are also arranged in the order of sampling time;
[0106] In the training set, the sample at the next sampling time after the last sample in the previously ordered time series segment is the first sample in the subsequently ordered time series segment.
[0107] More specifically, assuming that the sample set of the complex system to be detected in the anomaly-free state is represented as a time series P:
[0108] P = {P1,P2,…,P N};
[0109] wherein, P i is the i-th sample in P, and N is the number of samples in P;
[0110] the actual sampling time interval of P is S a ;
[0111] Then, starting from the first sample, the time series P is divided into one time series segment every set length n, so as to obtain time series segments;
[0112] the time series segments are used as the training set P train ;
[0113]
[0114] wherein, Part i is the i-th time series segment:
[0115] Part i = [P (i-1)×n+1 P (i-1)×n+2 … P i×n ;
[0116] wherein, n is a set length, that is, the number of samples included in the time series segment; 0 < n << N, that is, N is much larger than n, and N is a multiple of n;
[0117] wherein, i is a positive integer.
[0118] Furthermore, a preferred embodiment is provided in which, in step S2.2, the time series is divided starting from the first sample to obtain a training set; in fact, it is also possible not to start from the first sample, but to start from the second or third sample to divide the time series multiple times, that is, to use samples at different sampling times as the starting point for division, so as to expand more training sets.
[0119] The i-th partitioning process is as follows:
[0120] The time series is divided into several time series segments, starting from the i-th sample (i.e., the sample at the i-th sampling time) at intervals of a set length. The set of the several time series segments is used as the i-th training set.
[0121] More specifically, let the i-th training set be P. train,i ;
[0122] When i = 1:
[0123]
[0124] When i > 1:
[0125]
[0126] in, For the i-th training set P train,i The j-th time series segment in the data:
[0127]
[0128] Using the above method, n training sets can be obtained; these n training sets are then combined to form an extended training set P. 训 ;
[0129] P 训 ={P train,1 ,P train,2 ,…,P train,n};
[0130] Where j is a positive integer.
[0131] It should be noted that when dividing the time series P, the first training set P obtained from the first division... train,1 From which can be obtained There are 1 time series segments, but the i-th training set P is obtained from each subsequent partition. train,i (where i is greater than 1) can be obtained from A time series segment.
[0132] Furthermore, a preferred embodiment is provided, wherein in step S3:
[0133] The sequence-to-sequence model uses a gated loop unit as both the encoder and decoder; the data output of the encoder is connected to the data input of the decoder.
[0134] The data input terminal of the encoder is used to input any time sequence segment in the training set;
[0135] The data output terminal of the decoder is used to obtain the predicted value of the next time series segment of any given time series segment.
[0136] In this embodiment, the sequence-to-sequence model is abbreviated as Seq2Seq.
[0137] In this embodiment, the gated recurrent unit is abbreviated as GRU.
[0138] In this embodiment, a gated loop unit is used as the encoder and encoder of the sequence-to-sequence model, which can improve the modeling capability of the sequence-to-sequence model and simplify the model structure of the sequence-to-sequence model.
[0139] More specifically, the sequence-to-sequence model further includes a fully connected layer;
[0140] The fully connected layer is used to receive the predicted value of the next time series segment of any time series segment output by the decoder, and expand the predicted value into the format of a time series segment;
[0141] The data output terminal of the fully connected layer is used to output the predicted value of the next time series segment of any given time series segment in the format of time series segments.
[0142] More specifically, the encoder's data input terminal receives a time sequence segment each time; similarly, the fully connected layer's data output terminal outputs a time sequence segment each time.
[0143] More specifically, the number of samples that can be input simultaneously in each sequence-to-sequence model is called the input dimension; similarly, the number of samples that can be output simultaneously in each sequence-to-sequence model is called the output dimension.
[0144] The input dimension of the sequence-to-sequence model is the same as the length of the input time series segment;
[0145] The output dimension of the sequence-to-sequence model is the same as the length of the output time series segment.
[0146] More specifically, the input dimension of the sequence-to-sequence model is n; the output dimension of the sequence-to-sequence model is n.
[0147] Furthermore, a preferred embodiment is provided, in which step S4 generally proceeds as follows:
[0148] According to the sequential arrangement of the time series segments in the training set, each time series segment is sequentially input into the sequence model.
[0149] The sequence-to-sequence model obtains the predicted value of the next time sequence segment based on each input time sequence segment.
[0150] The difference between the actual value and the predicted value of the next time sequence segment of each time sequence segment is obtained by comparing the two.
[0151] Based on the difference between the two, the weight parameters of the sequence-to-sequence model are adjusted, and then the above process is repeated until the difference between the predicted value and the true value is within a predetermined range. Then the training of the sequence-to-sequence model is completed, and the trained sequence-to-sequence model is the perceptual data time series segment prediction model.
[0152] Training neural network models using training sets is a common technique and will not be elaborated upon here.
[0153] Implementation Method Two: Combination Figure 1 -3 This embodiment describes a method for obtaining a mutation anomaly detection threshold. The specific implementation details are as follows:
[0154] The method is implemented using the construction method of the time series segment prediction model for sensed data described in the above embodiments; the method includes the following steps:
[0155] ST1. Based on the training set and the time series segment prediction model of the perceived data, obtain the mutation anomaly residual and sequence; the mutation anomaly residual and sequence is composed of several mutation anomaly residuals arranged in chronological order;
[0156] The sum of the residuals of the i-th mutation anomaly in the sequence is the sum of the residuals between the i-th time series segment and the predicted value of the i-th time series segment, where i is a positive integer;
[0157] The predicted value of the i-th time series segment is obtained using the following method:
[0158] The (i-1)th time series segment in the training set is used as the input to the perceptual data time series segment prediction model, and the output of the perceptual data time series segment prediction model is used as the predicted value of the ith time series segment.
[0159] ST2. Obtain the mean and confidence interval of the sum of the residuals of the several mutation anomalies, and use the supremum of the sum of the mean of the residuals of the several mutation anomalies and the radius of their confidence intervals as the mutation anomaly detection threshold.
[0160] More specifically, the mutational anomalous residuals and sequences are represented as res one ;
[0161]
[0162] in, Let i be the sum of the residuals of the i-th mutation.
[0163]
[0164] in:
[0165] To divide the i-th time series segment Part i When used as input to the time series segment prediction model for the perceived data, the output of the time series segment prediction model for the perceived data is: For the i-th sample P i The predicted value;
[0166]
[0167] More specifically, the mean of the sum of the several mutational abnormal residuals is
[0168]
[0169] The standard deviation of the sum of the residuals of the several mutations is σ. one ;
[0170]
[0171] Based on this, the confidence intervals for the sum of the aforementioned mutational abnormal residuals can be obtained:
[0172]
[0173] The mutation anomaly detection threshold TH is obtained based on the mean and confidence interval of the sum of the aforementioned mutation anomaly residuals. sw :
[0174]
[0175] Where α is 1 - confidence level, It is a constant (which can be obtained by looking up a table).
[0176] Implementation Method 3: Combination Figure 1 -3 This embodiment describes a method for obtaining the detection threshold for slowly changing anomalies. The specific implementation details are as follows:
[0177] The method is implemented using the construction method of the time series segment prediction model of the perceived data described in the above embodiments and the method of obtaining the mutation anomaly detection threshold described in the above embodiments; the method includes the following steps:
[0178] STE1. Based on the training set, the mutation anomaly detection threshold, and the time series segment prediction model of the perceived data, obtain the slow-change anomaly residual and sequence; the slow-change anomaly residual and sequence is composed of several slow-change anomaly residuals arranged in chronological order;
[0179] The residual sum of the i-th slowly changing anomaly in the sequence is the sum of the residuals between the i-th time series segment and the predicted value of the i-th time series segment after removing the mutation anomaly;
[0180] STE2: Obtain the mean and confidence interval of the sum of the residuals of the several slowly changing anomalies, and use the supremum of the sum of the mean of the residuals of the several slowly changing anomalies and the radius of their confidence intervals as the slowly changing anomaly detection threshold.
[0181] Furthermore, in a preferred embodiment, the predicted value of the i-th time series segment after removing mutational anomalies is obtained using the following method:
[0182] When i equals 1:
[0183] The first time series segment is used as the predicted value after removing mutation anomalies from the first time series segment;
[0184] When i equals 2:
[0185] The first time series segment is used as the input to the perception data time series segment prediction model, and the output of the perception data time series segment prediction model is used as the predicted value of the second time series segment after removing mutation anomalies.
[0186] When i is greater than 2:
[0187] The residuals between the (i-1)th time series segment and the predicted value of the (i-1)th time series segment after removing mutation anomalies are compared with the mutation anomaly detection threshold:
[0188] If the sum of the residuals between the (i-1)th time series segment and the predicted value of the (i-1)th time series segment after removing mutation anomalies is not greater than the mutation anomaly detection threshold, then the (i-1)th time series segment is used as the input of the perception data time series segment prediction model, and the output of the perception data time series segment prediction model is used as the predicted value of the i-th time series segment after removing mutation anomalies.
[0189] If the sum of the residuals between the (i-1)th time series segment and the predicted value of the (i-1)th time series segment after removing mutation anomalies is greater than the mutation anomaly detection threshold, then the predicted value of the (i-1)th time series segment after removing mutation anomalies is used as the input of the perceived data time series segment prediction model, and the output of the perceived data time series segment prediction model is used as the predicted value of the i-th time series segment after removing mutation anomalies.
[0190] More specifically, the slowly varying anomaly residuals and sequences are represented as res mult ;
[0191]
[0192] in, Let i be the sum of the residuals of the i-th slowly varying anomaly;
[0193]
[0194] in:
[0195] For the i-th time series segment Part i Predicted values after removing mutational anomalies; For the i-th sample P i Predicted values after removing mutational anomalies;
[0196]
[0197] More specifically, the predicted value of the i-th time series segment after removing anomalous mutations. The process of obtaining it is as follows:
[0198] (1) For The process of obtaining it is as follows:
[0199] The first time series segment, Part1, is used as the predicted value after removing mutation anomalies from the first time series segment.
[0200] (2) For The process of obtaining it is as follows:
[0201] Assume that the first time series segment Part1 does not contain any mutational anomalous elements (i.e. Using Part 1 as input to the time series segment prediction model for the perceived data, the output of the time series segment prediction model is the predicted value of the second time series segment after removing mutation anomalies.
[0202] (3) For The process of obtaining it is as follows:
[0203] We need to determine whether the second time series segment, Part 2, contains any mutational anomalous events.
[0204] Get Part 2 and The sum of residuals between, i.e. the sum of residuals of the second slowly varying anomaly
[0205] The second slowly varying anomaly residual and With mutation anomaly detection threshold TH sw Comparison:
[0206] if This indicates that the second time series segment, Part 2, does not contain any mutation anomalies. In this case, Part 2 is used as the input to the perceived data time series segment prediction model, and the output of the perceived data time series segment prediction model is the predicted value of the third time series segment after removing mutation anomalies.
[0207] if This indicates that the second time series segment, Part 2, contains a mutation anomaly. At this point, [the following will be implemented]. As input to the time series segment prediction model for the sensed data, the output obtained by the time series segment prediction model is the predicted value of the third time series segment after removing mutation anomalies.
[0208] For the case i>3 (i.e.) …etc.), the predicted value of the i-th time series segment after removing mutational anomalies. The process of obtaining and The same applies, so I will not repeat it here.
[0209] More specifically, the mean of the sum of the several slowly varying anomaly residuals is
[0210]
[0211] The standard deviation of the sum of the several slowly varying anomaly residuals is σ. mult ;
[0212]
[0213] Based on this, the confidence intervals for the sum of the several slowly varying anomaly residuals can be obtained:
[0214]
[0215] The slowly varying anomaly detection threshold TH is obtained based on the mean and confidence interval of the sum of the residuals of the aforementioned slowly varying anomalies. det :
[0216]
[0217] Where α is 1 - confidence level, It is a constant (which can be obtained by looking up a table).
[0218] Implementation Method 4: Combination Figure 1 -3 Description of this embodiment: This embodiment provides a sensor slowly varying anomaly identification method based on sequence temporal correlation modeling. The specific implementation details are as follows:
[0219] The method is implemented using the method for constructing a time series segment prediction model for perceived data, the method for obtaining the threshold for detecting sudden anomalies, and the method for obtaining the threshold for detecting slowly changing anomalies described in the above embodiments; the method includes the following steps:
[0220] Step 1: Obtain the test sample set of the sensing data of the complex system to be tested. The test sample set contains several test samples.
[0221] Step 2: Process the sample set to be tested to obtain the input set; the input set includes several time series segments to be tested arranged in order; the lengths of the several time series segments to be tested are equal and all are set lengths;
[0222] Step 3: Based on the input set, the mutation anomaly detection threshold, and the perception data time series segment prediction model, obtain the interpretation residuals and sequences; the interpretation residuals and sequences are composed of several interpretation residuals arranged in chronological order.
[0223] The sum of the ith residuals in the sequence is the sum of the residuals between the ith time series segment to be tested and the predicted value of the ith time series segment to be tested after removing mutations;
[0224] Step 4: Compare the sum of the i-th interpretation residuals with the slowly varying anomaly detection threshold to obtain the slowly varying anomaly interpretation result:
[0225] If the sum of the i-th interpretation residuals is not greater than the slowly varying anomaly detection threshold, the i-th time series segment to be tested does not contain a slowly varying anomaly;
[0226] If the sum of the i-th interpretation residuals is greater than the slowly varying anomaly detection threshold, the i-th time series segment to be tested contains a slowly varying anomaly.
[0227] Further, a preferred implementation is provided: the sample set to be tested of the perceived data of the complex system to be detected is obtained by processing the original perceived data to be tested of the complex system to be detected, and the specific processing method comprises a linear interpolation method and a sampling method. By processing the original data to be tested, the actual sampling interval of the sample set to be tested is the same as the standard sampling interval of the sensor of the complex system to be detected.
[0228] The linear interpolation method and the sampling method have been described in previous implementations, and will not be repeated here.
[0229] Further, a preferred implementation is provided: the method for processing the sample set to be tested to obtain an input set is the method for dividing a time series into a plurality of time series segments, and this method has been described in previous implementations, so it will not be repeated here.
[0230] Let the input set
[0231]
[0232] wherein, is the i-th time series segment to be tested:
[0233]
[0234] wherein, n is a set length, that is, the number of samples contained in the time series segment to be tested; 0<n<<N, that is, N is much larger than n, and N is a multiple of n; is the i-th sample to be tested;
[0235] wherein, i is a positive integer.
[0236] Further, a preferred implementation is provided, the predicted value after abrupt anomaly removal of the i-th time series segment to be tested is obtained by the following method:
[0237] When i is equal to 1:
[0238] Taking the first time series segment to be tested as the predicted value after abrupt anomaly removal of the first time series segment;
[0239] When i is equal to 2:
[0240] The first time series segment to be tested is used as the input of the perceived data time series segment prediction model, and the output of the perceived data time series segment prediction model is used as the predicted value of the second time series segment to be tested after removing mutation anomalies.
[0241] When i is greater than 2:
[0242] The residuals between the (i-1)th test time series segment and the predicted values of the (i-1)th test time series segment after removing mutation anomalies are compared with the mutation anomaly detection threshold:
[0243] If the sum of the residuals between the (i-1)th test time series segment and the predicted value of the (i-1)th test time series segment after removing mutation anomalies is not greater than the mutation anomaly detection threshold, then the (i-1)th test time series segment is used as the input of the perception data time series segment prediction model, and the output of the perception data time series segment prediction model is used as the predicted value of the i-th test time series segment after removing mutation anomalies.
[0244] If the sum of the residuals between the (i-1)th test time series segment and the predicted value of the (i-1)th test time series segment after removing mutation anomalies is greater than the mutation anomaly detection threshold, then the predicted value of the (i-1)th test time series segment after removing mutation anomalies is used as the input of the perceived data time series segment prediction model, and the output of the perceived data time series segment prediction model is used as the predicted value of the i-th test time series segment after removing mutation anomalies.
[0245] In this embodiment, by comparing the interpretation residual with the mutation anomaly detection threshold, the method selects either the previous time series segment to be tested or the predicted value of the previous time series segment after removing mutation anomalies as the input to the prediction model of the perceived data time series segment, and then calculates the predicted value of the current time series segment after removing mutation anomalies. This method eliminates the time series segments to be tested with mutation anomalies in the input set, overcomes the model mismatch problem caused by directly inputting the time series segment to be tested into the prediction model in traditional anomaly judgment methods, and thus improves the stability and accuracy of slowly changing anomaly interpretation.
[0246] More specifically, the interpretation residual and sequence are represented as res det ;
[0247]
[0248] in, Let the sum of the residuals for the i-th read be denoted.
[0249]
[0250] in:
[0251] For the i-th time series segment to be tested Predicted values after removing mutational anomalies; For the i-th test sample Predicted values after removing mutational anomalies;
[0252]
[0253] More specifically, the predicted value of the i-th time series segment to be tested after removing anomalous mutations. The process of obtaining it is as follows:
[0254] (1) For The process of obtaining it is as follows:
[0255] The first time series segment to be tested The predicted value after removing mutational anomalies for the first time series segment to be tested
[0256] (2) For The process of obtaining it is as follows:
[0257] Assuming the first time series segment to be tested It does not contain mutational abnormalities (i.e. ),Will As input to the time series segment prediction model for the sensed data, the output obtained by the time series segment prediction model is the predicted value of the second time series segment to be tested after removing mutational anomalies.
[0258] (3) For The process of obtaining it is as follows:
[0259] The second time series segment to be tested needs to be determined. Does it contain mutational abnormalities?
[0260] Get and The sum of residuals between, i.e., the sum of residuals of the second interpretation.
[0261] The second interpretation residual and With mutation anomaly detection threshold TH sw Comparison:
[0262] if This indicates the second time series segment. The content does not contain mutation abnormalities, so it will be As input to the time series segment prediction model for the sensed data, the output obtained by the time series segment prediction model is the predicted value of the third time series segment after removing mutation anomalies.
[0263] if This indicates the second time series segment. It contains mutations and abnormalities, at which point... As input to the time series segment prediction model for the sensed data, the output obtained by the time series segment prediction model is the predicted value of the third time series segment after removing mutation anomalies.
[0264] For the case i>3 (i.e.) …etc.), the predicted value of the i-th time series segment after removing mutational anomalies. The process of obtaining and The same applies, so I will not repeat it here.
[0265] More specifically, With the slowly varying anomaly detection threshold TH det Comparison:
[0266] if Then it represents the i-th time series segment to be tested. A slow-change anomaly occurred.
[0267] Otherwise, it indicates the i-th time series segment to be tested. There were no slow-change anomalies.
[0268] Furthermore, a preferred embodiment is provided, in which the test sample set of the sensing data of the complex system to be detected can be expanded into multiple input sets:
[0269] Let the i-th input set be
[0270] When i = 1:
[0271]
[0272] When i > 1:
[0273]
[0274] in, For the i-th input set The j-th time series segment to be tested in the data:
[0275]
[0276] The sensor gradual change anomaly judgment method based on sequence temporal correlation modeling described above can judge the gradual change anomalies of the multiple input sets respectively. By expanding the multiple input sets, the location of the gradual change anomaly can be judged more accurately.
[0277] The method of expanding the test sample set (sample set) into multiple input sets (training sets) has been discussed in previous implementations and will not be repeated here.
[0278] In this embodiment, the sensor gradual anomaly identification method based on sequence temporal correlation modeling uses the sensor data prediction model to obtain the predicted value of the sensor data, and uses the residual sum between the predicted value and the true value of the sensor data for anomaly identification. This overcomes the problems of difficult extraction of gradual anomaly features and weak ability to identify gradual anomalies in traditional anomaly detection methods, and improves the accuracy of gradual anomaly detection.
[0279] The above description of several specific embodiments further details the technical solution provided by the present invention in order to highlight the advantages and benefits of the technical solution provided by the present invention. However, the above-described specific embodiments are not intended to limit the present invention. Any reasonable modifications and improvements to the present invention, reasonable combinations of embodiments, and equivalent substitutions based on the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for judging slowly varying anomalies in sensors based on sequence temporal correlation modeling, characterized in that, The method includes the following steps: Step 1: Obtain the test sample set of the sensing data of the complex system to be tested. The test sample set contains several test samples. Step 2: Process the sample set to be tested to obtain the input set; the input set includes several time series segments to be tested arranged in order; the lengths of the several time series segments to be tested are equal and all are set lengths; Step 3: Based on the input set, mutation anomaly detection threshold, and the time series segment prediction model of the perceived data, obtain the interpretation residuals and sequences; the interpretation residuals and sequences are composed of several interpretation residuals arranged in chronological order; The sum of the ith residuals in the sequence is the sum of the residuals between the ith time series segment to be tested and the predicted value of the ith time series segment to be tested after removing mutations; Step 4: Compare the sum of the i-th interpretation residuals with the slowly varying anomaly detection threshold to obtain the slowly varying anomaly interpretation result: If the sum of the i-th read residuals is not greater than the slowly changing anomaly detection threshold, then the i-th time series segment to be tested does not contain a slowly changing anomaly. If the sum of the i-th read residuals is greater than the slowly changing anomaly detection threshold, then the i-th time series segment to be tested contains a slowly changing anomaly. The slowly varying anomaly detection threshold in Step 4 is obtained using the following method: STE1. Based on the training set, the mutation anomaly detection threshold, and the time series segment prediction model of the perceived data, obtain the slow-change anomaly residual and sequence; the slow-change anomaly residual and sequence is composed of several slow-change anomaly residuals arranged in chronological order; The residual sum of the i-th slowly changing anomaly in the sequence is the sum of the residuals between the i-th time series segment and the predicted value of the i-th time series segment after removing the mutation anomaly; STE2: Obtain the mean and confidence interval of the sum of the residuals of the several slowly changing anomalies, and use the supremum of the sum of the mean of the residuals of the several slowly changing anomalies and the radius of their confidence intervals as the slowly changing anomaly detection threshold. The time series segment refers to a segment extracted from a time series; the time series, or simply time sequence, refers to a sequence formed by arranging data collected by sensors in chronological order of sampling time.
2. The sensor slowly varying anomaly identification method based on sequence temporal correlation modeling according to claim 1, characterized in that, The time series segment prediction model for the sensed data in Step 3 is obtained using the following construction method: S1. Obtain a sample set of sensing data of the complex system to be detected under an abnormal state, wherein the sample set contains several samples. S2. Process the sample set to obtain a training set; the training set includes several time series segments arranged in order; the several time series segments have equal lengths and are all of a set length; S3. Establish a sequence-to-sequence model; the sequence-to-sequence model is used to obtain the predicted value of the next time sequence segment of any time sequence segment in the training set. S4. The sequence-to-sequence model is trained using the training set to obtain a perceptual data time series segment prediction model, thus completing the construction method.
3. The sensor slowly varying anomaly identification method based on sequence temporal correlation modeling according to claim 2, characterized in that, The sample set of sensing data of the complex system to be detected under anomaly-free conditions was obtained using the following method: STEP 1: Obtain raw sensing data from the sensors of the complex system to be tested under normal conditions; the raw sensing data contains several samples. STEP 2: Using linear interpolation, new samples are inserted into the original sensing data to obtain linearly interpolated sensing data; the sampling time interval of the linearly interpolated sensing data is the greatest common divisor of the actual sampling time interval of the original sensing data and the standard sampling time interval of the sensor of the complex system to be detected. STEP 3: Sample the linearly interpolated sensing data according to the standard sampling time interval of the sensor of the complex system to be tested, and obtain a sample set of sensing data of the complex system to be tested under the condition of no abnormality.
4. The sensor slowly varying anomaly identification method based on sequence temporal correlation modeling according to claim 2, characterized in that, Step S2 includes: S2.1 Represent the sample set as a time series; S2.2 Divide the time series into time series segments at intervals of a set length, starting from the first sample, to obtain several time series segments; use the set of the several time series segments as the training set.
5. The sensor slowly varying anomaly identification method based on sequence temporal correlation modeling according to claim 2, characterized in that, The mutation anomaly detection threshold in Step 3 is obtained using the following method: ST1. Based on the training set and the time series segment prediction model of the perceived data, obtain the mutation anomaly residual and sequence; the mutation anomaly residual and sequence is composed of several mutation anomaly residuals arranged in chronological order; The sum of the residuals of the i-th mutation anomaly in the sequence is the sum of the residuals between the i-th time series segment and the predicted value of the i-th time series segment, where i is a positive integer; The predicted value of the i-th time series segment is obtained using the following method: The (i-1)th time series segment in the training set is used as the input of the perceptual data time series segment prediction model, and the output of the perceptual data time series segment prediction model is used as the predicted value of the ith time series segment. ST2. Obtain the mean and confidence interval of the sum of the residuals of the several mutation anomalies, and use the supremum of the sum of the mean of the residuals of the several mutation anomalies and the radius of their confidence intervals as the mutation anomaly detection threshold.
6. The sensor slowly varying anomaly identification method based on sequence temporal correlation modeling according to claim 4, characterized in that, The predicted value of the i-th time series segment after removing mutations in step STE1 is obtained using the following method: When i equals 1: The first time series segment is used as the predicted value after removing mutation anomalies from the first time series segment; When i equals 2: The first time series segment is used as the input to the perception data time series segment prediction model, and the output of the perception data time series segment prediction model is used as the predicted value of the second time series segment after removing mutation anomalies. When i is greater than 2: The residuals between the (i-1)th time series segment and the predicted value of the (i-1)th time series segment after removing mutation anomalies are compared with the mutation anomaly detection threshold: If the sum of the residuals between the (i-1)th time series segment and the predicted value of the (i-1)th time series segment after removing mutation anomalies is not greater than the mutation anomaly detection threshold, then the (i-1)th time series segment is used as the input of the perception data time series segment prediction model, and the output of the perception data time series segment prediction model is used as the predicted value of the i-th time series segment after removing mutation anomalies. If the sum of the residuals between the (i-1)th time series segment and the predicted value of the (i-1)th time series segment after removing mutation anomalies is greater than the mutation anomaly detection threshold, then the predicted value of the (i-1)th time series segment after removing mutation anomalies is used as the input of the perceived data time series segment prediction model, and the output of the perceived data time series segment prediction model is used as the predicted value of the ith time series segment after removing mutation anomalies.
7. The sensor slowly varying anomaly identification method based on sequence temporal correlation modeling according to claim 1, characterized in that, The predicted value of the i-th time series segment to be tested after removing anomalous mutations in Step 3 is obtained using the following method: When i equals 1: The first time series segment to be tested is used as the predicted value of the first time series segment after removing mutation anomalies; When i equals 2: The first time series segment to be tested is used as the input of the perceived data time series segment prediction model, and the output of the perceived data time series segment prediction model is used as the predicted value of the second time series segment to be tested after removing mutation anomalies. When i is greater than 2: The residuals between the (i-1)th test time series segment and the predicted values of the (i-1)th test time series segment after removing mutation anomalies are compared with the mutation anomaly detection threshold: If the sum of the residuals between the (i-1)th test time series segment and the predicted value of the (i-1)th test time series segment after removing mutation anomalies is not greater than the mutation anomaly detection threshold, then the (i-1)th test time series segment is used as the input of the perception data time series segment prediction model, and the output of the perception data time series segment prediction model is used as the predicted value of the i-th test time series segment after removing mutation anomalies. If the sum of the residuals between the (i-1)th test time series segment and the predicted value of the (i-1)th test time series segment after removing mutation anomalies is greater than the mutation anomaly detection threshold, then the predicted value of the (i-1)th test time series segment after removing mutation anomalies is used as the input of the perceived data time series segment prediction model, and the output of the perceived data time series segment prediction model is used as the predicted value of the i-th test time series segment after removing mutation anomalies.
Citation Information
Patent Citations
Business data anomaly detection method and device
CN112800116A
Multi-level shield tunnel safety protection system and method
CN113982605A