A method and system for predicting carbon factor of power grid nodes based on graph neural network

Through the method based on graph neural network, a supervised graph convolution neural network is established, and iterative training is performed using the load sequence and carbon emission factor data of the power grid system, which solves the problem that the existing technology cannot predict future carbon emission factors, and achieves the correct The rapid and accurate prediction of carbon emission factors at the grid nodes supports grid optimization scheduling and user carbon reduction.

CN117670586BActive Publication Date: 2024-12-24NORTHEASTERN UNIV FOSHAN GRADUATE SCHOOL OF INNOVATION
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311620749.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-28
Publication Date
2024-12-24
Estimated Expiration
2043-11-28

AI Technical Summary

Technical Problem

The existing technology cannot predict future carbon emission factors in the absence of grid operating parameters, and the processing of grid loss and new energy generator sets is not accurate enough, resulting in insufficient calculation of carbon emission factors and inability to give carbon emission factors for the future period. Data, the user side carbon reduction guidance cannot be activated.

Method used

Using a graph neural network-based method, by establishing a supervised graph convolution neural network, iterative training is performed using the load sequence and carbon emission factor data of the power grid system to generate a prediction model, and real-time prediction of carbon emission factors of the power grid nodes is considered. topology and power generation power of generator set.

Benefits of technology

It realizes the rapid prediction of grid carbon emission factors in the absence of grid operating parameters, improves the accuracy and real-time prediction, provides users with carbon reduction guidance, and supports grid optimization scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117670586B_ABST
    Figure CN117670586B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of energy consumption prediction, and specifically to a method and system for predicting the carbon factor of power grid nodes based on graph neural networks. The method comprises: determining the load sequence and carbon emission factor of each node in the power system; establishing a supervised graph convolutional neural network, and iteratively training the graph convolutional neural network to obtain a trained prediction model; wherein the input data of the graph convolutional neural network is the load sequence of the node, and the output data of the graph convolutional neural network is the carbon emission factor of the node; inputting the load collected from the node in real time into the prediction model to predict the carbon emission factor of the node; the present invention can quickly predict the carbon emission factor of the node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of energy consumption prediction, and in particular to a method and system for predicting carbon factors of power grid nodes based on graph neural networks. Background Art

[0002] The classical carbon emission flow theory is the theoretical basis of the existing methods for calculating carbon emission factors. It links the virtual carbon emission flow with the power grid flow, characterizes the carbon emissions corresponding to the power flowing through the branch, and proposes a basic method for calculating the carbon potential of the node without considering the network loss. Most of the existing technologies are based on the classical or improved carbon emission flow theory, such as allocating the network loss to the load by calculating the equivalent transmission power of the line and the equivalent load of the node, and converting the lossy network into a lossless network; considering the impact of random and uncertain injected power such as wind power and photovoltaic power on the carbon emission flow, the uncertain characteristics of the carbon emission flow of the power system under random and intermittent power injection are obtained. These technologies are widely used in the calculation of carbon emission factors of power grids under various working conditions.

[0003] According to the carbon emission flow theory, the existing method for calculating the carbon emission factor of the grid node must know all the grid operation parameters, which means that the existing technology must rely on past grid data to complete the calculation of the node carbon emission factor. This post-evaluation feature makes it impossible for the existing technology to provide carbon emission factor data for a period of time in the future, and it is impossible to activate the user side to provide users with effective carbon reduction guidance. Secondly, the current carbon emission flow theory still needs to be improved, especially the treatment of network losses and new energy generators, which makes the existing technology not accurate enough when calculating the node carbon emission factor. Summary of the invention

[0004] The purpose of the present invention is to provide a method and system for predicting carbon factors of power grid nodes based on graph neural networks, which can quickly predict carbon emission factors.

[0005] In order to achieve the above object, the present invention provides the following technical solutions:

[0006] In a first aspect, an embodiment of the present invention provides a method for predicting carbon factor of a power grid node based on a graph neural network, the method comprising the following steps:

[0007] S100, determining the load sequence and carbon emission factor of each node in the power system;

[0008] S200, establishing a supervised graph convolutional neural network, and iteratively training the graph convolutional neural network to obtain a trained prediction model; wherein the input data of the graph convolutional neural network is the load sequence of the node, and the output data of the graph convolutional neural network is the carbon emission factor of the node;

[0009] S300, inputting the load collected from the node in real time into the prediction model to predict the carbon emission factor of the node.

[0010] Optionally, the carbon emission factor of each node in the power system is determined by:

[0011] The carbon emission factor of a node is calculated according to the following formula:

[0012]

[0013] In the formula, is the carbon emission factor of the ith node, represents the power generation of the kth generator connected to the i-th node, g i represents the number of generators connected to the i-th node, represents the carbon emission factor of the kth generator; represents the load of the ith node, d i represents the total number of loads connected to the i-th node; represents the power flow injected from the jth node to the ith node, n i Represents the total number of nodes connected to the jth node and the ith node;

[0014] By processing formula (1), we can obtain formula (2) for calculating carbon emission factor:

[0015]

[0016] in, is the diagonal component, representing the total power flowing out of the i-th node; is the non-diagonal component, which represents the power flow injected from the jth node to the i-th node.

[0017] Optionally, in S200, the step of establishing a supervised graph convolutional neural network and iteratively training the graph convolutional neural network to obtain a trained prediction model includes:

[0018] S210, determining an adjacency matrix and a degree matrix of the power grid system: wherein the adjacency matrix is ​​used to describe the connection relationship between nodes in the power grid system, and the degree matrix is ​​used to measure the centrality of nodes in the power grid system, and the degree matrix is ​​calculated based on the adjacency matrix;

[0019] S220, based on degree matrix and adjacency matrix Determine a transfer formula for transferring graph convolutional neural network parameters, and transfer parameters of the graph convolutional neural network in training according to the transfer formula;

[0020] S230, using a back propagation algorithm to iteratively update the parameters of the graph convolutional neural network until the iterative loss calculated according to the loss function reaches an expected value, thereby obtaining a trained prediction model.

[0021] Optionally, determining the adjacency matrix and degree matrix of the power grid system includes:

[0022] The nodes in the power grid are numbered 1, 2, 3, ..., n, forming an n×n original matrix;

[0023] If nodes i and j in the power grid are directly connected, the corresponding positions of the i-th row and j-th column and the j-th row and i-th column of the original matrix are set to 1; if nodes i and j are not directly connected, the corresponding positions of the original matrix are set to 0, and the first adjacency matrix A of the power grid system is obtained;

[0024] The second adjacency matrix of the power grid system is calculated according to the following formula:

[0025]

[0026] Where I is the identity matrix with the same dimension as the first adjacency matrix A;

[0027] The degree matrix is ​​calculated according to the following formula The degree matrix of the node in row i and column j is

[0028]

[0029] The power generation vector of the generator set is introduced into the second adjacency matrix through the attention mechanism Get the adjacency matrix

[0030] Optionally, the adjacency matrix Calculated by the following formula:

[0031] S = C·b (5);

[0032]

[0033] B = A⊙S(7);

[0034]

[0035] Where b is the power vector of the generator set, with a dimension of g×1, where g is the number of generators; C is a random number matrix with a dimension of e×g, where e is the number of edges in the power grid system; S is a column vector with a dimension of e; is a symmetric matrix of dimension n×n.

[0036] Optionally, the formula for transferring parameters of the graph convolutional neural network is:

[0037]

[0038] H (l+1) =σ(W (l) H (l) +B (l) ) (10);

[0039] Formula (9) is the expression of the multi-layer parameter transfer process in the graph convolutional neural network, H (l) is the characteristic vector of the Lth layer, i.e., load sequence, whose dimension is d, H (l+1) is the feature vector of the next layer of layer L; is the adjacency matrix in stage 2, is the matrix used to normalize the degree matrix, W (l) is the weight vector of the Lth layer in the graph convolutional neural network, and σ is the nonlinear activation function;

[0040] Formula (10) is the expression of the inter-layer propagation process of the fully connected layer. The output feature vector of the last layer of the graph convolutional neural network is the input vector of the first layer of the fully connected layer; H (l) is the feature vector of the Lth layer, H (l+1) is the feature vector of the next layer of layer L; W (l) is the weight matrix of the Lth layer, so that the feature vector of the Lth layer is projected to the L+1th layer, B (l) is the bias vector of the Lth layer, and σ is a nonlinear activation function.

[0041] Optionally, the loss function is calculated as follows:

[0042]

[0043] Where n is the total number of nodes in the power grid system, is the predicted value of the carbon emission factor of the ith node, y i is the true value of the carbon emission factor of the ith node.

[0044] In a second aspect, an embodiment of the present invention provides a grid node carbon factor prediction system based on a graph neural network, the system comprising:

[0045] at least one processor;

[0046] at least one memory for storing at least one program;

[0047] When the at least one program is executed by the at least one processor, the at least one processor implements a method for predicting the carbon factor of a power grid node based on a graph neural network as described in any one of the above.

[0048] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium storing a program executable by a processor, wherein the program executable by the processor is used to execute a method for predicting the carbon factor of a power grid node based on a graph neural network as described in any one of the above when executed by the processor.

[0049] The beneficial effects of the present invention are as follows: the present invention discloses a method and system for predicting carbon factors of power grid nodes based on graph neural networks. The present invention can obtain a prediction model by training the load of power grid nodes and the corresponding carbon emission factor data. The present invention can quickly predict the carbon emission factor of the power grid based on the power grid load prediction data in the absence of power grid operation parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0051] Figure 1 It is a schematic flow chart of a method for predicting carbon factor of power grid nodes based on graph neural network in an embodiment of the present invention;

[0052] Figure 2 It is a structural schematic diagram of a grid node carbon factor prediction system based on a graph neural network in an embodiment of the present invention. DETAILED DESCRIPTION

[0053] The following will be combined with the embodiments and drawings to clearly and completely describe the concept, specific structure and technical effects of the present invention, so as to fully understand the purpose, scheme and effect of the present invention. It should be noted that the embodiments and features in the embodiments of the present invention can be combined with each other without conflict.

[0054] See also Figure 1 , Figure 1 The present invention provides a method for predicting carbon factor of power grid nodes based on graph neural network, and the method comprises the following steps:

[0055] S100, determining the load sequence and carbon emission factor of each node in the power system;

[0056] It should be noted that since the energy consumption and carbon emissions in the power system are mainly related to the active output of the power source, and are slightly affected by the reactive output of the generator set, it can be considered that the carbon emission flow is only affected by the calculation results of the active power flow of the power system without considering the network loss. Based on the power flow analysis method, the present invention introduces the carbon emission factor of the carbon emission flow definition node, which represents the weighted sum of the active power of each branch flowing into the node. According to the principle of proportional sharing, the carbon flow density of the outflow flow of the node is the same as the carbon emission factor of the node.

[0057] In some embodiments, a group of user node load data is randomly generated, and the power flow data between each node of the power grid system and the actual injected power of the generator are calculated using MATPOWER software when various power parameters of the power grid are known, so as to obtain the parameters required for calculating the carbon emission factor. The carbon emission flow theory is introduced to define the carbon emission factor of each node.

[0058] In some preferred embodiments, the carbon emission factor of each node in the power system is determined by:

[0059] The carbon emission factor of a node is calculated according to the following formula:

[0060]

[0061] In the formula, is the carbon emission factor of the ith node, represents the power generation of the kth generator connected to the i-th node, g i represents the number of generators connected to the i-th node, represents the carbon emission factor of the kth generator; represents the load of the ith node, d i represents the total number of loads connected to the i-th node; represents the power flow injected from the jth node to the ith node, n i Represents the total number of nodes connected to the j-th node and the i-th node.

[0062] The calculation formula of the carbon emission factor is processed to obtain the formula for calculating the carbon emission factor:

[0063]

[0064] in, is the diagonal component, representing the total power flowing out of the i-th node; is the non-diagonal component, which represents the power flow injected from the jth node to the i-th node.

[0065] The present invention revolves around the carbon emission factor of the node, and it is necessary to set and calculate the required power parameters of the power grid. The first is to set the power injected by the generator set and the load of each node. Secondly, the carbon emission intensity of each generator set and the basic power parameters of the power grid are set. On this basis, in some embodiments, MATPOWER software is used. The algorithm of this software is based on the principle of Newton-Raphson iteration. Calling this algorithm can directly derive the power flow distribution and calculate the power flow distribution matrix of the power grid branch. The matrix represents the power flow between each node.

[0066] Since the load of power grid users is relatively stable, the present invention sets the node load to random data that fluctuates within a certain range, and can use MATLAB to generate normally distributed random numbers around the set value. Through multiple sets of random load values, the actual carbon emission factors of multiple sets of nodes can be obtained through flow calculation. The generated multiple sets of loads and their corresponding multiple sets of node carbon emission factors are used as input data and output data of the graph convolutional neural network.

[0067] S200, establishing a supervised graph convolutional neural network, and iteratively training the graph convolutional neural network to obtain a trained prediction model; wherein the input data of the graph convolutional neural network is the load sequence of the node, and the output data of the graph convolutional neural network is the carbon emission factor of the node;

[0068] It should be noted that since the active power of each branch needs to be calculated using power flow and is relatively complex and difficult to control, the present invention uses the load of each node as As the input variable of the graph convolutional neural network, D i As the node load, the calculated carbon emission factor of each node is As output. In this way, a supervised graph convolutional neural network can be designed based on the input and output data. The input data of the graph convolutional neural network is the load sequence D = {D1, D2, D3…D d}, the dimension is d, d is the total number of nodes with load, and the output data is the carbon emission factor of each node The dimension is n.

[0069] S300, inputting the load collected from the node in real time into the prediction model to predict the carbon emission factor of the node.

[0070] In order to predict the node carbon emission factor according to the user's load, the present invention selects a graph convolutional neural network that is compatible with the topological structure of the power grid system, uses the user's node load data as the input data of the graph convolutional neural network, and uses the node carbon emission factor data as the output data of the graph convolutional neural network, thus completing a supervised network. After iteration, the network can fit the relationship between the input data and the output data, and achieves the effect of quickly predicting the node's carbon emission factor according to the node load data.

[0071] It should be noted that the Graph Convolution Network (GCN) is an algorithm that can process graph structured data. Unlike traditional CNN, RNN, etc., which can only process Euclidean spatial data such as images and languages, the Graph Convolutional Neural Network can process a lot of complex regular or irregular data. The most typical is the topological structure or can be processed abstractly as a topological structure such as social networks, chemical formulas, etc. Considering that the power grid system happens to be a topological structure composed of nodes, transmission lines, etc., which is a typical graph structure, this gives the Graph Convolutional Neural Network a natural advantage in extracting the features of power grid nodes. The characteristics of the Graph Convolutional Neural Network are as follows:

[0072] A graph is an entity composed of some points and edges. It includes three elements: points, edges and global information. Global information is composed of points and edges in the graph according to a certain topological structure. Therefore, a graph has three attributes, namely point attributes, edge attributes and global attributes. Since our research subject, the power grid system, happens to be composed of nodes and transmission lines between nodes, they are also a topological structure. In this way, we can set the relationship between points and edges in the graph according to the topological structure of the power grid system, and they perfectly form a graph. The edges in the graph are divided into directed edges and undirected edges, which requires considering whether the relationship between points is exchangeable. Since the nodes in the power grid are of the same type, the direction of the edges in the graph is undirected.

[0073] The convergence process of the graph convolutional neural network is the process of transmitting the information of the neighboring nodes to the central node, and the convergence is completed by the weighted sum of the eigenvalues ​​of the adjacent nodes and the central node. It has similar characteristics to convolution. However, unlike convolution, the convergence process is a process of continuous information transmission, which does not change the dimension of the information. Each node in the topological structure is independent, and the information of each node in the graph is transmitted and influenced by each other. It can be considered as a kind of infinite-dimensional data and does not have translation invariance. A single-layer graph convolutional neural network can only perform one node walk, that is, each time the node converges, it can only receive information from the neighboring nodes directly connected to the node. A multi-layer graph convolutional neural network can pass the information of the edge nodes to the central node through multi-step walks. It should be noted that studies have shown that when the number of layers of the graph convolutional neural network is too large, the network will be too smooth. Therefore, we can reasonably choose the number of layers of the graph convolutional neural network according to the complexity of the power grid topology.

[0074] In some preferred embodiments, in S200, the step of establishing a supervised graph convolutional neural network and iteratively training the graph convolutional neural network to obtain a trained prediction model includes:

[0075] S210, determining an adjacency matrix and a degree matrix of the power grid system: wherein the adjacency matrix is ​​used to describe the connection relationship between nodes in the power grid system, and the degree matrix is ​​used to measure the centrality of nodes in the power grid system, and the degree matrix is ​​calculated based on the adjacency matrix;

[0076] It should be noted that the adjacency matrix is ​​used to describe the connection relationship between nodes in the graph, and the graph convolutional neural network uses the adjacency matrix to represent the topological structure in the graph. After the power grid nodes are numbered 1, 2, 3, ....., n, an n×n matrix is ​​formed. If nodes i and j in the power grid are directly connected, then the corresponding positions in the i-th row and j-th column of the matrix and the j-th row and i-th column are set to 1. If nodes i and j are not directly connected, then the corresponding positions are set to 0, thus forming the initial adjacency matrix A of the power grid system. Since the weighted sum of the nodes themselves needs to be considered in the graph convolutional neural network, the diagonal positions in the initial adjacency matrix A also need to be set to 1.

[0077] In some preferred embodiments, determining the adjacency matrix and degree matrix of the power grid system includes:

[0078] The nodes in the power grid are numbered 1, 2, 3, ..., n, forming an n×n original matrix;

[0079] If nodes i and j in the power grid are directly connected, the corresponding positions of the i-th row and j-th column and the j-th row and i-th column of the original matrix are set to 1; if nodes i and j are not directly connected, the corresponding positions of the original matrix are set to 0, and the first adjacency matrix A of the power grid system is obtained;

[0080] The second adjacency matrix of the power grid system is calculated according to the following formula:

[0081]

[0082] Where I is the identity matrix with the same dimension as the first adjacency matrix A.

[0083] It should be noted that the adjacency matrix of the graph is only related to the topological structure of the power grid system. As long as the topological structure of the power grid system remains unchanged, the adjacency matrix does not need to change. The degree matrix is ​​used to measure the centrality of nodes in the system. If a node is connected to i nodes, the degree of the node is i. The degree matrix is ​​related to the adjacency matrix. The degree matrix of the power grid system Based on the adjacency matrix Calculated.

[0084] The degree matrix is ​​calculated according to the following formula The degree matrix of the node in row i and column j is

[0085]

[0086] It should be noted that the degree matrix used in graph convolutional neural networks is used to do weighted summation to update parameters. Since the diagonal elements in the degree matrix are greater than 1, if the degree matrix is ​​used directly, the eigenvector, i.e., the load sequence D = {D1, D2, D3…D d} becomes larger and larger, making the output result unable to converge, which will lead to the failure of graph convolutional neural network training. Therefore, it is necessary to normalize the degree matrix, use the normalized degree matrix to participate in parameter update, and perform corresponding processing in subsequent steps.

[0087] The power generation vector of the generator set is introduced into the second adjacency matrix through the attention mechanism Get the adjacency matrix

[0088] It should be noted that the attention mechanism is borrowed from the focusing function of the human eye and can ignore certain things that the brain considers unimportant. In the neural network, the attention mechanism can make the neural network ignore unimportant eigenvectors by assigning different scores to different factors, and focus on calculating useful eigenvectors. Using the attention mechanism can achieve better fitting effects. While discarding useless features that interfere with the fitting results, the calculation speed is improved. The method for updating parameters of the classic graph convolutional neural network is to use the adjacency matrix to update the parameters in an average weighted manner. This method lacks flexibility. It should be noted that the importance of different nodes is different, and the edges should use different weights. The present invention introduces this concept in the graph convolutional neural network. Considering that the carbon emission factor of the power grid node is affected by the power generation power of the generator set from the source, the present invention introduces the power generation power vector of the generator set as a factor affecting the network output result into the adjacency matrix through the attention mechanism.

[0089] In some preferred embodiments, the adjacency matrix Calculated by the following formula:

[0090] S = C·b (5);

[0091]

[0092] B = A⊙S(7);

[0093]

[0094] Where b is the power vector of the generator set. When the load vector changes, the power vector of the generator set will also change at the same time. Its dimension is g×1, where g is the number of generators. C is a random number matrix with a dimension of e×g, where e is the number of edges in the power grid system. S is a column vector with a dimension of e. is a symmetric matrix of dimension n×n. By using formula (6), the positions in the first adjacency matrix A where the columns are larger than the rows (i.e. the positions where the nodes are connected by edges) are sequentially formed into a set M. The elements in S are sequentially formed into a set N, so that M=N. Then It becomes a symmetric matrix, thereby replacing the variable edge weight value with the value set to 1 in the first adjacency matrix A. The Hadamard product operation of the matrix is ​​performed through formula (7), that is, the corresponding positions of the matrix are multiplied, and the first adjacency matrix A is transformed into the adjacency matrix B containing the attention mechanism. Finally, according to the method in step 1, the adjacency matrix is ​​obtained through formula (8) Through the above method, the adjacency matrix with the attention mechanism is obtained, and the parameters related to the power generation of the generator set are added, making the graph convolutional neural network more effective when updating parameters.

[0095] In the obtained adjacency matrix of the power grid system Sum degree matrix Finally, it is necessary to transfer the parameters between layers in the graph convolutional neural network.

[0096] S220, based on degree matrix and adjacency matrix Determine a transfer formula for transferring graph convolutional neural network parameters, and transfer parameters of the graph convolutional neural network in training according to the transfer formula;

[0097] In some preferred embodiments, the formula for transferring the parameters of the graph convolutional neural network is:

[0098]

[0099] H (l+1) =σ(W (l) H (l) +B (l) ) (10);

[0100] Formula (9) is the expression of the multi-layer parameter transfer process in the graph convolutional neural network, H (l) is the characteristic vector of the Lth layer, i.e., load Sequence, whose dimension is d, i = 1, 2, 3 ... d, H (l+1) is the feature vector of the next layer of layer L; It is the adjacency matrix in stage 2, which sums the weights of all nodes connected to a node and its own node to complete node information aggregation; It is a matrix used to normalize the degree matrix. Since the difference between the eigenvectors of nodes with larger degrees and nodes with smaller degrees in the degree matrix will become larger and larger during the iteration process, the eigenvalues ​​corresponding to the nodes with smaller degrees will have less and less influence on the overall loss, or even be ignored, resulting in the situation where small data is eaten up by big data. Therefore, it is necessary to use The eigenvector is normalized. The left multiplication is to normalize the rows, and the right multiplication is to normalize the columns. The present invention uses The result of the aggregation of the feature vectors of the Lth layer is standardized. (l) It is the weight vector of the Lth layer in the graph convolutional neural network. Each layer in the graph convolutional neural network has only one weight vector. Its purpose is to project the feature vector of the previous layer to the next layer, and the feature vector can be converted into a vector of any dimension. σ is a nonlinear activation function, and functions such as ReLU and softmax can be selected as needed. After iterating through multiple layers of the graph convolutional neural network, the dimension of the feature vector does not necessarily match the dimension of the output vector required by the present invention. Therefore, the present invention adds a fully connected layer after the graph convolutional neural network layer.

[0101] Formula (10) is the expression of the inter-layer propagation process of the fully connected layer. The output feature vector of the last layer of the graph convolutional neural network is the input vector of the first layer of the fully connected layer; H (l) is the feature vector of the Lth layer, H (l+1) is the feature vector of the next layer of layer L; W (l) is the weight matrix of the Lth layer, so that the feature vector of the Lth layer is projected to the L+1th layer, and its dimension is related to the dimension of the feature vector of the Lth layer and the L+1th layer. (l) is the bias vector of the Lth layer, σ is a nonlinear activation function, and generally a softmax function can be used. The dimension of the output feature vector of the last layer of the fully connected layer should be the same as the dimension of the data required by the present invention. In the above embodiment, the carbon emission factor δ of each node p After iterating equations (9) and (10), preliminary output data is obtained.

[0102] S230, using a back propagation algorithm to iteratively update the parameters of the graph convolutional neural network until the iterative loss calculated according to the loss function reaches an expected value, thereby obtaining a trained prediction model.

[0103] After the above stages, the basic model framework has been built. It is necessary to continuously update the parameters in formula (9) and formula (10) according to the output results. The back propagation algorithm is the most commonly used parameter update method in neural networks, and the present invention also uses the back propagation algorithm. The present invention is a supervised neural network. It is very important to select a suitable loss function, which will directly affect the training effect of the model. Considering that the carbon emission factor values ​​of power grid nodes are generally distributed between 0 and 1, using the root mean square error loss function RMSE (root mean square error) will make the loss too small, which is not very convenient when performing gradient descent. Therefore, the present invention uses the mean absolute error MAE (mean absolute error) as the loss function, and updates the parameters according to the loss function until the loss calculated according to the loss function reaches the expected value, and the optimal loss is obtained. The parameters corresponding to the optimal loss update the graph convolutional neural network to obtain a trained prediction model.

[0104] In some preferred embodiments, the loss function is calculated as follows:

[0105]

[0106] Where n is the total number of nodes in the power grid system, is the predicted value of the carbon emission factor of the ith node, y i is the true value of the carbon emission factor of the ith node.

[0107] The training strategy and training parameters of the graph convolutional neural network are as follows:

[0108] After the above stages, the present invention has completely built the entire graph convolutional neural network. In order to achieve better training results, it is necessary to continuously adjust the training parameters and training strategies during the training process of the graph convolutional neural network. The present invention uses a small batch gradient descent method to train a prediction model. This method allows the graph convolutional neural network to first calculate the loss of a batch of samples, and update the corresponding parameters according to the gradient descent direction of the batch of samples, thereby avoiding oscillation in the descent direction. In some embodiments, the number of a batch of samples can be adjusted according to the number of samples and the training situation, and the number of a batch of samples can be appropriately increased when the loss direction oscillates. On this basis, the present invention generates n groups of training data by a tidal calculation method, and divides the training data into a training set, a test set, and a validation set according to a ratio of 7:2:1. After each round of training, the model is placed in the test set, and the model with the best loss is taken to run the validation set. In addition, it is necessary to adjust appropriate training parameters according to the training process, such as the learning rate, the number of training rounds, the number of layers of the graph convolutional neural network, the input and output dimensions of each layer, and the number of neurons in each layer of the fully connected layer. After adjusting the training parameters, the model training can be officially started.

[0109] In summary, the graph convolutional neural network provided by the present invention has the following advantages:

[0110] 1. Graph convolutional neural networks can extract system features containing topological structures, easily adapt to the topological structure of the power grid system, and are simple and easy to use.

[0111] 2. After the graph convolutional neural network model is trained, if the local power grid structure does not change, its prediction speed is very fast and can be used all the time. When the power grid structure changes, the graph convolutional neural network can also adjust the topology structure accordingly, which is very easy.

[0112] 3. Graph convolutional neural networks are highly scalable and can flexibly add or delete some nodes, providing a variety of ideas and improvement directions for training.

[0113] 4. Graph convolutional neural networks can be jointly trained with other neural networks, and can also incorporate mechanisms from other networks, and have good adaptability.

[0114] The present invention firstly starts from the carbon reduction on the user side, builds a carbon emission factor prediction model, quickly predicts the carbon emission factor data for a period of time in the future, and provides strong support for users to reduce carbon. Secondly, it uses graph convolutional neural networks to predict the carbon emission factors of nodes in the power grid system. Within the expected error, it can quickly complete the prediction based on the load conditions of the nodes in the power grid, providing good data support for the optimization and scheduling of the power grid system.

[0115] and Figure 1 Corresponding to the method, refer to Figure 2 The embodiment of the present invention provides a grid node carbon factor prediction system based on a graph neural network, comprising:

[0116] at least one processor;

[0117] at least one memory for storing at least one program;

[0118] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.

[0119] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0120] In addition, an embodiment of the present invention further discloses a computer program product or a computer program, which is stored in a computer-readable storage medium. A processor of a computer device can read the computer program from a computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above method. Similarly, the contents of the above method embodiment are all applicable to the storage medium embodiment, and the functions specifically implemented by the storage medium embodiment are the same as those of the above method embodiment, and the beneficial effects achieved are also the same as those achieved by the above method embodiment.

[0121] It will be appreciated by those skilled in the art that all or some of the methods disclosed above, the system can be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, and the computer-readable medium can include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0122] The above is a specific description of the preferred implementation of the present disclosure, but the present disclosure is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions without violating the spirit of the present disclosure. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present disclosure.

Claims

1. A method for predicting carbon factor of power grid nodes based on graph neural network, characterized in that: The method comprises the following steps: S100, determining the load sequence and carbon emission factor of each node in the power system; S200, establishing a supervised graph convolutional neural network, and iteratively training the graph convolutional neural network to obtain a trained prediction model; wherein the input data of the graph convolutional neural network is the load sequence of the node, and the output data of the graph convolutional neural network is the carbon emission factor of the node; S300, inputting the load collected from the node in real time into the prediction model to predict the carbon emission factor of the node; In S100, the step of determining the load sequence and carbon emission factor of each node in the power system includes: The carbon emission factor of a node is calculated according to the following formula: (1); In the formula, is the carbon emission factor of the ith node, represents the power generation of the kth generator connected to the i-th node, represents the number of generators connected to the i-th node, represents the carbon emission factor of the kth generator; represents the load of the ith node, represents the total number of loads connected to the i-th node; represents the power flow injected from the jth node to the ith node, Represents the total number of nodes connected to the jth node and the ith node; By processing formula (1), we can obtain formula (2) for calculating carbon emission factor: (2); in, is the diagonal component, representing the total power flowing out of the i-th node; is the off-diagonal component, which represents the power flow injected from the jth node to the i-th node; In S200, the step of establishing a supervised graph convolutional neural network and iteratively training the graph convolutional neural network to obtain a trained prediction model includes: S210, determining an adjacency matrix and a degree matrix of the power grid system: wherein the adjacency matrix is ​​used to describe the connection relationship between nodes in the power grid system, and the degree matrix is ​​used to measure the centrality of nodes in the power grid system, and the degree matrix is ​​calculated based on the adjacency matrix; S220, based on degree matrix and adjacency matrix Determine a transfer formula for transferring graph convolutional neural network parameters, and transfer parameters of the graph convolutional neural network in training according to the transfer formula; S230, iteratively updating the parameters of the graph convolutional neural network using a back propagation algorithm until the iterative loss calculated according to the loss function reaches an expected value, thereby obtaining a trained prediction model; The step of determining the adjacency matrix and degree matrix of the power grid system includes: The nodes in the power grid are numbered 1, 2, 3, ..., n, forming an n×n original matrix; If nodes i and j in the power grid are directly connected, the corresponding positions of the i-th row and j-th column and the j-th row and i-th column of the original matrix are set to 1; if nodes i and j are not directly connected, the corresponding positions of the original matrix are set to 0, and the first adjacency matrix A of the power grid system is obtained; The second adjacency matrix of the power grid system is calculated according to the following formula: : (3); Where I is the identity matrix with the same dimension as the first adjacency matrix A; The degree matrix is ​​calculated according to the following formula The degree matrix of the node in row i and column j is : (4); The power generation vector of the generator set is introduced into the second adjacency matrix through the attention mechanism , and get the adjacency matrix ; The adjacency matrix Calculated by the following formula: (5); (6); (7); (8); Where b is the power vector of the generator set, with a dimension of g×1, where g is the number of generators; C is a random number matrix with a dimension of e×g, where e is the number of edges in the power grid system; S is a column vector with a dimension of e; is a symmetric matrix of dimension n×n.

2. A method for predicting carbon factor of power grid nodes based on graph neural network according to claim 1, characterized in that: The formula for transferring the parameters of the graph convolutional neural network is: (9); (10); Formula (9) is the expression of the multi-layer parameter transfer process in the graph convolutional neural network. is the characteristic vector of the Lth layer, i.e., load sequence, whose dimension is d, is the feature vector of the next layer of layer L; is the adjacency matrix in stage 2, is the matrix used to normalize the degree matrix. is the weight vector of the Lth layer in the graph convolutional neural network, is a nonlinear activation function; Formula (10) is an expression of the inter-layer propagation process of the fully connected layer. The output feature vector of the last layer of the graph convolutional neural network is the input vector of the first layer of the fully connected layer. is the feature vector of the Lth layer, is the feature vector of the next layer of layer L; is the weight matrix of the Lth layer, so that the feature vector of the Lth layer is projected to the L+1th layer, is the bias vector of the Lth layer, is a non-linear activation function.

3. A method for predicting carbon factor of power grid nodes based on graph neural network according to claim 1, characterized in that: The calculation formula of the loss function is: (11); Where n is the total number of nodes in the power grid system, is the predicted value of the carbon emission factor of the ith node, is the true value of the carbon emission factor of the ith node.

4. A grid node carbon factor prediction system based on graph neural network, characterized in that: The system comprises: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements a method for predicting carbon factors of power grid nodes based on graph neural networks as described in any one of claims 1 to 3.

5. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to perform the method according to any one of claims 1 to 3 when executed by the processor.

Citation Information

Patent Citations

  • Power distribution network carbon emission flow prediction method

    CN115936255A

  • Carbon footprint prediction method and system based on improved neural network model, and medium

    CN116595878A

  • Time sequence network-based carbon emission factor day-ahead prediction method and system, storage medium and equipment

    CN116862050A

  • Public institution-oriented LSTM recurrent neural network carbon emission prediction method

    CN116882580A

  • Methods and systems for machine-learning for prediction of grid carbon emissions

    US20200372588A1