Power grid operation state panoramic super-real-time calculation method and system based on Grapher network
The operation status of the power grid is calculated through the Graphormer network in panoramic ultra-real-time, which solves the problem of difficult perception of the spatial structure and node changes of the power grid, realizes the safe and stable operation of the power grid, and provides effective guidance for scheduling.
Patent Information
- Application Number
- CN202411497405.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art is difficult to effectively perceive the real-time changes between the spatial structure of the power grid and the nodes, resulting in unstable grid frequency and affecting the safe and reliable operation of the power grid.
The Graphormer network is used to perform panoramic ultra-real-time calculation of the grid operation state, capture the graph space information and information between nodes through different encoding methods, build the grid operation state panoramic map, node feature matrix and edge feature matrix, and predict it through training models. .
It realizes accurate identification and real-time monitoring of the operating status of the power grid, ensures the safe and stable operation of the power grid, and provides effective guidance for grid scheduling.
Smart Images

Figure CN119443496A_ABST
Abstract
Description
Technical Field
[0001] The patent of this invention relates to the technical field of power system, and relates to a method and system for panoramic ultra-real-time calculation of power grid operation status based on Graphormer network. Background Art
[0002] As renewable energy sources such as photovoltaic power generation and wind power generation are connected to the power grid, the scale of the power grid is gradually expanding, and its complexity and uncertainty are also increasing. In particular, renewable energy generation is intermittent, volatile, and random, which can easily lead to unstable power grid frequency and even cause significant property losses and casualties. Therefore, a comprehensive and real-time estimation of the power grid operation status is very important to ensure the safe and reliable operation of the power grid.
[0003] Transformer networks have powerful sequence data modeling capabilities, such as natural language processing and speech recognition. Variants based on Transformer networks have also performed well in the fields of computer vision and programming languages. However, Transformer networks can only establish connections between independent units and the overall structure of a graph, and are difficult to apply to the representation of the spatial structure of a graph and the relationship between nodes. Graphormer networks introduce different encoding methods based on Transformer networks, which not only allows them to be applied to graph-level tasks, but also allows them to effectively perceive the spatial structure of a graph and the relationship between nodes.
[0004] Although the current artificial intelligence algorithms, such as the neural network, take into account the topological connection relationship of the physical model of the power grid, it is difficult for the network to perceive the spatial structure of the graph and the real-time changes between nodes. The Graphormer network is used to perform ultra-real-time calculations on the power grid operation status. It uses different encoding methods to realize the use of graph spatial information and information between nodes. It can effectively capture the node features and edge features in the panoramic view of the power grid status, and process the changes of the nodes and topological information of the power grid status in real time. At the same time, since the Graphormer network directly receives the panoramic view of the power grid status data, it is more efficient when calculating the power grid status. Therefore, it is necessary to study the panoramic ultra-real-time calculation of the power grid operation status based on the Graphormer network. Summary of the invention
[0005] The purpose of the present invention is to provide a method and system for calculating the panoramic ultra-real-time operation status of a power grid based on a Graphormer network, so as to realize accurate identification of bad data of the power grid and ensure safe and stable operation of the power grid.
[0006] To achieve this purpose, the present invention designs a method for calculating the panoramic ultra-real-time operation status of a power grid based on a Graphormer network, which comprises the following steps:
[0007] Obtaining historical section data of the power grid status, and generating a panoramic view of the power grid operation status, a node feature matrix, and an edge feature matrix based on the historical section data of the power grid status;
[0008] Normalize each node in the grid operation status panorama to obtain node data with unified dimensions;
[0009] The Graphormer network is trained using node data, node feature matrix and edge feature matrix with unified dimensions to obtain an initially trained Graphormer network model, and the real-time cross-sectional data of the power grid status is input into the initially trained Graphormer network model to obtain an initial prediction value of the power grid operation status;
[0010] The loss function of the initially trained Graphormer network model is calculated according to the initial prediction value of the power grid operation status and the prediction value of the power grid operation status obtained by the traditional graph neural network method. According to the loss function, the trained Graphormer network model is obtained, and the real-time cross-sectional data of the power grid status is input into the trained Graphormer network model to obtain the optimal prediction value of the power grid operation status.
[0011] Beneficial effects of the present invention:
[0012] The present invention provides a method for calculating the panoramic ultra-real-time operation status of a power grid based on a Graphormer network. First, a panoramic view of the operation status of a power grid is constructed through the historical section data of the power grid status. The data provided by the power grid section includes node data and edge data. In the process of building the panoramic view, a node feature matrix and an edge feature matrix are obtained. Secondly, inspired by the Transformer network, centrality coding, spatial coding and edge coding are constructed in the network, so that it can effectively process graph structure data. Furthermore, the node features and edge features of the constructed panoramic view of the operation status of the power grid are innovatively extracted through the Graphormer network, and the node features are mapped to the bus voltage amplitude and voltage phase angle, as well as the active power and reactive power of the main transformer and line nodes. In practical applications, the operation status of the power grid can be calculated in ultra-real time according to the measured values provided by the power grid section, which ensures the safe and stable operation of the power grid, and provides guidance for the dispatching of the power grid. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 is a flow chart of the calculation method of the present invention;
[0014] Figure 2 It is the graphormer network structure diagram;
[0015] Figure 3 It is a schematic diagram of the structure of the present invention. DETAILED DESCRIPTION
[0016] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0017] like Figure 1 A method for calculating the panoramic ultra-real-time operation status of a power grid based on a Graphormer network is shown, which comprises the following steps:
[0018] Obtaining historical section data of the power grid status, and generating a panoramic view of the power grid operation status, a node feature matrix, and an edge feature matrix based on the historical section data of the power grid status;
[0019] Normalize each node in the grid operation status panorama to obtain node data with unified dimensions;
[0020] The Graphormer network is trained using node data, node feature matrix and edge feature matrix with unified dimensions to obtain an initially trained Graphormer network model, and the real-time cross-sectional data of the power grid status is input into the initially trained Graphormer network model to obtain an initial prediction value of the power grid operation status;
[0021] The loss function of the initially trained Graphormer network model is calculated according to the initial prediction value of the power grid operation status and the prediction value of the power grid operation status obtained by the traditional graph neural network method. According to the loss function, the trained Graphormer network model is obtained, and the real-time cross-sectional data of the power grid status is input into the trained Graphormer network model to obtain the optimal prediction value of the power grid operation status.
[0022] A method for calculating the panoramic ultra-real-time operation status of a power grid based on a Graphormer network is proposed. The method obtains the historical section data of the power grid status, and generates a panoramic view of the power grid operation status, a node feature matrix, and an edge feature matrix according to the historical section data of the power grid status. The specific method is as follows:
[0023] Obtain the historical section data of the power grid status, which includes node data and edge data, wherein the node data includes: voltage amplitude measurement value, voltage phase angle measurement value, generator active power, generator reactive power, generator active measurement value, generator reactive measurement value, load active measurement value, load reactive measurement value, load active nominal value, load reactive nominal value; edge data includes: branch resistance, branch reactance and transformer ratio; according to the power grid topology diagram, the node data is modeled as the vertex of the graph, and the power line data is modeled as the edge of the graph; the formula is, is the graph, is the node set, and is the edge set; the historical section data at a moment constitutes a graph, and finally constructs n panoramic views of the power grid operation status;
[0024] The node data is converted into a node feature matrix of (a, b) dimensions, and the edge data is converted into an edge feature matrix of (c, d) dimensions, where a is the number of nodes, b is the type of node data, c is the number of edges, and d is the type of edge data.
[0025] When the historical section data of the power grid status is constructed into a graph structure in the present invention, the node data voltage amplitude measurement value, voltage phase angle measurement value, generator active power, generator reactive power, generator active measurement value, generator reactive measurement value, load active measurement value, load reactive measurement value, load active nominal value, load reactive nominal value are converted into a (97, 10)-dimensional characteristic matrix, and the edge data branch resistance, branch reactance and transformer ratio are converted into a (130, 3)-dimensional characteristic matrix.
[0026] A method for calculating the panoramic ultra-real-time operation status of a power grid based on a Graphormer network is proposed. Each node in the panoramic view of the power grid operation status is normalized to obtain node data with unified dimensions. The specific method is as follows:
[0027] The nodes in each constructed grid operation status panorama are normalized, that is, each node in each map is subtracted from the average value of the corresponding nodes in all maps, and then divided by the standard deviation of the corresponding nodes in all maps. The normalization formula is:
[0028]
[0029] Among them, s i,j is the j-th node data of the i-th graph, is the average value of the j-th node data of all graphs, is the standard deviation of the data of the jth node in all graphs, It is the normalized data of the jth node in the i-th graph.
[0030] Each row of the node feature matrix represents a grid operation state node, and each row contains the features of the state node, namely, voltage amplitude measurement value, voltage phase angle measurement value, generator active power, generator reactive power, generator active measurement value, generator reactive measurement value, load active measurement value, load reactive measurement value, load active nominal value, load reactive nominal value. Each row of the edge feature matrix represents a grid line, and each row contains the features of the line, namely, branch resistance, branch reactance and transformer ratio.
[0031] A panoramic ultra-real-time calculation method for power grid operation status based on Graphormer network is proposed. The Graphormer network is trained using node data, node feature matrix and edge feature matrix with unified dimensions to obtain an initially trained Graphormer network model. The specific method of inputting real-time cross-sectional data of power grid status into the initially trained Graphormer network model to obtain an initial prediction value of power grid operation status is as follows:
[0032] First, the network parameters are initialized, the constructed panoramic view of the power grid operation status is input into the Graphormer network, and the centrality of the nodes in the graph is encoded:
[0033]
[0034] in, is the feature of node j, x j is the feature of the original node j, is the linear change characteristic of node j’s out-degree, is the linear variation characteristic of the in-degree of node j;
[0035] Spatial encoding is performed based on the shortest path distance between two nodes, and the shortest path distance is added to the self-attention mechanism A. ij edgecode In the formula:
[0036]
[0037] Among them, A ij is the (i,j) element in the query and key product matrix of the Graphormer network, h i and h j is the hidden representation of position i and position j, W Q is the weight matrix of the query matrix of the Graphormer network, W K is the weight matrix of the key-value matrix of the Graphormer network, d is the dimension of the hidden layer, is a learnable scalar, φ(v i ,v i ) is the shortest path distance between two nodes, T is the matrix transpose;
[0038] Calculate the weighted average of all edge features on the shortest path between nodes to obtain edge feature encoding, and integrate edge feature encoding into the self-attention mechanism. ij Rewritten as:
[0039]
[0040] Among them, c ij Encode the edge features. is the shortest path distance φ(v i ,v i ), is the nth weight embedding;
[0041] The Graphormer model is based on the self-attention mechanism that incorporates the shortest path distance and feature encoding to obtain the initially trained Graphormer network model. The real-time cross-sectional data of the power grid status is input into the initially trained Graphormer network model to obtain the initial prediction value of the power grid operation status.
[0042] The Graphormer network includes multiple coding layers, each of which includes a self-attention mechanism. Spatial coding and edge coding are integrated into the self-attention mechanism of the traditional Transformer network to enable the network to be applicable to non-Euclidean structures and better applied to processing graph-level tasks, especially the ultra-real-time computing task of the panoramic view of the power grid operation status.
[0043] In the process of converting the node data and edge data of the historical section of the power grid state estimation into a panoramic graph structure, the corresponding node feature matrix and edge feature matrix are obtained, where the node feature matrix dimension is (97,10) and the edge feature matrix dimension is (130,3). Then the constructed power grid operation state panoramic graph is input into the Graphormer network to encode the centrality of the nodes to obtain the node features, and then the node features and edge features are encoded by spatial coding and edge coding. The Graphormer network maps the input historical section node information to the network output power grid operation state estimation prediction value
[0044] A method for calculating the panoramic ultra-real-time operation status of a power grid based on a Graphormer network, wherein the loss function of the initially trained Graphormer network model is calculated according to the initial prediction value of the power grid operation status and the prediction value of the power grid operation status obtained by a traditional graph neural network method, and the trained Graphormer network model is obtained according to the loss function. The specific method of inputting the real-time cross-sectional data of the power grid status into the trained Graphormer network model to obtain the optimal prediction value of the power grid operation status is as follows:
[0045] The estimated value of the power grid operation status calculated by the Graphormer network is compared with the estimated value of the power grid operation status obtained using the traditional graph neural network (GNN) method. The model is trained based on the error, and the loss function is selected as the mean square error function, which is calculated as follows:
[0046]
[0047] Among them, w jis the Graphormer network parameter during the jth training; y i To obtain the estimated predicted value of the power grid operation state through the state estimation method in the traditional graph neural network method, y% i The estimated predicted value of the power grid operation status calculated by the model;
[0048] The traditional method is the graph neural network (GNN) method. In terms of power grid state estimation, GNN has the following disadvantages compared to the Graphormer network: 1. The GNN method mainly focuses on the local topological information of the graph, and it is difficult to model the global information of the graph; 2. GNN relies on the adjacency matrix or edge information of the graph to transmit messages, but when faced with complex graph structures, it is difficult to fully characterize the relative position of nodes in the graph; 3. When dealing with large-scale power grids, GNN training will be affected by too many neighbor nodes or high feature dimensions, resulting in low training efficiency. In short, compared with traditional GNN, the Graphormer network can better capture global information and handle complex power grid topology structures.
[0049] According to the loss function calculated by different training rounds, the Graphormer network parameters are optimized. When the difference between the loss functions of two consecutive rounds is less than a preset threshold, the training is stopped to obtain a trained Graphormer network model. The real-time cross-sectional data of the power grid status is input into the trained Graphormer network model to obtain the best prediction value of the power grid operation status.
[0050] The threshold calculation formula is as follows:
[0051] L(w j )-L(w j+1 )<ε
[0052] Here, ε is an artificially set threshold. In the present invention, the threshold is set to 0.00001.
[0053] The present invention divides 853 panoramic images of power grid operation status into training set, validation set and test set according to the ratio of 6:2:2, adopts the back-propagation optimization algorithm Adam optimizer, sets the learning rate to 0.0001, and trains 200 rounds. The network parameters are optimized according to the loss function, and finally a trained model is obtained, which is evaluated on the validation set and the test set.
[0054] In the present invention, the training set is mainly used for the initial training of the model and for tuning the parameters of the model; the validation set is used to monitor the model training process and for optimizing the hyperparameters; and the test set is used to evaluate the generalization ability of the model.
[0055] The purpose of the number of training rounds is to ensure that the model has enough opportunities to learn features from the data and gradually optimize the model parameters. When the number of training rounds is reached but the threshold is not reached, this usually indicates that the model has not yet learned the features of the relevant data well and the model parameters are not ideal. At this time, we will increase the number of training rounds to provide the model with more learning opportunities; if the number of training rounds is not reached but the threshold is reached, and the loss function gradually stabilizes (all less than the threshold), it indicates that the model has fully learned the features of the data. In this case, you can stop training and save the model.
[0056] A panoramic ultra-real-time computing system for power grid operation status based on a Graphormer network, comprising a historical data conversion module, a normalization processing module, a Graphormer network training module and a parameter optimization module;
[0057] The historical data conversion module is used to obtain the historical section data of the power grid state, and generate a panoramic view of the power grid operation state, a node feature matrix and an edge feature matrix according to the historical section data of the power grid state;
[0058] The normalization processing module is used to perform normalization processing on each node in the panoramic view of the power grid operation status to obtain node data with unified dimensions;
[0059] The Graphormer network training module is used to train the Graphormer network using node data, node feature matrix and edge feature matrix with unified dimensions to obtain an initially trained Graphormer network model, and input the real-time cross-sectional data of the power grid state into the initially trained Graphormer network model to obtain an initial prediction value of the power grid operation state;
[0060] The parameter optimization module is used to calculate the loss function of the initially trained Graphormer network model based on the initial prediction value of the power grid operation status and the prediction value of the power grid operation status obtained by the traditional graph neural network method. According to the loss function, a trained Graphormer network model is obtained, and the real-time cross-sectional data of the power grid status is input into the trained Graphormer network model to obtain the optimal prediction value of the power grid operation status.
[0061] A panoramic ultra-real-time computing system for power grid operation status based on Graphormer network The historical data conversion module is used to obtain the historical section data of the power grid status, and the specific method of generating a panoramic view of the power grid operation status, a node feature matrix and an edge feature matrix according to the historical section data of the power grid status is as follows:
[0062] Obtain the historical section data of the power grid status, which includes node data and edge data, wherein the node data includes: voltage amplitude measurement value, voltage phase angle measurement value, generator active power, generator reactive power, generator active measurement value, generator reactive measurement value, load active measurement value, load reactive measurement value, load active nominal value, load reactive nominal value; edge data includes: branch resistance, branch reactance and transformer ratio; according to the power grid topology diagram, the node data is modeled as the vertex of the graph, and the power line data is modeled as the edge of the graph; the formula is, is the graph, is the node set, and is the edge set; the historical section data at a moment constitutes a graph, and finally constructs n panoramic views of the power grid operation status;
[0063] The node data is converted into a node feature matrix of (a, b) dimensions, and the edge data is converted into an edge feature matrix of (c, d) dimensions, where a is the number of nodes, b is the type of node data, c is the number of edges, and d is the type of edge data.
[0064] A panoramic ultra-real-time computing system for power grid operation status based on Graphormer network, wherein the normalization processing module is used to normalize each node in the panoramic graph of power grid operation status, and the specific method for obtaining node data with unified dimension is:
[0065] The nodes in each constructed grid operation status panorama are normalized, that is, each node in each map is subtracted from the average value of the corresponding nodes in all maps, and then divided by the standard deviation of the corresponding nodes in all maps. The normalization formula is:
[0066]
[0067] Among them, s i,j is the jth node data of the i-th graph, s j is the average value of the j-th node data of all graphs, is the standard deviation of the data of the jth node in all graphs, It is the normalized data of the jth node in the i-th graph.
[0068] A panoramic ultra-real-time computing system for power grid operation status based on a Graphormer network, wherein the Graphormer network training module is used to train the Graphormer network using node data, node feature matrix and edge feature matrix with unified dimensions to obtain an initially trained Graphormer network model, and a specific method for inputting real-time cross-sectional data of the power grid status into the initially trained Graphormer network model to obtain an initial prediction value of the power grid operation status is as follows;
[0069] First, the network parameters are initialized, the constructed panoramic view of the power grid operation status is input into the Graphormer network, and the centrality of the nodes in the graph is encoded:
[0070]
[0071] in, is the feature of node j, x j is the feature of the original node j, is the linear change characteristic of node j’s out-degree, is the linear variation characteristic of the in-degree of node j;
[0072] The spatial encoding is performed based on the shortest path distance between two nodes, and the shortest path distance is added to the self-attention mechanism. The formula is:
[0073]
[0074] Among them, A ij is the (i,j) element in the query and key product matrix of the Graphormer network, h i and h j is the hidden representation of position i and position j, W Q is the weight matrix of the query matrix of the Graphormer network, W K is the weight matrix of the key-value matrix of the Graphormer network, d is the dimension of the hidden layer, is a learnable scalar, φ(v i ,v i ) is the shortest path distance between two nodes, T is the matrix transpose;
[0075] Calculate the weighted average of all edge features on the shortest path between nodes to obtain edge feature encoding, and integrate edge feature encoding into the self-attention mechanism. ij Rewritten as:
[0076]
[0077] Among them, c ij Encode the edge features. is the shortest path distance φ(v i ,v i ), is the nth weight embedding;
[0078] The Graphormer model is based on the self-attention mechanism that incorporates the shortest path distance and feature encoding to obtain the initially trained Graphormer network model. The real-time cross-sectional data of the power grid status is input into the initially trained Graphormer network model to obtain the initial prediction value of the power grid operation status.
[0079] A panoramic ultra-real-time computing system for power grid operation status based on a Graphormer network, wherein the parameter optimization module is used to calculate the loss function of the initially trained Graphormer network model according to the initial prediction value of the power grid operation status and the prediction value of the power grid operation status obtained by the traditional graph neural network method, and the trained Graphormer network model is obtained according to the loss function, and the specific method of inputting the real-time cross-sectional data of the power grid status into the trained Graphormer network model to obtain the optimal prediction value of the power grid operation status is as follows;
[0080] The estimated value of the power grid operation state calculated by the Graphormer network is compared with the estimated value of the power grid operation state obtained by the state estimation method in the traditional graph neural network method. The model is trained according to the error, and the loss function is selected as the mean square error function, and its calculation formula is:
[0081]
[0082] Among them, w j is the Graphormer network parameter during the jth training; y i To obtain the estimated predicted value of the power grid operation state through the state estimation method in the traditional graph neural network method, y% i The estimated predicted value of the power grid operation status calculated by the model;
[0083] According to the loss function calculated by different training rounds, the Graphormer network parameters are optimized. When the difference between the loss functions of two consecutive rounds is less than a preset threshold, the training is stopped to obtain a trained Graphormer network model. The real-time cross-sectional data of the power grid status is input into the trained Graphormer network model to obtain the best prediction value of the power grid operation status.
[0084] The threshold calculation formula is as follows:
[0085] L(w j )-L(w j+1 )<ε
[0086] Among them, ε is an artificially set threshold.
[0087] The contents not described in detail in this specification belong to the prior art known to professional and technical personnel in this field.
Claims
1. A method for calculating the panoramic ultra-real-time operation status of a power grid based on a Graphormer network, characterized in that: It includes the following steps; Obtaining historical section data of the power grid status, and generating a panoramic view of the power grid operation status, a node feature matrix, and an edge feature matrix based on the historical section data of the power grid status; Normalize each node in the grid operation status panorama to obtain node data with unified dimensions; The Graphormer network is trained using node data, node feature matrix and edge feature matrix with unified dimensions to obtain an initially trained Graphormer network model, and the real-time cross-sectional data of the power grid status is input into the initially trained Graphormer network model to obtain an initial prediction value of the power grid operation status; The loss function of the initially trained Graphormer network model is calculated according to the initial prediction value of the power grid operation status and the prediction value of the power grid operation status obtained by the traditional graph neural network method. According to the loss function, the trained Graphormer network model is obtained, and the real-time cross-sectional data of the power grid status is input into the trained Graphormer network model to obtain the optimal prediction value of the power grid operation status.
2. According to claim 1, a method for calculating the panoramic ultra-real-time operation status of a power grid based on a Graphormer network, characterized in that: The specific method of obtaining the historical section data of the power grid state and generating the power grid operation status panorama, node feature matrix and edge feature matrix according to the historical section data of the power grid state is as follows: Obtain the historical section data of the power grid status, which includes node data and edge data, wherein the node data includes: voltage amplitude measurement value, voltage phase angle measurement value, generator active power, generator reactive power, generator active measurement value, generator reactive measurement value, load active measurement value, load reactive measurement value, load active nominal value, load reactive nominal value; edge data includes: branch resistance, branch reactance and transformer ratio; according to the power grid topology diagram, the node data is modeled as the vertex of the graph, and the power line data is modeled as the edge of the graph; the formula is, is the graph, is the node set, and is the edge set; the historical section data at a moment constitutes a graph, and finally constructs n panoramic views of the power grid operation status; The node data is converted into a node feature matrix of (a, b) dimensions, and the edge data is converted into an edge feature matrix of (c, d) dimensions, where a is the number of nodes, b is the type of node data, c is the number of edges, and d is the type of edge data.
3. According to claim 1, a method for calculating the panoramic ultra-real-time operation status of a power grid based on a Graphormer network, characterized in that: Each node in the panoramic view of the power grid operation status is normalized to obtain node data with unified dimensions; the specific method is: The nodes in each constructed grid operation status panorama are normalized, that is, each node in each map is subtracted from the average value of the corresponding nodes in all maps, and then divided by the standard deviation of the corresponding nodes in all maps. The normalization formula is: Among them, s i,j is the j-th node data of the i-th graph, is the average value of the j-th node data of all graphs, is the standard deviation of the data of the jth node in all graphs, It is the normalized data of the jth node in the i-th graph.
4. According to claim 1, a method for calculating the panoramic ultra-real-time operation status of a power grid based on a Graphormer network, characterized in that: The Graphormer network is trained using node data, node feature matrix and edge feature matrix with unified dimensions to obtain the initially trained Graphormer network model. The specific method of inputting the real-time cross-section data of the power grid status into the initially trained Graphormer network model to obtain the initial prediction value of the power grid operation status is as follows: Initialize the network parameters, input the constructed grid operation status panorama into the Graphormer network, and perform centrality coding on the nodes in the graph: in, is the feature of node j, x j is the feature of the original node j, is the linear change characteristic of node j’s out-degree, is the linear variation characteristic of the in-degree of node j; The spatial encoding is performed based on the shortest path distance between two nodes, and the shortest path distance is added to the self-attention mechanism. The formula is: Among them, A ij is the (i,j) element in the query and key product matrix of the Graphormer network, h i and h j is the hidden representation of position i and position j, W Q is the weight matrix of the query matrix of the Graphormer network, W K is the weight matrix of the key-value matrix of the Graphormer network, d is the dimension of the hidden layer, is a learnable scalar, φ(v i ,v i ) is the shortest path distance between two nodes, T is the matrix transpose; Calculate the weighted average of all edge features on the shortest path between nodes to obtain edge feature encoding, and integrate edge feature encoding into the self-attention mechanism A ij edgecode A ij Rewritten as: Among them, c ij is the edge feature encoding, x ek is the shortest path distance φ(v i ,v i ), is the nth weight embedding; The Graphormer model is based on the self-attention mechanism that incorporates the shortest path distance and feature encoding to obtain the initially trained Graphormer network model. The real-time cross-sectional data of the power grid status is input into the initially trained Graphormer network model to obtain the initial prediction value of the power grid operation status.
5. According to claim 1, a method for calculating the panoramic ultra-real-time operation status of a power grid based on a Graphormer network, characterized in that: The loss function of the initially trained Graphormer network model is calculated according to the initial prediction value of the power grid operation state and the prediction value of the power grid operation state obtained by the traditional graph neural network method. According to the loss function, the trained Graphormer network model is obtained. The specific method of inputting the real-time cross-sectional data of the power grid state into the trained Graphormer network model to obtain the optimal prediction value of the power grid operation state is as follows: The estimated value of the power grid operation state calculated by the Graphormer network is compared with the estimated value of the power grid operation state obtained by the state estimation method in the traditional graph neural network method. The model is trained according to the error, and the loss function is selected as the mean square error function, and its calculation formula is: Among them, w j is the Graphormer network parameter during the jth training; y i In order to obtain the estimated prediction value of the power grid operation state through the state estimation method in the traditional graph neural network method, The estimated predicted value of the power grid operation status calculated by the model; According to the loss function calculated by different training rounds, the Graphormer network parameters are optimized. When the difference between the loss functions of two consecutive rounds is less than a preset threshold, the training is stopped to obtain a trained Graphormer network model. The real-time cross-sectional data of the power grid status is input into the trained Graphormer network model to obtain the best prediction value of the power grid operation status. The threshold calculation formula is as follows: L(w j )-L(w j+1 )<ε Among them, ε is an artificially set threshold.
6. A panoramic ultra-real-time computing system for power grid operation status based on Graphormer network, characterized in that: It includes historical data conversion module, normalization processing module, Graphormer network training module and parameter optimization module; The historical data conversion module is used to obtain the historical section data of the power grid state, and generate a panoramic view of the power grid operation state, a node feature matrix and an edge feature matrix according to the historical section data of the power grid state; The normalization processing module is used to perform normalization processing on each node in the panoramic view of the power grid operation status to obtain node data with unified dimensions; The Graphormer network training module is used to train the Graphormer network using node data, node feature matrix and edge feature matrix with unified dimensions to obtain an initially trained Graphormer network model, and input the real-time cross-sectional data of the power grid state into the initially trained Graphormer network model to obtain an initial prediction value of the power grid operation state; The parameter optimization module is used to calculate the loss function of the initially trained Graphormer network model based on the initial prediction value of the power grid operation status and the prediction value of the power grid operation status obtained by the traditional graph neural network method. According to the loss function, a trained Graphormer network model is obtained, and the real-time cross-sectional data of the power grid status is input into the trained Graphormer network model to obtain the optimal prediction value of the power grid operation status.
7. According to claim 6, a Graphormer network-based panoramic ultra-real-time computing system for power grid operation status, characterized in that: The historical data conversion module is used to obtain the historical section data of the power grid state, and the specific method of generating the power grid operation state panorama, the node feature matrix and the edge feature matrix according to the historical section data of the power grid state is: Obtain the historical section data of the power grid status, which includes node data and edge data, wherein the node data includes: voltage amplitude measurement value, voltage phase angle measurement value, generator active power, generator reactive power, generator active measurement value, generator reactive measurement value, load active measurement value, load reactive measurement value, load active nominal value, load reactive nominal value; edge data includes: branch resistance, branch reactance and transformer ratio; according to the power grid topology diagram, the node data is modeled as the vertex of the graph, and the power line data is modeled as the edge of the graph; the formula is, is the graph, is the node set, and is the edge set; the historical section data at a moment constitutes a graph, and finally constructs n panoramic views of the power grid operation status; The node data is converted into a node feature matrix of (a, b) dimensions, and the edge data is converted into an edge feature matrix of (c, d) dimensions, where a is the number of nodes, b is the type of node data, c is the number of edges, and d is the type of edge data.
8. According to claim 6, a Graphormer network-based panoramic ultra-real-time computing system for power grid operation status, characterized in that: The normalization processing module is used to normalize each node in the panoramic view of the power grid operation status, and the specific method for obtaining node data with unified dimensions is: The nodes in each constructed grid operation status panorama are normalized, that is, each node in each map is subtracted from the average value of the corresponding nodes in all maps, and then divided by the standard deviation of the corresponding nodes in all maps. The normalization formula is: Among them, s i,j is the j-th node data of the i-th graph, is the average value of the j-th node data of all graphs, is the standard deviation of the data of the jth node in all graphs, It is the normalized data of the jth node in the i-th graph.
9. The Graphormer network-based panoramic ultra-real-time computing system for power grid operation status according to claim 6 is characterized in that: The Graphormer network training module is used to train the Graphormer network using node data, node feature matrix and edge feature matrix of uniform dimensions to obtain an initially trained Graphormer network model, and the specific method of inputting the real-time cross-sectional data of the power grid state into the initially trained Graphormer network model to obtain an initial prediction value of the power grid operation state is as follows; Initialize the network parameters, input the constructed grid operation status panorama into the Graphormer network, and perform centrality coding on the nodes in the graph: in, is the feature of node j, x j is the feature of the original node j, is the linear change characteristic of node j’s out-degree, is the linear variation characteristic of the in-degree of node j; The spatial encoding is performed based on the shortest path distance between two nodes, and the shortest path distance is added to the self-attention mechanism. The formula is: Among them, A ij is the (i,j) element in the query and key product matrix of the Graphormer network, h i and h j is the hidden representation of position i and position j, W Q is the weight matrix of the query matrix of the Graphormer network, W K is the weight matrix of the key-value matrix of the Graphormer network, d is the dimension of the hidden layer, is a learnable scalar, φ(v i ,v i ) is the shortest path distance between two nodes, T is the matrix transpose; Calculate the weighted average of all edge features on the shortest path between nodes to obtain edge feature encoding, and integrate edge feature encoding into the self-attention mechanism A ij edgecode A ij Rewritten as: Among them, c ij is the edge feature encoding, x ek is the shortest path distance φ(v i ,v i ), is the nth weight embedding; The Graphormer model is based on the self-attention mechanism that incorporates the shortest path distance and feature encoding to obtain the initially trained Graphormer network model. The real-time cross-sectional data of the power grid status is input into the initially trained Graphormer network model to obtain the initial prediction value of the power grid operation status.
10. The Graphormer network-based panoramic ultra-real-time computing system for power grid operation status according to claim 6, characterized in that: The parameter optimization module is used to calculate the loss function of the initially trained Graphormer network model according to the initial prediction value of the power grid operation state and the prediction value of the power grid operation state obtained by the traditional graph neural network method, and obtain the trained Graphormer network model according to the loss function, and input the real-time cross-sectional data of the power grid state into the trained Graphormer network model to obtain the specific method of the best prediction value of the power grid operation state; The estimated value of the power grid operation state calculated by the Graphormer network is compared with the estimated value of the power grid operation state obtained by the state estimation method in the traditional graph neural network method. The model is trained according to the error, and the loss function is selected as the mean square error function, and its calculation formula is: Among them, w j is the Graphormer network parameter during the jth training; y i To obtain the estimated predicted value of the power grid operation state through the state estimation method in the traditional graph neural network method, y% i The estimated predicted value of the power grid operation status calculated by the model; According to the loss function calculated by different training rounds, the Graphormer network parameters are optimized. When the difference between the loss functions of two consecutive rounds is less than a preset threshold, the training is stopped to obtain a trained Graphormer network model. The real-time cross-sectional data of the power grid status is input into the trained Graphormer network model to obtain the best prediction value of the power grid operation status. The threshold calculation formula is as follows: L(w j )-L(w j+1 )<ε Among them, ε is an artificially set threshold.
Citation Information
Cited By
Electric power system transient stability state and stability margin evaluation method, device and equipment based on Grapher multi-task learning and medium
CN121093874A
Multi-topology double-discriminator power system false data attack vector generation method
CN121792220A