Deep learning load flow calculation method and device, storage medium and computer equipment

By training the power flow calculation model using a combination of data-driven and physics-driven loss functions, and employing a phase angle recovery method for depth-first search, the problem of overall phase angle translation caused by different reference nodes in power flow calculation is solved, achieving high-precision and stable power flow solution recovery.

CN121124053APending Publication Date: 2025-12-12ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511355340.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-22
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

In existing deep learning power flow calculation methods, the phase angle is translated symmetric due to the different reference nodes. This introduces redundant information into the existing power flow calculation methods, which interferes with the model's generalization learning of the physical laws of power flow and significantly reduces the model's stability and transferability.

Method used

By constructing a target loss function that combines data-driven and physical-driven loss functions, a power flow calculation model is determined. The phase angle recovery method is then used to perform a depth-first search of the power grid to recover the phase angles of all nodes in the network, thus avoiding the overall phase angle shift problem caused by different reference node settings.

Benefits of technology

It achieves high-precision node power flow solutions and branch power prediction, improves the stability and versatility of the model, ensures the consistency and reliability of power flow solutions, simplifies the model structure, and enhances the robustness of the algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121124053A_ABST
    Figure CN121124053A_ABST
Patent Text Reader

Abstract

According to the deep learning load flow calculation method and device, the storage medium and the computer equipment provided by the invention, during power grid load flow calculation, load flow input data is obtained according to future prediction data, output plan arrangement and power grid topology construction, and meanwhile, a load flow calculation model obtained by training of a data driving loss function and a physical driving loss function is determined; wherein the data driving loss function can promote accurate numerical fitting of the model, and the physical driving loss can restrain the physical consistency of model output. Therefore, the node power flow solution and the branch power obtained by predicting the power flow input data through the model have high precision, and the problem of overall phase angle translation caused by different balance nodes is avoided by removing direct modeling on the node phase angle; and after the phase angle difference between the nodes at the two ends of each branch is determined according to the prediction data, performing depth-first search on the power grid by adopting a phase angle recovery method so as to accurately recover the phase angle of the nodes of the whole grid and realize physical recovery of a complete power flow solution.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of power systems, and particularly relates to a deep learning power flow calculation method and device, a storage medium and a computer device. BACKGROUND

[0002] With large-scale access of new energy and increasing complexity of power system operation state, power flow analysis as a basic tool for steady-state operation calculation of power systems has higher requirements for its real-time performance, robustness and generalization ability. Traditional power flow calculation methods mainly rely on numerical iterative algorithms such as Newton-Raphson, which have good accuracy, but when facing large-scale power grids or highly uncertain operating conditions, they often have low calculation efficiency and poor convergence, which is difficult to meet the real-time and wide-area adaptation needs of modern power grid operation.

[0003] In recent years, with the development of deep learning technology, its application in scientific computing has gradually expanded to the field of power systems. By constructing a deep neural network model, the power flow distribution law in historical operation data is learned to realize the rapid prediction of node voltage and other power flow, breaking through the bottleneck of traditional methods in complexity and real-time performance. At present, the power flow calculation method based on deep learning mostly uses the initial value of node power flow as input and outputs the voltage amplitude and phase angle of all nodes in the network.

[0004] Because a balance node must be set in the power system and a fixed phase angle value is given, the node phase angle distribution in the power flow solution will inevitably depend on the selection of the reference node. Under the same power flow physical state, if different reference nodes are selected, the corresponding phase angle solution will be shifted as a whole. From the perspective of deep learning modeling, this kind of uncertainty of phase angle constitutes a kind of "global translation symmetry", which makes the same power distribution scenario appear as different high-dimensional data distribution under different reference settings, thereby introducing redundant information, interfering with the model's generalization learning of the power flow physical law, and significantly reducing the stability and migration ability of the model. SUMMARY

[0005] The present application aims to at least solve one of the above technical defects, especially the technical defect that the existing power flow calculation method introduces redundant information, interferes with the model's generalization learning of the power flow physical law, and significantly reduces the stability and migration ability of the model.

[0006] The present application provides a deep learning power flow calculation method, which comprises:

[0007] obtaining future prediction data, output planning arrangement and power grid topology of the power grid, and constructing power flow input data according to the future prediction data, the output planning arrangement and the power grid topology;

[0008] A power flow calculation model is determined; the power flow calculation model is trained using a target loss function, which is a combination of a data-driven loss function and a physics-driven loss function.

[0009] The power flow calculation model is used to predict the power flow input data to obtain the nodal power flow solution and branch power of the power grid, and the phase angle difference between the two ends of each branch in the power grid is determined based on the nodal power flow solution and the branch power.

[0010] Based on the phase angle differences and phase angle reference frames, a depth-first search is performed on the power grid using a phase angle recovery method to recover the phase angles of each node based on the search results.

[0011] Optionally, obtaining power flow input data based on the future forecast data, the power output plan, and the power grid topology includes:

[0012] Based on the future forecast data and the power output plan, the injected active power, injected reactive power, voltage amplitude, generator reactive power upper and lower limits and parallel admittance of each node in the power grid are determined to form the initial power flow values;

[0013] Generate a mask matrix corresponding to the initial power flow value based on the attribute of each parameter in the initial power flow value;

[0014] The adjacency matrix of the power grid is generated based on the power grid topology, and power flow input data is formed according to the initial power flow value, the mask matrix, and the adjacency matrix.

[0015] Optionally, determining the power flow calculation model includes:

[0016] Data augmentation is performed on the historical operation data of the power grid to form training sample data, and sample input data for the training sample data is constructed.

[0017] The sample input data is input into a preset deep learning model so that the deep learning model performs forward computation based on the sample input data and outputs the node power flow solution and branch power.

[0018] Based on the node power flow solution and the branch power, the target loss function is used to backpropagate in the deep learning model to update the parameters of the deep learning model.

[0019] Return to the previous steps of inputting the sample input data into the preset deep learning model and subsequent steps until the deep learning model meets the convergence condition, thus obtaining the power flow calculation model.

[0020] Optionally, the process of determining the target loss function includes:

[0021] The first mean square loss of the node power flow results and the second mean square loss of the branch power are determined, and the first mean square loss and the second mean square loss are weighted and summed to obtain the data-driven loss function.

[0022] Kirchhoff constraints are determined based on unbalanced active power and unbalanced reactive power, branch loss consistency constraints are determined based on branch active power loss and branch reactive power loss, and power flow constraints are determined based on node injected active power and node injected reactive power.

[0023] The physical drive loss function is obtained by weighted summation of the Kirchhoff constraint, the branch loss consistency constraint, and the power flow constraint.

[0024] The target loss function is obtained by weighted summation of the data-driven loss function and the physics-driven loss function.

[0025] Optionally, the power flow calculation model includes a feature dimensionality upscaling module, a feature aggregation module, and a feature dimensionality reduction module;

[0026] The step of using the power flow calculation model to predict the power flow input data to obtain the nodal power flow solution and branch power of the power grid includes:

[0027] The feature upscaling module is used to upscale the initial power flow value and the mask matrix in the power flow input data to obtain the node upscaling feature corresponding to the initial power flow value and the mask upscaling feature corresponding to the mask feature.

[0028] The feature aggregation module extracts and aggregates features from the node up-dimensional features, the mask up-dimensional features, and the adjacency matrix in the power flow input data to obtain aggregated high-dimensional features.

[0029] The aggregated high-dimensional features are input into the feature dimensionality reduction module for feature dimensionality reduction, and the node power flow solution output by the feature dimensionality reduction module is obtained.

[0030] Optionally, the power flow calculation module further includes a feature extraction module;

[0031] The step of using the power flow calculation model to predict the power flow input data to obtain the nodal power flow solution and branch power of the power grid further includes:

[0032] The adjacency matrix is ​​upgraded using the feature upscaling module to obtain branch upscaling features;

[0033] The feature extraction module extracts features from the branch up-dimensional features and the aggregate high-dimensional features to obtain the branch feature matrix.

[0034] The branch feature matrix is ​​input into the feature dimensionality reduction module for feature dimensionality reduction, and the branch power output by the feature dimensionality reduction module is obtained.

[0035] Optionally, the step of performing a depth-first search of the power grid using a phase angle recovery method based on each phase angle difference and phase angle reference frame, to recover the phase angle of each node based on the search results, includes:

[0036] Based on the power grid topology, an undirected graph of the nodes of the power grid is obtained, and a node is selected from the undirected graph as a balance node according to actual needs.

[0037] The phase angle reference value of the balancing node is set according to the phase angle reference system, and the balancing node and the phase angle reference value are added to the phase angle dictionary in the form of key-value pairs, and the balancing node is added to the traversed node set and the traversal queue set.

[0038] Select a node from the traversal queue set as the target node, and search for the neighbor nodes of the target node in the undirected graph of the nodes;

[0039] If the neighbor node is not in the traversed node set, then determine the phase angle difference between the target node and the neighbor node to restore the phase angle of the neighbor node, and add the neighbor node and the phase angle to the phase angle dictionary;

[0040] Remove the target node from the traversal queue set, and add the neighboring nodes to the traversed node set and the traversal queue set respectively;

[0041] Return to the previous step of selecting a node as the target node from the traversal queue set and the subsequent steps, until the traversal queue set is empty.

[0042] This application also provides a deep learning power flow computing device, including:

[0043] The data construction module is used to acquire future power grid forecast data, power output plan arrangements, and power grid topology, and to construct power flow input data based on the future power grid forecast data, the power output plan arrangements, and the power grid topology.

[0044] The model determination module is used to determine the power flow calculation model; the power flow calculation model is trained using a target loss function, which is a combination of a data-driven loss function and a physics-driven loss function.

[0045] The model prediction module is used to predict the power flow input data using the power flow calculation model, obtain the nodal power flow solution and branch power of the power grid, and determine the phase angle difference between the two ends of each branch in the power grid based on the nodal power flow solution and the branch power.

[0046] The phase angle restoration module is used to perform a depth-first search on the power grid based on each phase angle difference and phase angle reference system, using a phase angle restoration method, so as to restore the phase angle of each node according to the search results.

[0047] This application also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the deep learning power flow calculation method as described in any of the above embodiments.

[0048] This application also provides a computer device, including: one or more processors, and memory;

[0049] The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the deep learning power flow calculation method as described in any of the above embodiments.

[0050] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0051] The deep learning-based power flow calculation method, apparatus, storage medium, and computer equipment provided in this application can obtain power flow input data based on acquired future forecast data, power output plans, and power grid topology during power flow calculation. Simultaneously, a power flow calculation model is determined, trained using a target loss function combining a data-driven loss function and a physical-driven loss function. The data-driven loss function promotes accurate numerical fitting of the model, while the physical-driven loss function constrains the physical consistency of the model output. Therefore, this application can use this power flow calculation model to predict power flow input data, obtaining high-precision nodal power flow solutions and branch power. Furthermore, by eliminating direct modeling of nodal phase angles, it avoids the overall phase angle shift problem caused by different reference node settings. Then, based on the nodal power flow solutions and branch power, the phase angle difference between the nodes at both ends of each branch in the power grid is determined. Based on each phase angle difference and phase angle reference system, a depth-first search of the power grid is performed using a phase angle recovery method to accurately recover the phase angles of all nodes in the network, achieving a physical reconstruction of the complete power flow solution. Attached Figure Description

[0052] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0053] Figure 1 A flowchart illustrating a deep learning power flow calculation method provided in an embodiment of this application;

[0054] Figure 2 A training architecture diagram of a power flow calculation model provided in this application embodiment;

[0055] Figure 3 A prediction structure diagram of a power flow calculation model provided in an embodiment of this application;

[0056] Figure 4 This is a schematic diagram of a branch power output method provided in an embodiment of this application;

[0057] Figure 5 An application architecture diagram of a deep learning power flow calculation method provided in this application embodiment;

[0058] Figure 6 An application scenario diagram of a deep learning power flow calculation method provided in the embodiments of this application;

[0059] Figure 7 A schematic diagram of the structure of a deep learning power flow computing device provided in an embodiment of this application;

[0060] Figure 8 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0061] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0062] Because power systems must have slack nodes with fixed phase angles, the distribution of node phase angles in power flow solutions inevitably depends on the selection of reference nodes. Under the same power flow physical state, different reference nodes will result in a global shift in the corresponding phase angle solutions. From the perspective of deep learning modeling, this uncertainty in phase angles constitutes a kind of "global translational symmetry," causing the same power distribution scenario to exhibit different high-dimensional data distributions under different reference settings. This introduces redundant information, interferes with the model's generalization learning of power flow physical laws, and significantly reduces the model's stability and transferability.

[0063] Based on this, this application proposes the following technical solution, as detailed below:

[0064] In one embodiment, such as Figure 1 As shown, Figure 1 This is a flowchart illustrating a deep learning power flow calculation method provided in an embodiment of this application. This application provides a deep learning power flow calculation method, specifically including the following:

[0065] S110: Obtain future forecast data, power output plan, and grid topology of the power grid, and construct power flow input data based on the future forecast data, power output plan, and grid topology.

[0066] In this step, during power flow calculation, the computer equipment can obtain power flow input data based on the acquired future forecast data, power output plan arrangements, and power grid topology, which serves as data support for power flow calculation.

[0067] Understandably, future forecast data, power output planning, and grid topology represent different dimensions of grid operation information. Future forecast data refers to the prediction results of the grid's operating status for a certain period of time, including new energy forecasts and load forecasts; power output planning refers to the power generation plan formulated by the grid dispatch center for each generating unit based on system operation requirements and the principles of economy and safety, including power generation capacity and operating time periods. It can serve as input data for power nodes in power flow calculations, determining the active and reactive power output of each node; grid topology refers to the structural description of the connection relationships between various equipment nodes in the power system.

[0068] Specifically, when performing power flow calculations, computer equipment can use multi-dimensional operational information to construct complete power flow input data that conforms to the actual operating scenario. As an important data support for carrying out power flow calculations, it can include key information such as generator output, voltage amplitude and phase angle, load demand, and transmission line parameters.

[0069] S120: Determine the power flow calculation model; the power flow calculation model is trained using a target loss function, which is a combination of a data-driven loss function and a physics-driven loss function.

[0070] In this step, after the power flow input data is constructed through step S110, the computer device can also determine the power flow calculation model. The power flow calculation model is trained using a target loss function that combines a data-driven loss function and a physics-driven loss function. The data-driven loss function can promote accurate numerical fitting of the model, while the physics-driven loss function can constrain the physical consistency of the model output.

[0071] Understandably, the target loss function used in the power flow calculation model is a composite target loss function that integrates data-driven and physics-driven loss functions, thus achieving an effective balance between mathematical accuracy and physical consistency. Specifically, the data-driven loss function relies heavily on extensive historical and simulated data, focusing on improving the model's ability to accurately fit the power flow state of the power grid, enabling the model to highly reproduce real-world operating conditions numerically. The physics-driven loss function, on the other hand, is based on the physical laws and electrical characteristics of power grid operation, such as constraints like energy conservation, power balance, voltage limits, and line capacity, strongly constraining the physical rationality of the model's output. This ensures that the results are not only numerically close to reality but also logically and physically consistent with the fundamental principles of power systems. Therefore, even when facing complex power grid structures, multi-source heterogeneous data, and dynamic operating environments, the power flow calculation model in this application can still maintain high accuracy in its output calculations.

[0072] S130: The power flow calculation model is used to predict the power flow input data, obtain the nodal power flow solution and branch power of the power grid, and determine the phase angle difference between the two ends of each branch in the power grid based on the nodal power flow solution and branch power.

[0073] In this step, after the power flow calculation model is determined in step S120, the computer equipment can use the power flow calculation model to predict the power flow input data, obtain high-precision nodal power flow solutions and branch power, and then determine the phase angle difference between the nodes at both ends of each branch in the power grid based on the nodal power flow solutions and branch power. This eliminates the need for direct modeling of the node phase angle, and the phase angle can be restored by calculating the phase angle difference, thus avoiding the overall phase angle translation problem caused by different reference node settings.

[0074] Understandably, power flow calculation models can effectively improve the prediction accuracy and generalization ability of power flow solutions under complex operating conditions through a mechanism combining deep learning and physical constraints during the calculation process. Based on the high-precision power flow calculation results output by the model, computer equipment can deduce the voltage phase angle difference between the two ends of each branch node in the power grid, thereby achieving indirect reconstruction of voltage phase angle information.

[0075] It should be noted that the power flow calculation model abandons the direct modeling of node voltage phase angles during its construction, thereby essentially eliminating the problem of overall phase angle translation caused by different slack node selections. Through this model, this application not only simplifies the model structure and improves its stability and versatility, but also maintains the consistency and reliability of power flow solutions when facing power grids with different reference settings. In other words, it solves the problem of multiple solutions and non-uniqueness that may arise in modeling due to the translational invariance of phase angles.

[0076] S140: Based on the phase angle differences and phase angle reference frames, a depth-first search is performed on the power grid using the phase angle recovery method to recover the phase angles of each node based on the search results.

[0077] In this step, after determining the phase angle difference between the two nodes of each branch in the power grid through step S130, the computer equipment can perform a depth-first search of the power grid based on each phase angle difference and the phase angle reference system, using the phase angle recovery method, so as to accurately recover the phase angle of all nodes in the network according to the search results, and realize the physical restoration of the complete power flow solution.

[0078] Specifically, in the process of phase angle restoration, the computer equipment can first select a node as the balancing node and assign it a fixed phase angle value. Then, according to the topological connection relationship of the power grid, it can gradually traverse every node and branch in the power grid from top to bottom or from front to back. By using the known phase angle difference between adjacent nodes, the phase angle values ​​of all nodes can be gradually accumulated or recursively calculated, thereby realizing the global restoration of the phase angle information of the entire power grid.

[0079] Understandably, by employing a depth-first search-based phase angle recovery method, this application not only maintains the coherence and directionality of the computation process but also preserves high computational efficiency and stability when dealing with complex or large-scale power grid structures. The phase angle recovery method does not rely on direct modeling of the absolute phase angle of each node; instead, it uses physically measurable and verifiable inter-node phase angle differences to reconstruct the phase angle. This effectively avoids offset errors caused by differences in balancing node settings, thereby enhancing the physical consistency of power flow calculation results and the robustness of the algorithm.

[0080] In the above embodiments, during power flow calculation, power flow input data can be obtained based on the acquired future forecast data, power output plan, and power grid topology. Simultaneously, a power flow calculation model is determined. This model is trained using a target loss function, which combines a data-driven loss function and a physical-driven loss function. The data-driven loss function promotes accurate numerical fitting of the model, while the physical-driven loss function constrains the physical consistency of the model output. Therefore, this application can utilize this power flow calculation model to predict the power flow input data, obtaining high-precision nodal power flow solutions and branch power. Furthermore, by eliminating direct modeling of nodal phase angles, the overall phase angle shift problem caused by different reference node settings is avoided. Then, the phase angle difference between the nodes at both ends of each branch in the power grid can be determined based on the nodal power flow solution and branch power. Based on each phase angle difference and phase angle reference system, a depth-first search of the power grid is performed using a phase angle recovery method to accurately recover the phase angles of all nodes in the network, achieving a physical restoration of the complete power flow solution.

[0081] In one embodiment, the process of obtaining power flow input data based on future forecast data, power output planning, and power grid topology in step S110 may include:

[0082] S111: Based on future forecast data and power output plan arrangements, determine the injected active power, injected reactive power, voltage amplitude, generator reactive power upper and lower limits, and parallel admittance of each node in the power grid to form the initial power flow values.

[0083] S120: Generate a mask matrix corresponding to the initial power flow value based on the attribute of each parameter in the initial power flow value.

[0084] S130: Generate the adjacency matrix of the power grid based on the power grid topology, and form power flow input data according to the initial power flow value, mask matrix and adjacency matrix.

[0085] In this embodiment, the power flow input data may include initial power flow values, a mask matrix, and an adjacency matrix. Therefore, when constructing the power flow input data, the computer device can determine the injected active power, injected reactive power, voltage amplitude, generator reactive power upper and lower limits, and parallel admittance of each node in the power grid based on future forecast data and power output plan arrangements, forming initial power flow values. Furthermore, it can generate a mask matrix corresponding to the initial power flow values ​​based on the attributes of each parameter in the initial power flow values. In addition, the computer device can also generate the adjacency matrix of the power grid based on the power grid topology.

[0086] Specifically, for a power grid with N nodes and L branches, the constructed power flow input data can include initial power flow values. Mask matrix and adjacency matrix .

[0087] in, The matrix formed by the initial power flow values ​​of all nodes before power flow calculation has different phase angles depending on the reference frame chosen. The phase angle is not included. The specific elements in can be represented as follows:

[0088]

[0089] In the formula, , and These represent the injected active power, injected reactive power, and voltage amplitude of node i, respectively. For unknown quantities before power flow calculation, initial values ​​are set according to the flat start principle. For example, the voltage amplitude of PQ node is set to 1, the injected reactive power of PV node is set to 0, and the injected active power and injected reactive power of balanced node are both set to 0. and These represent the lower and upper limits of the generator for node i, respectively. For non-generator nodes, the upper and lower limits can be 0. and It represents the parallel admittance of node i, including the parallel admittance of the branch connected to node i and the reactive power compensation of the node.

[0090] M is a mask matrix, and M and The elements in the array correspond row by row to represent The element is set to 1 if the active power, reactive power, and voltage amplitude of the corresponding node are known, and 0 otherwise. The mask matrix is ​​used to allow the model to understand the type of each node. When the node number, number of nodes, or node type changes, the model can identify the current node type, avoiding model confusion. This mask matrix can be represented as follows:

[0091]

[0092] A is the adjacency matrix, which can be used to declare the connection relationships and connection weights between nodes, as shown below:

[0093]

[0094] In the formula, and Representing branch roads Admittance; and Representing branch roads For transmission lines, the turns ratios at nodes i and j are... .

[0095] In one embodiment, the process of determining the power flow calculation model in step S120 may include:

[0096] S121: Perform data augmentation on the historical operation data of the power grid to form training sample data, and construct the sample input data for obtaining the training sample data.

[0097] S122: Input the sample input data into the preset deep learning model so that the deep learning model can perform forward computation based on the sample input data and output the node power flow solution and branch power.

[0098] S123: Based on the node power flow solution and branch power, backpropagation is performed in the deep learning model using the objective loss function to update the parameters of the deep learning model.

[0099] S124: Return to the execution of inputting the sample input data into the preset deep learning model and subsequent steps until the deep learning model meets the convergence condition, and obtain the power flow calculation model.

[0100] In this embodiment, as Figure 2 As shown, Figure 2 This document provides a training architecture diagram for a power flow calculation model according to an embodiment of this application. When training the power flow calculation model, the computer device can first perform data augmentation on historical power grid operating data to form training sample data, and then construct sample input data for the training sample data. This sample input data is then input into a preset deep learning model, enabling the deep learning model to perform forward computation based on the sample input data, outputting node power flow solutions and branch power. Subsequently, based on the node power flow solutions and branch power, backpropagation can be performed in the deep learning model using a target loss function to update the model's parameters. Finally, the computer device can repeatedly train the deep learning model using the sample input data until the deep learning model meets the convergence condition, thus obtaining the power flow calculation model.

[0101] Specifically, the computer equipment can construct a series of historical operating scenarios based on historical data of all generators, loads, and new energy sources in the power grid required for the application. Within these historical operating scenarios, the computer equipment can further augment the data by applying random disturbances such as load fluctuations and branch initiation, forming a series of training sample data. Next, the computer equipment can construct the power flow input data for the power flow calculation model based on the training sample data, including initial power flow values, a mask matrix, and an adjacency matrix. This constructed input data can then be fed into the power flow calculation model, and the model's forward computation outputs the node power flow solution and branch power. Finally, based on the target loss function obtained by combining the data-driven loss function and the physical-driven loss function, optimization algorithms such as Adam are used for normal propagation to update the parameters of the power flow calculation model.

[0102] More specifically, in the output data of the power flow calculation model, the nodal power flow solutions... This can include active power prediction values. Reactive power prediction value and voltage amplitude prediction value Branch power This can include branch active power prediction values And branch reactive power prediction value Their expressions are as follows:

[0103]

[0104]

[0105] In the formula, L represents the number of branches. Since the model outputs the power at both ends of the branches, the length of the branch power output is 2L.

[0106] In one embodiment, the process of determining the target loss function in step S120 may include:

[0107] S125: Determine the first mean square loss of the nodal power flow results and the second mean square loss of the branch power of the power grid, and perform a weighted summation of the first mean square loss and the second mean square loss to obtain the data-driven loss function.

[0108] S126: Determine Kirchhoff constraints based on unbalanced active power and unbalanced reactive power, determine branch loss consistency constraints based on branch active power loss and branch reactive power loss, and determine power flow constraints based on node injected active power and node injected reactive power.

[0109] S127: The physical drive loss function is obtained by weighted summation of Kirchhoff constraints, branch loss consistency constraints and power flow constraints.

[0110] S128: The target loss function is obtained by weighted summation of the data-driven loss function and the physics-driven loss function.

[0111] In this embodiment, the target loss function of the power flow calculation model is obtained by weighted summation of the data-driven loss function and the physical-driven loss function; the data-driven loss function is obtained by weighted summation of the mean square loss of both node power flow results and branch power; and the physical-driven loss function is obtained by weighted summation of Kirchhoff constraints, branch loss consistency constraints, and power flow constraints.

[0112] Specifically, the target loss function includes the data-driven loss function. and physical driving loss function The loss function consists of two parts. The data-driven loss function can be used to improve the model's numerical fitting ability, resulting in more accurate predictions. The physics-driven loss function, on the other hand, can be used to promote the consistency of the model's predictions with physical constraints, thereby improving the effectiveness of the results. The data expression for the objective loss function is as follows:

[0113]

[0114] In the formula, and These represent the weight coefficients of the data-driven loss function and the physics-driven loss function, respectively.

[0115] For the data-driven loss function, this loss function can be represented by the mean square loss of both node power flow results and branch power, with different weighting coefficients. and Weighted average, specifically as follows:

[0116]

[0117] In the formula, B represents the total number of training data samples, and b represents the sample sequence number. Denotes the F-norm; The mean squared loss represents the result of the node power flow, where, Represents the predicted value of the node power flow result. This represents the actual value of the node power flow result; This represents the mean square loss of branch power, where, This represents the predicted value of the branch power. This represents the actual value of the branch power.

[0118] For physics-driven loss design, the loss function is constrained by Kirchhoff constraints. Branch loss consistency constraints and power flow constraints The composition, with the three factors weighted by different weights, is as follows:

[0119]

[0120] In the formula, , and These represent the weighting coefficients of Kirchhoff constraints, branch loss consistency constraints, and power flow constraints, respectively.

[0121] The calculation method for Kirchhoff constraints is as follows:

[0122]

[0123] In the formula, This represents the number of nodes in sample b. and These represent the imbalanced active power and imbalanced reactive power of sample B, respectively.

[0124] The branch loss consistency constraint uses model predictions of the power at both ends of the branch and the voltage amplitude at the nodes to calculate the active and reactive power losses of the branch. These losses are then compared with the actual labeled values ​​to calculate the losses and ensure that the power at both ends of the branch output by the model conforms to the branch loss constraint. This is specifically expressed as follows:

[0125]

[0126]

[0127]

[0128]

[0129] In the formula, This represents the current flowing from node i to node j, calculated from the model prediction results. The impedance of the branch; and This indicates the active and reactive power losses of a branch circuit. Let represent the number of branches in sample b. Since the power at both ends of each branch is calculated for loss during the loss calculation, the denominator is . .

[0130] The calculation method for power flow constraints is expressed as follows:

[0131]

[0132]

[0133] In the formula, Indicates a branch The predicted phase angle difference between the two endpoints i and j; and Representing branch roads Active power forecast and reactive power forecast; This represents the predicted voltage magnitude at node i. Indicates a branch Admittance; Indicates a branch The ratio on the node i side.

[0134] In one embodiment, the power flow calculation model in step S130 may include a feature dimensionality enhancement module, a feature aggregation module, and a feature dimensionality reduction module; wherein, the process of using the power flow calculation model to predict the power flow input data and obtain the node power flow solution and branch power of the power grid may include:

[0135] S131: Use the feature upscaling module to upscale the initial power flow value and the mask matrix in the power flow input data to obtain the node upscaling feature corresponding to the initial power flow value and the mask upscaling feature corresponding to the mask feature.

[0136] S132: The feature aggregation module extracts and aggregates features from node up-dimensional features, mask up-dimensional features, and adjacency matrix in power flow input data to obtain aggregated high-dimensional features.

[0137] S133: Input the aggregated high-dimensional features into the feature reduction module to perform feature reduction, and obtain the node power flow solution output by the feature reduction module.

[0138] In this embodiment, as Figure 3 As shown, Figure 3 A prediction structure diagram of a power flow calculation model provided in an embodiment of this application; Figure 3 In the power flow calculation model, when solving the nodal power flow solution, the feature dimensionality upscaling module can first perform feature dimensionality upscaling on the initial power flow value and mask matrix in the power flow input data to obtain the node dimensionality upscaling feature corresponding to the initial power flow value and the mask dimensionality upscaling feature corresponding to the mask feature. Then, the feature aggregation module performs feature extraction and aggregation on the node dimensionality upscaling feature, the mask dimensionality upscaling feature and the adjacency matrix in the power flow input data to obtain the aggregated high-dimensional feature. The aggregated high-dimensional feature can then be input into the feature dimensionality reduction module for feature dimensionality reduction to obtain the nodal power flow solution output by the feature dimensionality reduction module.

[0139] Specifically, the power flow calculation model needs to map the input low-dimensional features, namely the initial power flow values ​​and mask matrix in the power flow input data, to a high-dimensional space in the feature upscaling module to obtain richer feature representations, thereby extracting more complex relational features, as shown below:

[0140]

[0141] In the formula, This represents the high-dimensional features of the node; where E represents the high-dimensional feature dimension. and These represent the node dimensionality increase feature and the mask dimensionality increase feature, respectively.

[0142] The feature aggregation module can be implemented using a Transformer network (GT). It extracts and aggregates features to form a high-dimensional feature representation for each node. Let the aggregated high-dimensional feature be denoted as... :

[0143]

[0144] In the formula, This represents the forward transfer function of the graph Transformer network.

[0145] The node power flow solution can be obtained through the feature dimensionality reduction module. Dimensionality reduction is achieved, specifically as follows:

[0146]

[0147] In the formula, This represents the forward transfer function of the feature dimensionality reduction module.

[0148] In one embodiment, the power flow calculation module in step S130 may further include a feature extraction module; wherein, the process of using the power flow calculation model to predict the power flow input data and obtain the nodal power flow solution and branch power of the power grid may further include:

[0149] S134: Use the feature upscaling module to upscale the adjacency matrix to obtain branch upscaling features.

[0150] S135: The feature extraction module extracts the branch dimensionality-upgrading features and aggregated high-dimensional features to obtain the branch feature matrix.

[0151] S136: Input the branch feature matrix into the feature reduction module for feature reduction, and obtain the branch power output by the feature reduction module.

[0152] In this embodiment, as Figure 3 As shown, the power flow calculation model can also use the feature upscaling module to upscale the adjacency matrix to obtain branch upscaling features. Then, the feature extraction module extracts features from the branch upscaling features and the aggregated high-dimensional features to obtain the branch feature matrix. The branch feature matrix can then be input into the feature downscaling module for feature downscaling to obtain the branch power output by the feature downscaling module.

[0153] Specifically, since the deep learning power flow calculation method of this application does not use node phase angle as model input and output, it is necessary to add branch power as the direct output of the power flow calculation model. For example... Figure 4 As shown, Figure 4 This is a schematic diagram of a branch power output method provided in an embodiment of this application. When outputting branch power, the power flow calculation model can first perform feature dimensionality increase on the adjacency matrix through a feature dimensionality increase module to obtain branch dimensionality increase features, and then perform branch feature extraction through a feature extraction module, as specifically shown below:

[0154]

[0155] In the formula, Indicates a branch The characteristic is that the default direction is from node i to node j; This indicates the dimensionality increase characteristic of the branch; This represents the branch feature extraction matrix. Combined with... Figure 4 As can be seen from the above, the branch feature transformation process uses a matrix. Key features for predicting the power of subsequent branches are selected from the node features at both ends of the branch, the difference between node features, and the branch features.

[0156] In the feature reduction module, two different linear transformations can be used to convert branch features into active power representations of the branches. and reactive power representation Then, by using different dimensionality reduction matrices to reduce the dimensionality of the two representations, the active power prediction value and reactive power prediction value of the branch can be obtained, as shown below:

[0157]

[0158]

[0159] In the formula, These represent the active power characteristic transformation matrix and the reactive power characteristic transformation matrix of the branch, respectively; These represent the active power reduction matrix and reactive power reduction matrix of the branch, respectively. After dimensionality reduction, the branch can be directly output. The merits and the inefficiencies.

[0160] Finally, the feature reduction module can concatenate the active power predictions and reactive power predictions of all branches to obtain the predicted power of each branch. Specifically, it is expressed as follows:

[0161]

[0162] In one embodiment, step S140, which involves performing a depth-first search of the power grid using a phase angle recovery method based on each phase angle difference and phase angle reference frame, to reconstruct the phase angles of each node according to the search results, may include:

[0163] S141: Obtain the undirected graph of the power grid nodes based on the power grid topology, and select a node from the undirected graph as the balancing node according to actual needs.

[0164] S142: Set the phase angle reference value of the balancing node according to the phase angle reference system, add the balancing node and the phase angle reference value to the phase angle dictionary in the form of key-value pairs, and add the balancing node to the traversed node set and the traversal queue set.

[0165] S143: Select a node from the traversal queue set as the target node, and search for the neighbor nodes of the target node in the undirected node graph.

[0166] S144: If the neighboring node is not in the set of traversed nodes, determine the phase angle difference between the target node and the neighboring node to restore the phase angle of the neighboring node, and add the neighboring node and phase angle to the phase angle dictionary.

[0167] S145: Remove the target node from the traversal queue set and add the neighboring nodes to the traversed node set and the traversal queue set respectively.

[0168] S146: Return to the execution of selecting a node from the traversal queue set as the target node and its subsequent steps, until the traversal queue set is empty.

[0169] In this embodiment, when the computer device restores the phase angle of each node, it can first obtain the undirected graph of the power grid nodes according to the power grid topology, select a node from the undirected graph as the balancing node according to actual needs, and set the phase angle reference value of the balancing node according to the phase angle reference system. Then, it can gradually search its neighboring nodes based on the balancing node to restore the phase angle until the phase angle of all nodes is restored.

[0170] Specifically, the computer equipment can first construct the power grid as an undirected graph based on the connection relationships between the nodes in the power grid topology, denoted as . Then, a node can be selected as the balancing node according to actual needs, and the phase angle reference value of the balancing node can be set based on the phase angle reference system. Let the selected balancing node be denoted as . The phase angle reference value is and initialize the set of traversed nodes as Traversing the queue set The phase angle results are recorded using a dictionary, which is initialized to... .

[0171] During a depth search, the computer device can sequentially traverse the queue set. Select a target node, denoted as . The corresponding phase angle is denoted as Then search for neighboring nodes in the search. For each one not present Neighbor nodes in You can get nodes and Phase angle difference and restoration The phase angle, and then from Remove node ,exist and Add nodes Finally, update the phase angle result and add nodes. The phase angle is also recorded in key-value pairs. The search process is repeated until the entire queue set has been traversed. An empty value indicates that the phase angles of all nodes have been successfully recovered, and the computer can then return the phase angle dictionary. This allows the phase angles of all nodes to be represented as key-value pairs.

[0172] To better explain the deep learning power flow calculation method of this application, the following will be conducted through... Figure 5 and Figure 6 To further illustrate, schematically, Figure 5 An application architecture diagram of a deep learning power flow calculation method provided in this application embodiment; Figure 6 This is an application scenario diagram of a deep learning power flow calculation method provided in an embodiment of this application.

[0173] Figure 5 In this process, the computer equipment, upon acquiring the inference dataset for power flow calculation, can first construct its corresponding power flow input data, including initial power flow values, mask matrix, and adjacency matrix. Then, it uses a deep learning power flow calculation model to predict the power flow solutions and branch powers at the output nodes. Furthermore, it can calculate the phase angle difference between each node based on this output data, and, based on a phase angle reference frame, perform a breadth-first search using a phase angle recovery method to reconstruct the phase angle of each node. Figure 6 The example is a topology diagram of an IEEE 39-node system in a running scenario. The power flow calculation of the system takes into account the start and stop of generators, including the shutdown of 3 generators. There are a total of 36 nodes in the topology diagram, of which node 34 is the balancing node.

[0174] Furthermore, Figure 5 Application architecture diagrams are applied to Figure 6 After performing power flow calculations on the application scenario graph, the nodal power flow solutions output by the model are shown in the table below:

[0175]

[0176] The branch power output by the model is shown in the table below:

[0177]

[0178] As can be seen from the two tables above, the power flow calculation model makes very accurate predictions for both nodes and branches.

[0179] Furthermore, during model training, to ensure the consistency of the numerical ranges of various features, all power values ​​of the computer equipment were normalized. The normalized values ​​were used for loss calculation, and the phase angle was calculated in radians. Specifically, when calculating the branch power loss consistency constraint, the current of the branch with losses was calculated based on the power at both ends of the branch. Then, the predicted loss was obtained by combining the branch's resistance and reactance. Additionally, based on the power flow constraint, the phase angle difference between the nodes at both ends of each branch was calculated according to the model's predictions of branch power and node voltage amplitude. Through these calculations, the branch power loss consistency constraint was found to be 0.000239, and the power flow constraint was found to be 0.0000062. Further, based on the predicted phase angle differences of all branches, with node 34 as the balancing node and the reference voltage set to 0°, the predicted phase angles of all nodes in the power grid were obtained using a depth-first search phase angle calculation method, as shown in the table below.

[0180]

[0181] As can be seen from the table above, the final calculated phase angle has high accuracy.

[0182] The deep learning power flow calculation device provided in the embodiments of this application is described below. The deep learning power flow calculation device described below can be referred to in correspondence with the deep learning power flow calculation method described above.

[0183] In one embodiment, such as Figure 7 As shown, Figure 7 This application provides a schematic diagram of a deep learning power flow computing device according to an embodiment of the present application. The present application also provides a deep learning power flow computing device, including a data construction module 210, a model determination module 220, a model prediction module 230, and a phase angle restoration module 240, specifically comprising the following:

[0184] The data construction module 210 is used to acquire future forecast data, power output plan arrangements and power grid topology of the power grid, and to construct power flow input data based on the future forecast data, power output plan arrangements and power grid topology.

[0185] The model determination module 220 is used to determine the power flow calculation model. The power flow calculation model is trained using a target loss function, which is a combination of a data-driven loss function and a physics-driven loss function.

[0186] The model prediction module 230 is used to predict the power flow input data using the power flow calculation model, obtain the nodal power flow solution and branch power of the power grid, and determine the phase angle difference between the two ends of each branch in the power grid based on the nodal power flow solution and branch power.

[0187] The phase angle restoration module 240 is used to perform a depth-first search of the power grid based on each phase angle difference and phase angle reference system, using a phase angle restoration method, so as to restore the phase angle of each node according to the search results.

[0188] In the above embodiments, during power flow calculation, power flow input data can be obtained based on the acquired future forecast data, power output plan, and power grid topology. Simultaneously, a power flow calculation model is determined. This model is trained using a target loss function, which combines a data-driven loss function and a physical-driven loss function. The data-driven loss function promotes accurate numerical fitting of the model, while the physical-driven loss function constrains the physical consistency of the model output. Therefore, this application can utilize this power flow calculation model to predict the power flow input data, obtaining high-precision nodal power flow solutions and branch power. Furthermore, by eliminating direct modeling of nodal phase angles, the overall phase angle shift problem caused by different reference node settings is avoided. Then, the phase angle difference between the nodes at both ends of each branch in the power grid can be determined based on the nodal power flow solution and branch power. Based on each phase angle difference and phase angle reference system, a depth-first search of the power grid is performed using a phase angle recovery method to accurately recover the phase angles of all nodes in the network, achieving a physical restoration of the complete power flow solution.

[0189] In one embodiment, the data construction module 210 may include:

[0190] The first data generation submodule is used to determine the injected active power, injected reactive power, voltage amplitude, generator reactive power upper and lower limits and parallel admittance of each node in the power grid based on future forecast data and power output plan arrangements, so as to form the initial power flow values.

[0191] The second data generation submodule is used to generate a mask matrix corresponding to the initial power flow value based on the attributes of each parameter in the initial power flow value.

[0192] The third data generation submodule is used to generate the adjacency matrix of the power grid based on the power grid topology, and to form power flow input data based on the initial power flow value, mask matrix and adjacency matrix.

[0193] In one embodiment, the model determination module 220 may include:

[0194] The sample construction submodule is used to perform data augmentation on the historical operation data of the power grid, form training sample data, and construct the sample input data that yields the training sample data.

[0195] The forward operation submodule is used to input sample input data into a preset deep learning model, so that the deep learning model can perform forward operations based on the sample input data and output the node power flow solution and branch power.

[0196] The backpropagation submodule is used to perform backpropagation in the deep learning model based on the node power flow solution and branch power, using the objective loss function to update the parameters of the deep learning model.

[0197] The iterative training submodule is used to return to the execution of inputting the sample input data into the preset deep learning model and subsequent steps until the deep learning model meets the convergence condition and obtains the power flow calculation model.

[0198] In one embodiment, the model determination module 220 may further include:

[0199] The first weighted summation submodule is used to determine the first mean square loss of the node power flow results and the second mean square loss of the branch power of the power grid, and to perform a weighted summation of the first mean square loss and the second mean square loss to obtain the data-driven loss function.

[0200] The constraint determination submodule is used to determine Kirchhoff constraints based on unbalanced active and unbalanced reactive power, branch loss consistency constraints based on branch active and reactive power losses, and power flow constraints based on node injected active and reactive power.

[0201] The second weighted summation submodule is used to perform weighted summation on Kirchhoff constraints, branch loss consistency constraints, and power flow constraints to obtain the physical drive loss function.

[0202] The third weighted summation submodule is used to perform a weighted summation of the data-driven loss function and the physics-driven loss function to obtain the target loss function.

[0203] In one embodiment, the power flow calculation model in the model prediction module 230 may include a feature dimensionality enhancement module, a feature aggregation module, and a feature dimensionality reduction module; the model prediction module 230 may also include:

[0204] The first feature dimensionality-upgrading submodule is used to perform feature dimensionality-upgrading on the initial power flow value and the mask matrix in the power flow input data, respectively, to obtain the node dimensionality-upgrading feature corresponding to the initial power flow value and the mask dimensionality-upgrading feature corresponding to the mask feature.

[0205] The feature aggregation submodule is used to extract and aggregate features from node up-dimensional features, mask up-dimensional features, and adjacency matrices in power flow input data to obtain aggregated high-dimensional features.

[0206] The first feature dimensionality reduction submodule is used to input the aggregated high-dimensional features into the feature dimensionality reduction module for feature dimensionality reduction, and obtain the node power flow solution output by the feature dimensionality reduction module.

[0207] In one embodiment, the power flow calculation module in the step model prediction module 230 may further include a feature extraction module; wherein, the model prediction module 230 may further include:

[0208] The second feature dimension-upgrading submodule is used to perform feature dimension-upgrading on the adjacency matrix using the feature dimension-upgrading module to obtain branch dimension-upgrading features.

[0209] The feature extraction submodule is used to extract features from the branch up-dimensional features and aggregated high-dimensional features through the feature extraction module to obtain the branch feature matrix.

[0210] The second feature reduction submodule is used to input the branch feature matrix into the feature reduction module for feature reduction, and obtain the branch power output by the feature reduction module.

[0211] In one embodiment, the phase angle restoration module 240 may include:

[0212] The node selection submodule is used to obtain the undirected graph of the power grid nodes based on the power grid topology and select a node from the undirected graph as the balancing node according to actual needs.

[0213] The set generation submodule is used to set the phase angle reference value of the balancing node according to the phase angle reference system, add the balancing node and the phase angle reference value to the phase angle dictionary in the form of key-value pairs, and add the balancing node to the traversed node set and the traversal queue set.

[0214] The node search submodule is used to select a node as the target node from the traversal queue set and search for the neighbor nodes of the target node in the undirected node graph.

[0215] The phase angle recovery module is used to determine the phase angle difference between the target node and its neighboring nodes if the neighboring node is not in the set of traversed nodes, so as to restore the phase angle of the neighboring node and add the neighboring node and its phase angle to the phase angle dictionary.

[0216] The node removal submodule is used to remove the target node from the traversal queue set and add the neighboring nodes to the traversed node set and the traversal queue set, respectively.

[0217] The node traversal submodule is used to return the execution of selecting a node as the target node from the traversal queue set and subsequent steps until the traversal queue set is empty.

[0218] In one embodiment, this application also provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the deep learning power flow calculation method as described in any of the above embodiments.

[0219] In one embodiment, this application also provides a computer device storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the deep learning power flow calculation method as described in any of the above embodiments.

[0220] Indicatively, such as Figure 8 As shown, Figure 8 This is a schematic diagram of the internal structure of a computer device 300 provided in an embodiment of this application. The computer device 300 can be provided as a server. (Refer to...) Figure 8 The computer device 300 includes a processing component 302, which further includes one or more processors, and memory resources represented by memory 301 for storing instructions, such as application programs, that can be executed by the processing component 302. The application programs stored in memory 301 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 302 is configured to execute instructions to perform the deep learning power flow calculation method of any of the above embodiments.

[0221] The computer device 300 may also include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate on an operating system stored in memory 301, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.

[0222] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0223] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0224] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.

[0225] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A deep learning power flow calculation method, characterized in that, The method includes: Acquire future power grid forecast data, power output plan arrangements, and power grid topology, and construct power flow input data based on the future power grid forecast data, the power output plan arrangements, and the power grid topology; A power flow calculation model is determined; the power flow calculation model is trained using a target loss function, which is a combination of a data-driven loss function and a physics-driven loss function. The power flow calculation model is used to predict the power flow input data to obtain the nodal power flow solution and branch power of the power grid, and the phase angle difference between the two ends of each branch in the power grid is determined based on the nodal power flow solution and the branch power. Based on the phase angle differences and phase angle reference frames, a depth-first search is performed on the power grid using a phase angle recovery method to recover the phase angles of each node based on the search results.

2. The deep learning power flow calculation method according to claim 1, characterized in that, The process of obtaining power flow input data based on the future forecast data, the power output plan, and the power grid topology includes: Based on the future forecast data and the power output plan, the injected active power, injected reactive power, voltage amplitude, generator reactive power upper and lower limits and parallel admittance of each node in the power grid are determined to form the initial power flow values; Generate a mask matrix corresponding to the initial power flow value based on the attribute of each parameter in the initial power flow value; The adjacency matrix of the power grid is generated based on the power grid topology, and power flow input data is formed according to the initial power flow value, the mask matrix, and the adjacency matrix.

3. The deep learning power flow calculation method according to claim 1, characterized in that, The determined power flow calculation model includes: Data augmentation is performed on the historical operation data of the power grid to form training sample data, and sample input data for the training sample data is constructed. The sample input data is input into a preset deep learning model so that the deep learning model performs forward computation based on the sample input data and outputs the node power flow solution and branch power. Based on the node power flow solution and the branch power, the target loss function is used to backpropagate in the deep learning model to update the parameters of the deep learning model. Return to the previous steps of inputting the sample input data into the preset deep learning model and subsequent steps until the deep learning model meets the convergence condition, thus obtaining the power flow calculation model.

4. The deep learning power flow calculation method according to any one of claims 1 or 3, characterized in that, The process of determining the target loss function includes: The first mean square loss of the node power flow results and the second mean square loss of the branch power are determined, and the first mean square loss and the second mean square loss are weighted and summed to obtain the data-driven loss function. Kirchhoff constraints are determined based on unbalanced active power and unbalanced reactive power, branch loss consistency constraints are determined based on branch active power loss and branch reactive power loss, and power flow constraints are determined based on node injected active power and node injected reactive power. The physical drive loss function is obtained by weighted summation of the Kirchhoff constraint, the branch loss consistency constraint, and the power flow constraint. The target loss function is obtained by weighted summation of the data-driven loss function and the physics-driven loss function.

5. The deep learning power flow calculation method according to claim 1, characterized in that, The power flow calculation model includes a feature dimensionality upscaling module, a feature aggregation module, and a feature dimensionality reduction module. The step of using the power flow calculation model to predict the power flow input data to obtain the nodal power flow solution and branch power of the power grid includes: The feature upscaling module is used to upscale the initial power flow value and the mask matrix in the power flow input data to obtain the node upscaling feature corresponding to the initial power flow value and the mask upscaling feature corresponding to the mask feature. The feature aggregation module extracts and aggregates features from the node up-dimensional features, the mask up-dimensional features, and the adjacency matrix in the power flow input data to obtain aggregated high-dimensional features. The aggregated high-dimensional features are input into the feature dimensionality reduction module for feature dimensionality reduction, and the node power flow solution output by the feature dimensionality reduction module is obtained.

6. The deep learning power flow calculation method according to claim 5, characterized in that, The power flow calculation module also includes a feature extraction module; The step of using the power flow calculation model to predict the power flow input data to obtain the nodal power flow solution and branch power of the power grid further includes: The adjacency matrix is ​​upgraded using the feature upscaling module to obtain branch upscaling features; The feature extraction module extracts features from the branch up-dimensional features and the aggregate high-dimensional features to obtain the branch feature matrix. The branch feature matrix is ​​input into the feature dimensionality reduction module for feature dimensionality reduction, and the branch power output by the feature dimensionality reduction module is obtained.

7. The deep learning power flow calculation method according to claim 1, characterized in that, The process involves performing a depth-first search of the power grid using a phase angle recovery method based on each phase angle difference and phase angle reference frame, to reconstruct the phase angle of each node based on the search results. This includes: Based on the power grid topology, an undirected graph of the nodes of the power grid is obtained, and a node is selected from the undirected graph as a balance node according to actual needs. The phase angle reference value of the balancing node is set according to the phase angle reference system, and the balancing node and the phase angle reference value are added to the phase angle dictionary in the form of key-value pairs, and the balancing node is added to the traversed node set and the traversal queue set. Select a node from the traversal queue set as the target node, and search for the neighbor nodes of the target node in the undirected graph of the nodes; If the neighbor node is not in the traversed node set, then determine the phase angle difference between the target node and the neighbor node to restore the phase angle of the neighbor node, and add the neighbor node and the phase angle to the phase angle dictionary; Remove the target node from the traversal queue set, and add the neighboring nodes to the traversed node set and the traversal queue set respectively; Return to the previous step of selecting a node as the target node from the traversal queue set and the subsequent steps, until the traversal queue set is empty.

8. A deep learning power flow computing device, characterized in that, include: The data construction module is used to acquire future power grid forecast data, power output plan arrangements, and power grid topology, and to construct power flow input data based on the future power grid forecast data, the power output plan arrangements, and the power grid topology. The model determination module is used to determine the power flow calculation model; the power flow calculation model is trained using a target loss function, which is a combination of a data-driven loss function and a physics-driven loss function. The model prediction module is used to predict the power flow input data using the power flow calculation model, obtain the nodal power flow solution and branch power of the power grid, and determine the phase angle difference between the two ends of each branch in the power grid based on the nodal power flow solution and the branch power. The phase angle restoration module is used to perform a depth-first search on the power grid based on each phase angle difference and phase angle reference system, using a phase angle restoration method, so as to restore the phase angle of each node according to the search results.

9. A storage medium, characterized in that: The storage medium stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the deep learning power flow calculation method as described in any one of claims 1 to 7.

10. A computer device, characterized in that, include: One or more processors, and memory; The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the deep learning power flow calculation method as described in any one of claims 1 to 7.