Electricity consumption early warning method and system based on graph neural network, medium and processor
By constructing a power consumption unit structure graph with edge weights and updating the node feature matrix using a graph neural network, the problem of insufficient consideration of interaction and environmental factors in power consumption early warning is solved, thus achieving efficient and accurate power consumption early warning.
Patent Information
- Application Number
- CN202510793573.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-11-07
AI Technical Summary
Existing electricity consumption early warning technologies cannot accurately capture the interactions between electricity-consuming units and lack comprehensive consideration of environmental factors and external data, resulting in insufficient accuracy and robustness of early warning models.
A graph neural network-based approach is used to construct a power consumption unit structure graph with edge weights. By combining the power consumption unit type and environmental parameters, the node feature matrix is updated through the graph neural network to extract historical sample features and perform early warning detection.
It improves the accuracy and efficiency of electricity consumption early warning, can accurately capture the interaction between electricity users and the impact of environmental factors, enhances the robustness of the model, adapts to changes in the power grid, and reduces the risk of false alarms and missed alarms.
Smart Images

Figure CN120911733A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of electricity consumption early warning, in particular to an electricity consumption early warning method and system based on a graph neural network, a medium and a processor. BACKGROUND
[0002] With the rapid development of big data and artificial intelligence technology, graph neural networks have shown great potential in handling complex network structure data. Graph neural networks have been widely used in social network analysis, recommendation systems, traffic prediction and other fields due to their ability to effectively capture the dependencies between nodes. In particular, in the power system, load forecasting and early warning of the power system have become increasingly important, and accurate electricity consumption early warning helps to optimize the scheduling of the power grid, reduce energy waste and improve power supply reliability. The application of graph neural networks provides a new perspective and method for electricity consumption forecasting and energy management.
[0003] However, existing electricity consumption early warning technologies generally have the following shortcomings: first, traditional methods often rely on simple statistical models or machine learning methods, which are difficult to handle complex power grid topology and cannot accurately capture the interactions between electricity consumption units. Second, existing technologies lack comprehensive consideration of environmental factors and external data, resulting in insufficient accuracy and robustness of the early warning model. These problems limit the effectiveness of existing technologies in practical applications, and the present application is proposed to overcome these technical bottlenecks and achieve efficient and accurate electricity consumption early warning.
[0004] Therefore, there is a need for an electricity consumption early warning method and system based on a graph neural network. SUMMARY
[0005] To overcome the problems of existing technologies that cannot accurately capture the interactions between electricity consumption units and lack comprehensive consideration of environmental factors and external data, the present application provides an electricity consumption early warning method and system based on a graph neural network, which can accurately capture the interactions between electricity consumption units and comprehensively consider the effects of environmental factors and external data, achieving better results in terms of early warning accuracy, efficiency and data processing. The specific technical solutions are as follows:
[0006] An electricity consumption early warning method based on a graph neural network, comprising:
[0007] S1: Obtain first data of electricity consumption units and perform standardization processing;
[0008] S2: Construct an electricity consumption unit structure graph G with edge weights according to the first data;
[0009] S3: Construct a graph structure model G(Q, X) according to the electricity consumption unit structure graph G;
[0010] S4: updating the feature value matrix X in the graph structure model G(Q, X) through the graph neural network to obtain a new feature value matrix X new , updating the feature value of each node in the power consumption unit structure graph G according to the new feature value matrix X new ;
[0011] S5: obtaining historical samples based on the updated power consumption unit structure graph G, and performing feature extraction and early warning detection on the historical samples.
[0012] Further, in step S2, the power consumption unit structure graph G with edge weights is constructed according to the first data, including the following steps:
[0013] S21: initializing the weight of each edge between power consumption unit nodes as a first initial weight;
[0014] S22: multiplying the first initial weight of each edge by a category coefficient γ according to the type of the power consumption unit to obtain a second initial weight;
[0015] S23: setting a position coefficient β of the edge according to the environmental parameters of each power consumption unit;
[0016] S24: multiplying the position coefficient β of the edge to the second initial weight to obtain an edge weight coefficient of the edge;
[0017] S25: taking the power consumption unit as a node in the graph structure, and constructing a power consumption unit structure graph G with edge weights according to the edge weight coefficient between nodes.
[0018] Further, in step S22, the category coefficient γ is set to γ1 for the connection edge between power consumption unit nodes of the same type, and is set to γ2 for the connection edge between power consumption unit nodes of different types; and the γ2 is different from the γ1.
[0019] Further, in step S23, the position coefficient β of the edge is set according to the environmental parameters of each power consumption unit, including the following steps:
[0020] Taking the environmental parameters in the first data related to the power consumption unit node A as a vector a;
[0021] Taking the environmental parameters in the first data related to the power consumption unit node B as a vector b;
[0022] Calculating the edge position coefficient β of the edge between the power consumption unit node A and the power consumption unit node B according to the vector a and the vector b, and the calculation formula is as follows:
[0023]
[0024] wherein ||a-b|| represents the Euclidean distance between vector a and vector b.
[0025] Further, in step S3, the graph structure model G(Q, X) includes a weight matrix Q and a feature value matrix X; the weight matrix Q is a matrix composed of edge weight coefficients of edges connecting nodes of the power consumption unit structure graph G; and the feature value matrix X is a matrix composed of feature values of individual nodes of the power consumption unit structure graph G.
[0026] Further, in step S4, the feature value matrix X new The calculation formula is as follows:
[0027]
[0028] σ(x) = max(0, x);
[0029] wherein D represents a degree matrix; W represents pre-trained graph neural network model parameters; σ represents a nonlinear activation function, and X represents a feature value matrix; represents an edge weight coefficient of an edge connecting the i-th node and the j-th node; and A is an original adjacency matrix of the power consumption unit structure graph G.
[0030] Further, in step S5, based on the updated power consumption unit structure graph G, historical samples are obtained, and feature extraction and early warning detection are performed on the historical samples, including the following steps:
[0031] S51: Based on the updated power consumption unit structure graph G, feature data of all power consumption unit nodes at a time t are obtained, and feature values of all power consumption unit nodes at multiple time points before the time t are obtained, and historical samples are constructed for each power consumption unit;
[0032] S52: A historical feature value matrix is constructed based on the historical samples;
[0033] S53: Feature extraction is performed on the historical feature value matrix, and a prediction value is obtained; the calculation formula of the prediction value is as follows:
[0034] M = ConV(F);
[0035] wherein F represents the historical feature value matrix, and M as the prediction value is an n-dimensional vector, each dimension representing a calculation result of each power consumption unit;
[0036] S54: A power use early warning threshold is set; if the prediction value does not exceed the early warning threshold, no early warning is performed on the power consumption trend of the power consumption unit; if the prediction value exceeds the early warning threshold, the power consumption trend of the power consumption unit is early warned, and the power consumption behavior of the power consumption unit is intervened.
[0037] A power consumption early warning system based on a graph neural network, applied to the power consumption early warning method based on the graph neural network described above, comprising:
[0038] An acquisition module for acquiring first data of the power consumption unit and performing standardization processing;
[0039] A first construction module for constructing a power consumption unit structure graph G with edge weights according to the first data;
[0040] A second construction module for constructing a graph structure model G(Q, X) according to the power consumption unit structure graph G;
[0041] An update module for updating a feature value matrix X in the graph structure model G(Q, X) through a graph neural network to obtain a new feature value matrix X new , and updating the feature value of each node in the power consumption unit structure graph G according to the new feature value matrix X new
[0042] A prediction module for acquiring historical samples based on the updated power consumption unit structure graph G, performing feature extraction and early warning detection on the historical samples.
[0043] A computer-readable storage medium comprising a stored program, wherein the program controls the device where the computer-readable storage medium is located to execute the power consumption early warning method based on the graph neural network described above when the program is running.
[0044] A processor for running a program, wherein the program executes the power consumption early warning method based on the graph neural network described above when the program is running.
[0045] Compared with the prior art, the beneficial effects of the present application are:
[0046] 1. The interaction between power consumption units can be accurately captured, and the influence of environmental factors and external data can be comprehensively considered, achieving better results in terms of early warning accuracy, efficiency, and data processing.
[0047] 2. Precise capture of power consumption unit correlation: by constructing a power consumption unit structure graph with edge weights, the power consumption unit is abstracted as a graph node, and the edge weight integrates the power consumption unit type and environmental parameter difference, which can intuitively depict the strong and weak correlation in the power grid topology, laying a foundation for the neural network to capture nonlinear relationships, and solving the problem of complex spatial dependence between power grid nodes that traditional methods cannot handle.
[0048] 3. Fusion of multi-node information to improve prediction accuracy: use graph convolution network or graph attention network to update node feature matrix, realize "neighbor aggregation" of node features, make each node new feature fuse its own and adjacent node weighted information, effectively capture regional electricity consumption trend, improve prediction accuracy, and solve the problem of ignoring adjacent node collaborative effect in traditional model.
[0049] 4. Comprehensive environmental factors to enhance model robustness: temperature, humidity and other environmental parameters are taken as node environment vector, the position coefficient is embedded into edge weight, and the data is standardized pretreated, the external variable is included, the warning ability of the model under extreme conditions is enhanced, and the problem that the existing model does not fully consider environmental factors is solved.
[0050] 5. Dynamic feature update to adapt to power grid changes: periodically update node feature matrix through graph neural network, combine long time series historical sample modeling, ensure that the model reflects the latest power consumption mode, capture periodicity and trend of load, and solve the problem that static model cannot adapt to power grid topology changes.
[0051] 6. Distributed graph structure storage and end-to-end pipeline design are adopted to improve data processing efficiency, which can support large-scale power grid real-time warning, and solve the problems of high warning delay and low processing efficiency of existing technology. BRIEF DESCRIPTION OF DRAWINGS
[0052] In order to more clearly illustrate the technical solutions in the specific embodiments or prior art of the present application, the drawings needed in the description of the specific embodiments or prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, each element or part is not necessarily drawn according to the actual proportion.
[0053] Figure 1 A flowchart of a power consumption warning method based on a graph neural network;
[0054] Figure 2 A structural diagram of a power consumption warning system based on a graph neural network. DETAILED DESCRIPTION
[0055] The technical solutions in the embodiments of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0056] It should be understood that the terms "comprises" and "comprising" when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0057] It should also be understood that the terms used in the specification of the present application are only for the purpose of describing particular embodiments and are not intended to limit the present application. As used in the specification and the appended claims of the present application, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0058] It should be further understood that the term "and / or" used in the present application means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0059] Embodiment one
[0060] As Figure 1 shows a flowchart of a power consumption early warning method based on a graph neural network, including the following steps:
[0061] S1: Obtain the first data of the power consumption unit and perform standardization processing.
[0062] In a specific implementation, the power consumption unit includes various power consumption units in a city and key nodes of a power grid; further, the power consumption unit includes a shopping mall, a residential area, a school, a hospital, and the like. The present embodiment is implemented in an actual city power consumption detection scenario, and there are many power consumption units in the scenario, such as factories, residential areas, and government agencies.
[0063] Further, the first data includes electrical parameter and environmental parameter data of various power consumption units in the city measured and recorded by a monitoring device in real time. Further, the electrical parameter data includes electrical parameters such as current, voltage, power, and power factor; and the environmental parameters include temperature, humidity, vibration, and the like. Further, the monitoring device includes a smart meter responsible for power grid data acquisition in a graph neural network construction module and a sensor for temperature, humidity, vibration, and the like detection. Further, the sensor includes a thermometer, a hygrometer, a capacitive sensor, and the like. Through power consumption data acquisition, power consumption data of all power consumption units in the city are collected and saved in real time.
[0064] The first data of the power consumption unit is automatically collected from the smart meter and the sensor according to a preset time interval.
[0065] In a specific implementation, the standardization processing includes deleting error data, outliers and duplicate records generated in the collection process, missing data is completed by the mean filling method, and all collected data is scaled to the range of 0-1, and the scaling formula is represented as:
[0066]
[0067] wherein x represents the collected data, x min represents the minimum value in the collected data of a certain type, x max represents the maximum value in the collected data of a certain type, and x norm represents the standardized data.
[0068] S2: Constructing a power consumption unit structure graph G with edge weight according to the first data. Including the following steps:
[0069] S21: First, initialize the weight of each edge between power consumption unit nodes as the first initial weight, and the initial weight can be set to 1;
[0070] S22: Then multiply the first initial weight of each edge by the category coefficient γ according to the type of the power consumption unit to obtain the second initial weight;
[0071] The category coefficient of the connecting edge between the nodes of the same type of power consumption unit is set to γ1; and the category coefficient of the connecting edge between the nodes of different types of power consumption unit is set to γ2.
[0072] S23: In addition to setting the edge category coefficient according to the type of the power consumption unit, the position coefficient β of the edge is also set according to the environmental parameters of each power consumption unit.
[0073] Further, the position coefficient β of the edge is set according to the environmental parameters of each power consumption unit, including the following steps:
[0074] The environmental parameters in the first data related to the power consumption unit node A are taken as vector a, and the vector a is exemplified as follows:
[0075] a = [temperature, humidity, ultraviolet light, etc.];
[0076] The environmental parameters in the first data related to the power consumption unit node B are taken as vector b;
[0077] The edge position coefficient β between the power consumption unit node A and the power consumption unit node B is calculated according to the vector a and the vector b, and the calculation formula is as follows:
[0078] β = e‖a-b‖ 2 ;
[0079] Wherein ‖a-b‖ represents the Euclidean distance between the vector a and the vector b.
[0080] S24: multiply the position coefficient β of the edge to the second initial weight to obtain the edge weight coefficient of the edge;
[0081] S25: take each power consumption unit as a node in the graph structure, and construct a power consumption unit structure graph G with edge weights according to the edge weight coefficients between the nodes.
[0082] For example:
[0083] The standard data collected and standardized by S1 is subjected to graph structure construction, each power consumption unit in the city is regarded as a node in the graph structure, it is assumed that there are n power consumption units in the city, a power consumption unit structure graph G with n nodes is constructed, then each two nodes in the power consumption unit structure graph G are connected by an edge, a total of n(n-1) / 2 edges are constructed, and each edge is assigned a weight value. First, the weight of each edge is initialized to 1, then each edge is multiplied by the coefficient γ according to the type of the power consumption unit, for the same type of power consumption unit node, the category coefficient γ1 of the connected edge is set to 2, and the category coefficient γ2 of the different type node is set to 1. The position coefficient β of the edge is set according to the environmental parameters of the power consumption unit. The environmental parameters of the power consumption unit node A are regarded as a vector a = [temperature, humidity, ultraviolet light, etc.]. The environmental parameters of the power consumption node B are regarded as a vector b. Then the position coefficient β between node A and node B is β = e‖a-b‖ 2 . Then multiply all the position coefficients β of the edges to the edge weights to obtain a power consumption unit structure graph G with edge weights.
[0084] S3: constructing a graph structure model G(Q, X) according to the power consumption unit structure graph G.
[0085] In a specific implementation, the graph structure model G(Q, X) includes a weight matrix Q and a feature value matrix X; the weight matrix Q is composed of the edge weight coefficients of the connected edges between the nodes of the power consumption unit structure graph G, and is an n x n matrix, Q ij represents the edge weight coefficient of the connected edge between the i th node and the j th node.
[0086] The feature value matrix X of the power consumption unit structure graph G is composed of the feature values (i.e., the electrical parameters described above) of a single node. The feature value matrix X of the node is an n x m matrix, X im represents the m th data collected by the i th node, and the collected data includes m data such as current, voltage, power, and power factor.
[0087] S4: updating the feature value matrix X in the graph structure model G(Q, X) through a graph neural network to obtain a new feature value matrix X new new Update the characteristic value of each node in the power consumption unit structure graph G.
[0088] In specific implementation, the graph neural network can be a graph convolution network, a graph attention network, or other suitable graph neural network. In the embodiments of the present application, the graph neural network uses a graph convolution network as the graph neural network for updating the characteristic value matrix. In this step, the following steps are specifically included:
[0089] S41: Capture the nonlinear relationship of power consumption by fusing the node information and adjacent node information through the graph neural network, and update the characteristic value matrix X to obtain a new characteristic value matrix X new .
[0090] Specifically, each node in the power consumption unit structure graph G updates its own characteristic value by updating the characteristic values of all other nodes, thereby fusing the information of other nodes. The calculation formula for updating the characteristic value matrix X to obtain a new characteristic value matrix X new is represented as:
[0091]
[0092] σ(x)=max(0,x);
[0093] where D represents a degree matrix, W represents a pre-trained graph neural network model parameter, σ represents a nonlinear activation function, X represents a characteristic value matrix, and A is the original adjacency matrix of the power consumption unit structure graph G, recording the connection relationship (whether connected) between nodes.
[0094] S42: Update the characteristic value of each node in the power consumption unit structure graph G according to the new characteristic value matrix X new After updating the node characteristics, the node characteristic values of all power consumption units in the graph are updated, and the updated characteristic values of each node fuse the characteristic information of all other nodes, reflecting the nonlinear association between nodes.
[0095] S5: Obtain historical samples based on the updated power consumption unit structure graph G, and perform feature extraction and early warning detection on the historical samples.
[0096] In the embodiments of the present application, the historical samples are obtained by performing feature extraction and early warning detection through a feature extraction method, including the following steps:
[0097] S51: Obtain the characteristic data (i.e., the electrical parameters of each node) of all power consumption unit nodes at a time t (t can be the current time) based on the updated power consumption unit structure graph G, and obtain the characteristic values of all power consumption unit nodes from multiple time points before time t, and construct historical samples for each power consumption unit respectively.
[0098] Further, the plurality of time points can be 99 time points, or 999 time points, or other time points based on the upper limit of system records.
[0099] S52: Construct a historical feature value matrix based on the historical samples. Specifically, the historical feature value matrix F of the i-th node A is i which can be expressed as:
[0100] F i ∈R 100×m ;
[0101] Each row of the matrix F i represents the feature value of the node A at a certain time point, and 100x m represents 100 time points and the number of electrical parameters.
[0102] S53: Feature extraction is performed on the historical feature value matrix to obtain a prediction value.
[0103] In a specific implementation, the feature extraction method can be convolution processing, a recurrent neural network, or other suitable feature extraction methods.
[0104] In an optional embodiment, the feature extraction method uses convolution processing as the method for extracting historical sample features. Specifically, the feature extraction performed on the historical feature value matrix to obtain a prediction value refers to performing convolution processing on the historical feature value matrix, and the convolution result M obtained through the convolution processing is used as the prediction value, which is expressed as:
[0105] M = ConV(F);
[0106] where F represents the historical feature value matrix, and M is an n-dimensional vector, each dimension of which represents the calculation result of each electricity using unit.
[0107] S54: Set a power usage warning threshold. If the prediction value does not exceed the warning threshold, no warning is given to the electricity using trend of the electricity using unit. If the prediction value exceeds the warning threshold, the electricity using trend of the electricity using unit is warned, and the electricity using behavior of the electricity using unit is intervened.
[0108] The calculation result of each electricity using unit on the historical feature value matrix is obtained A power usage warning threshold is set for each electricity using unit, and all power usage warning thresholds are summarized to obtain N ∈ R n M and all elements of N are compared.
[0109] If M i ≤ N i , the electricity using trend of the i-th electricity using unit does not need to be warned temporarily.
[0110] If M i ≥ N i , the power consumption trend of the i-th power consumption unit is warned, and the power consumption behavior is intervened.
[0111] The application provides a power consumption warning method based on a graph neural network, which fully excavates the relationship between power consumption time series data by constructing a graph neural network, improves the accuracy of power consumption warning, and reduces the risk of false positives and false negatives; by combining external factors such as weather data, air data and other environmental parameters, the accuracy of the warning is further improved; through real-time monitoring of the structure graph, a large amount of historical sample data can be quickly processed and real-time warning can be performed; the warning result outputs the power consumption warning value at multiple future moments, and can be visually displayed, which can facilitate user decision-making and planning. The application achieves better results in terms of warning accuracy, efficiency, and data processing.
[0112] Through the graph neural network, the nonlinear correlation between nodes is used to accurately predict the power consumption trend of the power consumption unit, solving the problem of insufficient accuracy and robustness of the current warning model.
[0113] The technical problem solved by the application is that the existing power system power consumption warning method has insufficient ability to process complex power grid topology structure, lacks comprehensive consideration of environmental factors and external data, and how to use a graph neural network to achieve efficient and accurate power consumption warning.
[0114] Embodiment two
[0115] In another optional embodiment, the graph neural network uses a graph attention network as the graph neural network for updating the feature value. In step S4, the feature value matrix X in the graph structure model G(Q, X) is updated by the graph neural network to obtain a new feature value matrix X new , and the feature value of each node in the power consumption unit structure graph G is updated according to the new feature value matrix X new , including the following steps:
[0116] S31: The graph attention network first gives each node in the graph structure model G(Q, X) an initial feature vector, and all nodes form an initial feature matrix.
[0117] S32: For each node in the graph structure model G(Q, X), the graph attention network calculates the attention coefficient between the node and all neighbor nodes.
[0118] S33: Based on the calculated attention coefficient, the features of the neighbor nodes are weighted and summed, and the weighted and summed features are processed through a nonlinear activation function to capture the nonlinear relationship.
[0119] S34: Repeat the above steps in multiple attention layers to finally obtain the updated feature value matrix X of each node new .
[0120] S35: Update the feature value of each node in the power consumption unit structure graph G according to the new feature value matrix X new .
[0121] In an optional embodiment, in step S53, when the historical feature value matrix is extracted and the predicted value is obtained, a recurrent neural network is used as a method for extracting features of historical samples. Specifically, an input layer that accepts sequence data is defined, one or more recurrent layers are added after the input layer, time step processing, hidden state updating, and gating mechanism are performed in the recurrent layer, and the output layer performs prediction based on the feature extraction result of the recurrent layer to obtain the predicted value.
[0122] Embodiment three
[0123] As shown in Figure 2 , a power consumption early warning system based on a graph neural network is applied to the power consumption early warning method based on a graph neural network described above, comprising:
[0124] An acquisition module is configured to acquire first data of a power consumption unit and perform standardization processing.
[0125] A first construction module is configured to construct a power consumption unit structure graph G with edge weights according to the first data.
[0126] A second construction module is configured to construct a graph structure model G(Q, X) according to the power consumption unit structure graph G.
[0127] An update module is configured to update the feature value matrix X in the graph structure model G(Q, X) through a graph neural network to obtain a new feature value matrix X new , and update the feature value of each node in the power consumption unit structure graph G according to the new feature value matrix X new .
[0128] A prediction module is configured to acquire historical samples based on the updated power consumption unit structure graph G, extract features of the historical samples, and perform early warning detection.
[0129] Embodiment four
[0130] A computer readable storage medium, comprising a stored program, wherein the computer readable storage medium controls a device where the computer readable storage medium is located to perform the power consumption early warning method based on the graph neural network described above when the program runs.
[0131] Embodiment five
[0132] A processor for running a program, wherein the power consumption early warning method based on the graph neural network described above is performed when the program runs.
[0133] The application discloses a power consumption early warning method and system based on a graph neural network, a medium and a processor, and relates to the technical field of power consumption early warning. The method comprises the following steps: obtaining power consumption unit data and standardizing the data, constructing a power consumption unit structure graph with edge weights, updating node features based on a graph structure model through a graph neural network, and combining historical samples to perform feature extraction and early warning detection. The edge weight fuses a power consumption unit type coefficient and an environmental parameter distance coefficient, and realizes neighbor information aggregation of node features through adjacency matrix normalization. The system comprises acquisition, construction, updating and prediction modules. The computer readable storage medium and the processor can execute the above method. The application captures the nonlinear correlation between power consumption units through the graph neural network, improves the early warning accuracy by comprehensively considering environmental factors, is suitable for power grid load prediction and real-time management, effectively solves the problems of insufficient topological analysis and missing environmental factor consideration in traditional methods, and has high efficiency and robustness.
[0134] Those skilled in the art can appreciate that the units of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components of the examples have been described in the above description in general terms. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0135] In the embodiments provided in the present application, it should be understood that the division of units is only a logical functional division, and when actually implemented, there can be another division manner, for example, a plurality of units can be combined into one unit, one unit can be split into a plurality of units, or some features can be ignored, etc.
[0136] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0137] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0138] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and they should be covered in the scope of the present application.
Claims
1. A power consumption early warning method based on a graph neural network, characterized in that, The method comprises the following steps: S1: obtaining first data of the power consumption unit and performing standardization processing; S2: constructing a power consumption unit structure graph G with edge weights according to the first data; S3: constructing a graph structure model G(Q, X) according to the power consumption unit structure graph G; S4: updating the feature value matrix X in the graph structure model G(Q, X) through the graph neural network to obtain a new feature value matrix X new , updating the feature value of each node in the power consumption unit structure graph G according to the new feature value matrix X new ; S5: obtaining historical samples based on the updated power consumption unit structure graph G, and performing feature extraction and early warning detection on the historical samples.
2. The power consumption early warning method based on a graph neural network according to claim 1, characterized in that, In step S2, the power consumption unit structure graph G with edge weights is constructed according to the first data, comprising the following steps: S21: initializing the weight of each edge between the power consumption unit nodes as a first initial weight; S22: multiplying a category coefficient γ on the first initial weight of each edge according to the type of the power consumption unit to obtain a second initial weight; S23: setting a position coefficient β of the edge according to the environmental parameters of each power consumption unit; S24: multiplying the position coefficient β of the edge to the second initial weight to obtain an edge weight coefficient of the edge; S25: taking the power consumption unit as a node in the graph structure, and constructing a power consumption unit structure graph G with edge weights according to the edge weight coefficient between the nodes.
3. The power consumption early warning method based on a graph neural network according to claim 2, characterized in that, In step S22, the category coefficient γ is set to γ1 for the connection edge between power consumption unit nodes of the same type, and is set to γ2 for the connection edge between power consumption unit nodes of different types; γ2 is different from γ1.
4. The power consumption early warning method based on a graph neural network according to claim 2, characterized in that, In step S23, the position coefficient β of the edge is set according to the environmental parameters of each power consumption unit, comprising the following steps: Taking the environmental parameters in the first data related to the power consumption unit node A as a vector a; Taking the environmental parameters in the first data related to the power consumption unit node B as a vector b; Calculating the edge position coefficient β between the power consumption unit node A and the power consumption unit node B according to the vector a and the vector b, and the calculation formula is as follows: β = e || a - b || 2 ; Wherein, ‖a-b‖ represents the Euclidean distance between the vector a and the vector b.
5. The power consumption early warning method based on a graph neural network according to claim 4, characterized in that, In step S3, the graph structure model G(Q, X) comprises a weight matrix Q and a feature value matrix X; the weight matrix Q is a matrix composed of edge weight coefficients of the connection edges between nodes of the power consumption unit structure graph G; and the feature value matrix X is a matrix composed of feature values of a single node of the power consumption unit structure graph G.
6. The power consumption early warning method based on a graph neural network according to claim 5, characterized in that, In step S4, the feature value matrix X new The calculation formula is as follows: σ(x) = max(0, x); Wherein, D represents a degree matrix; W represents a pre-trained graph neural network model parameter; sigma represents a nonlinear activation function, and X represents a feature value matrix; represents an edge weight coefficient of a connection edge between the i th node and the j th node; A is an original adjacency matrix of the power unit structure graph G.
7. The power consumption early warning method based on a graph neural network according to claim 1, characterized in that, In step S5, the historical samples are obtained based on the updated power consumption unit structure graph G, and feature extraction and early warning detection are performed on the historical samples, comprising the following steps: S51: obtaining feature data of all power consumption unit nodes at a time t and feature values of all power consumption unit nodes at multiple time points before the time t based on the updated power consumption unit structure graph G, and constructing historical samples for each power consumption unit respectively; S52: constructing a historical feature value matrix based on the historical samples; S53: performing feature extraction on the historical feature value matrix and obtaining a prediction value; the calculation formula of the prediction value is as follows: M = ConV(F); Wherein, F represents the historical feature value matrix, and M is an n-dimensional vector as a prediction value, each dimension representing a calculation result of each power consumption unit. S54: setting a power use early warning threshold value; if the prediction value does not exceed the early warning threshold value, no early warning is performed on the power use trend of the power use unit; if the prediction value exceeds the early warning threshold value, early warning is performed on the power use trend of the power use unit, and intervention is performed on the power use behavior of the power use unit.
8. A power consumption early warning system based on a graph neural network, characterized in that, The power consumption early warning method based on the graph neural network according to any one of claims 1 to 7 comprises: an acquisition module configured to acquire first data of the power use unit and perform standardization processing; a first construction module configured to construct a power use unit structure graph G with edge weights according to the first data; a second construction module configured to construct a graph structure model G(Q, X) according to the power use unit structure graph G; An updating module is configured to update a feature value matrix X in a graph structure model G (Q, X) through a graph neural network to obtain a new feature value matrix X new , update the feature value of each node in the power consumption unit structure graph G according to the new feature value matrix X new a prediction module configured to acquire historical samples based on the updated power use unit structure graph G, and perform feature extraction and early warning detection on the historical samples.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises a stored program, wherein the program controls the device where the computer readable storage medium is located to execute the power consumption early warning method based on the graph neural network according to any one of claims 1 to 7 when the program is running.
10. A processor, comprising: The processor is configured to run a program, wherein the program executes the power consumption early warning method based on the graph neural network according to any one of claims 1 to 7 when the program is running.