Electric energy meter abnormal data repairing method based on dual-channel feature fusion

By adopting dual -channel feature fusion methods in the repair of wind power sequence data, combined with the Malcov transfer field and recursive map extraction features, and using multiple attention mechanisms for integration, solving the problem of inaccurate data repair in the existing technology, realizing the realization More accurate and efficient data repair effects.

CN119377746AActive Publication Date: 2025-01-28HUBEI ENERGY GRP QIYUESHAN WIND POWER CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411622072.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-01-28
Estimated Expiration
2044-11-14

AI Technical Summary

Technical Problem

The prior art is inaccurate in wind power time series data repair, making it difficult to effectively analyze the periodic or repetitive characteristics of wind farms with weather changes.

Method used

Adopt the method of dual -channel feature fusion, extract short -term and periodic features through the Malcov transfer field and recursive map, and use multiple attention mechanisms for feature fusion, build dual -channel feature fusion modules, and finally use long and short memory networks for data repair.

Benefits of technology

It improves the accuracy and practicality of data repair, retains the ability to analyze wind farm start -stop characteristics and periodic fluctuation features, enhance characteristics of characteristics, and avoid characteristics of feature loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377746A_ABST
    Figure CN119377746A_ABST
Patent Text Reader

Abstract

The invention discloses an electric energy meter abnormal data repairing method based on dual-channel feature fusion, and the method comprises the following steps: obtaining wind power time series data of a wind power plant, carrying out the feature extraction of the wind power time series data through employing a Markov transfer field, and obtaining short-term features, performing feature extraction on the wind power time sequence data by using a recurrence plot method to obtain periodic features; constructing a dual-channel feature fusion module, and fusing the short-term features and the periodic features by using the dual-channel feature fusion module to obtain attention fusion features; constructing a time sequence data repairing module, and processing the attention fusion features by using the time sequence repairing module to obtain a sample label corresponding to the wind power time sequence data; and performing data repair on the wind power time sequence data of which the sample labels are abnormal data by using an abnormal data repair module to obtain wind power time sequence repair data. The accuracy and practicability of the abnormal data of the electric energy meter can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of data processing, and in particular to a method for repairing abnormal data of an electric energy meter based on dual-channel feature fusion. Background Art

[0002] In recent years, wind power generation has achieved large-scale and high-quality development, and its installed capacity is still expanding, accounting for an increasing proportion in the power system. However, since most wind farms are located in areas with harsh natural environments, extreme weather, unstable signals, and hardware failures of sensors or other monitoring equipment will cause data collection interruptions during data storage or transmission, resulting in a large amount of data missing. This causes a certain degree of damage to the integrity of the collected wind power time series and the adequacy of the data, which directly affects decisions in power generation assessment, reliability analysis, operation and maintenance, technical transformation and decommissioning, etc. Therefore, it is necessary to study the automatic repair method of wind farm monitoring data to ensure the safe and stable operation of the power system and provide complete and accurate data support for the realization of intelligent operation and maintenance of the power grid.

[0003] Traditional knowledge-driven data patching methods rely too much on expert experience and require a lot of feature engineering work. Traditional data patching methods based on a single type of data-driven features are mostly only applicable to certain specific application scenarios. For example, the traditional Markov transition field (MTF) converts one-dimensional time series data to two-dimensional image data by calculating the conversion probability before and after each time point. Although it is useful for analyzing the start-stop characteristics of wind farms, it has low sensitivity to the distribution of time series data. Therefore, it is not effective when analyzing the periodic or repetitive characteristics of wind farms that fluctuate with weather changes. Recursive graphs (RP) can effectively analyze the correlation information of samples over a long time span of wind farms by calculating the similarity between samples at each time point in the time series data, that is, the periodic fluctuation information of wind power output with weather changes. However, it is easily affected by abnormal data, resulting in errors in the conversion process parameters, which in turn affects the accuracy of data patching. Summary of the invention

[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides a method for repairing abnormal data of an electric energy meter based on dual-channel feature fusion, which solves the problem of inaccurate repair of wind power time series data in the prior art.

[0005] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is: a method for repairing abnormal data of an electric energy meter based on dual-channel feature fusion, comprising the following steps:

[0006] S1. Obtain wind power time series data of a wind farm, use a Markov transition field to perform feature extraction on the wind power time series data to obtain short-term features, and use a recursive graph method to perform feature extraction on the wind power time series data to obtain periodic features;

[0007] S2. Construct a dual-channel feature fusion module, and use the dual-channel feature fusion module to fuse short-term features and periodic features to obtain attention fusion features;

[0008] The dual-channel feature fusion module includes a first self-attention layer, a second attention layer, a first cross-attention layer, a second cross-attention layer, and a third self-attention layer;

[0009] The first self-attention layer and the second attention layer are arranged in parallel, the first cross-attention layer is connected to the first self-attention layer and the second attention layer respectively, the second cross-attention layer is connected to the first self-attention layer and the second attention layer respectively, and the third attention layer is connected to the first cross-attention layer and the second cross-attention layer respectively;

[0010] S3, construct a time series data patching module, use the time series patching module to process the attention fusion features, and obtain the sample labels corresponding to the wind power time series data;

[0011] Sample labels include abnormal data and normal data;

[0012] S4. Use the abnormal data repair module to repair the wind power time series data whose sample labels are abnormal data to obtain wind power time series repair data.

[0013] The beneficial effect of the above scheme is that the present invention adopts multiple feature extraction mechanisms at the same time, constructs a dual-channel feature extraction system, and enhances the feature characterization ability for samples. On this basis, in view of the problem that the traditional multi-feature fusion model only causes the loss of some important but insignificant features through simple feature splicing, a multiple attention mechanism is introduced. By enhancing the important but insignificant features obtained by different feature extraction methods, the mutual enhancement of features of different feature extraction methods is achieved. This method not only retains the ability of the data patching method to analyze the start and stop characteristics of the wind farm, but also retains the ability of the data patching method to analyze the periodic fluctuation characteristics of the wind farm with the weather. Finally, the fused features are used as the input of the long-short term memory network model. Compared with the traditional method of directly inputting time series data, the new architecture enables the long-short term memory network model to directly focus on important features, achieve more accurate patching of abnormal data of wind farm electric energy meters, and improve the accuracy and practicality of data patching.

[0014] Furthermore, in step S1, the Markov transition field is used to extract features from the wind power time series data to obtain short-term features, which specifically include:

[0015] S11, dividing the wind power time series data to obtain a subsequence set of the wind power time series data;

[0016] S12, calculating the state transition probability between the first subsequence and the second subsequence in the subsequence set;

[0017] The first subsequence and the second subsequence are different, and the state transition probability includes a single-step transition probability and a multi-step transition probability;

[0018] S13. Generate a Markov transition field according to the single-step transition probability and the multi-step transition probability, and use the Markov transition field as a short-term feature.

[0019] The beneficial effect of the above further scheme is that the use of Markov transition fields to extract features from wind power time series data can effectively capture time dependencies and state transition patterns and improve prediction accuracy.

[0020] Furthermore, in step S12, the calculation formula used to calculate the state transition probability between the first subsequence and the second subsequence in the subsequence set is:

[0021]

[0022] Among them, P i,j is the multi-step transition probability, indicating that it is currently in the subsequence q i The elements in the next moment transition to the subsequence q in multiple steps j The probability of being within, P i,i-1 It represents the probability of transitioning from one state to another between adjacent moments i and i-1 in the time series, p i,j It represents the probability of transition from one state to another between non-adjacent moments i and j in the time series, p i,i-1 It represents the state transition probability (p) of a certain step from one state to another state between adjacent moments in the time series. i,i-1 ∈P i,i-1 ), q i represents the subsequence reflecting the sample state at time i, x t represents an element in a subsequence at a certain moment, i represents a specific moment i, and j represents a specific moment j different from i;

[0023] In step S13, the calculation formula used to generate the Markov transition field is as follows according to the single-step transition probability and the multi-step transition probability:

[0024]

[0025] Among them, P i,j is the multi-step transition probability, indicating that it is currently in the subsequence q iThe elements in the next moment transition to the subsequence q in multiple steps j The probability within , M represents the Markov transition field.

[0026] The beneficial effect of the above further scheme is that wind power time series data usually has strong time dependence. The Markov transition field can effectively capture this time dependence by constructing a matrix to represent the state transition probability between different time points, reveal the state transition pattern in the time series, and help identify the wind speed change law in different time periods.

[0027] Furthermore, in step S1, the recursive graph is used to extract features from the wind power time series data to obtain periodic features, which specifically include:

[0028] S14, calculating the Euclidean distance between the first wind power time sample point and the second wind power time sample point in the wind power time series data;

[0029] The first wind power time sample point and the second wind power time sample point are different;

[0030] S15. Generate a recursive graph according to the Euclidean distance, and use the recursive graph as a periodic feature.

[0031] Furthermore, in step S15, the calculation formula used to generate the recursive graph according to the Euclidean distance is:

[0032] R(i, j) = Θ(ε-||x i -x j ||)

[0033] Where R(i,j) represents the recurrence graph, Θ represents the Heaviside step function, and x i represents the i-th sample, x j represents the jth sample, and ε represents the preset threshold.

[0034] The beneficial effect of the above further scheme is that it can effectively reveal the periodic patterns and other complex structures in the wind power time series data. Through the recursive graph, it can not only improve the accuracy of the prediction model, but also better understand the inherent laws of wind power data.

[0035] Furthermore, in step S2, the calculation formula of the first self-attention layer is:

[0036]

[0037] Among them, X h represents the output feature vector of the previous layer of network, represents the first output feature vector of the first self-attention layer, A tt(Q, K, V) represents the attention layer network function, Q represents the query matrix, K represents the key matrix, and V represents the value matrix;

[0038] The calculation formula for the second attention layer is:

[0039]

[0040] Among them, X h represents the output feature vector of the previous layer of network, represents the first output feature vector of the second self-attention layer, A tt (Q, K, V) represents the attention layer network function, Q represents the query matrix, K represents the key matrix, and V represents the value matrix;

[0041] The calculation formula for the first cross-attention layer is:

[0042]

[0043] in, represents the first cross feature vector output by the first cross attention layer, represents the first output feature vector of the first self-attention layer, represents the first output feature vector of the second self-attention layer, A tt (Q, K, V) represents the attention layer network function, Q represents the query matrix, K represents the key matrix, and V represents the value matrix;

[0044] The calculation formula for the second cross attention layer is:

[0045]

[0046] in, represents the second cross feature vector output by the second cross attention layer, represents the first output feature vector of the first self-attention layer, represents the first output feature vector of the second self-attention layer, A tt (Q, K, V) represents the attention layer network function, Q represents the query matrix, K represents the key matrix, and V represents the value matrix;

[0047] The calculation formula for the third self-attention layer is:

[0048]

[0049] in, represents the third output feature vector of the third self-attention layer, X cross Represented by the second cross eigenvector and the first cross eigenvector The third cross eigenvector formed by concatenation.

[0050] The beneficial effects of the above further scheme are: the self-attention layer and the cross-attention layer play an important role in processing single sequence and cross-sequence tasks respectively. The self-attention layer improves the expressiveness and efficiency of the model through global dependency modeling and dynamic context modeling, while the cross-attention layer improves the performance of multimodal tasks and sequence generation tasks through cross-modal information fusion and enhanced information interaction.

[0051] Further, in step S3, the time series data repair module is a long short-term memory network, and the long short-term memory network includes a forget gate, an input gate and an output gate;

[0052] The attention fusion features are processed using the time series patching module to obtain the sample labels corresponding to the wind power time series data, including:

[0053] S31, obtaining the attention fusion feature input at time t and the hidden state at time t-1, and calculating the forget gate at time t according to the attention fusion feature input at time t and the hidden state at time t-1;

[0054] S32, calculating the input gate at time t and the candidate memory state at time t according to the attention fusion feature input at time t and the hidden state at time t-1;

[0055] S33, calculating the output gate at time t according to the attention fusion feature input at time t and the hidden state at time t-1;

[0056] S34, calculating the hidden state at time t according to the output gate at time t and the candidate memory state at time t;

[0057] S35, determining a sample label according to the forget gate at time t, the input gate at time t, the candidate memory state at time t, the input gate at time t, and the candidate memory state at time t;

[0058] Wherein, t is a positive integer greater than 1.

[0059] Furthermore, in step S31, according to the attention fusion feature input at time t and the hidden state at time t-1, the calculation formula used to calculate the forget gate at time t is:

[0060] f t =σ(W f ·[h t-1 ,x t ]+b f )

[0061] Among them, f t represents the forget gate at time t, W f and bf represents the parameter of the forget gate, σ represents the sigmoid function, [h t-1 ,x t ] represents the hidden state h at time t-1 t-1 and the attention fusion feature x input at time t t Vectors formed by stitching together;

[0062] In step S32, according to the attention fusion feature input at time t and the hidden state at time t-1, the calculation formula for the input gate at time t is:

[0063] i t =σ(W i ·[h t-1 ,x t ]+b i )

[0064] Among them, i t represents the input gate at time t, W i and b i represents the parameter of the input gate, σ represents the sigmoid function, [h t-1 ,x t ] represents the hidden state h at time t-1 t-1 and the attention fusion feature x input at time t t Vectors formed by stitching together;

[0065] According to the attention fusion feature input at time t and the hidden state at time t-1, the calculation formula for the candidate memory state at time t is:

[0066] c t =tanh(W c ·[h t-1 ,x t ]+b c )

[0067] Among them, c t represents the candidate memory state at time t, W c and b c represents the parameter of the candidate memory state, tanh represents the hyperbolic tangent function, [h t-1 ,x t ] represents the hidden state h at time t-1 t-1 and the attention fusion feature x input at time t t Vectors formed by stitching together;

[0068] In step S33, according to the attention fusion feature input at time t and the hidden state at time t-1, the calculation formula used to calculate the output gate at time t is:

[0069] o t =σ(W o ·[h t-1 ,x t ]+b o )

[0070] Among them, t represents the output gate at time t, W o and b o represents the parameters of the output gate, σ represents the sigmoid function, [h t-1 ,x t ] represents the hidden state h at time t-1 t-1 and the attention fusion feature x input at time t t Vectors formed by stitching together;

[0071] In S34, according to the output gate at time t and the candidate memory state at time t, the hidden state at time t is calculated using the following calculation formula:

[0072] h t =o t ⊙tanh(c t )

[0073] Among them, h t represents the hidden state at time t, ⊙ represents element multiplication, o t represents the output gate at time t, c t represents the candidate memory state at time t, tanh(c t ) represents the result of the candidate memory state at time t after passing through the tanh activation function.

[0074] The beneficial effects of the above further scheme are: LSTM effectively solves the problem of traditional RNN in processing long sequences through its unique memory unit and gating mechanism, and improves the model's ability to handle long-term dependencies. LSTM has performed well in many fields such as time series prediction and natural language processing, and has flexibility, robustness and good generalization ability. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] Figure 1 The figure is a flow chart of an abnormal data repair method for electric energy meters based on dual-channel feature fusion.

[0076] Figure 2 Schematic diagram of the internal connection of the dual-channel feature fusion module.

[0077] Figure 3 Schematic diagram of the internal structure of the self-attention layer.

[0078] Figure 4The figure is a schematic diagram of the model structure of an abnormal data repair method for electric energy meters based on dual-channel feature fusion.

[0079] Figure 5 It is a structural diagram of the dual-channel feature fusion module.

[0080] Figure 6 This is a schematic diagram of the LSTM structure. DETAILED DESCRIPTION

[0081] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0082] like Figure 1 As shown, a method for repairing abnormal data of an electric energy meter based on dual-channel feature fusion includes the following steps:

[0083] S1. Obtain wind power time series data of a wind farm, use a Markov transition field to extract features from the wind power time series data to obtain short-term features, and use a recursive graph method to extract features from the wind power time series data to obtain periodic features.

[0084] In this embodiment, the Markov transition field is used to extract features from the wind power time series data to obtain short-term features, which specifically include:

[0085] S11, dividing the wind power time series data to obtain a subsequence set of the wind power time series data;

[0086] S12, calculating the state transition probability between the first subsequence and the second subsequence in the subsequence set;

[0087] The first subsequence and the second subsequence are different, and the state transition probability includes a single-step transition probability and a multi-step transition probability;

[0088] S13. Generate a Markov transition field according to the single-step transition probability and the multi-step transition probability, and use the Markov transition field as a short-term feature.

[0089] In this embodiment, in step S12, the calculation formula used to calculate the state transition probability between the first subsequence and the second subsequence in the subsequence set is:

[0090]

[0091] Among them, P i,j is the multi-step transition probability, indicating that it is currently in the subsequence q i The elements in the next moment transition to the subsequence q in multiple steps j The probability of being within i,i-1 It represents the probability of transitioning from one state to another between adjacent moments i and i-1 in the time series, pi,j It represents the probability of transition from one state to another between non-adjacent moments i and j in the time series, p i,i-1 It represents the state transition probability (p) of a certain step from one state to another state between adjacent moments in the time series. i,i-1 ∈P i,i-1 ), q i represents the subsequence reflecting the sample state at time i, x t represents an element in a subsequence at a certain moment, i represents a specific moment i, and j represents a specific moment j different from i;

[0092] In step S13, the calculation formula used to generate the Markov transition field is as follows according to the single-step transition probability and the multi-step transition probability:

[0093]

[0094] Among them, P i,j is the multi-step transition probability, indicating that it is currently in the subsequence q i The elements in the next moment transition to the subsequence q in multiple steps j The probability within , M represents the Markov transition field.

[0095] In this embodiment, a recursive graph is used to extract features from wind power time series data to obtain periodic features, specifically including:

[0096] S14, calculating the Euclidean distance between the first wind power time sample point and the second wind power time sample point in the wind power time series data;

[0097] The first wind power time sample point and the second wind power time sample point are different;

[0098] S15. Generate a recursive graph according to the Euclidean distance, and use the recursive graph as a periodic feature.

[0099] In this embodiment, in step S15, the calculation formula used to generate the recursive graph according to the Euclidean distance is:

[0100] R(i,j)=Θ(ε-||x i -x j ||)

[0101] Where R(i,j) represents the recurrence graph, Θ represents the Heaviside step function, and x i represents the i-th sample, x j represents the jth sample, and ε represents the preset threshold.

[0102] For example, the Markov transfer field is a method for converting a one-dimensional time series signal into a two-dimensional image. Assume that the wind power time series data is defined as X = {x1, x2, x3, ..., x n}, where x i is the i-th signal in the wind power time series data, and its image encoding steps are as follows:

[0103] First, the wind power time series data X is divided into Q = {q1, q2, ..., q n} subsequences. Secondly, the state transition probability between the first subsequence and the second subsequence in the subsequence set is calculated, and a Markov transition field is generated according to the single-step transition probability and the multi-step transition probability, and the Markov transition field is used as a short-term feature.

[0104] The recursive graph method is a method that converts a one-dimensional time series signal into a two-dimensional image. Assume that the wind power time series data is defined as X = {x1, x2, x3, ..., x n}, where x i is the i-th signal in the wind power time series data, and its image encoding steps are as follows:

[0105] First, the Euclidean distance between the first wind power time sample point and the second wind power time sample point in the wind power time series data is calculated; and a recursive graph is generated based on the Euclidean distance, and the recursive graph is used as a periodic feature. In the recursive graph, the i-th sample x i and the jth sample x j If the distance between them is less than the preset threshold ε, the two points are considered to be close to each other, and the corresponding position R(i,j) on the recursive graph is marked as 1; otherwise, it is marked as 0. Θ represents the Heaviside step function, and the size of ε can be determined by artificial setting.

[0106] S2. Construct a dual-channel feature fusion module, and use the dual-channel feature fusion module to fuse short-term features and periodic features to obtain attention fusion features; the dual-channel feature fusion module includes a first self-attention layer, a second attention layer, a first cross-attention layer, a second cross-attention layer and a third self-attention layer; the first self-attention layer and the second attention layer are arranged in parallel, the first cross-attention layer is connected to the first self-attention layer and the second attention layer respectively, the second cross-attention layer is connected to the first self-attention layer and the second attention layer respectively, and the third attention layer is connected to the first cross-attention layer and the second cross-attention layer respectively.

[0107] In this embodiment, the calculation formula of the first self-attention layer is:

[0108]

[0109] Among them, X hrepresents the output feature vector of the previous layer of network, represents the first output feature vector of the first self-attention layer, A tt (Q, K, V) represents the attention layer network function, Q represents the query matrix, K represents the key matrix, and V represents the value matrix;

[0110] The calculation formula for the second attention layer is:

[0111]

[0112] Among them, X h represents the output feature vector of the previous layer of network, represents the first output feature vector of the second self-attention layer, A tt (Q, K, V) represents the attention layer network function, Q represents the query matrix, K represents the key matrix, and V represents the value matrix;

[0113] The calculation formula for the first cross-attention layer is:

[0114]

[0115] in, represents the first cross feature vector output by the first cross attention layer, represents the first output feature vector of the first self-attention layer, represents the first output feature vector of the second self-attention layer, A tt (Q, K, V) represents the attention layer network function, Q represents the query matrix, K represents the key matrix, and V represents the value matrix;

[0116] The calculation formula for the second cross attention layer is:

[0117]

[0118] in, represents the second cross feature vector output by the second cross attention layer, represents the first output feature vector of the first self-attention layer, represents the first output feature vector of the second self-attention layer, A tt (Q, K, V) represents the attention layer network function, Q represents the query matrix, K represents the key matrix, and V represents the value matrix;

[0119] The calculation formula for the third self-attention layer is:

[0120]

[0121] in, represents the third output feature vector of the third self-attention layer, X cross Represented by the second cross eigenvector and the first cross eigenvector The third cross eigenvector formed by concatenation.

[0122] like Figure 2 As shown, Figure 2 Figure 1 is a schematic diagram of the internal connection of the dual-channel feature fusion module. Figure 2 In the dual-channel feature fusion module, the first self-attention layer, the second attention layer, the first cross-attention layer, the second cross-attention layer and the third self-attention layer are arranged in parallel, the first cross-attention layer is connected to the first self-attention layer and the second attention layer respectively, the second cross-attention layer is connected to the first self-attention layer and the second attention layer respectively, and the third attention layer is connected to the first cross-attention layer and the second cross-attention layer respectively.

[0123] like Figure 3 As shown, Figure 3 Schematic diagram of the internal structure of the self-attention layer. Figure 3 In , "T" represents matrix transposition operation, "×" represents matrix multiplication operation, "+" represents matrix addition operation, and "Scale" represents dividing the input feature vector by 0.5 power of the feature length of the K-key matrix. In addition, in order to obtain as many hidden features in the sample as possible, a multi-head attention mechanism can be introduced in all attention layers, and the number of attention heads in each attention layer can be set to 16.

[0124] This embodiment takes into account the ability of the Markov transfer field to analyze short-term start-stop events of the wind farm and the ability of the recursive graph to analyze the long-term periodic fluctuation characteristics of the wind farm, that is, it integrates the respective advantages of different types of data-driven methods to enhance the overall characterization ability of the features. And in view of the problem that the feature fusion model causes the loss of important features under different types of feature extraction methods when using simple feature splicing, the present invention proposes to use a multi-attention mechanism to realize the fusion of two different types of data-driven features, that is, multimodal reasoning. This method ensures that under different feature extraction methods, even if some features are not significant relative to other types of features, they can obtain the same expression ability due to their own importance. Thereby effectively avoiding the adverse effects of feature loss on the overall performance of the model.

[0125] S3. Construct a time series data patching module, use the time series patching module to process the attention fusion features, and obtain sample labels corresponding to the wind power time series data; the sample labels include abnormal data and normal data.

[0126] In this embodiment, the time series data patching module is a long short-term memory network, and the long short-term memory network includes a forget gate, an input gate, and an output gate;

[0127] The attention fusion features are processed using the time series patching module to obtain the sample labels corresponding to the wind power time series data, including:

[0128] S31, obtaining the attention fusion feature input at time t and the hidden state at time t-1, and calculating the forget gate at time t according to the attention fusion feature input at time t and the hidden state at time t-1;

[0129] S32, calculating the input gate at time t and the candidate memory state at time t according to the attention fusion feature input at time t and the hidden state at time t-1;

[0130] S33, calculating the output gate at time t according to the attention fusion feature input at time t and the hidden state at time t-1;

[0131] S34, calculating the hidden state at time t according to the output gate at time t and the candidate memory state at time t;

[0132] S35, determining a sample label according to the forget gate at time t, the input gate at time t, the candidate memory state at time t, the input gate at time t, and the candidate memory state at time t;

[0133] Wherein, t is a positive integer greater than 1.

[0134] In this embodiment, in step S31, the calculation formula used to calculate the forget gate at time t is:

[0135] f t =σ(W f ·[h t-1 ,x t ]+b f )

[0136] Among them, f t represents the forget gate at time t, W f and b f represents the parameter of the forget gate, σ represents the sigmoid function, [h t-1 ,x t ] represents the hidden state h at time t-1 t-1 and the attention fusion feature x input at time t t Vectors formed by stitching together;

[0137] In step S32, according to the attention fusion feature input at time t and the hidden state at time t-1, the calculation formula for the input gate at time t is:

[0138] i t=σ(W i ·[h t-1 ,x t ]+b i )

[0139] Among them, i t represents the input gate at time t, W i and b i represents the parameter of the input gate, σ represents the sigmoid function, [h t-1 ,x t ] represents the hidden state h at time t-1 t-1 and the attention fusion feature x input at time t t Vectors formed by stitching together;

[0140] According to the attention fusion features input at time t and the hidden state at time t-1, the calculation formula for the candidate memory state at time t is:

[0141] c t =tanh(W c ·[h t-1 ,x t ]+b c )

[0142] Among them, c t represents the candidate memory state at time t, W c and b c represents the parameter of the candidate memory state, tanh represents the hyperbolic tangent function, [h t-1 ,x t ] represents the hidden state h at time t-1 t-1 and the attention fusion feature x input at time t t Vectors formed by stitching together;

[0143] In step S33, according to the attention fusion feature input at time t and the hidden state at time t-1, the calculation formula used to calculate the output gate at time t is:

[0144] o t =σ(W o ·[h t-1 ,x t ]+b o )

[0145] Among them, t represents the output gate at time t, W o and b o represents the parameters of the output gate, σ represents the sigmoid function, [h t-1 ,x t ] represents the hidden state h at time t-1 t-1and the attention fusion feature x input at time t t Vectors formed by stitching together;

[0146] In S34, according to the output gate at time t and the candidate memory state at time t, the hidden state at time t is calculated using the following calculation formula:

[0147] h t =o t ⊙tanh(c t )

[0148] Among them, h t represents the hidden state at time t, ⊙ represents element multiplication, o t represents the output gate at time t, c t represents the candidate memory state at time t, tanh(c t ) represents the result of the candidate memory state at time t after passing through the tanh activation function.

[0149] like Figure 4 As shown, Figure 4 The figure is a schematic diagram of the model structure of an abnormal data repair method for electric energy meters based on dual-channel feature fusion. Figure 4 In the model, there are four main modules, namely data preprocessing layer, feature extraction layer, LSTM layer and abnormal data repair layer.

[0150] The data preprocessing layer is mainly used to intercept a continuous wind power time series data X = {x1, x2, x3, ..., x n}, and normalize it to obtain a continuous time series data X = {x1, x2, x3, ..., x m}, where x i ∈[0,1].

[0151] Optionally, the data preprocessing layer may be run after the wind power time series data of the wind farm is acquired in step S1 to normalize the acquired wind power time series data.

[0152] The feature extraction layer is a dual-channel feature fusion module, which further integrates the knowledge-driven features and the data-driven features by introducing a joint training method. Specifically, in step S2, a multi-attention mechanism is used to fuse the features extracted from the Markov transfer field and the recursive graph, and then a joint training method is introduced to further fuse the data-driven data and the knowledge-driven data.

[0153] like Figure 5 As shown, Figure 5 It is a schematic diagram of the structure of the dual-channel feature fusion module. Figure 5In the example, the input of the dual-channel feature fusion module can be the data output by the data preprocessing layer after normalizing the wind power time series data. When processing the data, two convolution layers can be constructed first, the convolution kernel size is set to 5×5, the activation function uses the Relu function, the pooling layer is set to global average pooling 2×2, and the Dropout layer is set to 0.3.

[0154] like Figure 6 As shown, Figure 6 The diagram is a schematic diagram of the LSTM structure. The main network model used in the dual-channel feature fusion module is the Long Short Term Memory (LSTM). Figure 6 In the long short-term memory network, the main components are the forget gate f t , input gate i t and output gate o t The operation steps of the long short-term memory network are as follows:

[0155] First, for the input data x at time t t and the hidden state h at the previous moment t-1 , calculate the forget gate f t The function of the forget gate is to determine the memory state c of the previous moment. t-1 Which information should be forgotten and which information should be retained? t If the output is close to 0, it means that the information at the previous moment needs to be forgotten. If it is close to 1, it means that the information at the previous moment needs to be retained.

[0156] Next, calculate the input gate i t and the candidate memory state c at the current moment t The role of the input gate and candidate memory state is to t and the hidden state h at the previous moment t-1 Calculate a candidate memory state c t , to determine what information needs to be retained and what needs to be forgotten.

[0157] Finally, the output gate o is calculated t and the hidden state h at the current moment t .

[0158] S4. Use the abnormal data repair module to repair the wind power time series data whose sample labels are abnormal data to obtain wind power time series repair data.

[0159] In this embodiment, when performing time series data repair, the traditional long short-term memory network (LSTM) model usually directly uses the original time series features as input. However, when the input time series is too long and contains a lot of information, the LSTM model may encounter stability problems and gradient vanishing problems, which limits its ability to capture the long-term periodicity and repetitive features of the time series. In view of this, the present invention first converts the one-dimensional time series data into two-dimensional image data, and then converts the image data into high-dimensional short sequence features with the help of an improved convolutional neural network (CNN) model based on fusion features. Since the use of special fusion features as the input of the CNN model is more targeted than the traditional CNN model. Through this conversion, the LSTM model is able to enhance its ability to analyze local key information, while ensuring that the global periodicity and repetitive features are not forgotten prematurely, and enhancing the LSTM model's ability to analyze the front-to-back dependency features of time series data.

[0160] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the invention.

Claims

1. A method for repairing abnormal data of electric energy meters based on dual-channel feature fusion, characterized in that: The method comprises: S1. Obtain wind power time series data of a wind farm, use a Markov transition field to perform feature extraction on the wind power time series data to obtain short-term features, and use a recursive graph method to perform feature extraction on the wind power time series data to obtain periodic features; S2, constructing a dual-channel feature fusion module, and using the dual-channel feature fusion module to fuse the short-term feature and the periodic feature to obtain an attention fusion feature; The dual-channel feature fusion module includes a first self-attention layer, a second attention layer, a first cross-attention layer, a second cross-attention layer and a third self-attention layer; The first self-attention layer and the second attention layer are arranged in parallel, the first cross-attention layer is connected to the first self-attention layer and the second attention layer respectively, the second cross-attention layer is connected to the first self-attention layer and the second attention layer respectively, and the third attention layer is connected to the first cross-attention layer and the second cross-attention layer respectively; S3, constructing a time series data patching module, and using the time series patching module to process the attention fusion feature to obtain a sample label corresponding to the wind power time series data; The sample labels include abnormal data and normal data; S4. Use the abnormal data repair module to repair the wind power time series data whose sample labels are abnormal data to obtain wind power time series repair data.

2. The method according to claim 1, characterized in that: In step S1, the use of the Markov transition field to extract features from the wind power time series data to obtain short-term features specifically includes: S11, dividing the wind power time series data to obtain a subsequence set of the wind power time series data; S12, calculating the state transition probability between the first subsequence and the second subsequence in the subsequence set; The first subsequence and the second subsequence are different, and the state transition probability includes a single-step transition probability and a multi-step transition probability; S13. Generate a Markov transition field according to the single-step transition probability and the multi-step transition probability, and use the Markov transition field as the short-term feature.

3. The method according to claim 2, characterized in that In step S12, the calculation formula used for calculating the state transition probability between the first subsequence and the second subsequence in the subsequence set is: Among them, P i,j is the multi-step transition probability, indicating that it is currently in the subsequence q i The elements in the next moment transition to the subsequence q in multiple steps j The probability of being within i,i-1 It represents the multi-step state transition probability from one state to another between adjacent moments i and i-1 in the time series, p i,j It represents the probability of transition from one state to another between non-adjacent moments i and j in the time series, p i,i-1 It represents the state transition probability (p) of a certain step from one state to another state between adjacent moments in the time series. i,i-1 ∈P i,i-1 ), q i represents the subsequence reflecting the sample state at time i, x t represents an element in a subsequence at a certain moment, i represents a specific moment i, and j represents a specific moment j different from i; In step S13, the calculation formula used to generate the Markov transition field based on the single-step transition probability and the multi-step transition probability is: Among them, P i,j is the multi-step transition probability, indicating that it is currently in the subsequence q i The elements in the next moment transition to the subsequence q in multiple steps j The probability within , M represents the Markov transition field.

4. The method according to claim 1, characterized in that: In step S1, the feature extraction of the wind power time series data using a recursive graph to obtain periodic features specifically includes: S14, calculating the Euclidean distance between the first wind power time sample point and the second wind power time sample point in the wind power time series data; The first wind power time sample point and the second wind power time sample point are different; S15. Generate a recursive graph according to the Euclidean distance, and use the recursive graph as the periodic feature.

5. The method according to claim 4, characterized in that In step S15, the calculation formula used to generate the recursive graph according to the Euclidean distance is: R(i,j)=Θ(ε-||x i -x j ||) Where R(i,j) represents the recurrence graph, Θ represents the Heaviside step function, and x i represents the i-th sample, x j represents the jth sample, and ε represents the preset threshold.

6. The method according to claim 1, characterized in that In step S2, the calculation formula of the first self-attention layer is: Among them, X h represents the output feature vector of the previous layer of network, represents the first output feature vector of the first self-attention layer, A tt (Q, K, V) represents the attention layer network function, Q represents the query matrix, K represents the key matrix, and V represents the value matrix; The calculation formula of the second attention layer is: Among them, X h represents the output feature vector of the previous layer of network, represents the first output feature vector of the second self-attention layer, A tt (Q, K, V) represents the attention layer network function, Q represents the query matrix, K represents the key matrix, and V represents the value matrix; The calculation formula of the first cross attention layer is: in, represents the first cross feature vector output by the first cross attention layer, represents the first output feature vector of the first self-attention layer, represents the first output feature vector of the second self-attention layer, A tt (Q, K, V) represents the attention layer network function, Q represents the query matrix, K represents the key matrix, and V represents the value matrix; The calculation formula of the second cross attention layer is: in, represents the second cross feature vector output by the second cross attention layer, represents the first output feature vector of the first self-attention layer, represents the first output feature vector of the second self-attention layer, A tt (Q, K, V) represents the attention layer network function, Q represents the query matrix, K represents the key matrix, and V represents the value matrix; The calculation formula of the third self-attention layer is: in, represents the third output feature vector of the third self-attention layer, X cross Represented by the second cross eigenvector and the first cross eigenvector The third cross eigenvector formed by concatenation.

7. The method according to claim 1, characterized in that In step S3, the time series data patching module is a long short-term memory network, and the long short-term memory network includes a forget gate, an input gate and an output gate; The using the time series patching module to process the attention fusion feature to obtain the sample label corresponding to the wind power time series data specifically includes: S31, obtaining the attention fusion feature input at time t and the hidden state at time t-1, and calculating the forget gate at time t according to the attention fusion feature input at time t and the hidden state at time t-1; S32, calculating the input gate at time t and the candidate memory state at time t according to the attention fusion feature input at time t and the hidden state at time t-1; S33, calculating the output gate at time t according to the attention fusion feature input at time t and the hidden state at time t-1; S34, calculating the hidden state at time t according to the output gate at time t and the candidate memory state at time t; S35, determining the sample label according to the forget gate at time t, the input gate at time t, the candidate memory state at time t, the input gate at time t, and the candidate memory state at time t; Wherein, t is a positive integer greater than 1.

8. The method according to claim 7, characterized in that In step S31, the calculation formula used to calculate the forget gate at time t based on the attention fusion feature input at time t and the hidden state at time t-1 is: f t =σ(W f ·[h t-1 ,x t ]+b f ) Among them, f t represents the forget gate at time t, W f and b f represents the parameter of the forget gate, σ represents the sigmoid function, [h t-1 ,x t ] represents the hidden state h at time t-1 t-1 and the attention fusion feature x input at time t t Vectors formed by stitching together; In step S32, the calculation formula for calculating the input gate at time t based on the attention fusion feature input at time t and the hidden state at time t-1 is: i t =σ(W i ·[h t-1 ,x t ]+b i ) Among them, i t represents the input gate at time t, W i and b i represents the parameter of the input gate, σ represents the sigmoid function, [h t-1 ,x t ] represents the hidden state h at time t-1 t-1 and the attention fusion feature x input at time t t Vectors formed by stitching together; The calculation formula for calculating the candidate memory state at time t based on the attention fusion feature input at time t and the hidden state at time t-1 is: c t =tanh(W c ·[h t-1 ,x t ]+b c ) Among them, c t represents the candidate memory state at time t, W c and b c represents the parameter of the candidate memory state, tanh represents the hyperbolic tangent function, [h t-1 ,x t ] represents the hidden state h at time t-1 t-1 and the attention fusion feature x input at time t t Vectors formed by stitching together; In step S33, the calculation formula used to calculate the output gate at time t based on the attention fusion feature input at time t and the hidden state at time t-1 is: the t =σ(W o ·[h t-1 ,x t ]+b o ) Among them, t represents the output gate at time t, W o and b o represents the parameters of the output gate, σ represents the sigmoid function, [h t-1 ,x t ] represents the hidden state h at time t-1 t-1 and the attention fusion feature x input at time t t Vectors formed by stitching together; In S34, the calculation formula used to calculate the hidden state at time t based on the output gate at time t and the candidate memory state at time t is: h t =o t ☉tanh(c t ) Among them, h t represents the hidden state at time t, ⊙ represents element multiplication, o t represents the output gate at time t, c t represents the candidate memory state at time t, tanh(c t ) represents the result of the candidate memory state at time t after passing through the tanh activation function.

Citation Information

Patent Citations

  • Taking identification method and device based on double-channel cross attention mechanism

    CN113936339A

  • Multi-modal breast tumor risk prediction method and system based on pathological image

    CN118675618A

  • Detection method using fusion network based on attention mechanism, and terminal device

    US11222217B1