Industrial chain-oriented graph neural network electricity utilization anomaly extraction method
The feature extraction and graph structure representation of the power consumption data through graph neural network and long-term memory network is solved, and the problem of high false alarm rate and insufficient accuracy of power consumption abnormality detection in the prior art is achieved, and higher detection accuracy is achieved meet the requirements of power grid operation.
Patent Information
- Application Number
- CN202411077961.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-12-17
AI Technical Summary
The prior art has high false alarm rate in the detection of power consumption abnormalities, and cannot effectively deal with the accuracy of users who are unstable in power consumption and cannot meet the operating requirements of power grids.
Graph neural network (GNN) is used to combine long and short-term memory network (LSTM) and graph convolutional network to extract features and represent graph structures of electricity consumption data, and abnormal detection is performed using the correlation intensity between enterprises.
It improves the accuracy of power abnormality detection, which is 5% higher than the classic method, meeting the accuracy requirements of power grid operation requirements.
Smart Images

Figure CN119150181A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power systems, and in particular to a graph neural network power consumption anomaly extraction method for an industrial chain. Background Art
[0002] Against the background of continuous updating of new power systems, energy consumption patterns have gradually diversified, user diversification is obvious, user electricity consumption behavior is more complex, and the demand for load forecasting technology has also changed accordingly. Non-technical losses, led by abnormal electricity consumption by enterprises and users, account for 65% to 70% of the total losses in the distribution network, which is a chronic disease in the operation and management of power companies. Different industrial chains have gradually shown characteristics of multi-factor influences and large fluctuations in electricity consumption. It is difficult to balance electricity and electricity, and the supply and demand balance in the peak seasons of winter and summer and the peak hours of the day is continuously tense, resulting in severe challenges for the operation and management of the power grid. Therefore, higher requirements are placed on the extraction of abnormal electricity consumption characteristics. Currently, three types of methods are commonly used for data-driven abnormal electricity consumption detection:
[0003] The first is the clustering method. Some of the electricity consumption characteristics of abnormal electricity users are different from those of normal users. The clustering method can be used to find abnormal users who deviate from the clustering cluster. However, it is difficult to find representative features in complex electricity consumption behaviors, which makes this type of method have a high false alarm rate.
[0004] The second is the classification-based method. The classifier is mainly trained with labeled feature indicators so that it can judge the electricity consumption of unlabeled users. The detection effect is better than the clustering method in most cases. However, it is difficult to describe abnormal electricity consumption well by artificially designed feature indicators. In addition, the training of the classifier is based on the premise of stable electricity consumption. For a considerable number of users with unstable electricity consumption, the abnormal detection function will be lost.
[0005] Finally, there is the method based on power flow constraints. The electrical quantities in the distribution network are strongly coupled, and the injected power and voltage of the nodes are constrained by the power flow equation. Among them, the most important type of method is the anomaly detection method based on state estimation. By comparing the residuals of the node voltage and power estimation values and the measured values, it is inferred whether the measured values have been tampered with, and whether the user has abnormal electricity consumption. This type of method has better solved the problem of high false alarms when the classification method deals with unstable electricity users, but it is too dependent on the network topology and line parameter accuracy. In the actual general distribution network, especially when facing the electricity consumption of some enterprises when they are closed, it is difficult to meet the identification requirements.
[0006] In general, the data used by the common abnormal power consumption feature detection technology is basically time-power consumption data, which can reflect the overall trend of power consumption. With the changes in the national power consumption structure, the power consumption characteristics of provincial power grids have also changed greatly. Simply relying on the overall trend of power consumption cannot fully reflect the power consumption structure and change trend in a certain area, and the accuracy of power anomaly detection cannot meet the needs of power grid operation. Summary of the invention
[0007] In view of the above-mentioned problems, the present invention is proposed.
[0008] Therefore, the technical problem solved by the present invention is: Graph Neural Networks (GNN) is an emerging machine learning method that takes graph structure as its basic idea and consists of nodes and edges. It can fully reflect the relationship between each node and can effectively process graph structure data.
[0009] The main principle of this method is to use graph neural network technology to extract key abnormal features from electricity consumption data, take a single enterprise as a node in the graph, use time-power consumption, date, temperature, weather and other data as basic data, and extract features through the long short-term memory network (LSTM) as the node data in the graph; take the strength of the association between enterprises as the edge data in the graph, and detect electricity consumption anomalies through the graph neural network.
[0010] In order to solve the above technical problems, the present invention provides the following technical solutions: a graph neural network power consumption anomaly extraction method for the industrial chain, comprising:
[0011] Collect electricity consumption data from different enterprises for pre-processing;
[0012] The feature of each node is represented as a vector, and a long short-term memory neural network is established for the electricity consumption data to extract features into a feature vector of fixed length;
[0013] Convert the vector formed by node embedding into a graph structure and re-represent the entire graph as a new vector;
[0014] A graph convolutional network is used to extract and fuse features from the graph structure. Through multi-layer convolution operations, local and global patterns between sensors are learned and fused into a feature representation.
[0015] Add pooling layer and normalization layer modules between convolution operations;
[0016] Use known data to train the graph neural network;
[0017] After the training is completed, the trained graph neural network is used to make output predictions, the power consumption data is input, and the anomaly detection results are obtained through forward propagation through the network to determine whether the power consumption is abnormal or normal.
[0018] As a preferred solution of the graph neural network electricity consumption anomaly extraction method for the industrial chain described in the present invention, the preprocessing includes aligning the electricity consumption-time series and temperature-time series information of a single enterprise, unifying the time information into the UTC time system, and normalizing the data. The normalization step uses Z-score normalization, and the normalized data is stored in pickle format.
[0019] As a preferred solution of the graph neural network power consumption anomaly extraction method for the industrial chain described in the present invention, wherein: the normalization is expressed as,
[0020] x * =(x-μ x ) / σ x
[0021] y * =(y-μ y ) / σ y
[0022] Among them, x * ,y * They represent the normalized temperature and enterprise electricity consumption data, x, y are the original temperature and enterprise electricity consumption, μ x , μ y represents the original temperature mean and the enterprise electricity consumption mean, σ x , σ y The standard deviation of original temperature and the standard deviation of enterprise electricity consumption.
[0023] As a preferred solution of the graph neural network power consumption anomaly extraction method for the industrial chain described in the present invention, wherein: the feature vector extracted as a fixed length is expressed as,
[0024]
[0025] As a preferred solution of the graph neural network electricity consumption anomaly extraction method for the industrial chain described in the present invention, wherein: LSTM is composed of LSTM units, the input gate selectively "memorizes" the input signal xt and saves it to the unit state ct; the forgetting gate filters the unit state ct-1 transmitted from the previous node to decide how much information to forget; the output gate controls how much of the unit state ct is output to the output value ht of the LSTM.
[0026] As a preferred solution of the graph neural network power consumption anomaly extraction method for the industrial chain described in the present invention, wherein: the gate is a fully connected layer, the input is a vector, and the output is a real number vector between 0 and 1, expressed as,
[0027]
[0028] Among them, Wc, Wi, Wf and Wo represent the weight matrices of the unit state, input gate, forget gate and output gate respectively, which means connecting two vectors into a longer vector, b represents the bias corresponding to each item, and represents the sigmoid function.
[0029] As a preferred solution of the graph neural network power consumption anomaly extraction method for the industrial chain described in the present invention, wherein: the node embedding uses an improved sLSTM model to improve the calculation process, and a scalar update mechanism is added on the basis of LSTM;
[0030] Optimize the gating mechanism through fine-grained control of internal memory cells.
[0031] As a preferred solution of the graph neural network power consumption anomaly extraction method for the industrial chain described in the present invention, the improved sLSTM model is expressed as:
[0032] c t =f t c (t-1) +i t z t
[0033] n t =f t n t-1 +i t
[0034]
[0035] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method for extracting electricity consumption anomalies using a graph neural network for an industrial chain as described above are implemented.
[0036] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for extracting electricity consumption anomalies using a graph neural network for an industrial chain as described above.
[0037] Beneficial effects of the present invention: The graph neural network power consumption anomaly extraction method for the industrial chain provided by the present invention is based on the power consumption idea of the industrial chain. By extracting the time-weather-temperature-power consumption information features of a single enterprise as nodes in the graph, and the relationship between enterprises as edge information in the graph, the graph neural network is used to realize the association of power consumption features with regional enterprises, locations, time, and weather, and complete the detection of power consumption anomalies. Using this technical solution, the detection accuracy of power anomalies is improved by 5% compared with the classic detection algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] 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.
[0039] Figure 1 An overall flow chart of a graph neural network electricity consumption anomaly extraction method for an industrial chain provided by an embodiment of the present invention.
[0040] Figure 2 An LSTM structure diagram of a graph neural network electricity consumption anomaly extraction method for an industrial chain provided by an embodiment of the present invention.
[0041] Figure 3 An LSTM expansion structure diagram of a graph neural network electricity consumption anomaly extraction method for an industrial chain provided by an embodiment of the present invention.
[0042] Figure 4 A comparison chart of test results of a graph neural network electricity consumption anomaly extraction method for an industrial chain provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0043] 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.
[0044] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0045] Example 1, reference Figure 1-Figure 3 , which is an embodiment of the present invention, provides a graph neural network electricity consumption anomaly extraction method for the industrial chain, including:
[0046] Data preprocessing: To preprocess the electricity consumption data from different enterprises, align the electricity consumption-time series and temperature-time series information of a single enterprise, unify the time information into the UTC time system, and normalize the data. The normalization step uses Z-score normalization. The specific formula is shown below. The normalized data is stored in pickle format.
[0047] x * =(x-μ x ) / σ x
[0048] y * =(y-μ y ) / σ y
[0049] x * ,y * They represent the normalized temperature and enterprise electricity consumption data, x, y are the original temperature and enterprise electricity consumption, μ x , μ y represents the original temperature mean and the enterprise electricity consumption mean, σ x , σ y The standard deviation of original temperature and the standard deviation of enterprise electricity consumption.
[0050] Node embedding: The feature of each node is represented as a vector u. The construction process is as follows. A long short-term memory neural network is established for electricity consumption data to extract features and extract them into feature vectors of fixed length.
[0051]
[0052] The eigenvector at time t is:
[0053]
[0054] It should be noted that the long short-term memory neural network here is sLSTM, and the traditional LSTM principle is:
[0055] like Figure 2 As shown in the figure, LSTM is composed of a series of LSTM units, and its specific structure is shown in the figure. The input gate selectively "memorizes" the input signal ut and saves it to the unit state ct; the forget gate filters the unit state ct-1 passed from the previous node to decide how much information to forget; the output gate controls how much of the unit state ct is output to the LSTM output value ht.
[0056] The gate is actually a fully connected layer. The input is a vector and the output is a real vector between 0 and 1. The calculation equation of the gate is shown below. Where Wc, Wi, Wf and Wo represent the weight matrices of the unit state, input gate, forget gate and output gate respectively. [h t-1 ,u t ] means connecting two vectors into a longer vector, b represents the bias corresponding to each item, and σ represents the sigmoid function.
[0057]
[0058] Without considering the bias and nonlinear links, we have:
[0059]
[0060] The update equation of the LSTM unit state is expressed as follows, and the output ht of the hidden node is calculated as follows, where ⊙ represents the vector dot multiplication operation.
[0061] c t =i t ⊙a t +f t ⊙c t-1
[0062] h t =o t ⊙tanh(c t )
[0063] The structure of LSTM expanded over time is as follows Figure 3 As shown in Figure 2, the data of two adjacent moments are transmitted through states c and h in the LSTM method.
[0064] The improved sLSTM is used in the present invention, which improves the calculation process. The improved calculation process is:
[0065] n t =f⊙ t n t-1 +i t
[0066]
[0067] The improved sLSTM adds a scalar update mechanism to the traditional LSTM. By fine-grained control of internal memory units and optimizing the gating mechanism, it is more suitable for processing sequence data with subtle time changes. sLSTM uses exponential gating and normalization techniques to improve the stability and accuracy of the model in processing long sequence data. In this way, sLSTM can provide performance comparable to complex models while maintaining low computational complexity, and is suitable for resource-constrained environments or applications that require fast response.
[0068] The purpose of the improvement is to further improve the detection accuracy and detection speed; t and c t The calculation process of c was modified. t .
[0069] The original calculation process is:
[0070] c t =i t ⊙a t +f t ⊙c t-1
[0071] h t =o t ⊙tanh(c t )
[0072]
[0073] The modified calculation process is:
[0074] c t =i t ⊙a t +f t ⊙c t-1
[0075] n t =f⊙ t n t-1 +i t
[0076]
[0077] Effect achieved: Effectively improved computing efficiency and model reasoning capabilities.
[0078] The electricity consumption data of users in the power field is a time series data. When dealing with time series problems, traditional models often have problems with calculation efficiency and accuracy. The method of the present invention improves the calculation method of the traditional model and adopts the sLSTM model to improve the calculation efficiency on the basis of more fully mining the characteristics of power data.
[0079] Graph embedding: convert the vector formed by node embedding into a graph structure, and re-represent the entire graph as a new vector, which can be used to describe the state and properties of the entire anomaly detection system. Graph embedding is the process of mapping the node information in the graph into a low-dimensional vector space. The embedded vector can reflect the interactions and relationships between the nodes in the graph.
[0080] Graph Convolutional Network (GCN): Graph convolutional network is used to extract and fuse features from graph structures. Through multi-layer convolution operations, local and global patterns between sensors can be learned and fused into a more comprehensive feature representation. At the same time, pooling layer and normalization layer modules are added between convolution operations to further improve the robustness and stability of features.
[0081] Network training: Use known data to train the graph neural network to optimize the network's parameters and loss function and improve the network's performance and robustness. During network training, the data set is divided into a training set and a validation set. The training set is used to update parameters, and the validation set is used for model selection and adjustment.
[0082] Output: After training is completed, the trained graph neural network is used for output prediction. That is, new enterprise electricity consumption data is input and forward propagated through the network to obtain the corresponding anomaly detection results. The anomaly detection results include two categories: abnormal electricity consumption and normal electricity consumption.
[0083] Embodiment 2, an embodiment of the present invention, which is different from the previous embodiment in that:
[0084] 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.
[0085] 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.
[0086] 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.
[0087] 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.
[0088] Example 3, reference Figure 4 , which is an embodiment of the present invention, provides a graph neural network electricity consumption anomaly extraction method for the industrial chain. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.
[0089] The present invention is verified on the user's real kilowatt-hour electricity consumption data set released by the State Grid Corporation of China (SGCC). The data set contains the daily electricity consumption records of 42,372 users in 1,035 days (from January 2014 to October 2016). The present invention is compared with the random forest model, the KNN model and the BP neural network. Experiments show that the method proposed in the present invention has better detection accuracy.
[0090] 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 graph neural network electricity consumption anomaly extraction method for the industrial chain, characterized in that: include: Collect electricity consumption data from different enterprises for pre-processing; The feature of each node is represented as a vector, and a long short-term memory neural network is established for the electricity consumption data to extract features into a feature vector of fixed length; Convert the vector formed by node embedding into a graph structure and re-represent the entire graph as a new vector; A graph convolutional network is used to extract and fuse features from the graph structure. Through multi-layer convolution operations, local and global patterns between sensors are learned and fused into a feature representation. Add pooling layer and normalization layer modules between convolution operations; Use known data to train the graph neural network; After the training is completed, the trained graph neural network is used to make output predictions, the power consumption data is input, and the anomaly detection results are obtained through forward propagation through the network to determine whether the power consumption is abnormal or normal.
2. The graph neural network power consumption anomaly extraction method for the industrial chain as claimed in claim 1 is characterized by: The preprocessing includes aligning the electricity consumption-time series and temperature-time series information of a single enterprise, unifying the time information into the UTC time system, and normalizing the data. The normalization step uses Z-score normalization, and the normalized data is stored in a pickle format.
3. The graph neural network power consumption anomaly extraction method for the industrial chain as claimed in claim 2 is characterized by: The normalization is expressed as, x * =(x-μ) x ) / s x y * =(y-μ y ) / s y Among them, x * ,y * They represent the normalized temperature and enterprise electricity consumption data, x, y are the original temperature and enterprise electricity consumption, μ x , μ y represents the original temperature mean and the enterprise electricity consumption mean, σ x , σ y The standard deviation of original temperature and the standard deviation of enterprise electricity consumption.
4. The graph neural network power consumption anomaly extraction method for the industrial chain as claimed in claim 3 is characterized by: The feature vector extracted to a fixed length is expressed as, 5. The graph neural network power consumption anomaly extraction method for the industrial chain as claimed in claim 4 is characterized by: LSTM is composed of LSTM units. The input gate selectively "memorizes" the input signal xt and saves it to the unit state ct; the forget gate filters the unit state ct-1 passed from the previous node to decide how much information to forget; the output gate controls how much of the unit state ct is output to the output value ht of the LSTM.
6. The graph neural network power consumption anomaly extraction method for the industrial chain as claimed in claim 5 is characterized by: The gate is a fully connected layer, the input is a vector, and the output is a real number vector between 0 and 1, expressed as, Among them, Wc, Wi, Wf and Wo represent the weight matrices of the unit state, input gate, forget gate and output gate respectively, which means connecting two vectors into a longer vector, b represents the bias corresponding to each item, and represents the sigmoid function.
7. The graph neural network power consumption anomaly extraction method for the industrial chain as claimed in claim 6 is characterized by: The node embedding uses an improved sLSTM model to improve the calculation process and add a scalar update mechanism based on LSTM; Optimize the gating mechanism through fine-grained control of internal memory cells.
8. The graph neural network power consumption anomaly extraction method for the industrial chain as claimed in claim 7 is characterized by: The improved sLSTM model is expressed as: c t =f t c (t-1) +i t z t n t =f t n t-1 +i t 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 graph neural network electricity consumption anomaly extraction method for the industrial chain described in any one of claims 1 to 8 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 graph neural network electricity consumption anomaly extraction method for the industrial chain described in any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Power resource allocation prediction method and system based on industrial chain power consumption data analysis
CN122267718A
