Highly robust compressed sensing method for high-frequency power data under abnormal conditions

By combining sparse dictionary and abnormal point processing technology, the problem of low reconstruction accuracy in minute-level meter data is solved, and efficient abnormal point processing and data reconstruction are achieved, which improves the meter data Compression and reconstruction accuracy.

CN115718873BActive Publication Date: 2024-11-19STATE GRID JIANGSU ELECTRIC POWER CO LTD NANJING POWER SUPPLY COMPANY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211487648.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-25
Publication Date
2024-11-19
Estimated Expiration
2042-11-25

AI Technical Summary

Technical Problem

The traditional meter data compression perception method based on discrete Fourier transform or wavelet transform is low in reconstruction accuracy in minute-level meter data with inconspicuous periodicity, and the sparse dictionary-based method cannot guarantee reconstruction accuracy when an abnormal point exists. Selectively handle exception points, affecting the reconstruction accuracy of normal points.

Method used

Using a compression perception method based on sparse dictionary, learn sparse dictionary on the data set, combine collaborative forest and metric learning to annotate and expand outliers, use twin networks to detect abnormal points, track and block outliers through atomic feature masking matching, and combine sequence generation Data reconstruction is carried out on the adversarial network and numerical distribution intervals are provided to fill out the abnormal points.

Benefits of technology

Improve the compression rate and reconstruction accuracy of minute-level meter data, can better capture the fluctuation mode and characteristics of the data, enhance the processing ability of abnormal points, improve the reconstruction accuracy of normal points, and provide the inherent of abnormal points. Characteristic analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115718873B_ABST
    Figure CN115718873B_ABST
Patent Text Reader

Abstract

A highly robust compressed sensing method for high-frequency power data under abnormal conditions. A compressed sensing method based on a sparse dictionary performs compressed sensing on minute-level meter data containing abnormal points. A sparse dictionary is learned on the data set to capture several fluctuation patterns and features of the meter data, and then compressed and reconstructed. The edge detects the minute-level meter data containing abnormal points and compresses the normal values ​​therein, and the master station decompresses and reconstructs the data and fills the abnormal values. For data labeling and detection of abnormal points, a semi-supervised collaborative forest method is used to expand the abnormal point data set and output support set. In order to improve the reconstruction accuracy of normal values, an atomic feature masking method is used to learn a sparse representation dictionary to provide a prerequisite for compressed sensing. For the real data estimation problem of noise and abnormal points that may exist after data transmission, a sequence generative adversarial network is used to reconstruct the observed signal and give the distribution of predicted values.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of signal detection, estimation and communication technology, relates to the compression and reconstruction of power data, and is a highly robust compression sensing method for high-frequency power data under abnormal conditions. Background Art

[0002] The presence of abnormal sampling values ​​in meter data is called an abnormal scenario. The types of anomalies include missing values ​​and outliers. Anomalies refer to the locations where abnormal values ​​appear in the meter data sequence. In abnormal scenarios, data not collected by the meter is represented as 0 values, which will be confused with the 0 values ​​collected by the meter in normal scenarios. In the scenario of compression and reconstruction of power data, minute-level meter data fluctuates greatly, and methods based on mean and variance are prone to misjudging outliers caused by meter data collection errors; meter data will produce abnormal sampling values ​​during the collection process, and inevitably lose useful information of some samples. Directly ignoring abnormal points or compressing abnormal data points together with normal data points will reduce the reconstruction accuracy of the remaining normal values; the actual application of minute-level meters is relatively new, and there are fewer data sets with anomaly annotations.

[0003] The compressed sensing method is mainly used to compress sparse signals, but the meter data is not a sparse signal in the time domain. It is necessary to transform the dense signal into a sparse signal in a certain domain according to a certain sparse basis and then perform compressed sensing. Therefore, the selection of the sparse basis has a great influence on the reconstruction accuracy of compressed sensing. The existing power data compressed sensing algorithm is mainly used to compress power data with obvious periodicity. The compressed sensing algorithm using wavelet transform as the sparse basis has a high data reconstruction accuracy. However, for minute-level meter data with unclear periodicity, the traditional meter data compressed sensing algorithm based on discrete Fourier transform or wavelet transform has a low reconstruction accuracy. Compared with the meter data at the second level, the periodicity of minute-level meter data is not strong, and there are several fluctuation modes. The use of discrete wavelet transform cannot obtain a sparse representation of the original signal with high sparsity, resulting in low reconstruction accuracy of the algorithm. In view of the above problems, the present invention uses a compressed sensing method based on a sparse dictionary to learn a sparse dictionary on the data set. Compared with the compressed sensing method with a fixed sparse basis, it can better capture several fluctuation modes and features of meter data, thereby improving the compression rate and reconstruction accuracy.

[0004] Because the length of the sparse dictionary is fixed, solving the sparse representation during the compression process can only compress the power data as a whole according to the preset fixed length, and cannot selectively compress some points in the power data. However, in the case of abnormal points in the power data, simply deleting the abnormal point data and then compressing it will destroy the temporal integrity of the power data, thereby reducing the reconstruction accuracy; and if the abnormal point data is deleted and padded before compressing the power data as a whole, the poor padding algorithm will introduce additional interference items to the original power data, which will also reduce the reconstruction accuracy. At the same time, due to the small number of data sets with anomaly point annotations, it is also difficult to directly train a compressed sensing method with higher reconstruction accuracy through some machine learning methods. In summary, the existing compressed sensing methods based on sparse dictionaries that directly compress power data containing abnormal points will affect the reconstruction accuracy of other normal point values ​​in the power data. Summary of the invention

[0005] The technical problem to be solved by the present invention is that for minute-level meter data with unclear periodicity, the reconstruction accuracy of the traditional meter data compression sensing method based on discrete Fourier transform or wavelet transform is low, and the compression sensing method based on sparse dictionary cannot guarantee the reconstruction accuracy for power data containing abnormal points. For minute-level meter data, the number of abnormal points is large (~10%) under abnormal conditions, and the compression after padding has a greater impact on the reconstruction accuracy. The existing compression algorithm can only guarantee the reconstruction accuracy of normal values ​​first, and the padding of abnormal points is processed after decompression and reconstruction, and cannot be processed during compression, which affects the reconstruction. Therefore, the existing compression sensing technology can only compress the data sequence as a whole according to a fixed length. If the data contains abnormal points during compression, the reconstruction accuracy will decrease.

[0006] The technical solution of the present invention is: a highly robust compressed sensing method for high-frequency power data under abnormal conditions, which is characterized in that a compressed sensing method based on a sparse dictionary performs compressed sensing on minute-level meter data containing abnormal points, learns a sparse dictionary on the data set, captures several fluctuation modes and features of the meter data, and compresses and reconstructs them, wherein the edge end detects the minute-level meter data containing abnormal points and compresses the normal values ​​therein, and the master station side decompresses and reconstructs and fills the abnormal values, including the following steps:

[0007] 1) Based on collaborative forest and metric learning, the data set of power data is labeled and expanded with outlier labels. Collaborative forest is used for semi-supervised training on the original data set. The original data set is machine labeled according to known anomaly types. For unknown anomaly types, the metric learning model based on the twin network is used to discover new types on the machine-labeled data. The average similarity of each type of machine-labeled data with all other types of data is calculated. If the average similarity between a piece of machine-labeled data and all manually labeled data of each type is greater than the set threshold, it is considered that the machine-labeled data belongs to a new type of anomaly. The data set is labeled and expanded to finally obtain a labeled and expanded labeled data set. Labeling refers to the labeling of anomalies in power data.

[0008] 2) At the edge, for the high-frequency power data sequence X generated in real time, based on few-sample learning, a metric learning model based on a twin network is used to detect whether there are outliers in the data sequence and mark the outlier positions, and obtain the corresponding vector X recording the outlier point positions. m , X m The element corresponding to the position of the abnormal value of the X sequence is set to 1, and the normal value is 0. The support data set required for the metric learning model to perform anomaly detection comes from the labeled data set obtained in step 1), and the abnormal point labels obtained by anomaly detection are added to the labeled data set for label expansion;

[0009] 3) Use the labeled data set obtained in step 1) to pre-train the sparse dictionary, then use the trained sparse dictionary D and the position of the outliers marked in step 2) to perform the residual calculation of the sparse dictionary feature column corresponding to the outliers based on the matching pursuit method of atomic feature masking, and then calculate the residual of the sparse dictionary feature column corresponding to the outliers according to the sparse dictionary D and the vector X used for atomic feature masking. m , perform compressed sensing on the high-frequency power data X to obtain a compressed representation S corresponding to the high-frequency power data X;

[0010] 4) Data reconstruction is performed on the master station side based on the sequence generation adversarial network. First, the compressed data is denoised using the denoising network. The denoised compressed representation is preliminarily reconstructed according to the sparse dictionary D to restore the corresponding high-frequency power data X r '; Then use the sequence generation adversarial network to process the initial reconstruction of the high-frequency power data sequence X r ', predict the normal value of the abnormal point position in the data sequence, and the sequence generation adversarial network outputs X r 'The corresponding probability distribution sequence, probability sampling of the probability distribution sequence, and the numerical prediction output X r , X r With X r 'The normal values ​​are combined to obtain the final reconstruction result X r .

[0011] The data processed by the present invention is minute-level electricity meter data. The actual application of minute-level electricity meter data is relatively new, and there are fewer data sets with anomaly annotations. When there is less annotated data, the sparse dictionary is prone to overfitting on the data set, resulting in poor generalization and low reconstruction accuracy during later reconstruction, which cannot meet actual needs well. Therefore, the present invention uses a data set expansion algorithm based on semi-supervised learning to predict the remaining large amount of unlabeled data with a small amount of annotated data, and finally obtains a larger data set, which is convenient for sparse dictionary training. A metric learning model is trained on the expanded annotated data set. The metric learning model can effectively extract and discover feature associations between data. Then, the trained metric learning model is used to discover new types on the machine-annotated electricity meter data set.

[0012] In order to detect the position of outliers in the high-frequency power data sequence generated in real time, the present invention uses an anomaly detection algorithm based on few-sample learning. The advantage of the few-sample detection algorithm based on metric learning is that after the metric learning model is trained, if a new type of abnormal data needs to be detected, it is only necessary to add the corresponding data and labels to the support set, and there is no need to retrain the classification model on the updated data set, which is convenient for updating and iteration. The algorithm includes two parts: the support set and the metric learning model, in which the metric learning model inputs the two sequences to be compared and outputs the similarity between the two sequences. The principle of the few-sample anomaly detection algorithm is to use the metric model to compare the unknown sequence to be detected under the actual situation with the sequence in the support set, and take the type of the most similar sequences as the type of the unknown sequence. The support set required by the model comes from the fully labeled meter data set finally generated in step 1), and the metric learning model comes from the metric learning model trained on the manually labeled data set in step 1). When detecting anomalies, the number of comparisons of the anomaly detection model based on the metric learning model is related to the size of the support set. If the support set is too large, the detection speed of the anomaly detection algorithm will be reduced. Therefore, the present invention also extracts a small number of representative samples from each type of meter data as a support set, thereby reducing the number of comparisons and improving the detection speed while maintaining the detection accuracy. In order to obtain a small number of representative samples required for the support set of the anomaly detection algorithm, a clustering method is used to cluster the expanded meter data set and each label data set to obtain representative samples of each type of data as a lightweight support set. The metric learning model is then distilled to obtain a lightweight metric learning model and a lightweight support set, which are deployed on the edge together with a sparse dictionary and a sparse solution method.

[0013] In order to solve the problem that the existing sparse dictionary has a fixed length and cannot process and compress outliers, the present invention proposes a compressed sensing method based on atomic feature masked matching pursuit, which selectively masks the dictionary sparse atomic feature columns of the outlier value positions in the process of solving the sparse representation, thereby improving the reconstruction accuracy of normal point values.

[0014] Finally, after receiving the sparse representation and the outlier position vector from the edge, the master station first uses the known sparse dictionary to reconstruct the sparse representation, and then uses the generative adversarial network trained on the expanded data set to optimize the reconstructed data; the generator inputs a sequence and outputs the mean and variance values ​​of the Gaussian distribution. In a specific scenario, the generator in the generative adversarial network accepts a sequence of normal values ​​before the outlier position, and outputs a prediction that the outlier position value obeys the Gaussian distribution, and the final data value of the outlier is obtained by sampling the Gaussian distribution. Compared with the existing method of simply giving the outlier filling value, the method used in the present invention can give the numerical distribution range of the data, which is convenient for the master station personnel to have a deeper understanding of the intrinsic characteristics of the outlier data.

[0015] Compared with the prior art, the present invention has the following significant effects:

[0016] 1. For minute-level data with weak periodicity and several fluctuation patterns, the present invention uses a compressed sensing method based on a sparse dictionary to learn a sparse dictionary on the data set. Compared with the compressed sensing method with a fixed sparse basis, it can better capture several fluctuation patterns and features of minute-level meter data, thereby improving the compression rate and reconstruction accuracy.

[0017] 2. Training a sparse dictionary requires a larger data set, so the present invention uses a semi-supervised learning method to expand the data set and uses a metric learning model to discover new types of the machine-expanded data set.

[0018] 3. The existing methods can only compress the power data as a whole according to a preset fixed length when solving the sparse representation during the compression process. Directly compressing the power data containing abnormal points will affect the reconstruction accuracy of other normal point values ​​in the power data. In order to solve the problems of the existing sparse dictionary compressed sensing algorithm, the present invention proposes a compressed sensing method based on atomic feature masked matching pursuit, which shields the calculation of the abnormal point position when solving the compressed representation, thereby improving the reconstruction accuracy of the normal point position.

[0019] 4. Because minute-level meter data is a relatively new application and the data is updated quickly, the anomaly detection algorithm needs to quickly adapt to the new data. The advantage of the few-sample detection algorithm based on metric learning in the present invention is that after the metric learning model is trained, if a new type of abnormal data needs to be detected, only a small amount of corresponding data and labels need to be added to the support set, and there is no need to retrain the classification model on the updated data set, which is convenient for updating and iteration.

[0020] 5. Compared with the existing filling methods that can only give the filling values ​​of abnormal points, the generative adversarial network method used in the present invention can give the numerical distribution range of the filled data, which is convenient for the main station side personnel to have a deeper understanding of the intrinsic characteristics of the abnormal point data. In addition, the existing filling methods of the supervised learning paradigm have high requirements on the quantity and quality of data, while the generative adversarial network of the parallel learning paradigm can also be effectively trained on a small amount of manually annotated data combined with machine-annotated or generated data. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a flow chart of the present invention.

[0022] Figure 2 This is the metric learning model structure used in the present invention.

[0023] Figure 3 Schematic diagram of the sparse representation construction algorithm based on atomic feature masked matching pursuit used in the present invention.

[0024] Figure 4 This is the pre-trained denoising network structure used in the present invention.

[0025] Figure 5 This is a reconstruction algorithm framework based on sequence generative adversarial networks used in the present invention. DETAILED DESCRIPTION

[0026] The present invention proposes a highly robust compressed sensing and reconstruction method for high-frequency power data under abnormal conditions. For the data labeling and detection problems of abnormal points, a semi-supervised collaborative forest method is used to expand the abnormal point data set and output support set, and a lightweight few-sample anomaly detection model is implemented based on metric learning. For the compression problem during data transmission containing abnormal points, a matching pursuit method based on atomic feature masking is used to perform compressive sensing after sparse representation of the original signal. For the real data estimation problem of noise and abnormal points that may exist after data transmission, a reconstruction algorithm based on sequence generative adversarial networks is used to reconstruct the noisy compressed sensing signal, and the possible value range of the meter collected data at the abnormal position under normal conditions is given.

[0027] The present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0028] like Figure 1 Shown is a flow chart of the present invention, and the detailed steps are as follows:

[0029] (1) Dataset label expansion method based on collaborative forest and metric learning

[0030] Before semi-supervised learning, the data set is preprocessed, the included data set is sliced ​​according to the set size, and the samples containing outliers in the window are further subdivided into missing type, outlier type, etc., and then the collaborative forest is used to expand the data label. The collaborative forest method can only expand the label according to the unknown samples of the known category set, and cannot discover unknown samples of unknown categories. Therefore, the present invention also uses a data expansion algorithm based on a metric learning model to discover unknown types for streaming data. Samples of unknown data points are often encountered during the detection process. If the average similarity of the distance of the model output to any category of samples is less than the set value, the data point is determined to be a new abnormal type and added to the expanded data set.

[0031] The algorithm training steps of collaborative forest are as follows

[0032] 1. Initialize the random forest, set the size of the decision tree in the forest, and divide the sample set into labeled and unlabeled sets. The labeled set is initially a manually labeled data set, and the unlabeled set is other unlabeled data sets.

[0033] 2. Train on labeled data.

[0034] 3. Use the trained model to predict labels and add samples with confidence greater than a set threshold to the labeled dataset. Confidence is defined as the number of classifiers that vote for a specific label.

[0035] 4. When there is no decision tree update in the random forest, stop the iteration, otherwise iterate and execute steps 2 and 3.

[0036] After the unlabeled data is processed by the collaborative forest algorithm, a machine-labeled labeled data set is obtained. At this point, all the data in the data set has a label, and the current data set is the union of the manually labeled data set and the machine-labeled data set.

[0037] The collaborative forest algorithm can distinguish known anomaly types. For unknown anomaly types, the present invention proposes a metric learning model based on a twin network, which can help discover new anomalies on existing classifications.

[0038] The metric learning model structure proposed in this invention is as follows Figure 1As shown in the figure, it is divided into a twin network layer and a fully connected layer. The shared layer of the twin network layer is a bidirectional recurrent neural network. The bidirectional recurrent neural network was proposed by M. Schuster et al. in the article Bidirectional recurrent neural networks (IEEE Transactions on Signal Processing). Compared with unidirectional recurrent neural networks, bidirectional recurrent neural networks can better extract forward and backward information of the sequence, hereinafter referred to as Bi-RNN. The formula of Bi-RNN is as follows:

[0039]

[0040] in is the hidden state value output by the model at time t, is the weight of Bi-RNN, X t is the value of the input high-frequency power sequence X at time t, and the output o of Bi-RNN at each time t t As shown in the following formula, where g(·) is the activation function:

[0041]

[0042] Take the output of Bi-RNN at the last moment as the output of the input high-frequency sequence X, as shown in the following formula:

[0043]

[0044] When performing exception type discovery, for two values ​​of length n siam The data sequences P and Q are obtained by copying the network parameters of Bi-RNN twice to process the inputs of P and Q respectively, and obtaining the output of the shared layer network corresponding to P and Q. and in It means that P is processed after inputting the shared layer at the last moment n siam The output, It represents the output of Q at the last moment N after it passes through the shared layer. Then, the fully connected layer is used to process the output of the shared layer of the twin network at the last moment to obtain the similarity of P to Q. The smaller the similarity value, the more similar P and Q are. The similarity d m The definition is as shown in the following formula, where W m With b m is the weight of the fully connected layer, and concat(·) is the vector concatenation operation

[0045]

[0046] When using contrast loss as the model loss during training, for data sequences P and Q, the contrast loss of the model is L contra As described in the following formula, where λ contra To set the threshold, during training:

[0047]

[0048] After the metric learning model is trained on all the annotated data sets after expansion, new types of anomalies are discovered only on machine-annotated data. The metric learning model is used to calculate the average similarity between each type of machine-annotated data and all other types. If the average similarity between a piece of machine-annotated data and all manually annotated data of each type is greater than the set threshold, the machine-annotated data is considered to be a new type of anomaly.

[0049] After using the metric learning model to perform new type discovery operations on all machine-annotated data, the final expanded labeled dataset is obtained.

[0050] (2) A lightweight few-sample anomaly data detection method based on knowledge distillation.

[0051] After data expansion in step (1), an expanded labeled dataset and metric learning model are obtained.

[0052] The purpose of this step is to detect abnormal points on the actual input high-frequency power data and provide a feature selection sequence for the subsequent compression algorithm to shield the sparse dictionary calculation of the positions corresponding to the abnormal points, thereby improving the reconstruction accuracy of the normal point positions.

[0053] The present invention draws on the idea of ​​few-sample learning. The few-sample anomaly detection algorithm includes two parts: a support set and a metric learning model. The metric learning model inputs two sequences to be compared and outputs the similarity between the two sequences. The principle of the few-sample anomaly detection algorithm is to use a metric model to compare the unknown sequence that needs to be detected under real conditions with the sequences in the support set, and take the types of the most similar sequences as the types of the unknown sequence. The support set required by the model comes from the electric meter data set finally generated in the first step. The advantage of the few-sample detection algorithm based on metric learning is that after the metric learning model is trained, if a new type of abnormal data needs to be detected, it is only necessary to add the corresponding data and labels to the support set, and there is no need to retrain the classification model on the updated data set.

[0054] Based on the metric learning model trained on the manually labeled data in step (1), anomaly detection is performed on the data at the unknown anomaly point location. For a subsequence segment of an unknown high-frequency power data sequence X The categories given by the metric learning model are as shown in the following formula, where V is the support set, which comes from the labeled data set in step (1) and contains data of n known abnormal types, and V j represents the high-frequency power data set of the jth abnormal type, q i.j is the i-th fragment of the j-th abnormal type, d m () indicates similarity:

[0055]

[0056] If the category category output by the model belongs to the abnormal category, then mark the fragment The value at the center position of is the outlier, and the center position is the outlier position.

[0057] After detecting all the segments of the high-frequency power data X, the corresponding vector X recording the abnormal point position is obtained. m , X m The elements in the sequence corresponding to the positions of the outliers in the X sequence are set to 1, and the normal values ​​are set to 0.

[0058] When the anomaly detection model based on the metric learning model detects anomalies, the running speed of the anomaly detection model is related to the parameter scale of the model and the size of the support set. The larger the model parameter scale, the slower the running speed of the anomaly detection model; the more data samples of each type in the support set, the more comparisons are made during anomaly detection. Therefore, in order to improve the running speed of the anomaly detection model, the present invention speeds up the model running speed in two aspects: model lightweighting and support set lightweighting. In terms of model lightweighting, knowledge distillation is used to distill the large model of step (1) into a small model with a smaller parameter scale used in step (2); in terms of support set lightweighting, a small number of representative samples of each type of meter data are extracted as the support set, thereby reducing the number of comparisons and improving the detection speed while maintaining the detection accuracy.

[0059] The model lightweight operation uses the knowledge distillation operation. The idea of ​​knowledge distillation is to use a lightweight model to fit the classification output of the original model and the labels of the training samples at the same time after training a larger original model.

[0060] In terms of lightweight support set, clustering method is used to cluster the expanded meter data set and each label data set to obtain representative samples of each type of data as lightweight support set. The present invention uses a clustering algorithm based on dynamic time warping for feature screening and deploys it on the edge. The lightweight support set operation is described as follows:

[0061] For each category of data set, find its category center and the k samples closest to the category center as the support set of the lightweight anomaly detection model. The present invention uses the method of solving the category center in K-Means, and uses dynamic time warping as the similarity to solve the representative data samples of each category as the support set required by the detection model. Compared with the He distance, dynamic time warping can better capture the similarity of changes between two sequences, and can also compare two sequences of unequal lengths. It does not affect the similarity solution when sequence data points are missing. Dynamic time warping distance is a prior art and will not be described in detail.

[0062] (3) Sparse dictionary training and compressed sensing based on atomic feature masked matching pursuit

[0063] After abnormality detection, the high-frequency power data needs to be compressed. In order to obtain a compressed representation of the high-frequency power data X, the present invention performs sparse decomposition on the high-frequency power data X, and the decomposition formula is as follows:

[0064] X=SDM (7)

[0065] in is a sparse dictionary, is a sparse vector, n c is the number of sparse dictionary atoms, and N is the length of the high-frequency power data.

[0066] In order to obtain a sparse dictionary D, a sparse dictionary training method is proposed by the present invention. The sparse dictionary is trained on the data set containing abnormal data and normal data obtained in step (1). The objective function of the sparse decomposition of the high-frequency power data X is expressed by the following formula:

[0067]

[0068] Where M = diag(1-abs(X m ))∈R N×N , X m ∈{0,1} N is the outlier position marker vector obtained by the anomaly detection model in step (2). diag(·) refers to the operation of converting a one-dimensional array into a square matrix. The diagonal elements of this operation correspond to the vector elements, while the off-diagonal elements are 0. abs(·) means converting each element of the vector into the corresponding absolute value, for example, abs([-1,2,-3]) = [1,2,3].

[0069] The first line of formula (8) indicates finding a sparse vector S that minimizes the sparse decomposition error. The second line is the sparsity constraint of the sparse vector, n sparseis the sparsity of the sparse vector, i.e., the maximum number of non-zero values. Formula (8) formally expresses the optimization goal of sparse decomposition, and the training steps described below show how to solve the optimization goal.

[0070] For data with known outlier locations, m The corresponding element in the sequence is set to 1, and the normal value is 0; for example, for a sequence containing missing values ​​X = [7.51, 7.924, NULL, 7.929, 4.579], the corresponding sequence X m =[0,0,1,0,0]. The sparse dictionary training steps used in the present invention are as follows:

[0071] 3.1) Randomly initialize sparse dictionary Each column vector in D is an L2-normalized vector, and the number of iterations k = 1;

[0072] 3.2) For data sample X and corresponding X m , perform the following steps until the number of iterations k is greater than the set value:

[0073] a) Under the constraint of formula (8), for the dictionary D'=DM after feature masking, use the orthogonal matching pursuit method to calculate the sparse vector S corresponding to X;

[0074] b) Using the K-SVD dictionary learning method, the feature masked dictionary D' is updated according to the sparse vector S;

[0075] c) Update the sparse dictionary D using the feature-masked sparse dictionary D'.

[0076] d) The number of iterations k increases by 1.

[0077] After the above dictionary training method, a trained sparse dictionary D is obtained. When compressed sensing is actually performed, the atomic feature masking vector X corresponding to the trained sparse dictionary D and the current high-frequency power data is used. m , compressive sensing is performed on the high-frequency power data X to obtain a sparse representation S corresponding to the high-frequency power data X as a compressed representation of the high-frequency power data.

[0078] Step (2) obtains a lightweight metric learning model and a lightweight support set, which are deployed on the edge together with a sparse dictionary and a sparse solution method. When the edge uses the sparse solution method to compress the actual data, it first uses a lightweight metric learning model to mark the position and type of the abnormal points of the actual data, and then uses the compressed sensing of atomic feature masking proposed by the present invention to mask the sparse atomic features corresponding to the detected abnormal point positions, thereby compressing the remaining normal values ​​without destroying the temporal integrity of the sequence and without introducing additional interference items, and obtaining the final sparse representation and abnormal point position vector (feature masking vector) as compressed data.

[0079] (4) Compressed sensing reconstruction method based on sequence generation adversarial network

[0080] The model in this step is divided into three parts: generator, discriminator and denoising network, such as Figure 5 shown.

[0081] During the transmission from the edge to the main station, the compressed representation S of the high-frequency power data will be accompanied by noise due to transmission reasons, and become a noisy compressed representation S'. The present invention first uses a denoising network to denoise S'.

[0082] The denoising network takes the compressed representation S' with Gaussian noise added as input and the sparse representation value S after denoising as the target. After the pre-training is completed, the denoising network is fixed. The denoising network is based on the autoencoder structure, where h e (·) represents the encoding network, b e and W e is the parameter of the encoding network, and sigmoid(·) is the activation function. The encoding network formula is as follows:

[0083] h e (S') = sigmoid(b e +W e S') (9)

[0084] The decoding network then accepts the output of the encoding network and obtains the denoising result as the output of the denoising network, as shown below, where h d (·) represents the decoding network, W d and b d To decode the parameters of the network:

[0085] r=h d (h e (S')) = sigmoid(b d +W d (h e (S')) (10)

[0086] During training, the mean square error is used as the denoising network loss. The measurement value with Gaussian noise added to the input is used to make the output of the autoencoder as close to the original measurement value as possible. The loss is as follows:

[0087] L S =MSE(S,r) (11)

[0088] After the denoising network, the denoised compressed representation is initially reconstructed according to formula (7) to restore the corresponding high-frequency power data X r '.

[0089] After training the denoising network, the parameters of the denoising network are fixed, and the sequence generation adversarial network is trained. The optimization target of the sequence generation adversarial network used in the present invention is as follows, where D is the discriminator, G is the generator, z is the high-frequency power data containing abnormal values, x is the normal high-frequency power data, and p x is the actual data distribution, p z The data distribution generated for the network is:

[0090]

[0091] The training model consists of two stages, the discriminator D training stage and the generator G training stage. In the discriminator D training stage, given the generator G, the input data of the discriminator D is the real high-frequency power data x of the training set and the generated data G(z) of the generator G. After the data passes through the discriminator D, the discriminator D outputs a value between 0 and 1, which represents the probability that the input unknown sample data is the real meter data. The closer the value is to 1, the greater the possibility that the input is the real meter data. In the discriminator training stage, the value output by the discriminator needs to be as close to 1 as possible, that is, take a suitable D * (X) makes V(D,G) reach the maximum value. The training objective of this stage is as follows:

[0092]

[0093] When training the entire generative adversarial network, the discriminator and the generator compete with each other during training. One is fixed and the other is trained, so that the performance of the discriminator and the generator is improved alternately during training, and finally a Nash equilibrium is reached. At this point, it is believed that the sample data generated by generator G cannot be distinguished by discriminator D, and generator G has learned the distribution of real sample data.

[0094] The output of traditional sequence generation networks is usually optimized for text generation tasks, outputting a scalar at each time moment, which cannot capture the intrinsic distribution characteristics of time series well. In response to the above problems, the present invention proposes a data reconstruction algorithm based on sequence generation adversarial networks.

[0095] The generator network used in the sequence generation adversarial network of the present invention is shown in the following formula, where θ g ,W μ ,b u ,W σ is the network parameter, X t-1 is the value of the sequence input to the model at position t-1, h t-1 and h t are the hidden layer values ​​output by the network at time t-1 and time t respectively.

[0096]

[0097] Where μ is the mean, σ is the variance, and l g is the Gaussian distribution probability density function predicted by the model, and the numerical result X output by the model r For Gaussian distribution l g The sampling results.

[0098] The generator loss is shown in the following formula.

[0099] L G =-logl G (z t |θ(h t )) (15)

[0100] The discriminator is built using a fully connected network. The formula is as follows, where W u With b u Parameters for the fully connected layer:

[0101] D(x)=σ(W u ·x+b u ) (16)

[0102] The discriminative loss is as follows:

[0103]

[0104] In step (4), the master station obtains the step reconstruction X according to the sparse dictionary D r ', X r 'Input the trained sequence into the generator of the generative adversarial network, and the generator outputs the corresponding probability distribution sequence Then, the probability distribution sequence is sampled to obtain the numerical prediction output X r , and then the predicted value is compared with the initial reconstruction X r 'The normal values ​​are combined to obtain the final reconstruction result X r , as shown below:

[0105] X r =X r '·(1-X m)+X r ·X m (18)

[0106] When the master station receives the sparse representation and the outlier position vector from the edge, it first reconstructs the sparse representation using a known sparse dictionary, and then optimizes the reconstructed data using a generative adversarial network trained on the expanded data set; the generator inputs a sequence and outputs the mean and variance values ​​of a Gaussian distribution. In a specific scenario, the generator in the generative adversarial network of the present invention accepts a sequence of normal values ​​before the outlier position, and outputs a prediction that the outlier position value obeys a Gaussian distribution. The final data value of the outlier is obtained by sampling the Gaussian distribution, which is convenient for the master station personnel to have a deeper understanding of the intrinsic characteristics of the outlier data compared to the method of simply outputting the value completion.

[0107] In summary, the high-robustness compressed sensing method for high-frequency power data described in the present invention combines unsupervised label expansion, metric learning, compressed sensing, generative adversarial networks and other technologies to realize a high-robustness compressed sensing method for high-frequency power data; considering the problem of small number of annotations of minute-level meter data, a semi-supervised collaborative forest method is used to expand the abnormal point data set and support set; considering the possible appearance of unknown types of abnormal data, a lightweight few-sample anomaly detection model is implemented based on metric learning; considering the problem that a small number of outliers will affect the reconstruction accuracy, a matching pursuit method based on atomic feature masking is used to shield the compression calculation of outliers, thereby improving the reconstruction accuracy of remaining normal values; a reconstruction algorithm based on a sequence generative adversarial network is used to reconstruct the noisy compressed sensing signal, and a range of padding values ​​is given to enhance the interpretability of the model and its robustness to noise.

Claims

1. A highly robust compressed sensing method for high-frequency power data under abnormal conditions, characterized by The compressed sensing method based on sparse dictionary performs compressed sensing on minute-level meter data containing abnormal points. A sparse dictionary is learned on the data set to capture several fluctuation patterns and features of meter data, and then compress and reconstruct the data. The edge detects minute-level meter data containing abnormal points and compresses the normal values ​​therein. The master station decompresses and reconstructs the data and fills in the abnormal values. The following steps are included: 1) Based on collaborative forest and metric learning, the data set of power data is labeled and expanded with outlier labels. Collaborative forest is used for semi-supervised training on the original data set. The original data set is machine labeled according to known anomaly types. For unknown anomaly types, the metric learning model based on the twin network is used to discover new types on the machine-labeled data. The average similarity of each type of machine-labeled data with all other types of data is calculated. If the average similarity between a piece of machine-labeled data and all manually labeled data of each type is greater than the set threshold, it is considered that the machine-labeled data belongs to a new type of anomaly. The data set is labeled and expanded to finally obtain a labeled and expanded labeled data set. Labeling refers to the labeling of anomalies in power data. 2) At the edge, for the high-frequency power data sequence X generated in real time, a metric learning model based on a twin network is used based on few-sample learning to detect whether there are outliers in the data sequence and mark the outlier positions, and obtain the corresponding vector X recording the outlier point positions m , X m The element corresponding to the position of the abnormal value of the X sequence is set to 1, and the normal value is 0. The support data set required for the metric learning model to perform anomaly detection comes from the labeled data set obtained in step 1), and the abnormal point labels obtained by anomaly detection are added to the labeled data set for label expansion; 3) Use the labeled data set obtained in step 1) to pre-train the sparse dictionary, then use the trained sparse dictionary D and the position of the outliers marked in step 2) to perform the residual calculation of the sparse dictionary feature column corresponding to the outliers based on the matching pursuit method of atomic feature masking, and then calculate the residual of the sparse dictionary feature column corresponding to the outliers according to the sparse dictionary D and the vector X used for atomic feature masking. m , perform compressed sensing on the high-frequency power data X to obtain a compressed representation S corresponding to the high-frequency power data X; 4) Data reconstruction is performed on the master station side based on the sequence generation adversarial network. First, the compressed data is denoised using the denoising network. The denoised compressed representation is preliminarily reconstructed according to the sparse dictionary D to restore the corresponding high-frequency power data X r '; Then use the sequence generation adversarial network to process the initial reconstruction of the high-frequency power data sequence X r ', predict the normal value of the abnormal point position in the data sequence, and the sequence generation adversarial network outputs X r 'The corresponding probability distribution sequence, probability sampling of the probability distribution sequence, and the numerical prediction output X r , X r With X r 'The normal values ​​are combined to obtain the final reconstruction result X r .

2. The method for high robustness compressed sensing of high frequency power data under abnormal conditions according to claim 1 is characterized by: Step 1) is as follows: the original data set is preprocessed before semi-supervised learning, the data set is sliced ​​according to the set size, and the samples containing outliers in the slice window are further subdivided into missing type and outlier type. Then, collaborative forest is used to expand the data labels. The algorithm training steps of collaborative forest are as follows: 1.1) Initialize the random forest, set the size of the decision tree in the forest, and divide the original data set into labeled and unlabeled sets. The labeled set is initially a manually labeled data set, and the unlabeled set is an unlabeled data set; 1.2) Using collaborative forests for semi-supervised training on labeled datasets; 1.3) Use the trained model obtained in 1.2) to predict labels for the unlabeled set, and add samples with confidence greater than a set threshold to the labeled set. The confidence is defined as the number of classifiers that vote for a specific label. 1.4) When there is no decision tree update in the random forest, stop the iteration, otherwise iterate 1.2) to 1.3); After the unlabeled set is processed by the collaborative forest algorithm, it is automatically labeled by the machine and together with the initial manually labeled data set, it constitutes a fully labeled data set.

3. The method for high robustness compressed sensing of high frequency power data under abnormal conditions according to claim 1 is characterized by: The metric learning model based on the twin network is divided into a twin network layer and a fully connected layer, in which the shared layer part of the twin network layer is a bidirectional recurrent neural network Bi-RNN.

4. The method for high robustness compressed sensing of high frequency power data under abnormal conditions according to claim 1, characterized in that In step 2), for a subsequence segment of the high-frequency power data sequence X The categories given by the metric learning model are as shown in the following formula, where V is the support set, which contains data of n known abnormal types, and V j represents the high-frequency power data set of the jth abnormal type, q i.j is the i-th fragment of the j-th abnormal type, d m () indicates similarity: If the category category output by the metric learning model belongs to the abnormal category, then mark the segment The value at the center position is the abnormal value, and the center position is the abnormal position. After detecting all the segments cut from the high-frequency power data X, the corresponding vector X recording the abnormal point position is obtained. m .

5. The method for high robustness compressed sensing of high frequency power data under abnormal conditions according to claim 4 is characterized in that The twin network-based metric learning model used in step 2) is lightweighted using knowledge distillation, and the support set V is lightweighted by feature screening based on the dynamic time warping clustering algorithm, and representative samples of each abnormal type of meter data are extracted as the support set.

6. The method for high robustness compressed sensing of high frequency power data under abnormal conditions according to claim 1, characterized in that Step 3) is specifically: The high-frequency power data X is sparsely decomposed, and the decomposition formula is as follows: X=SDM in is a sparse dictionary, is a sparse vector, n c is the number of sparse dictionary atoms, N is the length of high-frequency power data; The objective function of sparse decomposition of high-frequency power data X is expressed as follows: S0≤n sparse Where M = diag(1-abs(X m ))∈R N×N , X m ∈{0,1} N is the outlier position marker vector, S0 is the number of non-zero elements in the sparse vector, n sparse is the sparsity of the sparse vector, that is, the maximum number of non-zero values; The sparse dictionary D is trained on the labeled data set containing abnormal data and normal data obtained in step 1). The sparse dictionary training steps are as follows: 3.1) Randomly initialize sparse dictionary Each column vector in D is an L2-normalized vector, and the number of iterations k = 1; 3.2) For data sample X and corresponding X m , perform the following steps until the number of iterations k is greater than the set value: a) Under the constraint of the objective function formula, the sparse vector S corresponding to X is calculated using the orthogonal matching pursuit method for the dictionary D'=DM after feature masking; b) Using the K-SVD dictionary learning method, the feature masked dictionary D' is updated according to the sparse vector S; c) using the feature-masked sparse dictionary D' to update the sparse dictionary D; d) The number of iterations k increases by 1; After the above dictionary training method, the trained sparse dictionary D is obtained. Then, according to the sparse dictionary D and the vector X used for masking the dictionary atomic features m , perform compressed sensing on the high-frequency power data X to obtain a compressed representation S corresponding to the high-frequency power data X.

7. The method for high robustness compressed sensing of high frequency power data under abnormal conditions according to claim 1, characterized in that The optimization objective of the sequence generation adversarial network in step 4) is as follows: Where D is the discriminator, G is the generator, z is the high-frequency power data containing abnormal values, x is the normal high-frequency power data, and p x is the actual data distribution, p z The data distribution generated for the network, The generator network is shown in the following formula: h t =RNN(h t-1 ,X t-1 ,θ g ) μ(h t )=W μ h t +b μ σ(h t )=log(1+exp(W σ h t )) where θ g ,W μ ,b u ,W σ is the network parameter, X t-1 is the value of the sequence input to the model at position t-1, h t-1 and h t are the hidden layer values ​​output by the network at time t-1 and time t, μ represents the mean, σ represents the variance, and l g Represents the Gaussian distribution probability density function predicted by the model, and the output numerical result is the Gaussian distribution l g The sampling results; The generator loss is shown in the following formula: L G =-logl G (With t |θ(h t )) The discriminator is built using a fully connected network. The formula is as follows, where W u With b u Parameters for the fully connected layer: D(x)=σ(W u ·x+b u ) The discriminative loss is as follows: L D =t(x)ln(D(x))+(1-t(x))ln(1-D(x)) When training the entire sequence-generating adversarial network, the discriminator and the generator compete with each other during training until a Nash equilibrium is reached. At this point, it is believed that the generator G has learned the distribution of real sample data and obtained a trained sequence generation adversarial network. The master station obtains the steps to reconstruct X based on the sparse dictionary D r ', X r 'Input the trained sequence into the generator of the generative adversarial network, and the generator outputs the corresponding probability distribution sequence Then, the probability distribution sequence is sampled to obtain the numerical prediction output X r , and then the predicted value is compared with the initial reconstruction X r 'The normal values ​​are combined to obtain the final reconstruction result X r , as shown below: X r =X r '·(1-X m )+X r ·X m 。