A power grid power flow prediction method and system based on a physical constraint graph convolutional network
By constructing an adjacency matrix and node feature matrix based on a physically constrained graph convolutional network, topology-aware learning is performed using the graph convolutional network. Furthermore, by combining a bus-branch association mapping layer and a node power balance correction layer with a physical regularization loss function, the problem of node power imbalance in the data-driven power flow prediction model is solved, achieving high-precision and consistent power flow prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SOUTHEAST UNIV
- Filing Date
- 2026-05-26
- Publication Date
- 2026-06-23
Smart Images

Figure CN122267796A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of power systems and its automation technology, in particular to a power grid power flow prediction method and system based on a physically constrained graph convolution network. BACKGROUND
[0002] Power flow calculation plays a key role in dealing with uncertainty analysis of power systems and is the basis for realizing safe and effective operation and planning of power grids. Although traditional model-driven methods (such as Newton-Raphson algorithm, Gauss-Seidel iteration method and fast decoupled power flow algorithm) are mathematically rigorous, they need to solve nonlinear equations repeatedly in large-scale systems, which is computationally intensive and prone to convergence difficulties, making it difficult to meet the needs of real-time or large-scale power flow applications.
[0003] In order to improve computational efficiency, data-driven methods (such as deep neural networks, graph convolution networks, etc.) have been gradually introduced into power flow analysis. However, there are still significant challenges when applying existing data-driven methods to actual power flow prediction: most existing models lack explicit integration of physical constraints, which often leads to physically inconsistent solutions, such as node power imbalance or unrealistic power flow distribution, greatly limiting their engineering applicability. Although some existing research attempts to integrate physical knowledge through physical information loss functions (soft penalties) or physical information architecture design, most of them fail to strictly enforce physical constraints, undermining the reliability and practicality of the prediction results. SUMMARY
[0004] In order to solve the technical problems of node power imbalance and low reliability of prediction results caused by the lack of strict physical constraints in existing data-driven power flow prediction models, the purpose of the present application is to provide a power grid power flow prediction method and system based on a physically constrained graph convolution network.
[0005] In order to achieve the above-mentioned purpose, the technical solutions adopted by the present application are as follows:
[0006] Firstly, the present application provides a power grid power flow prediction method based on a physically constrained graph convolution network, which comprises the following steps:
[0007] Obtain the topology structure and operating data of the power grid to be analyzed, construct an adjacency matrix and construct a node feature matrix and an edge label matrix;
[0008] Input the node feature data into the graph convolution network for topology-aware learning and obtain the node representation;
[0009] Map the node representation to the initial branch power flow prediction value through the bus-branch association mapping layer;
[0010] Using a pre-determined correction matrix, the initial branch power flow prediction value is adjusted through a node power balance correction layer to obtain a corrected branch power flow prediction value that strictly satisfies the node power balance hard constraint.
[0011] During the model training phase, the root mean square error between the corrected branch power flow prediction value and the sample label, as well as the physical regularization loss function calculated based on the corrected branch power flow prediction value, are combined to calculate the total training loss. The model parameters of the graph convolutional network and the bus-branch association mapping layer are iteratively updated to obtain the trained power flow prediction model.
[0012] During the online inference phase, real-time power grid operation data is collected and a node feature matrix is constructed. This matrix is then input into the trained power flow prediction model, which outputs branch power flow prediction results with physical consistency.
[0013] Furthermore, the steps of constructing the adjacency matrix and building the node feature matrix and edge label matrix specifically include:
[0014] Construct an initial adjacency matrix based on the physical connectivity of the power grid. If the busbars in the power grid are considered as nodes and the transmission lines as edges, then if the nodes... With nodes If there are physical connection branches between them, then the adjacent matrix elements ,otherwise The initial adjacency matrix is normalized to obtain a normalized adjacency matrix. ,
[0015] Constructing the node feature matrix Its expression is:
[0016] ,
[0017] In the formula, This is the bus voltage magnitude vector. and These are the active power injection vector and reactive power injection vector for each bus, respectively.
[0018] Obtain the sample labels corresponding to the node feature data and construct the edge label matrix. Its expression is:
[0019] ,
[0020] In the formula, and These are the active and reactive power flow vectors flowing out from the beginning of each branch, respectively. and These are the active and reactive power flow vectors flowing out from the ends of each branch, respectively.
[0021] Furthermore, the step of inputting the node feature matrix into a graph convolutional network for topology-aware learning and obtaining the initial branch power flow prediction value through a bus-branch association mapping layer, specifically includes the following forward propagation process:
[0022] Extracting node representation matrices using graph convolutional networks The calculation formula is as follows:
[0023] ,
[0024] In the formula, The parameter is Graph convolutional networks, This is the normalized adjacency matrix of the power grid;
[0025] The node representation matrix is generated through the bus-branch association mapping layer. Mapped to initial branch power flow prediction values The calculation formula is as follows:
[0026] ,
[0027] In the formula, The bus-branch correlation matrix of the power grid. Let it be its transpose matrix. and These are the trainable weight matrix and bias vector of the bus-branch association mapping layer, respectively.
[0028] Furthermore, the step of adjusting the initial branch power flow prediction value using a pre-determined correction matrix through a node power balance correction layer specifically includes:
[0029] Obtain the pre-determined redistribution matrix and injection allocation matrix ;
[0030] The initial branch power flow prediction value The active power prediction component and reactive power prediction component in the matrix are vertically concatenated and then processed through the redistribution matrix. and the injection allocation matrix Perform linear transformation correction for topological dependence:
[0031] , ,
[0032] In the formula, , , , These are the initial branch power flow prediction values. The corresponding components in, , , , These are the active and reactive power flow prediction components obtained after correction, which are combined to form the corrected branch power flow prediction value that strictly satisfies the power balance of all nodes in the network. .
[0033] Furthermore, the pre-deterministically constructed redistribution matrix and injection allocation matrix The construction process specifically includes the following steps:
[0034] Calculate the bus-branch correlation matrix of the power grid and its positive part matrix and negative part matrix ;
[0035] For each node in the power grid Determine the corresponding branch power flow component index set:
[0036] ,
[0037] In the formula, , , The total number of branch roads;
[0038] Based on the series susceptance amplitude of the branch circuit compute nodes Total susceptance weight and determine the coefficient vector Corresponding index element value Traversing all nodes yields the complete coefficient vector. ;
[0039] For each node If its associated branch number Then construct the local redistribution matrix:
[0040] ,
[0041] In the formula, It is the identity matrix. It is a matrix of all 1s;
[0042] The local redistribution matrix Embedded into the initialized zero matrix, i.e., assigned to a matrix with both row and column indices of 0. matrix blocks Traversing all nodes yields the complete redistribution matrix. ;
[0043] The coefficient vector Divided into first terminal vectors and terminal subvectors ;
[0044] Calculate the first-end injection allocation submatrix separately. and end-injection allocation submatrix In the formula, This represents a diagonal matrix generated by diagonalizing a vector;
[0045] Inject the first end into the allocation submatrix and end-injection allocation submatrix Vertical concatenation yields the complete injection allocation matrix. .
[0046] Furthermore, the step of calculating the total training loss by combining the root mean square error between the corrected branch power flow prediction value and the sample label, and the physical regularization loss function calculated based on the corrected branch power flow prediction value, specifically includes:
[0047] Based on the active and reactive components in the corrected branch power flow prediction values, calculate the active average branch power loss regularization term respectively. and reactive power average branch power loss regularization term The calculation formula is as follows:
[0048] , ,
[0049] In the formula, This represents the total number of branches in the power grid. express Norm;
[0050] The total training loss for model iteration updates is calculated by combining the root mean square error with the physical regularization term. The calculation formula is as follows:
[0051]
[0052] In the formula, The number of training samples, and The first The corrected branch power flow prediction values for each sample and their corresponding sample labels. Denotes the Euclidean norm. and These are the regularization coefficients that control the weights of the physical regularization terms for active and reactive power, respectively.
[0053] Secondly, the present invention also provides a power grid power flow prediction system based on a physical constraint graph convolutional network, the system comprising:
[0054] The data processing module is used to acquire the topology and operation data of the power grid to be analyzed, construct the adjacency matrix, and build the node feature matrix and edge label matrix.
[0055] The topology-aware learning module is used to input the node feature matrix into a graph convolutional network for topology-aware learning to obtain node representations;
[0056] The initial mapping module is used to map the node representation to the initial branch power flow prediction value through the bus-branch association mapping layer;
[0057] The physical constraint correction module is used to adjust the initial branch power flow prediction value through the node power balance correction layer using a pre-determined correction matrix to obtain a corrected branch power flow prediction value that strictly satisfies the node power balance hard constraint.
[0058] The model training module is used to calculate the total training loss during the model training phase by combining the root mean square error between the corrected branch power flow prediction value and the sample label, and the physical regularization loss function calculated based on the corrected branch power flow prediction value, and iteratively updating the model parameters of the graph convolutional network and the bus-branch association mapping layer to obtain the trained power flow prediction model.
[0059] The online inference module is used to collect real-time power grid operation data and construct a node feature matrix during the online inference phase. This matrix is then input into the trained power flow prediction model, and the output is a branch power flow prediction result with physical consistency.
[0060] Thirdly, the present invention provides an electronic system including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.
[0061] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described method.
[0062] Finally, the present invention also proposes a computer program product, including a computer program / instructions, wherein when the computer program / instructions are executed by a processor, the steps of the method proposed in the present invention are employed.
[0063] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0064] 1. Strictly ensures the physical consistency of prediction results: Based on the reconstructed bus injection model, this invention completely solves the problem of node power imbalance in traditional data-driven models by embedding hard constraints (node power balance correction layer) at the network architecture level and introducing soft constraints in training through physical regularization loss function.
[0065] 2. Possesses extremely strong topology generalization and adaptability: The correction matrix used in the node power balance correction layer proposed in this invention is directly constructed from the deterministic network topology, without involving any trainable parameters. This parameter-free design allows the model to naturally and seamlessly generalize to different network topologies, greatly enhancing its engineering practicality.
[0066] 3. Effectively suppresses unrealistic branch power loss: In order to supplement the node power balance correction layer, this invention innovatively establishes a physical regularization loss function to punish the unrealistic branch power loss introduced during the correction process, further enhancing the physical consistency and accuracy of the corrected branch power flow. Attached Figure Description
[0067] Figure 1 This is a flowchart illustrating a power flow prediction method based on a physical constraint graph convolutional network according to the present invention.
[0068] Figure 2 This is a schematic diagram of the overall framework of the power flow prediction model in the power flow prediction method based on physical constraint graph convolutional network of the present invention.
[0069] Figure 3 This is a schematic diagram illustrating the construction process of the node power balance correction matrix in a power flow prediction method based on a physical constraint graph convolutional network according to the present invention.
[0070] Figure 4 This is a comparative schematic diagram showing the evolution of average branch active power loss in one embodiment of a power grid power flow prediction method based on a physical constraint graph convolutional network according to the present invention.
[0071] Figure 5 This is a comparative schematic diagram showing the evolution of average branch reactive power loss in one embodiment of a power grid power flow prediction method based on a physical constraint graph convolutional network according to the present invention. Detailed Implementation
[0072] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this invention. The embodiments described in this invention are merely some embodiments of this invention, and not all embodiments. Based on the spirit of this invention, all other embodiments not described in this invention obtained by those skilled in the art based on the embodiments described in this invention without creative effort should fall within the protection scope of this invention.
[0073] Example 1: Figure 1 This is a flowchart illustrating a power flow prediction method based on a physical constraint graph convolutional network according to the present invention. The first aspect of the present invention relates to a power flow prediction method based on a physical constraint graph convolutional network, the method comprising steps 1 to 6, as detailed below:
[0074] Step 1: Obtain the topology and operation data of the power grid to be analyzed, construct the adjacency matrix, and build the node feature matrix and edge label matrix.
[0075] In order to enable the model to directly learn the mapping from available node voltage magnitude and power injection to branch power flow, this invention constructs an adjacency matrix representing the power grid topology based on the reconstructed BIM (Bus Injection Model), and constructs the node feature matrix and edge label matrix required by the model.
[0076] Preferably, the step of constructing the adjacency matrix and building the node feature matrix and edge label matrix specifically includes:
[0077] Construct an initial adjacency matrix based on the physical connectivity of the power grid. If the busbars in the power grid are considered as nodes and the transmission lines as edges, then if the nodes... With nodes If there are physical connection branches between them, then the adjacent matrix elements ,otherwise ;
[0078] The initial adjacency matrix is normalized to obtain the normalized adjacency matrix. The specific calculation is as follows: Introduce self-loops to construct an enhanced adjacency matrix. ,in Given the identity matrix, calculate the degree matrix. Its diagonal elements Calculate the normalized adjacency matrix ;
[0079] Constructing the node feature matrix Its expression is:
[0080] ,
[0081] In the formula, This is the bus voltage magnitude vector. and These are the active power injection vector and reactive power injection vector for each bus, respectively.
[0082] Obtain the sample labels corresponding to the node feature data and construct the edge label matrix. Its expression is:
[0083] ,
[0084] In the formula, and These are the active and reactive power flow vectors flowing out from the beginning of each branch, respectively. and These are the active and reactive power flow vectors flowing out from the ends of each branch, respectively.
[0085] Step 2: Input the node feature matrix into the graph convolutional network for topology-aware learning to obtain node representations.
[0086] Figure 2 This is a schematic diagram of the overall framework of the power flow prediction model in the power flow prediction method based on physical constraint graph convolutional networks of the present invention. Figure 2 As shown, the model mainly consists of a graph convolutional layer, a bus-branch association mapping layer, and a node power balance correction layer cascaded together. In step 2, the node feature matrix constructed in step 1 is first input to... Figure 2 The graph convolutional layer in the graph extracts node representations through topology-aware learning.
[0087] Preferably, the specific forward propagation process in step 2 is as follows:
[0088] Extracting node representation matrices using GCN (Graph Convolutional Network). The calculation formula is as follows:
[0089] ,
[0090] In the formula, The parameter is Graph convolutional networks, The normalized adjacency matrix constructed in step 1.
[0091] Step 3: Map the node representation to the initial branch power flow prediction value through the bus-branch association mapping layer.
[0092] like Figure 2As shown, the node representation obtained in step 2 is input into the bus-branch association mapping layer and mapped to the initial power flow on the branch.
[0093] Preferably, the calculation formula for step 3 is:
[0094] ,
[0095] In the formula, The bus-branch correlation matrix of the power grid. Let it be its transpose matrix. and These are the trainable weight matrix and bias vector of the bus-branch association mapping layer, respectively.
[0096] Step 4: Using the pre-determined correction matrix, adjust the initial branch power flow prediction value through the node power balance correction layer to obtain the corrected branch power flow prediction value that strictly satisfies the node power balance hard constraint.
[0097] like Figure 2 As shown, the initial branch power flow predictions are further subjected to hard constraint processing through a node power balance correction layer. This layer does not contain trainable parameters, but instead uses a pre-constructed correction matrix for linear transformation.
[0098] Preferably, the step of adjusting the initial branch power flow prediction value through the node power balance correction layer specifically includes:
[0099] Obtain the pre-determined redistribution matrix and injection allocation matrix ;
[0100] The initial branch power flow prediction value The active power prediction component and reactive power prediction component in the matrix are vertically concatenated and then processed through the redistribution matrix. and the injection allocation matrix Perform linear transformation correction for topological dependence:
[0101] , ;
[0102] In the formula, , , , These are the initial branch power flow prediction values. The corresponding components in, , , , These are the active and reactive power flow prediction components obtained after correction, which are combined to form the corrected branch power flow prediction value that strictly satisfies the power balance of all nodes in the network. .
[0103] Figure 3 This is a schematic diagram illustrating the construction process of the node power balance correction matrix in a power flow prediction method based on a physical constraint graph convolutional network according to the present invention. Combined with... Figure 3 Preferably, the pre-determined redistribution matrix and injection allocation matrix The construction process specifically includes the following steps:
[0104] Calculate the bus-branch correlation matrix of the power grid and its positive part matrix and negative part matrix ;
[0105] For each node in the power grid Determine the corresponding branch power flow component index set:
[0106] ,
[0107] In the formula, , , The total number of branch roads;
[0108] Based on the series susceptance amplitude of the branch circuit compute nodes Total susceptance weight and determine the coefficient vector Corresponding index element value Traversing all nodes yields the complete coefficient vector. ;
[0109] For each node If its associated branch number Then construct the local redistribution matrix:
[0110] ,
[0111] In the formula, It is the identity matrix. It is a matrix of all 1s;
[0112] The local redistribution matrix Embedded into the initialized zero matrix, i.e., assigned to a matrix with both row and column indices of 0. matrix blocks Traversing all nodes yields the complete redistribution matrix. ;
[0113] The coefficient vector Divided into first terminal vectors and terminal subvectors ;
[0114] Calculate the first-end injection allocation submatrix separately. and end-injection allocation submatrix In the formula, This represents a diagonal matrix generated by diagonalizing a vector;
[0115] Inject the first end into the allocation submatrix and end-injection allocation submatrix Vertical concatenation yields the complete injection allocation matrix. .
[0116] Step 5: During the model training phase, the total training loss is calculated by combining the root mean square error between the corrected branch power flow prediction value and the sample label, and the physical regularization loss function calculated based on the corrected branch power flow prediction value. The model parameters of the graph convolutional network and the bus-branch association mapping layer are iteratively updated to obtain the trained power flow prediction model.
[0117] Preferably, the step of calculating the total training loss specifically includes:
[0118] Based on the active and reactive components in the corrected branch power flow prediction values, calculate the active average branch power loss regularization term respectively. and reactive power average branch power loss regularization term The calculation formula is as follows:
[0119] , ;
[0120] In the formula, This represents the total number of branches in the power grid. express Norm;
[0121] The total training loss for model iteration updates is calculated by combining the root mean square error with the physical regularization term. The calculation formula is as follows:
[0122] ;
[0123] In the formula, The number of training samples, and The first The corrected branch power flow prediction values for each sample and their corresponding sample labels. Denotes the Euclidean norm. and These are the regularization coefficients that control the weights of the physical regularization terms for active and reactive power, respectively.
[0124] Step 6: In the online inference phase, real-time power grid operation data is collected and a node feature matrix is constructed. This matrix is then input into the trained power flow prediction model, and the result is output as a branch power flow prediction with physical consistency.
[0125] In this embodiment, the research and verification are mainly conducted on the IEEE-30 and IEEE-118 bus test systems. For these two systems, datasets are generated by independently perturbing the active and reactive power demands of the load nodes, with scaling factors uniformly sampled from the interval [0.8, 1.2]. For each perturbed load scenario, the Ipopt solver is used to solve the AC optimal power flow problem to generate physically feasible AC power flow solutions. The power flow equations are constructed in the form of a bus injection model using MATLAB software and the YALMIP toolbox.
[0126] From each optimal power flow solution, bus voltage magnitude, node active and reactive power injection, and branch active and reactive power flow are extracted to construct supervised input-output samples. A total of 10,000 samples are generated for each test system. All power-related quantities are expressed as per-unit values (pu) based on a power baseline of 100 MVA. The dataset is randomly divided into training, validation, and test sets at ratios of 80%, 10%, and 10%. The detailed training parameter settings of the physical constraint graph convolutional network model proposed in this invention are shown in Table 1.
[0127] Table 1 Training parameter settings for the model of this invention
[0128]
[0129] To fully verify the effectiveness of the method of the present invention, an evaluation was conducted based on the dataset of the above embodiments in the following three dimensions, which are discussed in detail below:
[0130] First, the effectiveness of the node power balance correction layer is verified.
[0131] This embodiment examines the effectiveness of the proposed node power balance correction layer in forcing node power balance. The evaluation was conducted on an IEEE-30 system, covering three representative load levels: 80%, 100%, and 120% of the nominal load. For each load level, a representative operating point was considered. Active and reactive power imbalances at each node were calculated using Kirchhoff's laws, and the degree of violation was quantified using the maximum active and maximum reactive power imbalances across all nodes.
[0132] Table 2 shows the node power imbalance under different load levels. As the data in Table 2 indicates, conventional GCNs produce significant active and reactive power imbalances at all three load levels, and the imbalance magnitude typically increases with increasing load level. In contrast, the model of this invention exhibits zero active and reactive power imbalances at all test operating points, indicating that node power balance is strictly satisfied. These results demonstrate that the node power balance correction layer has a significant advantage over conventional GCNs in enhancing physical consistency.
[0133] Table 2. Node power imbalance under different load levels
[0134]
[0135] Second, the constraint effect of the physical regularization loss function is verified.
[0136] This embodiment examines the effectiveness of the physical regularization loss function in constraining branch power losses during training. Experiments were conducted on the IEEE-30 system, comparing three models: conventional GCN, the model of this invention (without regularization), and the model of this invention (full version). The evaluation focuses on the average active and reactive power losses of all branches in the power network, and records their evolution over 100 training rounds on the validation set.
[0137] The evolution of average branch active and reactive power losses during training is as follows: Figure 4 and Figure 5 As shown, observations reveal that the model of this invention (without regularization) results in the highest branch power loss, significantly deviating from the true baseline value. While the branch power loss generated by conventional GCN is closer to the true baseline value than the model without regularization, it cannot guarantee node power balance. In contrast, after introducing physical regularization loss, the branch power loss generated by the model of this invention (complete version) closely matches the true baseline value in both active and reactive components, while strictly maintaining node power balance and effectively suppressing unrealistic power losses that may be introduced during the correction process.
[0138] Third, the overall prediction accuracy of the model is verified.
[0139] This embodiment evaluates the prediction accuracy of the proposed model on IEEE-30 and IEEE-118 bus systems. Four models are compared: DNN (Deep Neural Network), conventional GCN, the proposed model (unregularized), and the proposed model (full version). The evaluation metrics use four branch power flow variables (…). RMSE (Root Mean Square Error).
[0140] Table 3 shows the RMSE comparison results of each model in branch power flow prediction. As can be seen from Table 3, the model of this invention consistently achieved the lowest RMSE across all four power flow variables on the IEEE-30 and IEEE-118 systems. Compared with DNN and conventional GCN, even the unregularized model of this invention has achieved a lower prediction error, demonstrating the effectiveness of the node power balance correction layer in improving prediction accuracy. The physical regularization loss function included in the full-version model further enhances model performance, achieving the best overall accuracy among all compared models.
[0141] Table 3 Comparison of RMSE in Branch Power Flow Prediction
[0142]
[0143] Example 2: As a second aspect of the present invention, a power flow prediction system based on a physical constraint graph convolutional network utilizing the method of the first aspect of the present invention is provided. The system includes a data processing module, a topology-aware learning module, an initial mapping module, a physical constraint correction module, a model training module, and an online inference module; wherein,
[0144] The data processing module is used to acquire the topology and operation data of the power grid to be analyzed, construct the adjacency matrix, and build the node feature matrix and edge label matrix.
[0145] The topology-aware learning module is used to input the node feature matrix into a graph convolutional network for topology-aware learning to obtain node representations;
[0146] The initial mapping module is used to map the node representation to the initial branch power flow prediction value through the bus-branch association mapping layer;
[0147] The physical constraint correction module is used to adjust the initial branch power flow prediction value through the node power balance correction layer using a pre-determined correction matrix to obtain a corrected branch power flow prediction value that strictly satisfies the node power balance hard constraint.
[0148] The model training module is used to calculate the total training loss during the model training phase by combining the root mean square error between the corrected branch power flow prediction value and the sample label, and the physical regularization loss function calculated based on the corrected branch power flow prediction value, and iteratively updating the model parameters of the graph convolutional network and the bus-branch association mapping layer to obtain the trained power flow prediction model.
[0149] The online inference module is used to collect real-time power grid operation data and construct a node feature matrix during the online inference phase. This matrix is then input into the trained power flow prediction model, and the output is a branch power flow prediction result with physical consistency.
[0150] Example 3: This example provides an electronic system including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method proposed in the above example.
[0151] Example 4: This example provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method proposed in the above examples.
[0152] It should be noted that the electronic system can use terminal devices such as desktop computers, laptops, or cloud servers. Furthermore, terminal devices include, but are not limited to, processors and memory. For example, terminal devices can also include input / output devices, network access devices, and buses.
[0153] Furthermore, the processor can be a central processing unit (CPU). Of course, depending on the actual use, other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. can also be used. The general-purpose processor can be a microprocessor or any conventional processor, etc., and this application does not limit it in this regard.
[0154] Furthermore, the memory can be an internal storage unit of the terminal device, such as the hard disk or RAM of the terminal device, or an external storage device of the terminal device, such as a plug-in hard disk, smart memory card (SMC), secure digital card (SD), or flash memory card (FC) equipped on the terminal device. In addition, the memory can also be a combination of the internal storage unit and the external storage device of the terminal device. The memory is used to store computer programs and other programs and data required by the terminal device. The memory can also be used to temporarily store data that has been output or will be output. This application does not limit this.
[0155] Furthermore, through this electronic system, any one of the methods in the above embodiments can be stored in the memory of the electronic system and loaded and executed on the processor of the terminal device for convenient use.
[0156] Example 5: This example also discloses a computer program product, including a computer program / instruction, wherein when the computer program / instruction is executed by a processor, it employs the steps of any of the methods in the above examples.
[0157] The computer program can be stored in a computer-readable medium. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or certain middleware. The computer-readable medium includes any entity or device capable of carrying computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the computer-readable medium includes, but is not limited to, the above-mentioned components.
[0158] It should be further noted that the detection methods in the above embodiments are stored in the computer-readable storage medium and loaded and executed on the processor through this computer-readable storage medium, so as to facilitate the storage and application of the above methods. In the description of this specification, the descriptions of terms such as "an embodiment," "example," "specific example," etc., mean that the specific feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0159] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.
Claims
1. A power flow prediction method based on physical constraint graph convolutional networks, characterized in that, include: Obtain the topology and operational data of the power grid to be analyzed, construct the adjacency matrix, and build the node feature matrix and edge label matrix; The node feature matrix is input into a graph convolutional network for topology-aware learning to obtain node representations; the node representations are then mapped to initial branch power flow prediction values through a bus-branch association mapping layer. Using a pre-determined correction matrix, the initial branch power flow prediction value is adjusted through a node power balance correction layer to obtain a corrected branch power flow prediction value that strictly satisfies the node power balance hard constraint. During the model training phase, the root mean square error between the corrected branch power flow prediction value and the sample label, as well as the physical regularization loss function calculated based on the corrected branch power flow prediction value, are combined to calculate the total training loss. The model parameters of the graph convolutional network and the bus-branch association mapping layer are iteratively updated to obtain the trained power flow prediction model. Real-time power grid operation data is collected and a node feature matrix is constructed. This matrix is then input into the power flow prediction model, which outputs branch power flow prediction results with physical consistency.
2. The method according to claim 1, characterized in that, The construction of the adjacency matrix and the generation of the node feature matrix and edge label matrix specifically includes the following steps: Construct an initial adjacency matrix based on the physical connectivity of the power grid. If the busbars in the power grid are considered as nodes and the transmission lines as edges, then if the nodes... With nodes If there are physical connection branches between them, then the adjacent matrix elements ,otherwise ; The initial adjacency matrix is normalized to obtain the normalized adjacency matrix. The specific calculation is as follows: Introduce self-loops to construct an enhanced adjacency matrix. ,in Given the identity matrix, calculate the degree matrix. Its diagonal elements Calculate the normalized adjacency matrix ; Constructing the node feature matrix Its expression is: , In the formula, This is the bus voltage magnitude vector. and These are the active power injection vector and reactive power injection vector for each bus, respectively. Obtain the sample labels corresponding to the node feature data and construct the edge label matrix. Its expression is: , In the formula, and These are the active and reactive power flow vectors flowing out from the beginning of each branch, respectively. and These are the active and reactive power flow vectors flowing out from the ends of each branch, respectively.
3. The method according to claim 2, characterized in that, The node feature matrix The input is fed into a graph convolutional network for topology-aware learning. The forward propagation process is as follows: Extracting node representation matrices using graph convolutional networks The calculation formula is as follows: , In the formula, The parameter is Graph convolutional networks, This is the normalized adjacency matrix of the power grid; The node representation matrix is generated through the bus-branch association mapping layer. Mapped to initial branch power flow prediction values The calculation formula is as follows: , In the formula, The bus-branch correlation matrix of the power grid. Let it be its transpose matrix. and These are the trainable weight matrix and bias vector of the bus-branch association mapping layer, respectively.
4. The method according to claim 3, characterized in that, The following steps are used to obtain the corrected branch power flow prediction values, specifically including: Obtain the pre-determined redistribution matrix and injection allocation matrix ; The initial branch power flow prediction value The active power prediction component and reactive power prediction component in the matrix are vertically concatenated and then processed through the redistribution matrix. and the injection allocation matrix Perform linear transformation correction for topological dependence: , , In the formula, , , , These are the initial branch power flow prediction values. The corresponding components in, , , , These are the active and reactive power flow prediction components obtained after correction, which are combined to form the corrected branch power flow prediction value that strictly satisfies the power balance of all nodes in the network. .
5. The method according to claim 4, characterized in that, The pre-determined redistribution matrix and injection allocation matrix The construction process specifically includes the following steps: Calculate the bus-branch correlation matrix of the power grid and its positive part matrix and negative part matrix ; For each node in the power grid Determine the corresponding branch power flow component index set: , In the formula, , , The total number of branch roads; Based on the series susceptance amplitude of the branch circuit compute nodes Total susceptance weight and determine the coefficient vector Corresponding index element value Traversing all nodes yields the complete coefficient vector. ; For each node If its associated branch number Then construct the local redistribution matrix: , In the formula, It is the identity matrix. It is a matrix of all 1s; The local redistribution matrix Embedded into the initialized zero matrix, i.e., assigned to a matrix with both row and column indices of 0. matrix blocks Traversing all nodes yields the complete redistribution matrix. ; The coefficient vector Divided into first terminal vectors and terminal subvectors ; Calculate the first-end injection allocation submatrix separately. and end-injection allocation submatrix In the formula, This represents a diagonal matrix generated by diagonalizing a vector; Inject the first end into the allocation submatrix and end-injection allocation submatrix Vertical concatenation yields the complete injection allocation matrix. .
6. The method according to claim 5, characterized in that, During the model training phase, calculating the total training loss specifically includes the following steps: Based on the active and reactive components in the corrected branch power flow prediction values, calculate the active average branch power loss regularization term respectively. and reactive power average branch power loss regularization term The calculation formula is as follows: , , In the formula, This represents the total number of branches in the power grid. express Norm; The total training loss for model iteration updates is calculated by combining the root mean square error with the physical regularization term. The calculation formula is as follows: In the formula, The number of training samples, and The first The corrected branch power flow prediction values for each sample and their corresponding sample labels. Denotes the Euclidean norm. and These are the regularization coefficients that control the weights of the physical regularization terms for active and reactive power, respectively.
7. A power flow prediction system based on a physical constraint graph convolutional network, characterized in that, The system is used to implement the power flow prediction method based on physical constraint graph convolutional networks as described in any one of claims 1 to 6, and the system comprises: The data processing module is used to acquire the topology and operation data of the power grid to be analyzed, construct the adjacency matrix, and build the node feature matrix and edge label matrix. The topology-aware learning module is used to input the node feature matrix into a graph convolutional network for topology-aware learning to obtain node representations; The initial mapping module is used to map the node representation to the initial branch power flow prediction value through the bus-branch association mapping layer; The physical constraint correction module is used to adjust the initial branch power flow prediction value through the node power balance correction layer using a pre-determined correction matrix to obtain a corrected branch power flow prediction value that strictly satisfies the node power balance hard constraint. The model training module is used to calculate the total training loss during the model training phase by combining the root mean square error between the corrected branch power flow prediction value and the sample label, and the physical regularization loss function calculated based on the corrected branch power flow prediction value, and iteratively updating the model parameters of the graph convolutional network and the bus-branch association mapping layer to obtain the trained power flow prediction model. The online inference module is used to collect real-time power grid operation data and construct a node feature matrix during the online inference phase. This matrix is then input into the trained power flow prediction model, and the output is a branch power flow prediction result with physical consistency.
8. A computer program product comprising a computer program / instructions, characterized in that, When a computer program / instruction is executed by a processor, the steps of the method described in any one of claims 1 to 6 are employed.
9. An electronic system comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.