Power consumption data anomaly detection method and device, electronic equipment and storage medium

By constructing a dynamic heterogeneous network and expanding anomaly samples, the problem of scarcity of abnormal samples in the prior art is solved, and the accuracy of the abnormal detection model of electricity consumption data is improved.

CN120217075APending Publication Date: 2025-06-27BIG DATA & INFORMATION TECH RES INST OF WENZHOU UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510204783.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-24
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

In the prior art, anomaly samples are scarce in reality, resulting in the low proportion of abnormal samples in the training data, which in turn affects the accuracy of model detection.

Method used

By obtaining the power consumption data of power users, building a dynamic heterogeneous network, extracting node characteristics, and performing similarity calculations and groupings, a set of similar groups is obtained. Then, each similar group is extracted to obtain the dynamic behavior characteristics of the power user, expand the abnormal samples, and form a comprehensive abnormal samples set to train the preset abnormal detection model.

Benefits of technology

The ratio of abnormal samples is improved, the accuracy of the preset abnormal detection model is enhanced, and abnormal detection of electricity consumption data can be more efficiently.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120217075A_ABST
    Figure CN120217075A_ABST
Patent Text Reader

Abstract

The invention relates to a power consumption data anomaly detection method and device, electronic equipment and a storage medium, and the method comprises the steps: carrying out the node feature extraction and decomposition and similarity calculation and grouping of a dynamic heterogeneous network constructed by power consumption data, and obtaining a similar group set; performing feature extraction on each similar group in the similar group set to obtain a dynamic behavior feature of each power user; the abnormal samples are expanded according to the dynamic behavior characteristics, and a comprehensive abnormal sample set is obtained; after a preset anomaly detection model is trained according to the comprehensive anomaly sample set, anomaly detection is carried out on the to-be-detected set, and an anomaly detection result is obtained; according to the method, the similarity is calculated through the power consumption data of the user, so that the dynamic behavior characteristics are obtained, the abnormal samples are expanded, the proportion of the abnormal samples is increased, training and abnormal detection are performed on the preset abnormal detection model according to the expanded comprehensive abnormal sample set, and the accuracy of the preset abnormal detection model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of anomaly detection, and in particular, to a method, device, electronic device and storage medium for detecting abnormal power consumption data. Background Art

[0002] Anomaly detection refers to identifying deviant data that is inconsistent with normal data patterns, also known as outliers. This technology has been widely applied in multiple fields such as video surveillance, network security, credit fraud detection, power systems, and healthcare. In the power industry, the improvement of the informatization level has led to a surge in the amount of data generated by power equipment. Due to equipment failures, communication interruptions, grid fluctuations, and abnormal user behaviors, a large amount of abnormal data has been generated. Researching and applying anomaly detection algorithms is of great significance for data accuracy and event information mining in smart grids, and helps to improve the stability and security of power systems. The existing methods for detecting abnormal power consumption behaviors can be mainly divided into three categories, namely, those implemented based on statistical models, classification, and clustering. They usually focus on time series analysis of individual user behaviors, machine learning models, and static graph structure analysis. Common technologies such as autoregressive models (AR), support vector machines (SVM), and neural networks have been widely used in prediction and detection.

[0003] Traditional anomaly node detection usually relies on a large amount of data to train a model to identify abnormal patterns and distinguish abnormal and normal nodes. However, abnormal nodes are relatively scarce in reality, resulting in an overly low proportion of abnormal samples in the training data, which in turn affects the accuracy of the model and makes the model tend to identify normal nodes. Although some methods attempt to use unlabeled data to alleviate this problem, the abnormal samples are still insufficient.

[0004] Therefore, there is an urgent need to propose a method, device, electronic device and storage medium for detecting abnormal power consumption data to solve the technical problem in the prior art that abnormal samples are relatively scarce in reality, resulting in an overly low proportion of abnormal samples in the training data, which in turn affects the accuracy of model detection. Summary of the Invention

[0005] In view of this, it is necessary to provide a method, device, electronic device and storage medium for detecting abnormal power consumption data to solve the technical problem in the prior art that abnormal samples are relatively scarce in reality, resulting in an overly low proportion of abnormal samples in the training data, which in turn affects the accuracy of model detection.

[0006] To solve the above problems, the present invention provides a method for detecting abnormal power consumption data, including: Obtaining the power consumption data of power users within a preset time period, and constructing a dynamic heterogeneous network according to the power consumption data; the preset time period includes the current moment; Extract and decompose the node features of the dynamic heterogeneous network to obtain the low-dimensional matrices of all nodes, and calculate the similarity and group each node according to the low-dimensional matrices to obtain a set of similarity groups; Extract the features of each similarity group in the set of similarity groups to obtain the dynamic behavior features of each power user; Augment the abnormal samples according to the dynamic behavior features to obtain a comprehensive set of abnormal samples; the comprehensive set of abnormal samples includes a set to be detected composed of the feature data of each power user at the current moment; After training a preset anomaly detection model according to the comprehensive set of abnormal samples, perform anomaly detection on the set to be detected to obtain an anomaly detection result.

[0007] In a possible implementation manner, the extracting and decomposing the node features of the dynamic heterogeneous network to obtain the low-dimensional matrices of all nodes, and calculating the similarity and grouping each node according to the low-dimensional matrices to obtain a set of similarity groups includes: Extract the node feature information of the dynamic heterogeneous network according to the graph convolutional network to obtain the feature matrices of all nodes; Decompose the feature matrix according to non-negative matrix factorization to obtain low-dimensional matrices; the low-dimensional matrices include node low-dimensional matrices and semantic low-dimensional matrices.

[0008] In a possible implementation manner, the calculating the similarity and grouping each node according to the low-dimensional matrices to obtain a set of similarity groups includes: Calculate the similarity of the row vectors of each node in the node low-dimensional matrix and the semantic low-dimensional matrix to obtain the similarity values between the nodes; Group the nodes with similarity values higher than the similarity threshold according to the non-linear mapping to obtain a set of similarity groups.

[0009] In a possible implementation manner, the extracting the features of each similarity group in the set of similarity groups to obtain the dynamic behavior features of each power user includes: Extract the feature differences of each node at adjacent moments in each similarity group based on a preset time sliding window to obtain the node local features of each node; Obtain the dynamic behavior features of each power user according to the behavior differences of all node local features in each similarity group.

[0010] In a possible implementation manner, the augmenting the abnormal samples according to the dynamic behavior features to obtain a comprehensive set of abnormal samples includes: Set a generation module corresponding to each time point; Determine the abnormal behavior characteristics corresponding to each time point according to the dynamic behavior characteristics of all power users at different time points; Input the abnormal behavior characteristics of each time point into the corresponding generation module for expansion to obtain the initial abnormal sample set of each time point; Merge all the initial abnormal sample sets at different time points to obtain a comprehensive abnormal sample set.

[0011] In a possible implementation manner, the preset abnormal detection model includes a multi-task detector; after expanding the abnormal samples according to the dynamic behavior characteristics to obtain a comprehensive abnormal sample set, it further includes: Classify the comprehensive abnormal sample set according to a preset ratio to obtain a training set and a validation set; Construct training tasks corresponding to each time point according to the multi-task detector and the different time points in the training set; Train the preset abnormal detection model according to the training set, the validation set, and all training tasks to obtain the trained preset abnormal detection model.

[0012] In a possible implementation manner, the step of training the preset abnormal detection model according to the training set, the validation set, and all training tasks to obtain the trained preset abnormal detection model includes: Input the training set into the preset abnormal detection model for cyclic training according to each training task respectively, and update the execution parameters of the preset abnormal detection model when each training task is replaced. When all training tasks are trained, obtain the trained preset abnormal detection model.

[0013] On the other hand, the present invention also provides an abnormal detection device for electricity consumption data, including: A data acquisition module, configured to acquire the electricity consumption data of power users within a preset time period, and construct a dynamic heterogeneous network according to the electricity consumption data; the preset time period includes the current moment; A set determination module, configured to perform node feature extraction and decomposition on the dynamic heterogeneous network to obtain low-dimensional matrices of all nodes, and calculate the similarity and group each node according to the low-dimensional matrices to obtain a set of similarity groups; A feature extraction module, configured to extract features from each similarity group in the set of similarity groups to obtain the dynamic behavior characteristics of each power user; A sample expansion module, configured to expand abnormal samples according to the dynamic behavior characteristics to obtain a comprehensive abnormal sample set; the comprehensive abnormal sample set includes a set to be detected composed of the feature data of each power user at the current moment; An anomaly detection module, which is used to perform anomaly detection on the set to be detected after training a preset anomaly detection model according to the comprehensive anomaly sample set, so as to obtain an anomaly detection result.

[0014] On the other hand, an embodiment of the present invention discloses an electronic device, including: a processor, a memory, and a computer program stored on the memory and capable of running on the processor. When the computer program is executed by the processor, each step of the above-mentioned embodiment of the power consumption data anomaly detection method is implemented.

[0015] On the other hand, an embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each step of the above-mentioned embodiment of the power consumption data anomaly detection method is implemented.

[0016] The beneficial effects of the present invention are as follows: obtaining the power consumption data of power users within a preset time period, and constructing a dynamic heterogeneous network according to the power consumption data; the preset time period includes the current moment; performing node feature extraction and decomposition on the dynamic heterogeneous network to obtain low-dimensional matrices of all nodes, and calculating the similarity and grouping each node according to the low-dimensional matrices to obtain a set of similarity groups; performing feature extraction on each similarity group in the set of similarity groups to obtain the dynamic behavior characteristics of each power user; expanding the anomaly samples according to the dynamic behavior characteristics to obtain a comprehensive anomaly sample set; the comprehensive anomaly sample set includes a set to be detected composed of feature data of each power user at the current moment; performing anomaly detection on the set to be detected after training a preset anomaly detection model according to the comprehensive anomaly sample set to obtain an anomaly detection result; the present invention can calculate the similarity through the power consumption data of users, so as to obtain dynamic behavior characteristics, and then can expand the anomaly samples according to the dynamic behavior characteristics, improve the proportion of anomaly samples, and then train and perform anomaly detection on a preset anomaly detection model according to the expanded comprehensive anomaly sample set, improving the accuracy of the preset anomaly detection model. Description of the Drawings

[0017] Figure 1 It is a schematic flowchart of an embodiment of the power consumption data anomaly detection method provided by the present invention; Figure 2 It is a schematic flowchart of an embodiment of determining the set of similarity groups provided by the present invention; Figure 3 For the present invention Figure 1 It is a schematic flowchart of an embodiment of step S104 in the present invention; Figure 4 For the present invention Figure 1 It is a schematic flowchart of an embodiment after step S104 in the present invention; Figure 5Schematic structural diagram of an embodiment of the overall abnormal power consumption data detection provided by the present invention; Figure 6 Schematic structural diagram of an embodiment of the abnormal power consumption data detection device provided by the present invention; Figure 7 Schematic structural diagram of an embodiment of the electronic device provided by the present invention. Detailed implementation manners

[0018] The following will specifically describe the preferred embodiments of the present invention in conjunction with the accompanying drawings. The accompanying drawings form a part of this application and are used together with the embodiments of the present invention to explain the principles of the present invention, rather than to limit the scope of the present invention.

[0019] As Figure 1 shown, a specific embodiment of the present invention discloses a method for detecting abnormal power consumption data, including: S101. Obtain the power consumption data of power users within a preset time period, and construct a dynamic heterogeneous network according to the power consumption data; the preset time period includes the current moment; S102. Extract and decompose the node features of the dynamic heterogeneous network to obtain the low-dimensional matrices of all nodes, and calculate the similarity and group the nodes according to the low-dimensional matrices to obtain a set of similarity groups; S103. Extract features for each similarity group in the set of similarity groups to obtain the dynamic behavior features of each power user; S104. Expand the abnormal samples according to the dynamic behavior features to obtain a comprehensive set of abnormal samples; the comprehensive set of abnormal samples includes a set to be detected composed of the feature data of each power user at the current moment; S105. After training a preset abnormal detection model according to the comprehensive set of abnormal samples, perform abnormal detection on the set to be detected to obtain an abnormal detection result.

[0020] It should be understood that the method for obtaining the power consumption data in step S101 can be to obtain a power consumption data set according to a power consumption acquisition device, or to call a historically stored power consumption data set from a storage medium. It can be applied to a power grid system, which can be a software system running on a terminal device. The terminal device can be a server, a tablet computer, a vehicle-mounted device, an Augmented Reality (AR) / Virtual Reality (VR) device, a laptop computer, an Ultra-Mobile Personal Computer (UMPC), a netbook, a Personal Digital Assistant (PDA), a mobile phone, or other terminal devices. The specific type of the terminal device is not limited in the embodiments of the present application. The power consumption data of power users in a certain period in the database of a provincial power grid system can be obtained. The power grid system can include a sample expansion module and a model training module. The sample expansion module can be configured to perform feature extraction on the collected power consumption data based on a Graph Convolutional Network (GCN) and Non-Negative Matrix Factorization (NNMF), generate abnormal samples at different times based on a multi-moment abnormal simulator, and form a comprehensive abnormal sample set containing various features to meet the requirements of quantity and diversity. The model training module can be configured to perform training processing on a preset abnormal detection model based on a multi-task detector and the expanded data in the comprehensive abnormal sample set, and perform abnormal prediction on the power consumption data at the current moment through the trained preset abnormal detection model, so as to detect the abnormality of the power consumption data.

[0021] In a specific embodiment of the present invention, the obtained power consumption data of power users within a preset time period may include historical power consumption data or power consumption data at the current moment. For example, the power consumption data is collected once per hour, and 24 time points are collected every day to monitor the power consumption data in real time. Among them, power users may include normal users and some abnormal users. The power consumption data can be screened to select representative data from the past six months or one year. The data at each time point is regarded as a piece of power consumption data, and the collected data information is organized into a structured data format similar to the csv or json type. Each piece of data contains information such as nodes u, v, time stamps, and node labels. The collected dataset of power consumption data can be constructed into a dynamic heterogeneous network. Specifically, the dynamic relationship graph can be divided into multiple network snapshots according to time, and then combined with the Graph Convolutional Network (GCN) and Non-Negative Matrix Factorization (NNMF) to extract and decompose the node features of the dynamic heterogeneous network, obtaining the low-dimensional matrix of all nodes. Then, similarity calculations and grouping are performed on each node according to the low-dimensional matrix to obtain a set of similar groups. After the nodes are divided into different groups, feature extraction is performed within each similar group in the set of similar groups, so as to obtain the dynamic behavior characteristics of each power user. In the embodiment of the present invention, there is a multi-moment anomaly simulator. The design of the multi-moment anomaly simulator is to ensure the quantity of anomaly simulation and meet the diversity requirements, so that the dynamic behavior characteristics can be simulated through the generation module corresponding to each time point in the multi-moment anomaly simulator, generating more realistic anomaly samples. Specifically, the anomaly samples can be expanded according to the dynamic behavior characteristics to obtain a comprehensive anomaly sample set. Among them, the comprehensive anomaly sample set may include a set to be detected composed of the feature data of each power user at the current moment, so that the preset anomaly detection model can be trained according to the comprehensive anomaly sample set. After the training is completed, the feature data of each power user at the current moment in the set to be detected is input into the trained preset anomaly detection model, and the preset anomaly detection model can output the anomaly detection result at the current moment.

[0022] Compared with the prior art, the present embodiment provides obtaining power consumption data of power users within a preset time period, and constructing a dynamic heterogeneous network according to the power consumption data; the preset time period includes the current moment; performing node feature extraction and decomposition on the dynamic heterogeneous network to obtain low-dimensional matrices of all nodes, and calculating and grouping the similarity of each node according to the low-dimensional matrices to obtain a set of similarity groups; performing feature extraction on each similarity group in the set of similarity groups to obtain dynamic behavior characteristics of each power user; expanding abnormal samples according to the dynamic behavior characteristics to obtain a comprehensive set of abnormal samples; the comprehensive set of abnormal samples includes a set to be detected composed of feature data of each power user at the current moment; after training a preset anomaly detection model according to the comprehensive set of abnormal samples, performing anomaly detection on the set to be detected to obtain an anomaly detection result; the present invention can calculate the similarity through the power consumption data of users, thereby obtaining dynamic behavior characteristics, and further expanding abnormal samples according to the dynamic behavior characteristics, improving the proportion of abnormal samples, and then training and performing anomaly detection on the preset anomaly detection model according to the expanded comprehensive set of abnormal samples, improving the accuracy of the preset anomaly detection model.

[0023] In some embodiments of the present invention, step S102 includes: Extracting node feature information of the dynamic heterogeneous network according to a graph convolutional network to obtain a feature matrix of all nodes; Decomposing the feature matrix according to non-negative matrix factorization to obtain low-dimensional matrices; the low-dimensional matrices include a node low-dimensional matrix and a semantic low-dimensional matrix.

[0024] In a specific embodiment of the present invention, a graph convolutional network (GCN) can learn low-dimensional embedding vectors of each node from neighboring nodes in the dynamic heterogeneous network, perform convolutional operations on each layer to extract node feature information, so as to obtain a feature matrix composed of node feature information of all nodes in the dynamic heterogeneous network. Among them, the graph convolutional network (GCN) can be 2 layers to ensure sufficient capture of local node similarity features, and can also obtain local structure information from low-level semantic information to avoid overfitting caused by large-size inputs. Non-negative matrix factorization (NNMF) can be used to decompose the feature matrix output by the graph convolutional network GCN into two low-dimensional matrices. One represents a compact representation of the node, that is, the node low-dimensional matrix, which can capture the local structure information of the node; the other represents the potential semantic distribution, that is, the semantic low-dimensional matrix, which can help capture the global structure and further reveal the potential similarity between nodes. Among them, the feature dimension is usually set between 64 and 128 dimensions. It can start from 64 dimensions and be gradually debugged according to the complexity of the data set and computing power resources to find the optimal dimension.

[0025] In some embodiments of the present invention, as Figure 2 shown, step S102 further includes: S201. Calculate the similarity between the row vectors of each node in the node low-dimensional matrix and the semantic low-dimensional matrix to obtain the similarity values between nodes. S202. Group the nodes with similarity values higher than the similarity threshold according to the non-linear mapping to obtain a set of similarity groups.

[0026] In a specific embodiment of the present invention, the similarity values between nodes are obtained by calculating the inner product of the row vectors of the node low-dimensional matrix and the semantic low-dimensional matrix of each node, that is, the comprehensive similarity score between nodes. Finally, the similarity values between nodes are input into a multi-layer perceptron (MLP), and nodes with high similarity are grouped into the same group through non-linear mapping to obtain a set of similarity groups. The number and method of grouping depend on the hyperparameters designed by the model and the type of data features. Through this grouping process, user groups with similar electricity consumption behaviors can be identified, ensuring that similar nodes are reasonably classified, thus providing support for subsequent anomaly detection.

[0027] In some embodiments of the present invention, step S103 includes: Extract the feature differences of each node at adjacent moments in each similarity group based on a preset time sliding window to obtain the node local features of each node. Obtain the dynamic behavior features of each electricity user according to the behavior differences of all node local features in each similarity group.

[0028] In a specific embodiment of the present invention, after nodes are divided into different groups, feature extraction can be performed from network snapshots at different times within each similarity group through a behavior feature extractor. The behavior feature extractor can utilize a preset time sliding window, which can be set to 2, to capture the feature differences of each node at adjacent moments. Since the features of nodes in the same group are similar, the graph convolution operation within the similarity group is more refined for extracting node local features, so that more accurate node local features of each node can be obtained. The graph convolution has 2 layers to ensure sufficient feature extraction depth, and the feature dimension is usually set between 64-128 dimensions. It can start from 64 dimensions and be gradually debugged according to the complexity of the dataset and computing power resources to find the optimal dimension. By comparing the changes in the node local features in each similarity group, the node behavior differences are quantified and used as the dynamic behavior features of the corresponding nodes, that is, the dynamic behavior features of each electricity user, which can reflect the behavior patterns of abnormal nodes.

[0029] In some embodiments of the present invention, as Figure 3 shown, step S104 includes: S301. Set the generation module corresponding to each time point. S302. Determine the abnormal behavior features corresponding to each time point according to the dynamic behavior features of all electricity users at different time points. S303. Input the abnormal behavior features at each time point into the corresponding generation module for augmentation to obtain the initial abnormal sample set at each time point; S304. Combine all the initial abnormal sample sets at different time points to obtain a comprehensive abnormal sample set.

[0030] In a specific embodiment of the present invention, a multi-time abnormal simulator may also be set. The multi-time abnormal simulator may set the generation modules corresponding to each relatively representative time point, and the generation modules for the number of abnormal node features at each time point may be trained using the idea of generative adversarial network. Each generation module specifically learns the abnormal node features at a specific time point. Among them, the number of training rounds for each generation module may be 200 - 500 rounds, and each batch may process 64 - 128 samples, which can be adjusted according to the actual situation to make the generated abnormal samples more realistic. Thus, according to the dynamic behavior features of all power users at different time points, the abnormal behavior features corresponding to each time point can be determined, that is, the behavior features representing the node abnormality at each moment. The abnormal behavior features are used as the input of the generation module corresponding to the corresponding time point, so that multiple generation modules can generate the initial abnormal sample sets corresponding to different time points. Furthermore, all the initial abnormal sample sets at different time points can be combined to form a comprehensive abnormal sample set containing various features, meeting the requirements of quantity and diversity.

[0031] In some embodiments of the present invention, the preset abnormal detection model includes a multi-task detector; as Figure 4 shown, after step S104, it further includes: S401. Classify the comprehensive abnormal sample set according to a preset ratio to obtain a training set and a validation set; S402. Construct the training tasks corresponding to each time point according to the multi-task detector and different time points in the training set; S403. Train the preset abnormal detection model according to the training set, the validation set, and all the training tasks to obtain the trained preset abnormal detection model.

[0032] In a specific embodiment of the present invention, the preset anomaly detection model may include a multi-task detector. The purpose of the embodiment of the present invention is to identify anomaly nodes at a new moment. Therefore, the feature data of each power user at the current moment in the comprehensive anomaly sample set can be removed. That is, after removing the data in the set to be detected, the remaining anomaly samples can be classified according to a preset ratio to obtain a training set and a validation set. For example, 70% of the node features at each moment are randomly sampled as the training set, and the remaining part is used as the validation set. To improve the generalization performance of the model, multiple training tasks can be asynchronously constructed for training according to the multi-task detector and the data in different time periods in the training set, that is, the training tasks corresponding to each time point. The training set can be used to train the preset anomaly detection model, and the validation set can be used to optimize the performance of the preset anomaly detection model, so that the preset anomaly detection model trained by the training set and the validation set can be obtained.

[0033] In some embodiments of the present invention, step S403 includes: The training set is input into the preset anomaly detection model for cyclic training according to each training task respectively, and when each training task is replaced, the execution parameters of the preset anomaly detection model are updated. When all training tasks are completed, the trained preset anomaly detection model is obtained.

[0034] In a specific embodiment of the present invention, the multi-task detector can be composed of two parts, namely an anomaly detector and a simulation predictor. The anomaly detector is responsible for identifying abnormal nodes, while the simulation predictor is used to distinguish real anomalies from simulated anomalies, avoiding the model from overfitting to the generated anomaly samples, thereby improving the performance of the model when dealing with different anomaly patterns. After constructing multiple training tasks asynchronously based on data from different time periods, the anomaly detector and the simulation predictor in the preset anomaly detection model can be trained through the training tasks. Each training task corresponds to a multi-task detector. To enhance the generalization ability of the preset anomaly detection model, the inner and outer loop structures in meta-learning can also be used to train the multi-task detector. Specifically, in the outer loop, the corresponding data in the training set can be input into the preset anomaly detection model according to the time segments of each training task to cyclically train the anomaly detector and the simulation predictor of the multi-task detector. The inner loop focuses on updating the parameters of each training task. Specifically, when cyclically replacing each training task, for example, when the first training task is completed and the second training task starts, the execution parameters of the preset anomaly detection model are updated, enabling the preset anomaly detection model to learn to adapt to the characteristics and requirements of different tasks. 5-10 training tasks can be trained in each round. When all training tasks are completed, the trained preset anomaly detection model can be obtained. This double-loop structure helps to create a more flexible and stable model, especially when dealing with newly emerging anomaly patterns, significantly improving the generalization ability of the model.

[0035] Examples of the embodiments of the present invention Figure 5As shown in the figure, after obtaining the power consumption data of power users within a preset time period, the graph convolutional network (GCN) and non-negative matrix factorization (NNMF) can be used to perform similarity grouping on the dynamic heterogeneous network of power consumption data. Nodes with similarity values higher than the similarity threshold are grouped together, resulting in similar groups such as user power consumption sequence 1, user power consumption sequence 2, user power consumption sequence 3, etc. All similar groups are combined to form a set of similar groups. The behavior feature extractor can process each similar group in the set of similar groups. The graph convolutional layer with a preset time sliding window can be used to extract the local node features of each node. Then, by comparing the changes in the local node features of each similar group, the node behavior differences are quantified and used as the dynamic behavior features of the corresponding nodes, that is, the behavior features of each power user. Furthermore, the discriminator and multiple generators (i.e., multiple generation modules) of the multi-moment anomaly simulator can process the behavior features representing node anomalies at each moment, generating an initial anomaly sample set corresponding to different time points. Subsequently, all the initial anomaly sample sets at different time points can be merged to form a comprehensive anomaly sample set containing various features. Then, the preset anomaly detection model can be trained using the multi-task detector and the comprehensive anomaly sample set. After the training is completed, anomaly detection can be performed on the feature data in the set to be detected (i.e., the new moment task) composed of the feature data of each power user at the current moment, and the latest anomaly detection results can be obtained.

[0036] Based on the graph convolutional network (GCN), the embodiment of the present invention uses non-negative matrix factorization (NNMF) to factorize the output feature matrix of GCN into two low-dimensional matrices for similarity grouping. This method reduces the situation of ignoring important information of some users and simultaneously discovers user groups with similar power consumption behaviors in the data. By combining multi-task learning and meta-learning algorithms, the challenge of scarce abnormal nodes is effectively addressed. This method combines multi-task learning with simulated generated anomaly samples, enabling the number of labeled anomaly samples to meet the requirements of the method. The internal and external loop structure of multi-task learning helps the model adapt to new anomaly patterns and improves its detection accuracy and generalization ability in new situations. Diversity is emphasized in the anomaly sample generation process, and the multi-task design avoids overfitting. Through the design of the multi-moment anomaly simulator, diverse anomaly samples can be generated, improving the robustness and applicability of the model. By parallel processing of multi-tasks and the internal and external loop structure, the efficiency and performance of anomaly detection are significantly improved, and the model shows high effectiveness.

[0037] To better implement the power consumption data anomaly detection method in the embodiment of the present invention, correspondingly, the embodiment of the present invention also provides a power consumption data anomaly detection device, as Figure 6 shown, the power consumption data anomaly detection device 600 includes: A data acquisition module 601, configured to acquire power consumption data of power users within a preset time period, and construct a dynamic heterogeneous network according to the power consumption data; the preset time period includes the current moment; A set determination module 602, configured to perform node feature extraction and decomposition on the dynamic heterogeneous network to obtain low-dimensional matrices of all nodes, and calculate similarity and group each node according to the low-dimensional matrices to obtain a set of similarity groups; A feature extraction module 603, configured to perform feature extraction on each similarity group in the set of similarity groups to obtain dynamic behavior features of each power user; A sample augmentation module 604, configured to augment abnormal samples according to the dynamic behavior features to obtain a comprehensive set of abnormal samples; the comprehensive set of abnormal samples includes a set to be detected composed of feature data of each power user at the current moment; An anomaly detection module 605, configured to perform anomaly detection on the set to be detected after training a preset anomaly detection model according to the comprehensive set of abnormal samples to obtain an anomaly detection result.

[0038] The power consumption data anomaly detection device 600 provided in the above embodiment can implement the technical solutions described in the above embodiment of the power consumption data anomaly detection method. The specific implementation principles of the above modules or units can be referred to the corresponding content in the above embodiment of the power consumption data anomaly detection method, and will not be elaborated here.

[0039] As Figure 7 shown, the present invention also correspondingly provides an electronic device 700. The electronic device 700 includes a processor 701, a memory 702, and a display 703. Figure 7 Only some components of the electronic device 700 are shown, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented.

[0040] The memory 702 may be an internal storage unit of the electronic device 700 in some embodiments, such as a hard disk or memory of the electronic device 700. The memory 702 may also be an external storage device of the electronic device 700 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the electronic device 700.

[0041] Furthermore, the memory 702 may also include both an internal storage unit and an external storage device of the electronic device 700. The memory 702 is used to store application software installed on the electronic device 700 and various types of data.

[0042] The processor 701 may be a Central Processing Unit (CPU), a microprocessor, or other data processing chips in some embodiments, and is used to run the program code stored in the memory 702 or process data, such as the abnormal power consumption data detection method in the present invention.

[0043] The display 703 may be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) toucher, etc. in some embodiments. The display 703 is used to display the information of the electronic device 700 and to display a visual user interface. The components 701 - 703 of the electronic device 700 communicate with each other through a system bus.

[0044] In some embodiments of the present invention, when the processor 701 executes the abnormal power consumption data detection program in the memory 702, the following steps can be implemented: Obtain the power consumption data of power users within a preset time period, and construct a dynamic heterogeneous network according to the power consumption data; the preset time period includes the current moment; Extract and decompose the node features of the dynamic heterogeneous network to obtain the low-dimensional matrices of all nodes, and calculate the similarity and group each node according to the low-dimensional matrices to obtain a set of similar groups; Extract the features of each similar group in the set of similar groups to obtain the dynamic behavior features of each power user; Augment the abnormal samples according to the dynamic behavior features to obtain a comprehensive abnormal sample set; the comprehensive abnormal sample set includes a set to be detected composed of the feature data of each power user at the current moment; After training the preset abnormal detection model according to the comprehensive abnormal sample set, perform abnormal detection on the set to be detected to obtain an abnormal detection result.

[0045] It should be understood that when the processor 701 executes the abnormal power consumption data detection program in the memory 702, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiments above.

[0046] Furthermore, the embodiments of the present invention do not specifically limit the type of the mentioned electronic device 700. The electronic device 700 may be a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop, or other portable electronic devices. Exemplary embodiments of the portable electronic device include, but are not limited to, portable electronic devices running IOS, android, microsoft, or other operating systems. The above portable electronic devices may also be other portable electronic devices, such as a laptop with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 700 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0047] Correspondingly, an embodiment of the present application also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the programs or instructions are executed by a processor, the method steps or functions of the abnormal power consumption data detection method provided by the above various method embodiments can be implemented.

[0048] Those skilled in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium. Among them, the computer-readable storage medium is a magnetic disk, an optical disk, a read-only memory, or a random access memory, etc.

[0049] The above has introduced in detail the abnormal power consumption data detection method, device, electronic device, and storage medium provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A method for detecting abnormal power consumption data, characterized in that: include: Acquire power consumption data of power users within a preset time period, and build a dynamic heterogeneous network based on the power consumption data; The preset time period includes the current time; Extracting and decomposing node features of the dynamic heterogeneous network to obtain a low-dimensional matrix of all nodes, and calculating and grouping similarity of each node according to the low-dimensional matrix to obtain a similar group set; Extracting features from each similar group in the similar group set to obtain dynamic behavior features of each power user; The abnormal samples are expanded according to the dynamic behavior characteristics to obtain a comprehensive abnormal sample set; the comprehensive abnormal sample set includes a set to be detected composed of characteristic data of each power user at the current moment; After the preset anomaly detection model is trained according to the comprehensive anomaly sample set, anomaly detection is performed on the set to be detected to obtain an anomaly detection result.

2. The method for detecting abnormal power consumption data according to claim 1, characterized in that: The node feature extraction and decomposition of the dynamic heterogeneous network are performed to obtain a low-dimensional matrix of all nodes, including: Extracting node feature information of the dynamic heterogeneous network according to a graph convolutional network to obtain a feature matrix of all nodes; The feature matrix is ​​decomposed according to non-negative matrix decomposition to obtain a low-dimensional matrix; the low-dimensional matrix includes a node low-dimensional matrix and a semantic low-dimensional matrix.

3. The method for detecting abnormal power consumption data according to claim 2, characterized in that: The similarity calculation and grouping of each node according to the low-dimensional matrix to obtain a similar group set includes: Calculating the similarity of the row vectors of each node in the node low-dimensional matrix and the semantic low-dimensional matrix to obtain similarity values ​​between the nodes; The nodes whose similarity values ​​are higher than a similarity threshold are grouped according to nonlinear mapping to obtain a similar group set.

4. The method for detecting abnormal power consumption data according to claim 1, characterized in that: The extracting features of each similar group in the similar group set to obtain the dynamic behavior features of each power user includes: Extracting feature differences of each node in each similar group at adjacent moments based on a preset time sliding window to obtain node local features of each node; According to the behavioral differences of the local characteristics of all nodes in each similar group, the dynamic behavioral characteristics of each power user are obtained.

5. The method for detecting abnormal power consumption data according to claim 1, characterized in that: The abnormal samples are expanded according to the dynamic behavior characteristics to obtain a comprehensive abnormal sample set, including: Set the generation module corresponding to each time point; According to the dynamic behavior characteristics of all power users at different time points, determine the abnormal behavior characteristics corresponding to each time point; Inputting the abnormal behavior features at each time point into the corresponding generation module for expansion to obtain an initial abnormal sample set at each time point; All the initial abnormal sample sets at different time points are merged to obtain a comprehensive abnormal sample set.

6. The method for detecting abnormal power consumption data according to claim 1, characterized in that: The preset anomaly detection model includes a multi-task detector; after the abnormal samples are expanded according to the dynamic behavior characteristics to obtain a comprehensive abnormal sample set, the method further includes: Classifying the comprehensive abnormal sample set according to a preset ratio to obtain a training set and a validation set; According to the multi-task detector and different time points in the training set, construct a training task corresponding to each time point; The preset anomaly detection model is trained according to the training set, the validation set and all training tasks to obtain a trained preset anomaly detection model.

7. The method for detecting abnormal power consumption data according to claim 1, characterized in that: The step of training the preset anomaly detection model according to the training set, the validation set, and all training tasks to obtain the trained preset anomaly detection model includes: According to each training task, the training set is input into the preset anomaly detection model for cyclic training, and when each training task is replaced, the execution parameters of the preset anomaly detection model are updated. When all the training tasks are completed, the preset anomaly detection model after training is obtained.

8. A device for detecting abnormal power consumption data, characterized in that: include: A data acquisition module is used to acquire the power consumption data of power users within a preset time period and to construct a dynamic heterogeneous network based on the power consumption data; The preset time period includes the current time; A set determination module is used to extract and decompose node features of the dynamic heterogeneous network to obtain a low-dimensional matrix of all nodes, and to calculate and group similarity of each node according to the low-dimensional matrix to obtain a similar group set; A feature extraction module, used to extract features from each similar group in the similar group set to obtain dynamic behavior features of each power user; A sample expansion module, used to expand the abnormal samples according to the dynamic behavior characteristics to obtain a comprehensive abnormal sample set; the comprehensive abnormal sample set includes a set to be detected composed of characteristic data of each power user at the current moment; The anomaly detection module is used to train a preset anomaly detection model according to the comprehensive anomaly sample set, and then perform anomaly detection on the set to be detected to obtain an anomaly detection result.

9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the power consumption data anomaly detection method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the power consumption data anomaly detection method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Water pressure monitoring method and device and terminal equipment

    CN120897197A

  • A water pressure monitoring method, device and terminal equipment

    CN120897197B