Method and system for evaluating running state of electric energy meter under small sample condition

By collecting and enhancing data in the power meter operating state evaluation method, using a multi-head self-attention mechanism and meta-learning model, the problem of small data sample size under the actual operating conditions of the power meter is solved, and more accurate power meter operating state recognition is achieved.

CN119810608AActive Publication Date: 2025-04-11国网安徽省电力有限公司营销服务中心
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510301526.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-04-11
Estimated Expiration
2045-03-14

AI Technical Summary

Technical Problem

The prior art is difficult to obtain real training data under the actual operating conditions of the power meter under the power outage detection, and the sample data is small, making it difficult to train the model, making it difficult to accurately identify the operating status of the power meter.

Method used

By collecting the running data of the power meter, building the original data set, and converting it into a three-dimensional matrix of N××D, inputting a multi-head self-attention mechanism to obtain a multi-channel weighted fusion feature map, and then data augmentation and marking are performed, and meta-learning models and LSTM models are trained to improve the number of data samples and the accuracy of the model.

Benefits of technology

Through data augmentation and model training, the number of data samples is expanded, the accuracy of the model is improved, and the operating status of the power meter can be more accurately identified, solving the problem of small sample data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810608A_ABST
    Figure CN119810608A_ABST
Patent Text Reader

Abstract

The invention discloses an electric energy meter operation state evaluation method and system under a small sample condition, and the method comprises the steps: collecting electric energy meter operation data and a corresponding electric energy meter operation state evaluation result, constructing an original data set, inputting the original data set into a data generation model, and obtaining an expanded data set; inputting the expanded data set into the trained meta-learning model to obtain a marking result of the expanded data set; inputting the marked extended data set and the original data set into an LSTM model, outputting the state category of the electric energy meter, training the LSTM model, and inputting the electric energy meter data collected in real time into the trained LSTM model to obtain an electric energy meter operation state evaluation result; the method has the advantages that the problem of small sample data volume is solved, and the running state of the electric energy meter is accurately identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of online monitoring of electric power metering, and in particular to a method and system for evaluating the operating status of an electric energy meter under small sample conditions. Background Art

[0002] As a key metering device in the high-voltage transmission system of the power system, the accuracy of the electric energy meter directly affects the billing and management of electricity. With the continuous development of the power market and the diversification of power users' needs, it is particularly important to ensure the accuracy and reliability of high-voltage electric energy meters. Traditional electric energy meter detection methods mainly rely on regular offline detection, which not only requires power outages and affects the normal power consumption of users, but also increases the detection cost and time cost. In recent years, online detection technology has gradually become the mainstream method for error state detection of high-voltage electric energy meters. This method allows detection when the electric energy meter is operating normally, avoiding the impact of power outages on users, while reducing manpower and time costs. The advantages of online detection technology are its high efficiency and real-time performance, which can promptly detect and repair potential problems of the electric energy meter and ensure the accuracy of electric energy metering.

[0003] At present, the online detection methods of the status of the electric energy meter mainly include the following: 1. Signal analysis method: By analyzing the waveform and frequency of the current and voltage signals, using Fourier transform and other technologies, the working status of the electric energy meter is monitored in real time. This method can effectively identify whether the electric energy meter has errors or faults. 2. Intelligent monitoring device: Combined with the Internet of Things technology, the intelligent monitoring device installed on the electric energy meter can collect the operation data of the electric energy meter in real time, and analyze it through the cloud platform to detect abnormal conditions in time. 3. Infrared thermal imaging technology: Use an infrared thermal imager to perform non-contact detection of the electric energy meter and monitor the temperature changes of the electric energy meter during operation. Temperature abnormalities may indicate equipment failures or errors. This method can detect problems at an early stage. 4. Data fusion and pattern recognition: By fusing the data of the electric energy meter with the data of other related equipment, using machine learning and pattern recognition technology, the possible error state of the electric energy meter can be identified. This method can improve the accuracy and efficiency of error detection.

[0004] In summary, the application of online detection technology makes the error state detection of electric energy meters more efficient and economical, providing important guarantees for the management and operation of power companies. With the continuous advancement of technology, online detection methods are expected to further improve the accuracy and reliability of electric energy meters and promote the intelligent development of the power industry.

[0005] The document "Liu Yuexiao, Yang Guanghua, Li Na, et al. A method for evaluating the operating status of an electric energy meter based on transfer learning [J]. Automation Applications, 2024, 65(16):142-146,149.DOI:10.19769 / j.zdhy.2024.16.044." proposes a method for evaluating the operating status of an electric energy meter based on transfer learning. First, the operating data, environmental data and attribute data of the electric energy meter under different operating conditions are obtained through experimental simulation, and the Adaboost algorithm is used to construct the association model between the operating characteristics, environmental characteristics, attribute characteristics and the operating status; secondly, the Adaboost evaluation model established in the laboratory is adaptively adjusted through transfer learning to be suitable for evaluating the actual operating status of the electric energy meter in the field. The above method uses transfer learning technology and requires a neural network model for transfer. A large amount of data is required for training the neural network model. However, it is difficult to obtain real training data for power outage detection under the actual operating conditions of the electric energy meter, and the amount of sample data is small, which makes it difficult to train the model and thus difficult to accurately identify the operating status of the electric energy meter. Summary of the invention

[0006] The technical problem to be solved by the present invention is that it is difficult to obtain real training data for power outage detection under the actual operating conditions of the electric energy meter in the existing electric energy meter operating status evaluation method, and the amount of sample data is small, which makes it difficult to train the model and thus difficult to accurately identify the operating status of the electric energy meter.

[0007] The present invention solves the above technical problems by the following technical means: a method for evaluating the operating status of an electric energy meter under small sample conditions, comprising: S1. Collect the operation data of the electric energy meter and its corresponding operation status evaluation results to construct the original data set, and convert the original data set into N× ×D three-dimensional matrix, where N is the batch size, is the time window size, D is the feature dimension, which is the amplitude and phase dimensions respectively; N× ×D three-dimensional matrix is ​​input into the multi-head self-attention mechanism to obtain a multi-channel weighted fusion feature map; the multi-channel weighted fusion feature map is passed through a normalization layer and a first fully connected layer in sequence to output a latent space vector; the latent space vector is decomposed into a trend component and three period components, and the outputs of the trend component and the three period components are flattened and spliced ​​into two-dimensional data to obtain an extended data set; S2, labeling a portion of the data in the extended data set as training data, using the training data to train the meta-learning model, and inputting the extended data set into the trained meta-learning model to obtain the labeling result of the extended data set; S3. Input the labeled expanded data set and the original data set into the LSTM model, output the electricity meter status category, train the LSTM model, and input the real-time collected electricity meter data into the trained LSTM model to obtain the electricity meter operation status evaluation result.

[0008] Furthermore, the original dataset is transformed into N× ×D three-dimensional matrix, including: , the step length is , transforming the original data set into an N× A three-dimensional matrix of type .

[0009] Furthermore, N× The three-dimensional matrix of ×D is input into the multi-head self-attention mechanism to obtain a multi-channel weighted fusion feature map, including: The multi-head self-attention mechanism includes h attention heads, and the branch vector of the j-th attention head includes the query vector , key vector , value vector , j=1, 2...h; according to the query vector and key vector Calculate the attention weight of the jth attention head ;Will and Perform matrix multiplication to obtain the weight feature vector of h channels and add it to N× ×D three-dimensional matrices are multiplied to obtain the original feature maps of h channels, and then convolution and average pooling operations are performed to obtain the pooled weighted feature maps of h channels. The original feature maps of h channels and the pooled weighted feature maps are then added together using the tensor broadcast mechanism to obtain h channel weighted feature maps. Finally, the h channel weighted feature maps are fused through the second fully connected layer to obtain a multi-channel weighted fused feature map.

[0010] Furthermore, the latent space vector is decomposed into a trend component and three period components, including: Tucker decomposition is used to decompose the latent space vector into a core tensor and three factor matrices. The core tensor is low-pass filtered as a trend component; the three factor matrices correspond to the batch size N, the time window size and a factor matrix of feature dimension D, as a periodic component.

[0011] Furthermore, using training data to train the meta-learning model in S2 refers to inputting the training data into the meta-learning model, training the meta-learning model, and stopping the training when the value of the loss function is minimized to obtain a trained meta-learning model; wherein, using the first The similarity between the sample and the corresponding sample in the original data set and the adjustment parameters are calculated. weight coefficients, and then use the first The cross entropy loss between the true label of the sample and the probability distribution predicted by the meta-learning model is The loss function is constructed by multiplying the weight coefficients.

[0012] Furthermore, S3 includes: The LSTM model includes a forget gate, an input gate, and an output gate, wherein the formula of the forget gate at the current time step is the product of the hidden state of the previous time step, the original data set of the current time step, and the expanded data set of the current time step with the first weight matrix plus the first bias term and then multiplied by the logic function; the formula of the input gate at the current time step is the product of the hidden state of the previous time step, the original data set of the current time step, and the expanded data set of the current time step with the second weight matrix plus the second bias term and then multiplied by the Sigmoid activation function of the input gate; the candidate cell state at the current time step is the hidden state of the previous time step, the original data set of the current time step, and the weight matrix of the candidate cell state, and then multiplied by the second bias term. The bias term of the candidate cell state is input as the input value into the hyperbolic tangent activation function; the result of the forget gate of the current time step is multiplied by the cell state of the previous time step, and then added to the product of the input gate of the current time step and the candidate cell state of the current time step to obtain the cell state of the current time step; the formula of the output gate of the current time step is the product of the hidden state of the previous time step, the original data set of the current time step and the weight matrix of the output gate, plus the bias of the output gate, and then multiplied by the Sigmoid activation function of the output gate; the hidden state of the last time step generated by the LSTM model is saved as the feature representation, sent to a third fully connected layer with a softmax activation function, and the energy meter state category is output.

[0013] The present invention also provides an electric energy meter operating status evaluation system under small sample conditions, comprising: The data enhancement module is used to collect the operation data of the electric energy meter and its corresponding electric energy meter operation status evaluation results to construct the original data set, and convert the original data set into N× ×D three-dimensional matrix, where N is the batch size, is the time window size, D is the feature dimension, which is the amplitude and phase dimensions respectively; N× ×D three-dimensional matrix is ​​input into the multi-head self-attention mechanism to obtain a multi-channel weighted fusion feature map; the multi-channel weighted fusion feature map is passed through a normalization layer and a first fully connected layer in sequence to output a latent space vector; the latent space vector is decomposed into a trend component and three period components, and the outputs of the trend component and the three period components are flattened and spliced ​​into two-dimensional data to obtain an extended data set; The data labeling module is used to label a part of the data in the extended data set as training data, use the training data to train the meta-learning model, and input the extended data set into the trained meta-learning model to obtain the labeling result of the extended data set; The status evaluation module is used to input the marked extended data set and the original data set into the LSTM model, output the status category of the electric energy meter, train the LSTM model, and input the real-time collected electric energy meter data into the trained LSTM model to obtain the electric energy meter operation status evaluation result.

[0014] Furthermore, the original dataset is transformed into N× ×D three-dimensional matrix, including: , the step length is , transforming the original data set into an N× A three-dimensional matrix of type .

[0015] Furthermore, N× The three-dimensional matrix of ×D is input into the multi-head self-attention mechanism to obtain a multi-channel weighted fusion feature map, including: The multi-head self-attention mechanism includes h attention heads, and the branch vector of the j-th attention head includes the query vector , key vector , value vector , j=1, 2...h; according to the query vector and key vector Calculate the attention weight of the jth attention head ;Will and Perform matrix multiplication to obtain the weight feature vector of h channels and add it to N× ×D three-dimensional matrices are multiplied to obtain the original feature maps of h channels, and then convolution and average pooling operations are performed to obtain the pooled weighted feature maps of h channels. The original feature maps of h channels and the pooled weighted feature maps are then added together using the tensor broadcast mechanism to obtain h channel weighted feature maps. Finally, the h channel weighted feature maps are fused through the second fully connected layer to obtain a multi-channel weighted fused feature map.

[0016] Furthermore, the latent space vector is decomposed into a trend component and three period components, including: Tucker decomposition is used to decompose the latent space vector into a core tensor and three factor matrices. The core tensor is low-pass filtered as a trend component; the three factor matrices correspond to the batch size N, the time window size and a factor matrix of feature dimension D, as a periodic component.

[0017] Furthermore, in the data labeling module, using the training data to train the meta-learning model refers to inputting the training data into the meta-learning model, training the meta-learning model, and stopping the training when the value of the loss function is minimized to obtain a trained meta-learning model; wherein, using the first The similarity between the sample and the corresponding sample in the original data set and the adjustment parameters are calculated. weight coefficients, and then use the first The cross entropy loss between the true label of the sample and the probability distribution predicted by the meta-learning model is The loss function is constructed by multiplying the weight coefficients.

[0018] Furthermore, the status assessment module is also used to: The LSTM model includes a forget gate, an input gate, and an output gate, wherein the formula of the forget gate at the current time step is the product of the hidden state of the previous time step, the original data set of the current time step, and the expanded data set of the current time step with the first weight matrix plus the first bias term and then multiplied by the logic function; the formula of the input gate at the current time step is the product of the hidden state of the previous time step, the original data set of the current time step, and the expanded data set of the current time step with the second weight matrix plus the second bias term and then multiplied by the Sigmoid activation function of the input gate; the candidate cell state at the current time step is the hidden state of the previous time step, the original data set of the current time step, and the weight matrix of the candidate cell state, and then multiplied by the second bias term. The bias term of the candidate cell state is input as the input value into the hyperbolic tangent activation function; the result of the forget gate of the current time step is multiplied by the cell state of the previous time step, and then added to the product of the input gate of the current time step and the candidate cell state of the current time step to obtain the cell state of the current time step; the formula of the output gate of the current time step is the product of the hidden state of the previous time step, the original data set of the current time step and the weight matrix of the output gate, plus the bias of the output gate, and then multiplied by the Sigmoid activation function of the output gate; the hidden state of the last time step generated by the LSTM model is saved as the feature representation, sent to a third fully connected layer with a softmax activation function, and the energy meter state category is output.

[0019] The advantages of the present invention are: (1) The present invention inputs the original data set into the data generation model to achieve data enhancement, obtains an extended data set, and then labels the generated extended data set, so that the generated extended data set can be used for subsequent LSTM model training. Overall, the number of data samples is expanded, the problem of small sample data volume is solved, and it is helpful to train the model. Subsequently, the accuracy of model training and prediction is improved, and the operating status of the electric energy meter is accurately identified.

[0020] (2) The present invention uses a channel multi-head attention mechanism to map the feature sequence in the channel domain to multiple subspaces to obtain richer channel relationships. Compared with the traditional channel attention mechanism, it captures more diversified channel relationships and can better help the network understand the relationship between different channels in the image, thereby improving the segmentation quality.

[0021] (3) The weight coefficient in the loss function set by the present invention when training the meta-learning model is a coefficient used to adjust the contribution of each sample in the loss function. The weight coefficient reflects the similarity or difference between each sample in the extended data set and the corresponding sample in the original data set. The purpose of the weight coefficient is to make the model pay more attention to samples that are more similar or more important to the known original data set, thereby improving the accuracy of label assignment.

[0022] (4) The present invention inputs both the expanded data set and the original data set into the LSTM model, which is equivalent to outputting the activation function twice. The two data sets jointly influence the output of the LSTM model to affect the results of the forget gate and the input gate, and the output result is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 This is a flow chart of a method for evaluating the operating status of an electric energy meter under small sample conditions disclosed in Example 1 of the present invention; Figure 2 A framework diagram of a data generation model in a method for evaluating an electric energy meter operating state under a small sample condition disclosed in Example 1 of the present invention; Figure 3 This is a schematic diagram of the LSTM model architecture in a method for evaluating the operating status of an electric energy meter under small sample conditions disclosed in Example 1 of the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in combination with the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0025] Example 1 like Figure 1 As shown, Embodiment 1 of the present invention provides a method for evaluating the operating status of an electric energy meter under a small sample condition, comprising: S1. Collect the operation data of the electric energy meter and its corresponding electric energy meter operation status evaluation results to construct the original data set , the original data set Convert to N× ×D three-dimensional matrix, where N is the batch size, is the time window size, D is the feature dimension, which is the amplitude and phase dimensions respectively; N× ×D three-dimensional matrix is ​​input into the multi-head self-attention mechanism to obtain a multi-channel weighted fusion feature map; the multi-channel weighted fusion feature map is passed through a normalization layer and a first fully connected layer in sequence to output a latent space vector; the latent space vector is decomposed into a trend component and three period components, and the outputs of the trend component and the three period components are flattened and spliced ​​into two-dimensional data to obtain an extended data set ; The specific process is as follows: S11. Collect the historical voltage amplitude sequence data of the same type and station, denoted as X, and its corresponding offline evaluation data, divided into normal and abnormal, to construct the original data set The original dataset The number of samples is relatively small, and each sample is a sequence data containing voltage data in seconds per unit time. The present invention designs a data generation model to generate new samples to achieve data enhancement, which mainly consists of two parts: the encoding layer (Encoder) maps the input data to the latent space and outputs the mean and variance of the latent variables; the decoding layer (Decoder) reconstructs the input data from the samples in the latent space. By introducing a multi-head self-attention mechanism in the encoding network to mine the deep features of the original data, comprehensive feature information is provided for the decoding network to generate data, and virtual data that is different from the original data but has a similar distribution is generated. Ultimately, the number of data samples can be expanded, the problem of small sample size can be solved, and the accuracy of subsequent network model training and prediction can be improved. The framework of the data generation model is as follows: Figure 2 shown.

[0026] In the Encoder section, the original dataset is a sequence data containing voltage data in seconds per unit time, which is divided into two dimensions: amplitude and phase. The length of each dimension is L. The vector data of each dimension is recorded as (x1, x2, ..., xL). Suppose the size of the time window is , the step length is , the window data batch size is N, then:

[0027] Simplifying, we get:

[0028] ; in, Represents the original data set The data length, Represents the original data set The i-th data of the medium amplitude dimension data, Represents the original data set The mean of the data in the middle amplitude dimension, Represents the original data set The standard deviation of the data in the amplitude dimension. According to the calculation results, the time window size is , the step length is , the original data set Convert to an N× A three-dimensional matrix of type .

[0029] S12, N× ×D three-dimensional matrix imports multi-head self-attention mechanism. The multi-head self-attention mechanism component can mine the deep features of the data. The multi-head self-attention mechanism is composed of multiple self-attentions. Compared with self-attention, it can map data to different subspaces to mine more comprehensive feature information of the data. The weight matrix Wq, Wk, and Wv of appropriate size are randomly generated by uniform distribution. After linear transformation, Q, K, and V are calculated. Q, K, and V are query vectors, key vectors, and value vectors, respectively. , , In order to avoid excessive concentration of the current channel when the self-attention mechanism encodes the channel information, Q, K, and V are divided into h groups, so that the channel information is mapped to different encoding information generated in different subspaces. Therefore, the multi-head self-attention mechanism in the present invention includes h attention heads, and the branch vector of the jth attention head includes the query vector , key vector , value vector , j=1, 2...h,; calculate the attention weight of the jth attention head ,in, represents the transpose of a matrix, Represents the key vector The dimension of is used to scale the dot product to stabilize the gradient, express function; Each element in represents the correlation between different channels of the feature map. and Perform matrix multiplication to obtain the weight feature vector of h channels and add it to N× ×D three-dimensional matrices are multiplied to obtain the original feature maps of h channels. At this stage, multi-head attention generates multiple branch vectors. Different branch vectors reflect different dependencies due to their different feature expressions, thereby extracting diversified channel relationships. Therefore, the generated attention matrix semantics will be richer. On the other hand, since multi-head attention only extracts features in the channel dimension, it will not generate too much calculation. Subsequently, the original feature maps of the h channels are passed to the channel enhancement part. The channel enhancement part can be understood as a feature enhancement operation. At this stage, convolution and average pooling operations are used to obtain the pooled weight feature maps of h channels. Then, the original feature maps of the h channels and the pooled weight feature maps are added using the tensor broadcast mechanism to obtain h channel weighted feature maps. Finally, the h channel weighted feature maps are fused through the second fully connected layer to obtain a multi-channel weighted fusion feature map. Tensor broadcast addition is an operation method that automatically adapts to the addition of tensors of different sizes, that is, the size of the weighted feature map after pooling may be different from the size of the original feature map, and the size of the weighted feature map after pooling is adaptively expanded to the original feature map. Figure 1 The channel multi-head attention mechanism maps the feature sequence in the channel domain to multiple subspaces to obtain richer channel relationships. Compared with the traditional channel attention mechanism, it captures more diversified channel relationships and can better help the network understand the relationship between different channels in the image, thereby improving the segmentation quality.

[0030] S13, passing the multi-channel weighted fusion feature map through a normalization layer and a first fully connected layer in sequence, and outputting a latent space vector S; S14, the input of Decoder is the latent space vector S generated by Encoder. Since time series data generally has trend and seasonal characteristics, the time structure is injected into the Decoder part, where the time structure is divided into trend components and period components. The latent space vector S of the input three-dimensional matrix of shape N×T×D is regarded as a tensor, and Tucker decomposition is used to decompose the latent space vector S into core tensors And three factor matrices, namely:

[0031] in, is the core tensor. Perform low-pass filtering to remove high-frequency noise and retain low-frequency components, which usually represent long-term trends in the data, as trend components; , , They correspond to batch size N and time window size respectively. and a factor matrix of feature dimension D, representing the direction of change of the data, as a periodic component.

[0032] The outputs of the trend component and the three period components are flattened and concatenated into two-dimensional data to obtain an extended data set. Since the core tensor includes data of multiple dimensions and is mixed together, it is integrated into the required two-dimensional data by flattening and splicing. Flattening and splicing are the existing technical processes. Flattening refers to converting the core tensor According to batch size N, time window size Sorting is performed to form a time series of data, and then the data in the time series contains different dimensions. The data of the same dimension are placed in the same row (that is, the splicing process) to form two-dimensional data as an extended data set. .

[0033] S2. Expanded Dataset It is an unlabeled voltage two-dimensional feature data. Through expert diagnosis, a small amount of data in the data is manually labeled with normal and abnormal probabilities as training data for subsequent models. The meta-learning model is trained using the training data to expand the data set. Input the trained meta-learning model to get the expanded data set The marking result; in this embodiment, the meta-learning model refers to the BP neural network. The BP neural network uses the meta-learning process, so it is named the meta-learning model, and the meta-learning process refers to the loss function training process involved in S2 of the present invention. In practical applications, the meta-learning model can also use other neural network models combined with the loss function involved in S2 for model training. The specific process of S2 is as follows: According to the extended data set Each element in the original data set The difference between corresponding elements determines the Weight coefficient , No. Weight coefficient It is used to adjust the A coefficient of the contribution of a sample in the loss function. The weight reflects the expansion of the data set Each sample in the original dataset The similarity or difference between the corresponding samples in . Weight coefficient The purpose is to make the model pay more attention to those data that are related to the known data (the original data set ) more similar or more important samples, thereby improving the accuracy of label assignment. The specific formula is:

[0034] in, Represents an extended dataset The Samples and original dataset The similarity between the corresponding samples in is the number of samples of training data, Represents an extended dataset No. elements, Represents the original data set No. elements.

[0035]

[0036] in, Indicates The weight coefficients, It is an adjustment parameter, set manually, used to control the variation of the weight coefficient.

[0037] Next, the loss function is set according to the weight coefficient of the sample. The loss function formula is:

[0038] in, They are the extended data sets Middle The true labels of samples and the probability distribution predicted by the meta-learning model; Represents an extended dataset Middle The cross entropy loss between the true label of each sample and the probability distribution predicted by the meta-learning model. The cross entropy loss used in this embodiment is calculated as .

[0039] Continuously updating weight coefficients in the meta-learning model , train the meta-learning model, use the manually labeled data as training data, the training data includes voltage data and the corresponding positive anomaly probability, the input of the meta-learning model is voltage data, and the output is normal anomaly probability. Randomly initialize the parameter set of the meta-learning model. For each iteration, use the current weight coefficient The value of the loss function is calculated by the parameter set, and the parameter set of the meta-learning model is continuously updated to minimize the loss function value, and finally the optimal parameter set is obtained. After obtaining the optimal parameter set, the normal anomaly probability of each unlabeled data can be predicted by the trained meta-learning model, and the state classification with the largest probability among the positive anomaly probabilities is taken as its final label.

[0040] S3: Expand the labeled dataset And the original dataset Input the LSTM model, output the status category of the electric energy meter, train the LSTM model, and input the real-time collected electric energy meter data into the trained LSTM model to obtain the electric energy meter operation status evaluation result; the specific process is as follows: like Figure 3 As shown in the figure, the LSTM model includes several gating units, namely the forget gate, input gate, and output gate. The gating unit helps manage the information flow and decides which information should be retained or forgotten over time. The purpose of the forget gate is to decide which information to discard from the cell state. The formula of the forget gate at the current time step is ,in, is a logical function, is the first weight matrix, is the hidden state of the previous time step, the original data set of the current time step, and the expanded data set of the current time step, is the first bias term; The relevant formula for the input gate of the current time step is ,in, is the Sigmoid activation function of the input gate, is the second weight matrix, is the second bias term; The candidate cell states at the current time step are ,in, is the weight matrix of candidate cell states, is the bias term of the candidate cell state, and tanh is the hyperbolic tangent activation function; Combine the results of the forget gate and the input gate to update the cell state, and the cell state at the current time step is ,in, is the cell state at the previous time step; Figure 3 Adding a d in the circle represents the multiplication symbol.

[0041] The output gate determines the hidden state of the output. The formula for the output gate at the current time step is , the hidden state of the output gate at the current time step is ,in, is the Sigmoid activation function of the output gate, is the weight matrix of the output gate, is the bias of the output gate; The labeled extended dataset And the original dataset Input the LSTM model, save the hidden state of the last time step generated by the LSTM model as the feature representation, send it to a third fully connected layer with a softmax activation function, output the status category of the electric energy meter, and use the expanded data set after the above labeling And the original dataset The LSTM model is trained and the training is stopped when the preset number of iterations is reached or the loss function of the LSTM model is minimized to obtain a trained LSTM model. The real-time collected electric energy meter data is input into the trained LSTM model to obtain the electric energy meter operation status evaluation result.

[0042] Through the above technical solution, the present invention converts the original data set Input data to generate the model, implement data enhancement, and obtain an expanded data set , and then label the generated extended data set so that the generated extended data set can be used for subsequent LSTM model training. Overall, it expands the number of data samples, solves the problem of small sample data volume, and helps train the model. In the subsequent model training and prediction, the accuracy is improved, and the operating status of the electric energy meter is accurately identified.

[0043] Example 2 Based on Example 1, Example 2 of the present invention further provides an electric energy meter operating status evaluation system under small sample conditions, including: Data enhancement module, used to collect the operation data of the electric energy meter and its corresponding electric energy meter operation status evaluation results to construct the original data set , the original data set Convert to N× ×D three-dimensional matrix, where N is the batch size, is the time window size, D is the feature dimension, which is the amplitude and phase dimensions respectively; N× ×D three-dimensional matrix is ​​input into the multi-head self-attention mechanism to obtain a multi-channel weighted fusion feature map; the multi-channel weighted fusion feature map is passed through a normalization layer and a first fully connected layer in sequence to output a latent space vector; the latent space vector is decomposed into a trend component and three period components, and the outputs of the trend component and the three period components are flattened and spliced ​​into two-dimensional data to obtain an extended data set ; Data labeling module, used to expand the data set A portion of the data is labeled as training data, and the meta-learning model is trained using the training data to expand the data set. Input the trained meta-learning model to get the expanded data set The marking results; The state evaluation module is used to expand the labeled data set And the original dataset Input the LSTM model, output the status category of the electric energy meter, train the LSTM model, and input the real-time collected electric energy meter data into the trained LSTM model to obtain the electric energy meter operation status evaluation result.

[0044] More specifically, the original dataset Convert to N× ×D three-dimensional matrix, including: The time window size is , the step length is , the original data set Convert to an N× ×D three-dimensional matrix, where , , Represents the original data set The data length, Represents the original data set The i-th data of the medium amplitude dimension data, Represents the original data set The mean of the data in the middle amplitude dimension, Represents the original data set The standard deviation of the data in the mid-amplitude dimension.

[0045] More specifically, N× The three-dimensional matrix of ×D is input into the multi-head self-attention mechanism to obtain a multi-channel weighted fusion feature map, including: The multi-head self-attention mechanism includes h attention heads, and the branch vector of the j-th attention head includes the query vector , key vector , value vector , j=1, 2...h; calculate the attention weight of the jth attention head ,in, represents the transpose of a matrix, Represents the key vector The dimension of express function; Will and Perform matrix multiplication to obtain the weight feature vector of h channels and add it to N× ×D three-dimensional matrices are multiplied to obtain the original feature maps of h channels, and then convolution and average pooling operations are performed to obtain the pooled weighted feature maps of h channels. The original feature maps of h channels and the pooled weighted feature maps are then added together using the tensor broadcast mechanism to obtain h channel weighted feature maps. Finally, the h channel weighted feature maps are fused through the second fully connected layer to obtain a multi-channel weighted fused feature map.

[0046] More specifically, the latent space vector S is decomposed into a trend component and three period components, including: Use Tucker decomposition to decompose the latent space vector S into core tensors And three factor matrices, namely:

[0047] in, is the core tensor. Perform low-pass filtering as a trend component; , , They correspond to batch size N and time window size respectively. and a factor matrix of feature dimension D, as a periodic component.

[0048] Specifically, using training data to train the meta-learning model in the data labeling module means inputting the training data into the meta-learning model, training the meta-learning model, and stopping the training when the value of the loss function is the smallest to obtain a trained meta-learning model; wherein the formula of the loss function is:

[0049] in, is the number of samples of training data, They are the extended data sets Middle The probability distribution of the true labels of samples and the predictions of the meta-learning model, Represents an extended dataset Middle The cross entropy loss between the true labels of samples and the probability distribution predicted by the meta-learning model; Indicates weight coefficients, and , is a tuning parameter, Represents an extended dataset The Samples and original dataset The similarity between the corresponding samples in , and , Represents an extended dataset No. elements, Represents the original data set No. elements.

[0050] Specifically, the status assessment module is also used to: The LSTM model includes a forget gate, an input gate, and an output gate. The formula of the forget gate at the current time step is: ,in, is a logical function, is the first weight matrix, is the hidden state of the previous time step, the original data set of the current time step, and the expanded data set of the current time step, is the first bias term; The relevant formula for the input gate of the current time step is ,in, is the Sigmoid activation function of the input gate, is the second weight matrix, is the second bias term; The candidate cell states at the current time step are ,in, is the weight matrix of candidate cell states, is the bias term of the candidate cell state, and tanh is the hyperbolic tangent activation function; Combine the results of the forget gate and the input gate to update the cell state, and the cell state at the current time step is ,in, is the cell state at the previous time step; The formula for the output gate at the current time step is , the hidden state of the output gate at the current time step is ,in, is the Sigmoid activation function of the output gate, is the weight matrix of the output gate, is the bias of the output gate; The hidden state of the last time step generated by the LSTM model is saved as the feature representation, sent to a third fully connected layer with a softmax activation function, and outputs the energy meter state category.

[0051] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for evaluating the operating status of an electric energy meter under small sample conditions, characterized in that: include: S1. Collect the operation data of the electric energy meter and its corresponding operation status evaluation results to construct the original data set, and convert the original data set into N× ×D three-dimensional matrix, where N is the batch size, is the time window size, D is the feature dimension, which is the amplitude and phase dimensions respectively; N× ×D three-dimensional matrix is ​​input into the multi-head self-attention mechanism to obtain a multi-channel weighted fusion feature map; the multi-channel weighted fusion feature map is passed through a normalization layer and a first fully connected layer in sequence to output a latent space vector; the latent space vector is decomposed into a trend component and three period components, and the outputs of the trend component and the three period components are flattened and spliced ​​into two-dimensional data to obtain an extended data set; S2, labeling a portion of the data in the extended data set as training data, using the training data to train the meta-learning model, and inputting the extended data set into the trained meta-learning model to obtain the labeling result of the extended data set; S3. Input the labeled expanded data set and the original data set into the LSTM model, output the electricity meter status category, train the LSTM model, and input the real-time collected electricity meter data into the trained LSTM model to obtain the electricity meter operation status evaluation result.

2. The method for evaluating the operating status of an electric energy meter under small sample conditions according to claim 1 is characterized in that: Convert the original dataset into N× ×D three-dimensional matrix, including: , the step length is , transforming the original data set into an N× A three-dimensional matrix of type .

3. The method for evaluating the operating status of an electric energy meter under small sample conditions according to claim 2 is characterized in that: N× The three-dimensional matrix of ×D is input into the multi-head self-attention mechanism to obtain a multi-channel weighted fusion feature map, including: The multi-head self-attention mechanism includes h attention heads, and the branch vector of the j-th attention head includes the query vector , key vector , value vector , j=1, 2...h; according to the query vector and key vector Calculate the attention weight of the jth attention head ;Will and Perform matrix multiplication to obtain the weight feature vector of h channels and add it to N× ×D three-dimensional matrices are multiplied to obtain the original feature maps of h channels, and then convolution and average pooling operations are performed to obtain the pooled weighted feature maps of h channels. The original feature maps of h channels and the pooled weighted feature maps are then added together using the tensor broadcast mechanism to obtain h channel weighted feature maps. Finally, the h channel weighted feature maps are fused through the second fully connected layer to obtain a multi-channel weighted fused feature map.

4. The method for evaluating the operating status of an electric energy meter under small sample conditions according to claim 2 is characterized in that: The latent space vector is decomposed into a trend component and three period components, including: Tucker decomposition is used to decompose the latent space vector into a core tensor and three factor matrices. The core tensor is low-pass filtered as a trend component; the three factor matrices correspond to the batch size N, the time window size and a factor matrix of feature dimension D, as a periodic component.

5. The method for evaluating the operating status of an electric energy meter under small sample conditions according to claim 1 is characterized in that: In S2, using training data to train the meta-learning model means inputting the training data into the meta-learning model, training the meta-learning model, and stopping the training when the value of the loss function is the smallest, thereby obtaining a trained meta-learning model. The similarity between the sample and the corresponding sample in the original data set and the adjustment parameters are calculated. weight coefficients, and then use the first The cross entropy loss between the true label of the sample and the probability distribution predicted by the meta-learning model is The loss function is constructed by multiplying the weight coefficients.

6. The method for evaluating the operating status of an electric energy meter under small sample conditions according to claim 1, characterized in that S3 include: The LSTM model includes a forget gate, an input gate, and an output gate, wherein the formula of the forget gate at the current time step is the product of the hidden state of the previous time step, the original data set of the current time step, and the expanded data set of the current time step with the first weight matrix plus the first bias term and then multiplied by the logic function; the formula of the input gate at the current time step is the product of the hidden state of the previous time step, the original data set of the current time step, and the expanded data set of the current time step with the second weight matrix plus the second bias term and then multiplied by the Sigmoid activation function of the input gate; the candidate cell state at the current time step is the hidden state of the previous time step, the original data set of the current time step, and the weight matrix of the candidate cell state, and then multiplied by the second bias term. The bias term of the candidate cell state is input as the input value into the hyperbolic tangent activation function; the result of the forget gate of the current time step is multiplied by the cell state of the previous time step, and then added to the product of the input gate of the current time step and the candidate cell state of the current time step to obtain the cell state of the current time step; the formula of the output gate of the current time step is the product of the hidden state of the previous time step, the original data set of the current time step and the weight matrix of the output gate, plus the bias of the output gate, and then multiplied by the Sigmoid activation function of the output gate; the hidden state of the last time step generated by the LSTM model is saved as the feature representation, sent to a third fully connected layer with a softmax activation function, and the energy meter state category is output.

7. A system for evaluating the operating status of an electric energy meter under small sample conditions, characterized in that: include: The data enhancement module is used to collect the operation data of the electric energy meter and its corresponding electric energy meter operation status evaluation results to construct the original data set, and convert the original data set into N× ×D three-dimensional matrix, where N is the batch size, is the time window size, D is the feature dimension, which is the amplitude and phase dimensions respectively; N× ×D three-dimensional matrix is ​​input into the multi-head self-attention mechanism to obtain a multi-channel weighted fusion feature map; the multi-channel weighted fusion feature map is passed through a normalization layer and a first fully connected layer in sequence to output a latent space vector; the latent space vector is decomposed into a trend component and three period components, and the outputs of the trend component and the three period components are flattened and spliced ​​into two-dimensional data to obtain an extended data set; The data labeling module is used to label a part of the data in the extended data set as training data, use the training data to train the meta-learning model, and input the extended data set into the trained meta-learning model to obtain the labeling result of the extended data set; The status evaluation module is used to input the marked extended data set and the original data set into the LSTM model, output the status category of the electric energy meter, train the LSTM model, and input the real-time collected electric energy meter data into the trained LSTM model to obtain the electric energy meter operation status evaluation result.

8. The system for evaluating the operation status of an electric energy meter under small sample conditions according to claim 7 is characterized in that: Convert the original dataset into N× ×D three-dimensional matrix, including: , the step length is , transforming the original data set into an N× A three-dimensional matrix of type .

9. The system for evaluating the operation status of an electric energy meter under small sample conditions according to claim 8, characterized in that: N× The three-dimensional matrix of ×D is input into the multi-head self-attention mechanism to obtain a multi-channel weighted fusion feature map, including: The multi-head self-attention mechanism includes h attention heads, and the branch vector of the j-th attention head includes the query vector , key vector , value vector , j=1, 2...h; according to the query vector and key vector Calculate the attention weight of the jth attention head ;Will and Perform matrix multiplication to obtain the weight feature vector of h channels and add it to N× ×D three-dimensional matrices are multiplied to obtain the original feature maps of h channels, and then convolution and average pooling operations are performed to obtain the pooled weighted feature maps of h channels. The original feature maps of h channels and the pooled weighted feature maps are then added together using the tensor broadcast mechanism to obtain h channel weighted feature maps. Finally, the h channel weighted feature maps are fused through the second fully connected layer to obtain a multi-channel weighted fused feature map.

10. The system for evaluating the operation status of an electric energy meter under small sample conditions according to claim 8, characterized in that: The latent space vector is decomposed into a trend component and three period components, including: Tucker decomposition is used to decompose the latent space vector into a core tensor and three factor matrices. The core tensor is low-pass filtered as a trend component; the three factor matrices correspond to the batch size N, the time window size and a factor matrix of feature dimension D, as a periodic component.

Citation Information

Patent Citations

  • Meta-learning model training method, system and equipment based on electrocardiogram diagnosis

    CN109700434A

  • PDGAN-based cable partial discharge data enhancement method

    CN111985528A

  • Electric energy metering fault diagnosis method and diagnosis terminal based on small sample learning

    CN116842459A

  • Glioma risk prediction method and system based on multi-modal information

    CN118609823A

  • IGBT fault prediction method and system based on inverted Transform network

    CN118761444A