An electric energy meter abnormality detection system and method based on multi-granularity dynamic receptive field

By combining a multi-granularity dynamic receptive field module and a Transformer model, the problems of information loss and insufficient semantic features in anomaly detection of multi-dimensional time-series data are solved, achieving more efficient anomaly detection and improving the anomaly identification capability of electricity meter data.

CN119128750BActive Publication Date: 2026-06-23BEIJING UNIV OF POSTS & TELECOMM +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING UNIV OF POSTS & TELECOMM
Filing Date
2024-08-26
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing anomaly detection methods for multidimensional time series data suffer from information loss and insufficient semantic feature mining when dealing with multidimensional time series data with complex pattern changes. In particular, reconstruction-based methods have large reconstruction errors when the data fluctuates, and fixed or random masking strategies limit the anomaly detection accuracy of the model.

Method used

A multi-granularity dynamic receptive field module is used to traverse and process the patch block data of the energy meter. Combined with a multi-dimensional time series encoder/decoder module and a two-layer anomaly detection module, the Transformer model is used for reconstruction and anomaly score calculation. Dynamic receptive field and hierarchical loss are designed to realize multi-granularity masking strategy and ensemble learning, and to explore the temporal dependence and dimensional correlation of multi-dimensional time series data.

Benefits of technology

It improves the accuracy and robustness of anomaly detection in multidimensional time-series data, enabling better anomaly identification and enhancing the precision and adaptability of anomaly detection, especially in low information density and complex data environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128750B_ABST
    Figure CN119128750B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on multi-granularity dynamic receptive field electric energy meter abnormality detection system and method, belong to electric energy measurement technical field.The system of the present application, comprising: multi-granularity dynamic receptive field module, for the patch block data of electric energy meter is iterated and handled, to output receptive field data;Multi-dimensional time series codec module is used to reconstruct the receptive field data that the multi-granularity dynamic receptive field module outputs, and output reconstruction data;Double-layer abnormality detection module is used to calculate the abnormality score of reconstruction data that the multi-dimensional time series codec module outputs, determines the abnormality of electric energy meter based on the abnormality score.The present application can identify the anomaly of data by receptive field and data reconstruction, to determine abnormality score, and solves the problem that information loss or semantic feature mining is insufficient when existing reconstruction method is handled low information density multi-dimensional time series data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electricity metering technology, and more specifically, to an electricity meter anomaly detection system and method based on multi-granularity dynamic sensing field. Background Technology

[0002] With the rapid development of IoT technology, the automation and intelligence levels of the power industry are continuously improving, especially in key areas such as power dispatch automation systems and smart meters, where the generation and application of multivariate time series data are increasing. This multidimensional time series data not only forms the foundation of cyber-physical systems, but its stability and accuracy are also crucial for the efficient operation of the entire system. Anomalies in these critical components can not only lead to a decline in system performance but also trigger chain reactions, severely damaging the stability and economic operation of the power grid. By employing advanced data analysis techniques, such as machine learning, deep learning, and time series analysis, abnormal patterns in the multidimensional time series data of smart meters can be effectively identified and predicted. This not only improves the accuracy and response speed of anomaly detection but also helps to achieve real-time monitoring and intelligent diagnosis of the power system, thus providing strong technical support for the intelligence and automation of the power industry.

[0003] In anomaly detection, due to the robustness and stability of electricity meter devices, the data collected typically consists of a large amount of normal data. Therefore, most multidimensional time series anomaly detection work focuses on semi-supervised learning settings (model training uses only normal data) or unsupervised learning settings (training data is mostly normal, but may contain a small number of unknown anomalies). Most multidimensional time series anomaly detection methods typically calculate an anomaly score for each time point and then compare that score to a certain threshold. In recent work on semi-supervised or unsupervised multidimensional time series anomaly detection, deep learning-based methods have achieved state-of-the-art results on authoritative and publicly available multidimensional time series dataset benchmarks.

[0004] Deep learning methods are mainly divided into two categories, among which prediction-based methods and reconstruction-based methods have been widely applied. Prediction methods utilize past information to predict future values ​​in a time series and use prediction error as an indicator of anomaly detection. Reconstruction methods encode the entire time series into a latent space and infer anomaly labels based on the reconstruction error between the original and reconstructed data. However, multidimensional time series data often exhibit complex pattern variations, and future time series values ​​may show high uncertainty, making accurate prediction of multidimensional time series data challenging. Conversely, existing reconstruction-based methods have achieved state-of-the-art results on complex multidimensional time series datasets. However, since reconstruction methods require reconstructing the entire time series, their performance largely depends on the reconstruction model's ability to extract and learn normal patterns in the data. To minimize the overall reconstruction error of the reconstruction model, when the data exhibits uncertainties such as small fluctuations, the strong data sensitivity of the reconstruction model can lead to larger reconstruction errors at fluctuating time points, thus limiting the detailed representation capability of the reconstruction model.

[0005] In recent years, mask reconstruction methods have shown good performance in the field of anomaly detection for multidimensional time series data, mainly divided into point mask reconstruction and patch mask reconstruction. The former mainly designs masks for multiple time points within a time window, while the latter processes time series data in the form of patches or time periods. In-depth analysis reveals that, compared to natural language data where each independent data point has rich semantics, multidimensional time series data are mostly continuous data points with weak semantics. Predicting or reconstructing time points makes it difficult to uncover the rich temporal dependencies and dimensional correlations of time series data. Therefore, point mask reconstruction based on single-point mining is not suitable for multidimensional time series anomaly detection tasks, while patch mask reconstruction is more suitable for segmented information extraction from time series data. Patch mask reconstruction typically only masks one of multiple patches within a time series window and processes the input data at a fixed or random position. However, fixed-position masks sacrifice some informational features of the input data, and while random masking strategies introduce randomness into model training, their testing process also suffers from the drawbacks of fixed-position masks. Furthermore, fixed or random position masks limit the size of the model's receptive field to the data. During training, the model often gets stuck in the repeated learning of the same level of features, making it impossible to achieve multi-level semantic interaction. This limits the improvement of its anomaly detection accuracy and may even lead to model overfitting. Summary of the Invention

[0006] To address the above problems, this invention proposes an anomaly detection system for electricity meters based on multi-granularity dynamic sensing fields, comprising:

[0007] The multi-granularity dynamic sensing field module is used to traverse and process the patch block data of the electricity meter to output sensing field data.

[0008] The multi-dimensional temporal codec module is used to reconstruct the receptive field data output by the multi-granularity dynamic receptive field module and output the reconstructed data.

[0009] A dual-layer anomaly detection module is used to calculate the anomaly score of the reconstructed data output by the multi-dimensional time-series codec module, and to determine the anomaly of the electricity meter based on the anomaly score.

[0010] Optionally, the multi-granularity dynamic receptive field module is also used for:

[0011] Acquire multidimensional time-series data from the electricity meter, standardize the multidimensional time-series data to obtain standardized data, and use a window-patch strategy to convert the standardized data into patch block data.

[0012] Optionally, the multi-granularity dynamic sensing field module traverses and processes the patch block data of the energy meter to output sensing field data, including:

[0013] The patch block data is subjected to a two-level traversal process based on position and size, and the multidimensional temporal semantic features of the patch block data are represented by receptive field data to output receptive field data.

[0014] Optionally, the multidimensional temporal codec module reconstructs the receptive field data based on the Transformer model and obtains the output data of the Transformer model.

[0015] Optionally, the dual-layer anomaly detection module determines the receptive field loss at different granularities based on the reconstructed data, and determines the model loss based on the output data of the Transformer model. The receptive field loss and the model loss are weighted and calculated to obtain the anomaly score of the reconstructed data.

[0016] Furthermore, this invention also proposes a method for detecting anomalies in electricity meters based on multi-granularity dynamic sensing fields, comprising:

[0017] Based on the multi-granularity dynamic sensing field module, the patch block data of the electricity meter is traversed and processed to output sensing field data.

[0018] Based on the multi-dimensional temporal codec module, the receptive field data output by the multi-granularity dynamic receptive field module is reconstructed, and the reconstructed data is output.

[0019] Based on the dual-layer anomaly detection module, the anomaly score of the reconstructed data output by the multi-dimensional time-series codec module is calculated, and the anomaly of the electricity meter is determined based on the anomaly score.

[0020] Optionally, the method also includes:

[0021] Based on the multi-granularity dynamic sensing field module, multi-dimensional time-series data of the electricity meter is acquired. The multi-dimensional time-series data is standardized to obtain standardized data. The standardized data is then converted into patch block data using a window-patch strategy.

[0022] Optionally, the patch block data of the energy meter is traversed and processed based on the multi-granularity dynamic sensing field module to output sensing field data, including:

[0023] The patch block data is subjected to a two-level traversal process based on position and size, and the multidimensional temporal semantic features of the patch block data are represented by receptive field data to output receptive field data.

[0024] Optionally, the receptive field data can be reconstructed using a Transformer model based on a multidimensional temporal codec module, and the output data of the Transformer model can be obtained.

[0025] Optionally, based on the dual-layer anomaly detection module, the anomaly score of the reconstructed data output by the multi-dimensional temporal codec module is calculated, including:

[0026] Based on the reconstructed data, the receptive field loss at different granularities is determined, and the model loss is determined based on the output data of the Transformer model. The receptive field loss and the model loss are weighted and calculated to obtain the anomaly score of the reconstructed data.

[0027] In another aspect, the present invention also provides a computing device, comprising: one or more processors;

[0028] A processor is used to execute one or more programs;

[0029] When the one or more programs are executed by the one or more processors, the method described above is implemented.

[0030] In another aspect, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements the method described above.

[0031] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0032] This invention provides a system and method for detecting anomalies in electricity meters based on multi-granularity dynamic sensing fields. The system includes: a multi-granularity dynamic sensing field module for traversing patch data of the electricity meter to output sensing field data; a multi-dimensional time-series codec module for reconstructing the sensing field data output by the multi-granularity dynamic sensing field module to output reconstructed data; and a two-layer anomaly detection module for calculating anomaly scores in the reconstructed data output by the multi-dimensional time-series codec module, and determining anomalies in the electricity meter based on these anomaly scores. This invention, through sensing field and data reconstruction, can identify data anomalies and determine anomaly scores, and solves the problems of information loss or insufficient semantic feature mining that may occur in existing reconstruction methods when processing low-information-density multi-dimensional time-series data. Attached Figure Description

[0033] Figure 1 This is a structural diagram of the system of the present invention;

[0034] Figure 2 This is a framework diagram of the multi-dimensional timing codec module of the system of the present invention;

[0035] Figure 3 This is a framework diagram of the dual-layer anomaly detection module of the present invention;

[0036] Figure 4 This is a flowchart of the method of the present invention. Detailed Implementation

[0037] Exemplary embodiments of the invention will now be described with reference to the accompanying drawings. However, the invention may be embodied in many different forms and is not limited to the embodiments described herein. These embodiments are provided to fully and completely disclose the invention and to fully convey its scope to those skilled in the art. The terminology used in the exemplary embodiments illustrated in the drawings is not intended to limit the invention. In the drawings, the same units / elements are referred to by the same reference numerals.

[0038] Unless otherwise stated, the terms used herein (including technical terms) have their common meaning as understood by one of ordinary skill in the art. Furthermore, it is understood that terms defined in commonly used dictionaries should be understood to have a meaning consistent with the context of their relevant field, and not to be interpreted as having an idealized or overly formal meaning.

[0039] Example 1:

[0040] This invention proposes an anomaly detection system for electricity meters based on multi-granularity dynamic sensing fields, such as... Figure 1 As shown, it includes:

[0041] The multi-granularity dynamic sensing field module is used to traverse and process the patch block data of the electricity meter to output sensing field data.

[0042] The multi-dimensional temporal codec module is used to reconstruct the receptive field data output by the multi-granularity dynamic receptive field module and output the reconstructed data.

[0043] A dual-layer anomaly detection module is used to calculate the anomaly score of the reconstructed data output by the multi-dimensional time-series codec module, and to determine the anomaly of the electricity meter based on the anomaly score.

[0044] The multi-granularity dynamic receptive field module is also used for:

[0045] Acquire multidimensional time-series data from the electricity meter, standardize the multidimensional time-series data to obtain standardized data, and use a window-patch strategy to convert the standardized data into patch block data.

[0046] The multi-granularity dynamic sensing field module traverses and processes the patch block data of the energy meter to output sensing field data, including:

[0047] The patch block data is subjected to a two-level traversal process based on position and size, and the multidimensional temporal semantic features of the patch block data are represented by receptive field data to output receptive field data.

[0048] Among them, the multi-dimensional temporal codec module reconstructs the receptive field data based on the Transformer model and obtains the output data of the Transformer model.

[0049] The dual-layer anomaly detection module determines the receptive field loss at different granularities based on the reconstructed data, and determines the model loss based on the output data of the Transformer model. The receptive field loss and the model loss are weighted and calculated to obtain the anomaly score of the reconstructed data.

[0050] The present invention will be further described below with reference to specific embodiments:

[0051] This invention proposes a multi-granularity masking strategy to continuously mine semantic features from low to high levels in multi-dimensional time-series data, and designs a dynamic receptive field to address the information loss problem in existing mask reconstructions, thereby better learning the temporal dependencies and dimensional coupling relationships of the data. Furthermore, MGDRF designs hierarchical losses based on receptive fields and models. By constructing a low-level loss for each single-granularity receptive field, low-level or high-level time-series semantic features corresponding to that granularity are mined. The idea of ​​ensemble learning is introduced, and a high-level loss is constructed by fusing the reconstruction results of multi-granularity dynamic receptive fields to further learn the semantic interaction features between different granularities of time-series data. The method framework is as follows: Figure 1As shown, MGDRF can learn long sequences based on a multi-granularity dynamic receptive field module and provide rich contextual segment-level information representations through a feature processing module. By training the information representation using a two-layer anomaly detection method, semantic information of different granularities can be obtained, thereby improving the model's anomaly detection capability.

[0052] This invention mainly includes a multi-granularity dynamic receptive field module, a multi-dimensional temporal encoder / decoder module, and a two-layer anomaly detection module. First, the standardized input data is transformed into patch blocks using a window-patch strategy, obtaining the input to the multi-granularity receptive field module. Second, by performing a two-layer traversal based on position and size on the temporal patch data, the rich semantic features of the multi-dimensional temporal sequence can be represented using receptive field data of different granularities. Then, this data is input to the multi-dimensional temporal encoder / decoder module, which reconstructs the receptive field data based on the Transformer model, and obtains the receptive field reconstruction output and model output based on the two-layer anomaly detection module. Finally, the data anomaly score is obtained by weighting the receptive field losses of different granularities with the final ensemble learning model loss.

[0053] Multi-granular dynamic receptive field module:

[0054] In this section, the present invention aims to design an effective unsupervised method for detecting temporal anomalies in time series data. Inspired by the field of natural language processing, each data point (i.e., a word in a sentence) in natural language, as an artificially generated signal, possesses rich semantics and is suitable as a data unit for model input. Conversely, time series data has a lower semantic density, with each isolated data point providing less semantic information. Temporal semantics only emerge when we observe at least segment-level data. Furthermore, for time series data, its feature information is distributed across a relatively long sequence of data. For example, a traffic system records data every five seconds; to understand the daily periodicity, this requires a complete periodic time slice of at least 288 consecutive time points. Although downsampling (lower frequency sampling) is a possible solution, it inevitably results in information loss. Based on this, the present invention designs a window-patch strategy and a patch-window strategy, dividing the entire large time window into different patches and using patch masks to perform in-depth mining of the time series data.

[0055] like Figure 1 As shown in the multi-granularity dynamic receptive field module, the input of the module is an M*T dimensional window. The algorithm first transforms the window into a patch using a window-patch strategy before performing data copying and mask design. For the original input temporal window x∈R T×MMGDRF sets a relatively long data input window (i.e., a large T). Although a long time series window increases model complexity, MGDRF mitigates this by stacking attention blocks and fixing model parameters to reduce computational and memory overhead. Let x∈R M×T If the time sequence is divided into P patches, then the time sequence patch x = {x1,...,x} can be obtained. p ,...,x P}, where x p ∈R M×T / p MGDRF first segments each patch in its window-patch strategy using segmented embedding:

[0056] EM p =E L x p E+E p (pos) (1)

[0057] Among them, E L ∈R L×M With E∈R T / p×1 The initial embedding representation of length L obtained by projecting each segment through a linear layer, E p (pos) It is the EM obtained by summing the learnable positional codes for different positional segments. p Let EM be the final embedding representation corresponding to the segment at position p. Then we have EM = {EM1, ..., EM}. p ,...,EM P}=Embedding{x1,...,x p ,...,x P}, EM∈R P×L That is, there are P patches, and the length of each patch vector is L.

[0058] Furthermore, patch size significantly impacts model learning. A small patch mask allows for simple prediction by the model, causing training to focus only on low-level information. Conversely, a large patch mask increases the difficulty of model reconstruction; to achieve smaller reconstruction errors, a larger patch mask task forces the model to delve deeper into the temporal dependencies within time series data sequences and the dimensional correlations between sequences. However, excessively large patch masks learn too little data information, potentially hindering effective model learning. Therefore, this invention designs a multi-granularity masking strategy to mine semantic information from low to high levels in time series data, enabling interactive learning of multidimensional time series data, such as... Figure 1The lower half is shown. Furthermore, fixed-position masks lead to information loss in the input data, while random-position masks introduce randomness and uncertainty into the model, making it impossible to achieve consistency between training and testing (because training can use multiple random-position masks to reduce input information loss, but testing only requires one mask). To fully exploit the rich temporal dependencies and feature coupling relationships in multi-dimensional time-series data, and to reduce the randomness of the model while maintaining consistency between training and testing, this invention designs a dynamic receptive field for the mask position.

[0059] Therefore, for the embedded representation EM, a mask ratio m is introduced. p Get the receptive field output DRF i :

[0060] DRF i =EM p ×(1-m p ), i={2,3,...,P-1}, i+p=P(2)

[0061] That is, the mask ratio m p The larger the sensory field, the greater the DRF. i The smaller the mask size, the less information the model can receive. In this case, to obtain a smaller loss, the model will tend to learn higher-level semantic features of sequence trend changes. This creates a relatively challenging self-supervised task for the model, forcing it to enhance its overall understanding of time-series data. Similarly, the mask size m... p The smaller the size, the better the sensed wild DRF. i The larger the size, the more information the model receives, such as... Figure 1 As shown in DRF7, the model learns representations of the rich temporal dependencies and dimensional correlations of time series data. At this point, MGDRF can learn relatively rich detailed feature representations.

[0062] For different DRFs i The input model can be trained in parallel by feeding it into the encoder-decoder structure, thus reducing overhead, because each receptive field DRF i Each model is trained individually, and ensemble learning is used to select the most effective model scheme for the corresponding dataset during the final output. Furthermore, the receptive field design based on mask ratio results in some information loss compared to the original dataset, which to some extent reduces the length of the time-series data. Therefore, MGDRF introduces a receptive step k to implement dynamic single-step masking for each input, thereby further enabling dynamic model perception, such as... Figure 1 Each DRF i The various data variations are shown. Specifically, for DRF... iIts dynamic receptive field copies the input data i-1 times and masks the i patches (excluding the first and last ones) to obtain the DRF. i,k The white patch in the image is the mask portion. Each dynamic receptive field (DRF) i,k This means that for p patches, the model obtains a receptive field of i patches, where pi patches are masked portions, and the mask position is the k-th position. It's important to note that each DRF... i,k All of these are data after input window patching and masking, not k dimensions.

[0063] but:

[0064] DRF i,k =EM p ×(1-m p,k ),p={1,3,...,P-2},i+p=P,k=2,3,...,P-2(3)

[0065] Where p is the mask size and k is the mask position, if P = 8, p = 1, k = 2, then i = Pp = 7, DRF 7,2 This means that only one (p) patch is blocked, and the blocked position is the second (kth) patch.

[0066] Multi-dimensional timing codec module:

[0067] After obtaining the different receptive field inputs for each window, the MGDRF method can be trained based on various feature processing networks. Due to the widespread application and excellent performance of Transformer in natural language processing, image processing, and multidimensional temporal data, MGDRF utilizes Transformer to achieve feature processing of multidimensional temporal data, such as… Figure 2 As shown.

[0068] For single-granularity masking strategies, MGDRF performs explicit mining of temporal dependencies and implicit analysis of dimensional correlations among different dynamic receptive fields. The model encoder is designed to model historical information from multidimensional time-series data, including L... en One Tranformer layer. For each model input DRF... i,k =X 0 If the encoder input is X 0 en ∈R P×L The details of the l-th encoder layer are as follows:

[0069]

[0070] Similarly, the model decoder also includes L deThe details of the l-th Tranformer layer and the l-th decoder layer are as follows:

[0071]

[0072] in, In the encoder, given the input of the Transformer Layer as X l ∈R P×L H is the number of heads, d l =[M / H] represents the dimensions of the query, key, and value in each header. The h-th self-attention header calculates the attention weights between time points to extract semantic information from the time-series data:

[0073]

[0074] Among them, W h Q W h K W h V ∈R L×dl express Figure 2 The three linear projectors in the Multi-Head Attention module, Q h K h V h ∈R P×dl These represent the query, key, and value, respectively. h ∈R L×L Z represents the attention weights between time points within the input window. h ∈R L×dl This represents the output of the self-attention head at time h. As shown in Equation 2, the outputs of the H self-attention heads are concatenated and then passed through a linear projector W. Z ∈R Hdl×P By projecting, we can obtain the output Z∈R of the multi-head attention Attn(·). P×L :

[0075] Z = Concat(Z1, ..., Z) h ,…,Z H W Z (7)

[0076] The above expression is obtained after decoding by a decoder. That is, DRF i,k The encoding and decoding output DRF′ i,k .

[0077] Dual-layer anomaly detection module:

[0078] Because the model's performance varies with different receptive field sizes, the weighted ensemble learning approach based on MLP layers is not suitable for the existing MGDRF design. Furthermore, most current multidimensional temporal anomaly detection methods rely on the overall reconstruction error of the input and output to determine subsequent positive anomaly state labels, meaning the model cannot learn different levels of data features during training based on the loss. Therefore, this invention designs a hierarchical loss module, incorporating both receptive field-based and model-based hierarchical loss designs.

[0079] like Figure 3 As shown, the dual-layer anomaly detection module mainly consists of two aspects:

[0080] MGDRF constructs the underlying loss for each individual receptive field to mine low-level or high-level temporal series semantic features corresponding to that granularity. For each changing dynamic receptive field, DRF... i,k The codec obtains the reconstructed output DRF. i, ′ k At this point, the loss of the dynamic receptive field can be calculated as:

[0081] Loss i,k =|DRF i,k -DRF′ i,k | (8)

[0082] Where i = {2, 3, ..., P-1}, k = {2, 3, ..., P-2}. Since each input to the dynamic receptive field is the result of data replication and processing, MGDRF performs weighted calculations on the loss for receptive fields under different dynamic variations k, thus obtaining the first-level loss based on the receptive field:

[0083] Loss i =weightedMean(Loss i,k ), k=2,3,...,P-2 (9)

[0084] At this point, for each of the i receptive field models, there is a corresponding input-output detail representation loss. i The first stage of model training is based on Loss. i Perform parallel training of i receptive field models and obtain the DRF output of the receptive field models. i ′.

[0085] 2) Introducing the concept of ensemble learning, MGDRF constructs a high-level loss by fusing the reconstruction results of multi-granularity dynamic receptive fields, further learning the semantic interaction features between different granularities of temporal data. That is, for each multi-granularity receptive field DRF... i The first training phase yields the model output DRF. iAt this point, MGDRF integrates the losses from multiple receptive fields. Because this invention incorporates a large masked receptive field (only the first or last patch is visible) during the receptive field construction process to maintain model balance, traditional weighted ensembles would be significantly affected by this large masked receptive field. Therefore, the model output can be obtained as x' = Ensemble(weightedMean(DRF')). i The model loss in the second stage is:

[0086] Loss = λLoss i +(1-λ)|xx′| (10)

[0087] Where x is the multidimensional time-series input data window, x' represents the model's integrated output value for the input data, and λ is a preset hyperparameter, usually 0. However, considering the preservation of detailed features during training, the hyperparameter λ is appropriately increased to around 0.2. The final output anomaly score is:

[0088]

[0089] Where N is the number of features in the dataset. Based on the above model input-output loss, the ensemble learning selector can choose the mask ratio and training model with a certain advantage from multiple mask training models. The pseudocode for model training is shown in Algorithm 1.

[0090]

[0091] In the technical solution of this invention, addressing the issues of information loss or insufficient semantic feature mining that may occur in existing reconstruction methods when processing low-information-density multidimensional time-series data, a multidimensional time-series anomaly detection method based on multi-granularity dynamic receptive fields (MGDRF) is proposed. This algorithm can learn the high-level semantic features of the ground truth of time-series data better than existing methods. Specifically, MGDRF proposes a multi-granularity masking strategy to continuously mine the semantic features of multidimensional time-series data from low to high levels, and designs dynamic receptive fields to solve the information loss problem of existing mask reconstruction, thereby better learning the temporal dependencies and dimensional coupling relationships of the data. In addition, MGDRF designs hierarchical losses based on receptive fields and models. By constructing a low-level loss for each single-granularity receptive field, low-level or high-level time-series semantic features corresponding to the granularity are mined. Furthermore, the idea of ​​ensemble learning is introduced, and a high-level loss is constructed by fusing the reconstruction results of multi-granularity dynamic receptive fields to further learn the semantic interaction features between different granularities of time-series data.

[0092] The invention was compared with 16 more advanced models on a real dataset of smart meters, which confirmed the effectiveness and advancement of the invention.

[0093] This invention selects AUC, Fc1, and F1PA%K as evaluation metrics to verify the performance of the proposed method and the baseline model.

[0094] AUC (Area Under Curve) is one of the most commonly used methods for evaluating unsupervised anomaly detection tasks. The AUC evaluation metric primarily calculates the area under the ROC (Receiver Operating Characteristic) curve, ranging from 0 to 1. A perfect dataset will result in an AUC of 1, while random data will produce an AUC value close to 0.5. Compared to traditional evaluation metrics, the advantage of AUC is that it is not affected by threshold settings. However, AUC only reflects the number of time points where the method correctly detects anomalies; a high AUC does not necessarily mean that the method accurately detects all anomaly segments.

[0095] F c1 (Composite F-score). F c1 It is a metric proposed in recent literature for time series anomaly detection tasks. Unlike AUC, F... c1 The advantage of this indicator is that it can fully reflect all correctly detected anomalies in a multi-dimensional time series, with a focus on the algorithm's ability to detect anomalous events. c1 The metrics require calculating recall during outlier time periods and precision at specific time steps, thus avoiding the overestimation of some algorithm performance by point-adjustment strategies. Models with higher recall during outlier periods and lower false positive rates at specific time steps yield the F-value. c1 The ratings are relatively high.

[0096] F1 PA%K (Point Adjustment % K). Similarly, we propose F1. PA%K This addresses the overestimation of model performance caused by point adjustment. It calculates a point-level F1 score, but performs point adjustments when the proportion of outliers detected by the model in consecutive outlier segments exceeds K%. To reduce dependence on the parameter K, the F1 score is... PA%K F1 can be adaptively calculated by adjusting the size of K. PA%K The area under the curve.

[0097] Comparison method:

[0098] The baseline comparison methods used in this experiment are currently influential mainstream methods, as shown in Table 1. These methods belong to different categories, including some classic methods: LOF, OCSVM, and iForest. Reconstruction-based algorithms: InterFusion. Generative adversarial models: BeatGAN, USAD. Models focusing on dimensional or temporal analysis: GDN, GTA, and MSCRED. The former two use graph structures to learn the relationships and couplings between different sensors, thus achieving robust dimensional correlation analysis of multivariate time series data. MSCRED utilizes Long Short-Term Memory (LSTM) networks and attention mechanisms to analyze the data. The latest temporal anomaly detection algorithms: TranAD and AT. The former builds a Transformer-based anomaly detection model based on an adaptive and adversarial training process. AT designs a method based on prior and sequence correlation based on attention mechanisms, and performs anomaly detection according to different correlation differences in positive anomalous states. Multidimensional temporal anomaly detection reconstruction methods: CAE-AD, RAE, TSMAE, MOUT. CAE-AD is a contrastive learning-based method used for implicit analysis of noise or anomalies, while the following three methods explicitly design modules for noise analysis. The mask reconstruction algorithm, ImDiffusion, implements unconditional generation time interpolation based on a diffusion model, and uses the mask reconstruction interpolation error for anomaly detection.

[0099] Table 1

[0100]

[0101] This invention uses the Adam optimizer for training with an initial learning rate of 1e-4 and a batch size of 16. The sliding window size and time step for the time-series data are 240, with 8 patches. The original training data is divided into training and validation sets in an 8:2 ratio. During training, the learning rate is halved if the loss on the validation set does not decrease within 3 epochs, and early stopping is triggered if the loss on the validation set does not decrease within 6 epochs. As for the baseline models, their hyperparameters and detection thresholds are set based on information provided in their respective original papers. Grid search is performed to determine optimal values ​​where these details are not explicitly mentioned. All experiments are repeated five times under different random seeds, and their average results are reported.

[0102] Actual electricity meter dataset:

[0103] The specific characteristics of the smart meter dataset (ELE) are shown in Table 2. This dataset was collected from nine three-phase meters in multiple transformer substations. Each device includes 22 sensor values: current (phase A, phase B, phase C), voltage (phase A, phase B, phase C), energy reading (positive active), energy reading (reverse active), energy reading (positive reactive), energy reading (reverse reactive), active power (phase A, phase B, phase C, total), reactive power (phase A, phase B, phase C, total), and power factor (phase A, phase B, phase C, total).

[0104] Table 2

[0105]

[0106] These smart meters exhibited various anomalies during their respective data recording periods, including reverse power flow, current loss, meter reversal, meter flying away, uneven meter readings, meter terminal block issues, and power differential anomalies. The dataset contains data collected daily at 96 sampling points from each physical meter device over 9-16 months. The experiment used data containing only normal data for training and data including anomalies for testing. Furthermore, the actual meter dataset includes nine complete physical devices, and the dataset exhibits varying data sizes and uneven anomaly proportions across different devices.

[0107] Evaluation of results on actual datasets:

[0108] To verify the universality of the proposed model, the performance of the proposed model was evaluated and analyzed on a real-world electricity meter dataset. The comparative experimental results are shown in Table 3. The table presents the AUC and F-values ​​of the proposed MGDRF and the baseline method. c1 F1 PA%K Three performance metrics are presented. All results shown in the table are averages obtained from five individual runs, allowing the study to assess the robustness of each baseline method. Furthermore, the best-performing method is highlighted in bold, while the second-best-performing method is indicated by underline.

[0109] It is worth noting that MGDRF performed excellently across all evaluation metrics, achieving an AUC of 0.6409 and an F-value of 0.3797. c1 The score and F1 score of 0.4302 PA%K The analysis revealed that MGDRF's AUC was 17.60% higher than the average results of other baseline methods, indicating that MGDRF has high accuracy in detecting outliers and is less affected by data uncertainty. Similarly, in F... c1In terms of score, MGDRF improved performance by 40.60% compared to the baseline method, demonstrating its high recall and high accuracy for detecting anomalous time periods. In F1... PA%K In terms of score, MGDRF improved by 48.84%, indicating that the MGDRF algorithm also has a high level of accuracy in detecting anomalies in time periods. The high performance of the above three indicators also confirms the superiority and applicability of the MGDRF algorithm in the task of anomaly detection in multidimensional time series data.

[0110] As shown in Table 2, the ELE dataset has a relatively high anomaly rate and a rich variety of anomaly types. Therefore, the excellent performance of MGDRF on the actual electricity meter dataset demonstrates that the algorithm's multi-granularity dynamic receptive field module can effectively detect anomaly segments in different regions, thus adapting to the impact of different anomalies on the model. Furthermore, since ELE is multi-dimensional time-series data collected from actual smart three-phase electricity meters, its features consist of multiple monitored quantities such as voltage, current, and power distributed in different parts of the system. Therefore, its features are all continuous quantities, and there are strong inter-correlation relationships between data dimensions. Thus, MGDRF's excellent performance on this dataset indicates its ability to learn dimensional correlations effectively. Overall, the MGDRF multi-granularity dynamic receptive field model based on Transformer can fully capture high-level semantic information of time series, hence its excellent performance on the ELE dataset. Comparative experimental results on the actual electricity meter dataset are shown in Table 3.

[0111] Table 3

[0112]

[0113]

[0114] Example 2:

[0115] This invention also proposes a method for detecting anomalies in electricity meters based on multi-granularity dynamic sensing fields, such as... Figure 4 As shown, it includes:

[0116] Step 1: Based on the multi-granularity dynamic sensing field module, the patch block data of the electricity meter is traversed and processed to output the sensing field data.

[0117] Step 2: Based on the multi-dimensional temporal codec module, reconstruct the receptive field data output by the multi-granularity dynamic receptive field module and output the reconstructed data;

[0118] Step 3: Based on the dual-layer anomaly detection module, calculate the anomaly score of the reconstructed data output by the multi-dimensional time sequence codec module, and determine the anomaly of the electricity meter based on the anomaly score.

[0119] The methods also include:

[0120] Based on the multi-granularity dynamic sensing field module, multi-dimensional time-series data of the electricity meter is acquired. The multi-dimensional time-series data is standardized to obtain standardized data. The standardized data is then converted into patch block data using a window-patch strategy.

[0121] Specifically, the patch block data of the energy meter is traversed and processed based on the multi-granularity dynamic sensing field module to output sensing field data, including:

[0122] The patch block data is subjected to a two-level traversal process based on position and size, and the multidimensional temporal semantic features of the patch block data are represented by receptive field data to output receptive field data.

[0123] Among them, the Transformer model based on the multi-dimensional temporal codec module reconstructs the receptive field data and obtains the output data of the Transformer model.

[0124] Specifically, based on the dual-layer anomaly detection module, the anomaly score of the reconstructed data output by the multi-dimensional temporal codec module is calculated, including:

[0125] Based on the reconstructed data, the receptive field loss at different granularities is determined, and the model loss is determined based on the output data of the Transformer model. The receptive field loss and the model loss are weighted and calculated to obtain the anomaly score of the reconstructed data.

[0126] This invention identifies data anomalies through receptive field and data reconstruction, thereby determining anomaly scores, and solves the problems of information loss or insufficient semantic feature mining that may occur in existing reconstruction methods when processing multidimensional time-series data with low information density.

[0127] Example 3:

[0128] Based on the same inventive concept, this invention also provides a computer device, which includes a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in the computer storage medium to implement corresponding method flows or corresponding functions, thereby implementing the steps of the methods in the above embodiments.

[0129] Example 4:

[0130] Based on the same inventive concept, this invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the steps of the method in the above embodiments.

[0131] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present invention can be implemented using various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0132] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0133] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0134] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0135] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0136] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A power meter anomaly detection system based on multi-granularity dynamic sensing field, characterized in that, include: The multi-granularity dynamic sensing field module is used to acquire multi-dimensional time-series data from the electricity meter, standardize the multi-dimensional time-series data to obtain standardized data, and use a window-patch strategy to convert the standardized data into patch block data. The multidimensional time-series data consists of multiple voltage, current, and power values ​​distributed across different parts of the system. A multi-granularity masking strategy is used to traverse the patch block data based on mask position and size, and the multidimensional time-series semantic features of the patch block data are represented using receptive field data to output receptive field data. Specifically, the window-patch strategy divides the time window into different patches and uses patch masks to deeply mine the time-series data. The multi-granularity masking strategy mines semantic information from low to high levels in the time-series data, enabling interactive learning of the multidimensional time-series data. By setting different mask ratios, dynamic receptive fields corresponding to different receptive field sizes are generated. The multi-dimensional temporal codec module is used to reconstruct the receptive field data output by the multi-granularity dynamic receptive field module based on the Transformer model, and output the reconstructed data. The dual-layer anomaly detection module is used to construct a receptive field loss for each single-granularity receptive field, and mine low-level or high-level time series semantic features corresponding to the granularity; it constructs a model loss by introducing ensemble learning to fuse the reconstruction results of multi-granularity dynamic receptive fields, and further learns the semantic interaction features between different granularities of time series data; and calculates the anomaly score of the reconstructed data based on the receptive field loss and the model loss, and determines the anomaly of the electricity meter based on the anomaly score.

2. A method for detecting anomalies in electricity meters based on multi-granularity dynamic sensing fields, characterized in that, include: Based on the multi-granularity dynamic sensing field module, multi-dimensional time-series data of the electricity meter is acquired. The multi-dimensional time-series data is standardized to obtain standardized data. The standardized data is then converted into patch block data using a window-patch strategy. The multidimensional time-series data consists of multiple voltage, current, and power values ​​distributed across different parts of the system. A multi-granularity masking strategy is used to traverse the patch block data based on mask position and size, and the multidimensional time-series semantic features of the patch block data are represented using receptive field data to output receptive field data. Specifically, the window-patch strategy divides the time window into different patches and uses patch masks to deeply mine the time-series data. The multi-granularity masking strategy mines semantic information from low to high levels in the time-series data, enabling interactive learning of the multidimensional time-series data. By setting different mask ratios, dynamic receptive fields corresponding to different receptive field sizes are generated. Based on the multi-dimensional temporal codec module, the receptive field data output by the multi-granularity dynamic receptive field module is reconstructed based on the Transformer model, and the reconstructed data is output. Based on the dual-layer anomaly detection module, a receptive field loss is constructed for each single-granularity receptive field to mine low-level or high-level time series semantic features corresponding to the granularity; by introducing ensemble learning to fuse the reconstruction results of multi-granularity dynamic receptive fields, a model loss is constructed to further learn the semantic interaction features between different granularities of time series data; and based on the receptive field loss and model loss, anomaly scores of the reconstructed data are calculated, and anomalies of the electricity meter are determined based on the anomaly scores.

3. A computer device, characterized in that, include: One or more processors; A processor is used to execute one or more programs; When the one or more programs are executed by the one or more processors, the method of claim 2 is implemented.

4. A computer-readable storage medium, characterized in that, It contains a computer program, which, when executed, implements the method as described in claim 2.