Electricity consumption anomaly detection method and system based on graph self-attention mechanism
By converting one-dimensional electricity consumption data into two-dimensional graph structures and using graph self-attention mechanisms, the traditional methods' shortcomings in capturing related information and adapting to different scenarios are solved, and more efficient electricity consumption abnormality detection is achieved.
Patent Information
- Application Number
- CN202411532964.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-14
AI Technical Summary
Traditional electricity abnormality detection methods are mostly limited to one-dimensional data analysis, and cannot capture richer related information. They have poor ability to adapt to fluctuations in electricity data in different industries and scenarios, especially when the electricity fluctuations are irregular, it is difficult to detect abnormalities.
By converting one-dimensional electricity consumption timing data into a two-dimensional graph structure, and combining the graph self-attention mechanism, an association network and detection model are built, and the correlation intensity and multi-layer attention mechanism stack are used to output abnormal detection results.
It improves the accuracy and adaptability of electricity consumption abnormality detection, can capture complex relationships and irregular fluctuations in the data, and is suitable for electricity consumption monitoring needs in different industries and scenarios.
Smart Images

Figure CN119441942A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power system data analysis and anomaly detection, and specifically to a method and system for detecting power consumption anomaly based on a graph self-attention mechanism. Background Art
[0002] In the power system, power anomaly detection is a key link to ensure power safety and stable operation. With the increase in power demand and the complexity of power equipment, how to effectively monitor and detect power anomalies has become an important challenge in power system management. Power anomalies may not only lead to power supply interruptions, but also cause equipment failures, energy waste, economic losses and safety hazards. Therefore, it is particularly important to develop and apply effective anomaly detection technology. Power anomaly refers to situations that are significantly different from the normal power consumption pattern during the operation of the power system. These abnormal situations may include sudden load fluctuations, equipment failures, power theft, fraud, etc. Specifically, power anomalies can be manifested in the following forms: load anomaly, the power load fluctuates sharply or exceeds the expected range, which may be caused by equipment failure, changes in user power consumption habits or other emergencies. Equipment failure, abnormal behavior of equipment during operation, such as current overload, voltage instability, etc., may cause damage to the equipment or failure of the power system. Power theft, illegal power use behavior is usually manifested as abnormal power consumption mode, which is not easy to detect under traditional monitoring methods.
[0003] Traditional methods for detecting anomalies in power consumption mainly include statistical analysis methods, rule-based methods, and machine learning methods. In the statistical analysis method, the mean-standard deviation method calculates the mean and standard deviation of power consumption data and sets a threshold to detect anomalies. This method is simple and intuitive, but it is less effective when the data distribution changes or the volatility is large. The control chart method is based on the control chart theory and monitors whether the power consumption data exceeds the control limit. This method is suitable for situations where the power consumption data has stable fluctuation characteristics, but the detection ability of sudden anomalies is limited. In the rule-based method, the threshold detection sets a fixed power consumption threshold, and when the actual power consumption exceeds or falls below the threshold, it is marked as an anomaly. This method is easy to implement, but lacks flexibility and cannot adapt to the characteristics of different users or devices. The pattern matching method establishes a power consumption pattern based on historical data and detects whether the current power consumption data is consistent with the expected pattern. This method relies on the accuracy of historical data and has poor adaptability to new patterns or unseen anomalies. In traditional machine learning methods, decision trees use feature selection and decision rules to classify power consumption data. Decision trees have good interpretability, but may be too dependent on the quality of training data. Support vector machine (SVM) separates normal and abnormal power consumption data by constructing a hyperplane, and has strong classification capabilities, but has high requirements for parameter selection and data preprocessing. k-nearest neighbor (k-NN) performs anomaly detection by calculating the distance between samples, which is suitable for situations with low data dimensions, but has poor effects on high-dimensional data.
[0004] In recent years, deep neural networks (DNNs) have shown significant advantages in the field of anomaly detection. Compared with traditional methods, deep neural networks can automatically learn the characteristics of data and adapt to complex anomaly detection tasks. Autoencoders are an unsupervised learning method that reconstructs input data by learning low-dimensional representations of data. Abnormal data is often difficult to reconstruct accurately, so anomaly detection is performed through reconstruction errors. Convolutional neural networks (CNNs) can also be applied to anomaly detection of time series data. By extracting local features through convolutional layers, abnormal patterns in electricity consumption data can be effectively identified. Recurrent neural networks (RNNs) are suitable for processing time series data. By modeling sequence data, they can capture the temporal characteristics of electricity consumption data. Long short-term memory networks (LSTMs) are a variant of RNNs that can better handle dependencies in long sequence data. Generative adversarial networks (GANs) can generate samples similar to real data through adversarial training of generators and discriminators. In anomaly detection, generative adversarial networks can be used to generate samples of normal data and identify abnormal data through discriminators.
[0005] Although the above method has achieved certain results in the task of anomaly detection in electricity consumption data, there are still certain problems. It is difficult to effectively model the statistical characteristics of electricity consumption data by simply learning the changing characteristics of electricity consumption data from one-dimensional data. Although the statistical characteristics of the existing abnormal data are usually different from those of normal electricity consumption data, this difference is difficult to quantify only in the form of one-dimensional data. To address this problem, the present invention converts the one-dimensional electricity consumption data into two-dimensional ones, and converts the time series correlation and the statistical characteristics of the data into similarities and correlations in a two-dimensional graph structure, thereby breaking the constraints of the single linear correlation of the time series, and judging whether electricity consumption anomalies occur by detecting similar nodes in the neighborhood of each electricity consumption data, thereby improving the accuracy of anomaly detection. Summary of the invention
[0006] In view of the above-mentioned problems, the present invention is proposed.
[0007] Therefore, the technical problem solved by the present invention is that traditional methods are mostly limited to one-dimensional data analysis, unable to capture richer related information, and have poor adaptability to fluctuations in electricity consumption data in different industries and scenarios, especially when electricity consumption fluctuations are irregular, it is difficult to detect anomalies.
[0008] In order to solve the above technical problems, the present invention provides the following technical solutions: a method for detecting abnormal power consumption based on a graph self-attention mechanism, comprising:
[0009] collecting characteristic data of the first object;
[0010] constructing an association network and analyzing the association strength of the first object;
[0011] Build a detection model and output anomaly detection results.
[0012] As a preferred solution of the power consumption anomaly detection method based on graph self-attention mechanism described in the present invention, wherein: the feature data includes a plurality of types of data sets that can reflect the anomaly of the first object at any time.
[0013] As a preferred solution of the method for detecting abnormal power consumption based on graph self-attention mechanism described in the present invention, wherein: the construction of the association network includes taking the feature data of the first object as one-dimensional data and constructing it into a two-dimensional association structure.
[0014] As a preferred solution of the power consumption anomaly detection method based on graph self-attention mechanism described in the present invention, wherein: the construction of the association network also includes, by the association strength, describing the relationship between the first objects in the association network;
[0015] The association strength includes calculating association analysis parameters between the first objects and adjusting the similarity association analysis parameters through a weighting mechanism.
[0016] As a preferred solution of the power consumption anomaly detection method based on graph self-attention mechanism described in the present invention, the detection model includes using the association network and association strength to construct a detection model through a neural network, and updating the feature information of the association network; after the update is completed, the final anomaly detection result is output.
[0017] As a preferred solution of the method for detecting abnormal power consumption based on the graph self-attention mechanism described in the present invention, updating the feature information of the associated network includes but is not limited to extracting the feature information of the associated network through the attention layer in the neural network, stacking multiple layers of attention mechanisms, fusing the feature information of each layer, and updating the feature information of the associated network.
[0018] As a preferred solution of the method for detecting abnormal electricity consumption based on the graph self-attention mechanism described in the present invention, wherein: extracting the feature information of the associated network through the attention layer in the neural network includes but is not limited to utilizing a multi-head attention mechanism for parallel calculation, with each attention head focusing on different features, and fusing multiple attention features as the feature information of the current attention layer.
[0019] A power consumption anomaly detection system based on graph self-attention mechanism, where:
[0020] A data module, collecting characteristic data of the first object;
[0021] An analysis module constructs a correlation network and analyzes the correlation strength of the first object;
[0022] Detection module, builds detection models and outputs anomaly detection results.
[0023] A computer device comprises: a memory and a processor; the memory stores a computer program, wherein the processor implements the steps of any one of the methods of the present invention when executing the computer program.
[0024] A computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of any one of the methods of the present invention.
[0025] Beneficial effects of the present invention: The power consumption anomaly detection method based on the graph self-attention mechanism provided by the present invention effectively improves the accuracy and adaptability of power consumption anomaly detection by converting one-dimensional power consumption time series data into a two-dimensional graph structure and combining it with the graph self-attention mechanism. Through feature aggregation and multi-layer stacking, the model can capture complex correlations and irregular fluctuations in the data, which is particularly suitable for power consumption monitoring needs in different industries and scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0027] Figure 1 An overall flow chart of a method for detecting power consumption anomalies based on a graph self-attention mechanism provided in the first embodiment of the present invention;
[0028] Figure 2 A GATSI-based abnormal source node detection model diagram of a power consumption anomaly detection method based on a graph self-attention mechanism is provided in the second embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0030] Example 1, reference Figure 1 , is an embodiment of the present invention, and provides a method for detecting abnormal power consumption based on a graph self-attention mechanism, comprising:
[0031] S1: Collect feature data of a first object.
[0032] Furthermore, in the present application, the first object is an electricity consumption system.
[0033] Specifically, the characteristic data includes a plurality of types of data sets that can reflect the abnormality of the first object at any time.
[0034] Furthermore, the collection of various types of feature data provides a comprehensive data basis for abnormal detection of power consumption systems, enabling the model to accurately capture the behavioral characteristics under normal and abnormal modes, thereby improving the accuracy of abnormal identification. Data of different feature dimensions, such as voltage, current, load, etc., help cover more abnormal scenarios, support the detection of multiple abnormal modes (such as sudden load fluctuations, equipment failures, etc.), and avoid misjudgment due to insufficient single features. At the same time, real-time monitoring of feature data provides a basis for the system's rapid response and forward-looking warning, ensuring the safe and stable operation of the power consumption system.
[0035] In an optional embodiment, the first object may also be industrial equipment monitoring. Identify abnormal behaviors in the operation of industrial equipment, such as fault warnings and abnormal energy consumption of manufacturing equipment, to improve the reliability of the production line. Traffic flow and intelligent traffic management, detect anomalies in traffic flow data, such as sudden congestion, traffic accidents, etc., to support the optimization management of intelligent transportation systems. Financial transaction risk monitoring, detect abnormal behaviors in financial transaction data, help identify potential fraudulent activities and abnormal market fluctuations, and improve the security of the financial system. Environmental monitoring and meteorological data analysis, identify abnormal meteorological events, such as abnormal fluctuations in temperature and precipitation, and improve meteorological monitoring and disaster warning capabilities.
[0036] S2: construct an association network and analyze the association strength of the first object.
[0037] Constructing the association network includes taking the feature data of the first object as one-dimensional data and constructing it into a two-dimensional association structure.
[0038] Association strength, describing the relationship between the first objects in the association network;
[0039] Further, the association analysis parameters between the first objects are calculated, and the similarity association analysis parameters are adjusted by a weighting mechanism. In an embodiment of the present application, the analysis parameter is similarity, and the similarity coefficient and attention coefficient between nodes are calculated to extract the attention features of the nodes.
[0040] In an optional embodiment, the correlation analysis parameter may also be a time difference. In some anomaly detection tasks, the time difference parameter may be used as an analysis factor to quantify the time span of adjacent nodes. For some regular events, a specific time difference may reflect the periodicity or burstiness of the power consumption pattern.
[0041] Furthermore, it can also be a periodic feature. If the electricity consumption data has periodic changes, the frequency or periodic feature can be used as an association analysis parameter to capture this repetitive behavior. Through this parameter, the model can identify the association between periodic patterns and improve the ability to identify periodic anomalies.
[0042] Furthermore, the load fluctuation characteristic load fluctuation can be used as a correlation parameter to quantify the similarity of load changes between nodes. In particular, in systems with frequent load fluctuations, this parameter can identify abnormal fluctuation patterns.
[0043] Furthermore, it can also be node feature differences, calculating the differences in specific features of nodes to construct association analysis parameters. The weighted association of node feature differences can help identify the impact of external environmental changes on power consumption data and improve the accuracy of anomaly detection.
[0044] Furthermore, by expanding the one-dimensional feature data into a two-dimensional association structure, the model can analyze the complex relationships between objects from a multi-dimensional perspective, improving the data's expressiveness. The association strength further accurately describes the similarity between objects, making it easier for the model to identify highly similar or significantly different data nodes, and providing a fine-grained metric for distinguishing normal and abnormal behaviors. The adaptive weighting mechanism dynamically adjusts the influence of similarity according to actual conditions, enhancing the model's adaptability and detection accuracy for different industries, equipment, or environmental characteristics. Through this association structure, the model achieves more robust anomaly detection based on local and global relationships, improving the reliability and robustness of detection.
[0045] S3: Build a detection model and output anomaly detection results.
[0046] The detection model includes using the association network and association strength to build a detection model through a neural network, updating feature information and stacking it step by step; after the feature stacking is completed, all feature information is fused to output the final anomaly detection result.
[0047] In this embodiment, the feature information of the associated network is updated, the feature information of the associated network is extracted through the attention layer in the neural network, and the feature information of each layer is fused by stacking multiple layers of attention mechanisms to update the feature information of the associated network.
[0048] In an optional embodiment, a convolutional layer may be introduced into a neural network to extract local features.
[0049] Furthermore, a recursive neural network layer can be introduced to process time series characteristics to further capture the temporal dependencies in node features, or residual connections can be introduced during the attention layer stacking process to prevent information loss when multiple layers are stacked.
[0050] Furthermore, an autoencoder is used to compress and reconstruct the feature information of the associated network to remove redundant information and extract key features. Alternatively, a generative adversarial network is used to generate features similar to normal node features.
[0051] In this embodiment, extracting feature information of the associated network through the attention layer in the neural network includes but is not limited to utilizing a multi-head attention mechanism for parallel computing, with each attention head focusing on different features, and fusing multiple attention features as feature information of the current attention layer.
[0052] In an optional embodiment, position encoding can be added to the graph network to enhance the temporal feature expression of time series data, so that the model can identify the relative position of nodes in the time series, thereby better extracting the temporal relationship. Furthermore, by introducing adaptive weights to dynamically adjust the weight of each attention head, the influence of different heads can be automatically adjusted according to the characteristics of the input data, thereby optimizing the effect of feature extraction.
[0053] Or, different scale settings can be used to extract feature information in different ranges.
[0054] Furthermore, skip connections can be introduced in multi-layer attention networks to preserve the original features of early layers and alleviate the information loss that may be caused by deep networks, thereby improving the effectiveness of feature fusion.
[0055] Example 2, reference Figure 2 , as an embodiment of the present invention, provides a method for detecting power consumption anomalies based on a graph self-attention mechanism, including: obtaining a user's power consumption data through sensors, the sensors including current sensors, voltage sensors, power sensors, and temperature and humidity sensors.
[0056] Electricity consumption data includes real-time values of current, voltage and power, user electricity consumption behavior data, meteorological data, holiday information and power system historical record data.
[0057] For electricity consumption data, the electricity consumption data is preprocessed, including removing obvious outliers and performing data interpolation to generate valid daily electricity consumption data. Then, these daily electricity consumption data are combined with information such as holidays and weather as input data for the model. The one-dimensional electricity consumption data is converted into two-dimensional graph data. Specifically, the input data at each time point is first used as a node of the graph, and then the edges between the input data of adjacent time nodes are established. Then, based on the input data, the similarity between the input data and other input data is calculated, the first k similar data are taken, and k edges connected to the current input data are established. In this way, the electricity consumption data is converted into a graph structure:
[0058] G=(V,E,Y)
[0059] Where V represents the node set, E represents the edge set; Y = {Y}{Y1,...,Y |V|} represents the status of all nodes in G, each Yi∈{1,-1} represents the abnormal state of node vi, Yi=1 means that vi is in an abnormal power consumption state, otherwise Yi=-1 means that it is in a normal power consumption state.
[0060] Based on the graph expression G, the present invention defines a multi-scale self-attention layer. The graph self-attention mechanism consists of three parts: similarity coefficient, attention coefficient and attention feature. For the similarity coefficient, a neural network is used to define it, and the formula is expressed as:
[0061] Similar ij =FCN(W(f i ,f j ))=FCN(W×concatenate(f i ,f j ))
[0062] Among them, Similar ij represents the similarity score between node i and node j, FCN represents a fully connected neural network, W represents a learnable weight matrix, and f i represents the feature vector of node i, f j represents the feature vector of node j, concatenate(f i ,f j ) means f i and f j Perform splicing operations.
[0063] According to the attention coefficient, the attention feature featurei of the current node i can be expressed as:
[0064]
[0065] Among them, attention ij Represents the attention weight between node i and node j, softmax (Similar ij ) indicates the similarity ij Perform Softmax normalization, Similar ij Represents the similarity measure between node i and node j, exp(Similar ij ): indicates the similarity ij Take exponential operation.
[0066] Features here i It is the feature calculated in the model, and the feature is calculated once for each node iIt is regarded as a feature extraction process of the network, as an attention layer, multiple layers are stacked to extract multi-layer attention features, and then the prediction results are output through a fully connected layer, and the output is represented as output. According to the graph self-attention mechanism defined by all the above formulas, a graph self-attention layer can be established, and multiple graph self-attention layers can be superimposed to extract structural features. Combined with the output layer, the predicted value of the output node is output, thereby predicting whether the node is an abnormal source node. The loss function is described as follows:
[0067] Loss(label,output)=-logσ(label)×output-log(1-σ(label))×(1-output)+λ||θ||
[0068] Among them, θ represents the weight parameter used in the calculation process, output represents the output of the model GAT-Detector, label represents the true label, Sigmoid represents the activation function, and λ represents the hyperparameter used to limit the regularization term.
[0069] GAT-Detector training is achieved by minimizing the above loss function. The time series power consumption data is converted into a two-dimensional graph. Based on the graph structure, the nodes are labeled with supervisory information, non-source nodes are marked as -1, and abnormal source nodes are marked as 1. Then, the graph self-attention neural network is trained based on the label information and output information to output the prediction of whether each node is an abnormal power consumption node. The overall structure of the model is as follows: Figure 2 shown.
[0070] Embodiment 3, an embodiment of the present invention provides a power consumption anomaly detection system based on a graph self-attention mechanism, comprising:
[0071] The data module collects characteristic data of the first object.
[0072] The analysis module constructs an association network and analyzes the association strength of the first object.
[0073] Detection module, builds detection models and outputs anomaly detection results.
[0074] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0075] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0076] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0077] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0078] In Example 4, a set of electricity consumption data from an actual power grid was selected. These data contain multiple typical load conditions, and are combined with influencing factors such as holidays and weather to ensure the representativeness of the data. The experiment preprocessed the electricity consumption data, including removing obvious outliers and filling missing values to form a complete daily electricity consumption data set. In order to more accurately evaluate the effect of the algorithm, the one-dimensional time series electricity consumption data is converted into a two-dimensional graph structure, and connections between nodes are established in the graph based on the similarity relationship between adjacent time points. Each time point is regarded as a node, and the nodes are connected based on the similarity of the electricity consumption characteristics, and the top K most similar nodes are taken to form edges.
[0079] Based on the graph model, the self-attention mechanism (GAT-Detector) is applied to calculate the similarity weights between nodes. First, the node features are extracted through a multi-scale self-attention layer to ensure that the global features and local details of the time series are captured. The similarity weights are processed by Softmax to finally generate the feature representation of each node. During the training process, the node status (normal or abnormal) is labeled by minimizing the cross entropy loss function. The loss function introduces a regularization term to enhance the robustness of the model. After the training is completed, the state of each node is predicted by the model to detect abnormal power consumption. The experimental data is shown in Table 1.
[0080] Table 1 Experimental data table
[0081]
[0082] It can be seen from the analysis of the tabular data that the power consumption anomaly detection method based on the self-attention mechanism has shown significant anomaly recognition capabilities under the influence of multiple factors. Experimental data show that under the influence of external factors such as different temperatures, humidity, holidays, etc., this method can accurately identify abnormal nodes. For example, when the daily power consumption of nodes 3 and 5 is higher than that of other nodes, they are marked as abnormal by the system, and this fluctuation is difficult to accurately detect through the traditional one-dimensional power consumption detection method. In traditional methods, such as the mean-standard deviation method and the control chart method, it is easy to be limited by the set threshold, resulting in false positives or negative negatives. The present invention can automatically learn the temporal feature associations between nodes through the construction of the graph structure and the multi-head attention layer of the self-attention mechanism, and capture the similarities and differences of nodes under multi-dimensional features.
[0083] The self-attention weights in the table also show the model's flexible weight allocation to different nodes. The self-attention weights of nodes 3 and 5 are significantly lower than those of other nodes, indicating that under similar weather and load fluctuation conditions, the self-attention mechanism can learn the heterogeneity of features and give lower similarity weights to these nodes with abnormal fluctuations. Further compared with traditional machine learning methods such as decision trees and support vector machines (SVMs), the present invention has more advantages in adaptability and robustness of feature dimensions. Traditional methods require manual setting of parameters, while the graph-based self-attention mechanism realizes automatic learning and weighting of features through a deep learning layer.
[0084] In practical applications, the method of the present invention also has strong scalability. GAT-Detector can monitor and continuously update node weights in real time during the process of detecting power consumption anomalies to adapt to the dynamic changes in power load, thereby ensuring that the system can still maintain high accuracy and robustness when facing sudden anomalies. This feature effectively solves the hysteresis of the threshold method in the prior art, the fixedness of the rule method, and the excessive dependence of the traditional machine learning method on data, making the detection model of the present invention more suitable for diversified load scenarios in actual power grid applications.
[0085] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A method for detecting abnormal power consumption based on graph self-attention mechanism, characterized in that: include: collecting characteristic data of the first object; constructing an association network and analyzing the association strength of the first object; Build a detection model and output anomaly detection results.
2. The method for detecting abnormal power consumption based on graph self-attention mechanism according to claim 1, characterized in that: The characteristic data includes a plurality of types of data sets that can reflect the abnormality of the first object at any time.
3. The method for detecting abnormal power consumption based on graph self-attention mechanism according to claim 2, characterized in that: The constructing of the association network includes taking the feature data of the first object as one-dimensional data and constructing it into a two-dimensional association structure.
4. The method for detecting abnormal power consumption based on graph self-attention mechanism according to claim 3, characterized in that: The constructing the association network further includes describing the relationship between the first objects in the association network by using the association strength; The association strength includes calculating association analysis parameters between the first objects and adjusting the similarity association analysis parameters through a weighting mechanism.
5. The method for detecting abnormal power consumption based on graph self-attention mechanism according to claim 4, characterized in that: The detection model includes using the association network and the association strength to construct a detection model through a neural network and update the characteristic information of the association network; After the update is completed, the final anomaly detection results are output.
6. The method for detecting abnormal power consumption based on graph self-attention mechanism according to claim 5, characterized in that: Updating the feature information of the associated network includes, but is not limited to, extracting the feature information of the associated network through an attention layer in a neural network, fusing the feature information of each layer through stacking of multiple layers of attention mechanisms, and updating the feature information of the associated network.
7. The method for detecting abnormal power consumption based on graph self-attention mechanism according to claim 6, characterized in that: Extracting feature information of the associated network through the attention layer in the neural network includes but is not limited to utilizing a multi-head attention mechanism for parallel computing, with each attention head focusing on different features, and fusing multiple attention features as feature information of the current attention layer.
8. A power consumption anomaly detection system based on a graph self-attention mechanism using the method according to any one of claims 1 to 7, characterized in that: A data module, collecting characteristic data of the first object; An analysis module constructs a correlation network and analyzes the correlation strength of the first object; Detection module, builds detection model and outputs anomaly detection results.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the power consumption anomaly detection method based on the graph self-attention mechanism described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the power consumption anomaly detection method based on the graph self-attention mechanism described in any one of claims 1 to 7 are implemented.