Power flow calculation method, system, device and medium based on graph calculation
By using a graph-based computing approach and leveraging the parallel computing capabilities of graph databases, the problem of low efficiency in power flow calculation in existing technologies is solved. This achieves a highly efficient matrix calculation process, improving the computational efficiency and cost-effectiveness of power systems.
Patent Information
- Application Number
- CN202310423537.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-19
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2043-04-19
AI Technical Summary
Existing graph computation methods are inefficient in solving power flow calculations, mainly due to the lack of native matrix computation support, which leads to frequent data import and export, affecting computational efficiency.
A graph-based computing approach is adopted. By constructing a topology graph of the power system, performing node layer division and matrix decomposition, and utilizing the distributed parallel computing capabilities of the graph database, the matrix calculation process is completed in the graph database, reducing data import and export operations and improving computing efficiency.
It improves the efficiency of power graph calculation, reduces redundant calculations, saves computing costs, makes full use of the parallel computing capabilities of graph databases, and avoids the impact of sparse matrices.
Smart Images

Figure CN116861031B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of power automation, and relates to a power flow calculation method, system, device and medium based on graph calculation. BACKGROUND
[0002] With the development of artificial intelligence and big data technology, data has become the main production factor in the current era, and the data sources and data types are also increasing. People are facing more and more complex analysis and calculation tasks, which makes the fusion of multi-source heterogeneous data a new trend. In the face of analysis and mining scenes based on large-scale multi-source heterogeneous data fusion, traditional relational data models are increasingly difficult to meet the needs of such complex tasks. As a new type of non-relational database, a graph database is very suitable for processing the association between entities, especially the data with a graph pattern in the real world. Existing graph pattern application scenarios, such as recommendation systems, road traffic and biomedicine, mainly use conventional graph computing algorithms, such as the shortest path algorithm and community detection algorithm, when using a graph database. However, many graph application scenarios involve a large amount of matrix computation in addition to these conventional graph computing algorithms.
[0003] Currently, there is little research on directly completing matrix computation on a graph or in a graph database. Graph data structure is essentially a form of matrix expression, and most mainstream graph database products currently focus on the storage and query analysis of graph data, lacking native support for matrix computation. For example, in the field of graph computing, Liu Kewen et al. proposed a full-node parallel iteration algorithm based on a whole synchronous parallel computing model to quickly solve the power flow calculation problem. On the basis of using the PageRank sorting to realize the parallel mechanism, the graph data model is used to realize the parallel power flow iteration calculation of the full node of the power network.
[0004] However, the main drawback of the existing graph computing method for solving the power flow calculation problem is the separation of storage and calculation. This method mainly uses graph computing operators in the graph computing engine for computation, and when encountering large sparse power graphs, since there are few native graph database interfaces or function functions supporting matrix operation, this method needs to frequently import data from the graph database into the graph computing engine, which directly leads to low efficiency of matrix operation and affects the efficiency of power flow calculation. SUMMARY
[0005] The purpose of the present application is to overcome the shortcomings of the prior art and provide a power flow calculation method, system, device and medium based on graph calculation.
[0006] To achieve the above purpose, the following technical solutions are adopted:
[0007] In a first aspect of the present application, a power flow calculation method based on graph calculation is provided, comprising:
[0008] S1: obtaining a node admittance matrix of the power system, and a left upper corner block matrix and a right lower corner block matrix of a Jacobian matrix according to a topological structure diagram of the power system;
[0009] S2: constructing a elimination tree of the left upper corner block matrix and the right lower corner block matrix of the Jacobian matrix, performing node layer division based on the elimination tree, and assigning a layer attribute to each node of the power system;
[0010] S3: traversing each node in order from 0 to a maximum layer number based on the layer attribute of each node, and performing matrix decomposition on the Jacobian matrix by a matrix decomposition method based on a graph structure to obtain an upper triangular matrix and a lower triangular matrix;
[0011] S4: obtaining a current iteration number, when the current iteration number is less than a preset maximum iteration number, performing S5-S7; otherwise, ending iteration;
[0012] S5: calculating power variation of each node by a power variation calculation method based on a graph structure according to the node admittance matrix;
[0013] S6: obtaining a maximum power variation in the power variation of each node, when the maximum power variation is greater than a preset convergence limit, ending iteration;
[0014] S7: traversing each node in order from 0 to the maximum layer number, obtaining a previous generation calculation vector by a previous generation calculation method based on a graph structure according to the lower triangular matrix, and updating a voltage amplitude and a voltage phase angle of each node by a back substitution calculation method based on a graph structure according to the power variation, the previous generation calculation vector and the upper triangular matrix.
[0015] Optionally, the matrix decomposition method based on a graph structure comprises:
[0016] Step 11: traversing in order from small to large in node number from a node set V of the topological structure diagram of the power system, selecting each time a node as a node p, and performing steps 12-19;
[0017] Step 12: selecting all nodes i from the node set V of the topological structure diagram of the power system; wherein the node i is pointed to by the node p and the node number of the node i is greater than the node number of the node p;
[0018] Step 13: dividing an edge weight of an edge p→i by a self-edge edge weight of the node p;
[0019] Step 14: subtracting a product of the edge weight of the edge p→i and an edge weight of an edge i→p from the self-edge edge weight of the node i;
[0020] Step 15: selecting all node pairs t, j from an edge set W of the topological structure diagram of the power system; wherein the node t points to the node j through the node p;
[0021] Step 16: subtract the product of the edge weight of edge t→p and the edge weight of edge p→j from the edge weight of edge t→j;
[0022] Step 17: select all node pairs (r, y) from the edge set W of the topological structure diagram of the power system; wherein, node p points to both node r and node y;
[0023] Step 18: subtract the product of the edge weight of edge r→p and the edge weight of edge p→y from the edge weight of edge r→y;
[0024] Step 19: subtract the product of the edge weight of edge y→p and the edge weight of edge p→r from the edge weight of edge y→r.
[0025] Optionally, the method for calculating the power variation of each node based on the graph structure comprises:
[0026] finding all s-(e)-t paths in the topological structure diagram of the power system, wherein, s and t represent node types, and (e) represents an edge type; and taking s as i and t as j, the power variation of each node is calculated by the following formula, the power variation comprising an active power imbalance and a reactive power imbalance:
[0027]
[0028] wherein, ΔP i is the active power imbalance of node i, ΔQ i is the reactive power imbalance of node i, P i is the injected active power of node i, Q i is the injected reactive power of node i, V i is the voltage phase angle of node i, G ij is the real part of the admittance of node i and node j in the node admittance matrix, B ij is the imaginary part of the admittance of node i and node j in the node admittance matrix, and δ ij is the phase angle difference between node i and node j.
[0029] Optionally, the method for obtaining the predecessor vector by the predecessor calculation method based on the graph structure comprises:
[0030] Step 21: assigning the power variation of each node to the self-edge of each node in the topological structure diagram of the power system as the z value of the self-edge of each node;
[0031] Step 22: traversing in ascending order of node number from the node set V of the topological structure diagram of the power system, and selecting one node p each time, and executing steps 23 to 25;
[0032] Step 23: selecting all nodes i from the node set V of the topology graph of the power system; wherein the node i is pointed to by the node p and the node number of the node i is smaller than the node number of the node p;
[0033] Step 24: subtracting the product of the edge weight of the edge p→i and the z value of the self-edge of the node i from the z value of the self-edge of the node p;
[0034] Step 25: dividing the z value of the self-edge of the node p by the edge weight of the self-edge of the node p;
[0035] Step 26: arranging the z values of the self-edges of all nodes in rows to obtain a previous generation calculation vector.
[0036] Optionally, the back substitution calculation method based on the graph structure, the updating of the voltage amplitude and the voltage phase angle of each node comprises:
[0037] Step 31: taking each element value in the previous generation calculation vector as the x attribute value of the self-edge of each node respectively;
[0038] Step 32: traversing the node set V of the topology graph of the power system in ascending order of the node number, selecting one node p each time, and executing the following steps 33 and 34;
[0039] Step 33: selecting all nodes i from the node set V of the topology graph of the power system; wherein the node i is pointed to by the node p and the node number of the node i is greater than the node number of the node p;
[0040] Step 34: subtracting the product of the edge weight of the edge p→i and the x attribute value of the self-edge of the node i from the x attribute value of the self-edge of the node p;
[0041] Step 35: obtaining the voltage amplitude variation and the voltage phase angle variation of each node according to the x attribute values of the self-edges of all nodes; and updating the voltage amplitude and the voltage phase angle of each node according to the voltage amplitude variation and the voltage phase angle variation of each node.
[0042] Optionally, the method further comprises:
[0043] S9: based on the power flow calculation result, dividing the buses supplied by the same generator into one area, and merging the power transmission circuits with consistent power directions between different areas into a chain to obtain a power system state graph;
[0044] S10: calculating an adjacency matrix of the power system state graph, and obtaining a path matrix according to the adjacency matrix;
[0045] S11: taking the chain where the overload branch is located as a target chain, calculating a starting adjoint matrix and a terminal adjoint matrix of the target chain according to a path matrix, and obtaining parallel power transmission sections and parallel power receiving sections of the target chain according to the starting adjoint matrix and the terminal adjoint matrix of the target chain; and taking a union of the parallel power transmission sections and the parallel power receiving sections of the target chain to obtain a parallel section of the overload branch.
[0046] Optionally, the calculating the starting adjoint matrix and the terminal adjoint matrix of the target chain according to the path matrix, and obtaining the parallel power transmission sections and the parallel power receiving sections of the target chain according to the starting adjoint matrix and the terminal adjoint matrix of the target chain comprises:
[0047] The starting adjoint matrix T and the terminal adjoint matrix R of the target chain are calculated by the following formula:
[0048]
[0049]
[0050] wherein k is a starting area serial number of the target chain, Q k = QM k Q is an intermediate matrix, which is obtained by adding a unit matrix to the path matrix, M k is a kth column vector of the unit matrix, represents that all elements in Q k are first negated and then transposed, represents that corresponding elements of two matrices are subjected to logical and operation, and A is an adjacency matrix of a state diagram of the power system; g is a terminal area serial number of the target chain, Q g = QM g M g is a gth column vector of the unit matrix, represents that all elements in Q g are first negated and then transposed;
[0051] combining chain combinations corresponding to non-zero elements in the starting adjoint matrix T as the parallel power transmission sections of the target chain;
[0052] combining chain combinations corresponding to non-zero elements in the terminal adjoint matrix R as the parallel power receiving sections of the target chain.
[0053] In the second aspect, the application provides a power flow calculation system based on graph calculation, comprising:
[0054] a data query module, configured to obtain a node admittance matrix of the power system, and upper left corner block matrices and lower right corner block matrices of a Jacobian matrix according to a topological structure diagram of the power system;
[0055] A constructing module is configured to construct a left-up corner block matrix and a right-down corner block matrix of a Jacobian matrix, perform node level number division based on an elimination tree of the left-up corner block matrix and the right-down corner block matrix, and assign a level number attribute to each node of the power system;
[0056] A matrix decomposition module is configured to traverse each node in an order from 0 to a maximum level number based on the level number attribute of each node, and perform matrix decomposition on the Jacobian matrix by using a graph structure based matrix decomposition method to obtain an upper triangular matrix and a lower triangular matrix.
[0057] An iteration module is configured to obtain a current iteration number, trigger a power calculation module, a discrimination module and a power flow calculation module when the current iteration number is less than a preset maximum iteration number, and end the iteration otherwise.
[0058] The power calculation module is configured to calculate a power variation of each node by using a graph structure based power variation calculation method according to a node admittance matrix.
[0059] The discrimination module is configured to obtain a maximum power variation in the power variations of each node, and end the iteration when the maximum power variation is greater than a preset convergence limit.
[0060] The voltage calculation module is configured to traverse each node in an order from 0 to the maximum level number, obtain a previous generation calculation vector by using a graph structure based previous generation calculation method according to the lower triangular matrix, and update a voltage amplitude and a voltage phase angle of each node by using a graph structure based back substitution calculation method according to the power variation, the previous generation calculation vector and the upper triangular matrix.
[0061] In a third aspect, the present application provides a computer device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the power flow calculation method based on graph calculation when executing the computer program.
[0062] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the power flow calculation method based on graph calculation when executed by a processor.
[0063] Compared with the prior art, the present application has the following beneficial effects:
[0064] The application is based on a power flow calculation method of graph calculation, through a matrix decomposition method based on a graph structure, a power change calculation method based on a graph structure, a previous generation calculation method based on a graph structure and a back substitution calculation method based on a graph structure, a matrix calculation process is expressed in a graph description manner, more power calculation tasks can be completed in a graph database, thus reducing repeated data import and export operations, and the distributed parallel computing capacity of the graph database can be fully utilized to improve the efficiency of power multi-source heterogeneous data calculation, through transforming the matrix calculation into an operation in the graph database, a software layer integrated power graph calculation method is realized, when a large sparse power graph is encountered, data does not need to be frequently imported from the graph database into the graph calculation engine, the matrix operation efficiency is improved, and the power graph calculation efficiency is improved. Moreover, only the nodes and neighbor nodes related to calculation need to be concerned in each calculation process, compared with the conventional matrix calculation method, the influence of zero elements in the matrix is removed, useless loop traversal is avoided, the synchronous parallel of all nodes can be realized, the calculation and analysis in the power system often need to perform many matrix operations, the inherent node parallel computing capacity of the graph calculation can avoid the redundant calculation caused by the sparse matrix, save the calculation cost and improve the calculation efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0065] Figure 1 The figure is a flow chart of the power flow calculation method based on graph calculation of the embodiment of the application.
[0066] Figure 2 The figure is a graph representation method of the matrix of the embodiment of the application.
[0067] Figure 3 The figure is an out-edge diagram of node p in G(A) of the embodiment of the application.
[0068] Figure 4 The figure is an in-edge diagram of node q in G(B) of the embodiment of the application.
[0069] Figure 5 The figure is a correction principle diagram of the p node of the embodiment of the application.
[0070] Figure 6 The figure is a principle diagram of eliminating the node with zero injection power of the embodiment of the application.
[0071] Figure 7 The figure is a principle diagram of merging the hanging node of the embodiment of the application.
[0072] Figure 8 The figure is a 6-bus system structure diagram of the embodiment of the application.
[0073] Figure 9 The figure is a 6-bus system state diagram of the embodiment of the application.
[0074] Figure 10 Structure block diagram of power flow calculation system based on graph calculation of embodiments of the present application. DETAILED DESCRIPTION
[0075] In order for those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work should fall within the scope of protection of the present application.
[0076] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0077] First, the related terms involved in the embodiments of the present application are introduced:
[0078] Graph database: a graph database is a data management system that stores units based on points and edges, and is designed to efficiently store and query graph data.
[0079] Matrix: a collection of complex or real numbers arranged in a rectangular array, originally from the coefficient and constant matrix formed by the coefficient and constant of the equation.
[0080] Graph description: a description of a graphical entity through geometric information, topological information and other auxiliary information of the graph.
[0081] Parallel computing: a process of using multiple computing resources simultaneously to solve computing problems, which is an effective means to improve the computing speed and processing capacity of a computer system.
[0082] Power flow calculation refers to calculation of distribution of active power, reactive power and voltage in a power network under conditions of given network topology, element parameters and power generation and load parameters.
[0083] The application will be described in further detail below with reference to the drawings:
[0084] Referring to Figure 1 In an embodiment of the application, a power flow calculation method based on graph calculation is provided, comprising the following steps:
[0085] S1: obtaining a node admittance matrix of a power system, and a left upper corner block matrix and a right lower corner block matrix of a Jacobian matrix according to a topological structure diagram of the power system.
[0086] S2: constructing a elimination tree of the left upper corner block matrix and the right lower corner block matrix of the Jacobian matrix, performing node layer division based on the elimination tree, and assigning a layer attribute to each node of the power system.
[0087] S3: traversing each node in order from 0 to the maximum layer number based on the layer attribute of each node, and performing matrix decomposition of the Jacobian matrix by a matrix decomposition method based on a graph structure to obtain an upper triangular matrix and a lower triangular matrix.
[0088] S4: obtaining a current iteration number, and when the current iteration number is less than a preset maximum iteration number, performing S5-S7; otherwise, ending iteration.
[0089] S5: calculating power variation of each node by a power variation calculation method based on a graph structure according to the node admittance matrix.
[0090] S6: obtaining a maximum power variation in the power variation of each node, and when the maximum power variation is greater than a preset convergence limit, ending iteration.
[0091] S7: traversing each node in order from 0 to the maximum layer number, obtaining a previous generation calculation vector by a previous generation calculation method based on a graph structure according to the lower triangular matrix, and updating a voltage amplitude and a voltage phase angle of each node by a back substitution calculation method based on a graph structure according to the power variation, the previous generation calculation vector and the upper triangular matrix.
[0092] The power flow calculation method based on graph calculation of the application expresses the matrix calculation process in a graph description manner, can complete more power calculation tasks in the graph database, thereby reducing repeated data import and export operations, and can fully utilize the distributed parallel computing capability of the graph database to improve the efficiency of power multi-source heterogeneous data calculation, realizes the power graph calculation method of software storage and calculation integration, and improves the matrix operation efficiency and the power graph calculation efficiency when a large sparse power graph is encountered. Moreover, only the nodes and neighbor nodes related to calculation need to be concerned in each calculation process, compared with the conventional matrix calculation method, the influence of zero elements in the matrix is removed, useless loop traversal is avoided, synchronous parallel of all nodes can be realized, calculation and analysis in the power system often perform a lot of matrix operations, the inherent node parallel computing capability of the graph calculation can avoid redundant calculation caused by the sparse matrix, save the calculation cost, and improve the calculation efficiency.
[0093] In a possible implementation, the matrix decomposition method based on the graph structure comprises the following steps:
[0094] Step 11: From the node set V of the topological structure graph of the power system, nodes are sequentially traversed from small to large according to node numbers, each selected node is taken as node p, and steps 12 to 19 are performed.
[0095] Step 12: All nodes i are selected from the node set V of the topological structure graph of the power system; wherein node i is pointed to by node p and the node number of node i is greater than that of node p.
[0096] Step 13: The edge weight of edge p→i is divided by the self-edge edge weight of node p.
[0097] Step 14: The self-edge edge weight of node i is subtracted by the product of the edge weights of edges p→i and i→p.
[0098] Step 15: All node pairs t, j are selected from the edge set W of the topological structure graph of the power system; wherein node t points to node j through node p.
[0099] Step 16: The edge weight of edge t→j is subtracted by the product of the edge weights of edges t→p and p→j.
[0100] Step 17: All node pairs (r, y) are selected from the edge set W of the topological structure graph of the power system; wherein node p points to both r and y.
[0101] Step 18: subtract the product of the edge weight of edge r→p and edge p→y from the edge weight of edge r→y.
[0102] Step 19: subtract the product of the edge weight of edge y→p and edge p→r from the edge weight of edge y→r.
[0103] Specifically, in the process of Jacobian matrix decomposition, the Jacobian matrix is converted into a graph structure by graph description, in which the diagonal elements are represented as the self-edge edge weight of the node in the graph, and the non-diagonal elements are represented as the adjacent edge edge weight in the graph. Specifically, since the PQ decomposition method is only used to solve the Jacobian matrix once in the power flow calculation, and the Jacobian matrix remains unchanged during the solving process, therefore, in order to reduce the number of matrix decompositions and speed up the calculation, it is more recommended to use the PQ decomposition method to realize the power flow calculation in the graph calculation scenario.
[0104] Taking the PQ decomposition method as an example, for the upper left block matrix H and the lower right block matrix L (the lower left and upper right block matrices are zero elements and do not participate in the calculation) of the Jacobian matrix, two temporary calculation graphs G(H) and G(L) are established respectively, wherein the diagonal elements of the H matrix are the self-edge edge weight of the node in G(H), the node number is consistent with the order of the matrix diagonal elements, and the non-diagonal elements are the adjacent edge edge weight. The same applies to the graph G(L). Then the graphs generated by the two matrices are decomposed respectively, and are involved in the subsequent calculation respectively.
[0105] In one possible implementation, the method for calculating the power change of each node based on the graph structure comprises the following steps:
[0106] In the topological structure graph of the power system, all s-(e)-t paths are searched, wherein s and t represent node types, and (e) represents an edge type; and the power change of each node is calculated by taking s as i and t as j through the following formula, and the power change includes active power imbalance and reactive power imbalance:
[0107]
[0108] ΔP i is the active power imbalance of node i, ΔQ i is the reactive power imbalance of node i, P i is the injected active power of node i, Q i is the injected reactive power of node i, V i is the phase angle of node i, G ij is the real part of the admittance of node i and node j in the node admittance matrix, B ij is the imaginary part of the admittance of node i and node j in the node admittance matrix, and δ ij is the phase angle difference between node i and node j.
[0109] In a possible implementation, the obtaining of the pre-ancestors calculation vector by the pre-ancestors calculation method based on the graph structure comprises the following steps.
[0110] Step 21: assigning the power variation of each node to the self-edge of each node in the topological structure graph of the power system as the z value of the self-edge of each node.
[0111] Step 22: sequentially traversing from small to large according to the node number from the node set V of the topological structure graph of the power system, and selecting one node p each time to execute steps 23 to 25.
[0112] Step 23: selecting all nodes i from the node set V of the topological structure graph of the power system; wherein the node i is pointed to by the node p and the node number of the node i is smaller than that of the node p.
[0113] Step 24: subtracting the product of the edge weight of the edge p→i and the z value of the self-edge of the node i from the z value of the self-edge of the node p.
[0114] Step 25: dividing the z value of the self-edge of the node p by the edge weight of the self-edge of the node p.
[0115] Step 26: arranging the z values of the self-edges of all nodes row by row to obtain the pre-ancestors calculation vector.
[0116] In a possible implementation, the back-ancestors calculation method based on the graph structure, the updating of the voltage amplitude and the voltage phase angle of each node comprises the following steps.
[0117] Step 31: taking each element value in the pre-ancestors calculation vector as the x attribute value of the self-edge of each node.
[0118] Step 32: sequentially traversing from small to large according to the node number from the node set V of the topological structure graph of the power system, and selecting one node p each time to execute steps 33 to 34.
[0119] Step 33: selecting all nodes i from the node set V of the topological structure graph of the power system; wherein the node i is pointed to by the node p and the node number of the node i is greater than that of the node p.
[0120] Step 34: subtracting the product of the edge weight of the edge p→i and the x attribute value of the self-edge of the node i from the x attribute value of the self-edge of the node p.
[0121] Step 35: obtaining the voltage amplitude variation and the voltage phase angle variation of each node according to the x attribute value of the self-edge of each node; and updating the voltage amplitude and the voltage phase angle of each node according to the voltage amplitude variation and the voltage phase angle variation of each node.
[0122] The power flow calculation method based on the graph calculation of the application is described in detail from the principle aspect as follows.
[0123] In the development of power system, in order to quickly calculate the branch flow, a large number of flow calculation methods are derived, from Gauss-Seidel iteration to Newton-Raphson method to P-Q decomposition method, these evolutions make the calculation amount and data storage amount greatly reduced, the general steps of the calculation can be summarized as follows:
[0124] 1) Determine the node admittance matrix according to the circuit structure.
[0125] 2) Design the initial value of the variable to be solved.
[0126] 3) Calculate the correction equation.
[0127] 4) Form the Jacobian matrix.
[0128] 5) Solve the correction equation.
[0129] 6) Make correction and iteration.
[0130] Among them, the formula of the iteration process is shown as 1 to 8:
[0131]
[0132] Among them, ΔP i , ΔQ i respectively show the imbalance of active power and the imbalance of reactive power at node i, P i is the active power injected at node i, Q i is the reactive power injected at node i, V i is the voltage amplitude at node i, G ij , B ij are the real part and imaginary part of the admittance of node i and node j in the node admittance matrix, and δ ij is the phase angle difference between node i and node j.
[0133]
[0134] Among them, ΔV and Δδ respectively represent the deviation of voltage amplitude and phase angle, and J represents the Jacobian matrix.
[0135]
[0136]
[0137]
[0138]
[0139]
[0140]
[0141] wherein, respectively represent the voltage amplitude and phase angle after the kth iteration.
[0142] After obtaining the node admittance matrix, in the kth iteration, and are taken as the new V i and δ i are substituted into formula (1) to obtain the imbalance of active power and reactive power, which is substituted into formula (2) to obtain ΔV k and Δδ k of the kth iteration, and then substituted into formula (8) to obtain V k+1 and δ k+1 of the k+1th iteration.
[0143] Wherein the generation of the matrix, the calculation of the imbalance of formula 1 and formula 6 iteration, the convergence judgment, the out-of-bound detection of voltage and power, etc. are only related to the values of the node or the nodes connected to it, and are irrelevant to other nodes, so node parallel can be used to realize it. Formula 2 is the most important step in the whole calculation, which can be generally expressed in the form of formula 9, wherein A represents the Jacobian matrix, and b is the power imbalance. For this operation, if the matrix inversion method is used to solve, the operation cost is very large, so LU decomposition is usually used to solve, which can be realized by hierarchical parallel of nodes.
[0144] Ax=b (9)
[0145] It can be seen that matrix operation occupies an important position in various fields such as power calculation. In the power system, as a core calculation task, the power flow calculation plays an important role in various stages such as power grid planning, power grid operation and fault detection. The existing main methods for solving power flow, such as Gauss-Seidel iteration, Newton method, PQ decomposition method, etc. often need to construct node admittance matrix and Jacobian matrix. Especially with the vigorous development of machine learning technology, various optimization solving problems gradually evolve into matrix operation problems, and the core step of solving is usually to solve the non-homogeneous linear equation group by using matrix operation. For large-scale calculation tasks, in order to speed up the solving speed, matrix decomposition method is usually used to reduce the solving cost.
[0146] The power flow calculation method based on graph calculation of the application enables the graph database to have the ability of matrix calculation, increases the application range of the graph database, places the related matrix calculation tasks in the database, thereby reducing the data transmission overhead, and thus can improve the speed of the graph-based power flow calculation.
[0147] Firstly, the matrix calculation method based on graph structure is introduced.
[0148] For matrix and have Common adjacency matrices are usually square matrices. Therefore, when transforming a matrix into a graph, the number of nodes in the graph should equal the larger dimension of the matrix. For example, for matrix A, if n ≥ m, the number of nodes in the transformed graph should equal n, while the number of edges is the same as the number of non-zero elements in the off-diagonal elements of the matrix. Nodes with indices greater than m will not have edges pointing to them; their in-degree is 0. As shown in Figure 2, the matrix has a dimension of 5 × 3, corresponding to... Figure 2 The graph contains 5 nodes, with nodes 4 and 5 having an in-degree of 0. If n ≤ m, then the number of nodes in the transformed graph should be equal to m, and the out-degree of nodes with numbers greater than n in the graph should be 0.
[0149] As known from matrix multiplication, the value of each element in matrix C can be derived from the following formula:
[0150]
[0151]
[0152] Therefore, for each edge c in the new graph G(C) corresponding to C... pq All are formed by the outgoing edges a of each node p in G(A). ip The incoming edge a to node q in G(B) iq Together, we determine the node number in the graph, where i∈{1,2,...,n} represents the node number. If there is no edge from node p to node i in G(A), i.e., a ip =0, then whether there is an edge from node i to node q in G(B) will not affect c in graph G(C). pq It has an impact. For example... Figure 3 In the example shown, c pq This can be derived from equation (11), where only the edges from node p to node i and from node i to node q in both graphs need to be calculated. When i = v, because edge b in G(B) vq Since it does not exist, we do not need to consider edge a in G(A). pv If c pq If ≠ 0, then insert a new edge c in graph G(C). pq Otherwise, no new edges will be generated.
[0153] Therefore, in order to quickly query the element in C corresponding to the node in the graph G(A) and G(B), mxl edges can be added to the graph, which are connected to each node in G(A) with non-zero out-degree and each node in G(B) with non-zero in-degree. The present application defines this type of edge as eLink. Specifically, eLink can not have any attributes and is only used to represent a corresponding relationship between the edge in G(C) and the nodes in G(A) and G(B). Alternatively, eLink can be used as the edge of G(C). The graph description method of the present application adopts the former mode when calculating matrix multiplication, and only regards eLink as a connection relationship without storing new values. eLink needs to be established before matrix multiplication is performed, and it can be imported into the database together with G(A) and G(B), or it can be established by inserting new edges when querying G(A) and G(B).
[0154] The edge insertion process of eLink generated by G(A) and G(B) is shown in the following algorithm 1:
[0155] Step 1: Assuming that the matrix dimension corresponding to G(A) is m*n, and the matrix dimension corresponding to G(B) is n*l, then the matrix C corresponding to the generated new graph G(C) has a dimension of m*l, and m and l are initialized to 0.
[0156] Step 2: Traverse each edge in the graph. If the current edge belongs to G(A), judge the source node number of the edge and the size of m, and take the maximum value as the new m. If the current edge belongs to G(B), judge the target node number of the edge and the size of l, and take the maximum value as the new l. After traversing all edges, the updated m and l are obtained.
[0157] Step 3: Initialize the counter i to 0.
[0158] Step 4: When i is less than m, execute the following steps.
[0159] Step 5: Initialize the counter j to 0.
[0160] Step 6: When j is less than l, execute the following steps.
[0161] Step 7: Insert an eLink edge, whose source node is the node numbered i in G(A), and whose target node is the node numbered j in G(B).
[0162] Step 8: Increase the value of j by 1 and continue to execute step 6.
[0163] Step 9: End the inner loop, increase the value of i by 1, and continue to execute step 4.
[0164] Step 10: When the value of i is greater than or equal to m, the entire loop ends.
[0165] s.idx and t.idx in the 3rd and 4th lines of Algorithm 1 represent the order number of the node in the matrix, and the 9th line represents inserting an edge eLink edge into the database, whose source node is the ith node in the VA node set and whose target node is the jth node in the VB node set.
[0166] After inserting the eLink edge by Algorithm 1, the matrix calculation process based on the graph description is shown in Algorithm 2.
[0167] In Algorithm 2, for the 1st line, if each matched edge e belongs to G(A) or G(B), then the nodes s and t of the edge must also belong to G(A) or G(B), and for the 5th line, if each matched edge belongs to the eLink edge set, then the nodes s and t must belong to G(A) and G(B) respectively, because all eLink edges point from a node in G(A) to a node in G(B). The 1st to 4th lines are used to find the out-degree neighbors of each node in G(A) (i.e. the nodes pointed by the node) and the in-degree neighbors of each node in G(B) (i.e. the nodes pointing to the node), and a local accumulator variable with a @ symbol at the beginning is used to store the matched neighbor number and the edge weight.
[0168] The 5th to 16th lines of Algorithm 2 show the specific process of matrix multiplication. Each time, the mode from s to t through eLink represents an edge from s.idx to t.idx in the graph G(C). Only the out-degree of s is traversed, and the product of the same number of in-degree of t and the weight of the edge is obtained, and the sum is accumulated, to obtain the weight of the new edge. If s.idx and t.idx are equal, it means that the new edge is a self-edge. Through Algorithm 2, the weights of all edges (including self-edges) in G(C) can be obtained, i.e. the matrix C is obtained. If the new graph G(C) needs to be inserted into the database, the new edges EC and the new nodes VC obtained by traversing can be used to execute the insertion command.
[0169] The specific steps of Algorithm 2 are as follows:
[0170] Step 1: Traverse each edge in G(A) and G(B). If the edge belongs to G(A), store the target node number of the edge and the edge weight as a key-value pair in the @Out accumulator of the source node of the edge. If the edge belongs to G(B), store the source node number of the edge and the edge weight as a key-value pair in the @In accumulator of the target node of the edge.
[0171] Step 2: Traverse each edge e in eLink, whose source node is s and whose target node is t, and perform the following steps.
[0172] Step 3: If the source node number s.idx of edge e is not equal to the target node number t.idx, then execute steps 4 to 7.
[0173] Step 4: Traverse the @Out accumulator of the source node s, take out the key-value pair <Idx, val> therein, and execute step 5.
[0174] Step 5: Take s.idx and t.idx as the source node number and the target node number of a new edge in G(C), and denote the new edge as EC(s.idx, t.idx), and add the edge weight of the new edge by val multiplied by the value corresponding to the key Idx in the @In accumulator of t.
[0175] Step 6: The loop corresponding to steps 4 and 5 ends.
[0176] Step 7: Add the edge weight of edge EC(s.idx, t.idx) by the self-edge edge weight of s multiplied by the value corresponding to the key s.idx in the @In accumulator of t, and by the self-edge edge weight of t multiplied by the value corresponding to the key t.idx in the @Out accumulator of s.
[0177] Step 8: If the source node number s.idx of edge e is equal to the target node number t.idx, then execute steps 9 to 12.
[0178] Step 9: Traverse the @Out accumulator of the source node s, take out the key-value pair <Idx, val> therein, and execute step 10.
[0179] Step 10: Update the self-edge edge weight of the node numbered Idx in G(C) by adding the product of val and the value corresponding to the key Idx in the @In accumulator of the target node t.
[0180] Step 11: The loop corresponding to steps 9 and 10 ends.
[0181] Step 12: Update the self-edge edge weight of the node numbered Idx in G(C) by adding the product of the self-edge edge weights of the source node s and the target node t.
[0182] Step 13: The loop corresponding to step 2 ends.
[0183] As can be seen from the above description, for the calculation of each edge in G(C), only some edges of graph G(A) and some edges of graph G(B) are involved, while most of the edges are not involved. During the calculation process, the topological structure and edge weights of G(A) and G(B) do not change, and the new edges generated are not dependent on each other, so parallel calculation can be realized in the matrix multiplication stage.
[0184] Secondly, the matrix decomposition method based on graph structure is introduced.
[0185] When solving systems of equations of the form Ax = b, matrix decomposition is often used to speed up the solution due to the high time complexity of matrix inversion. Common matrix decomposition methods include LU decomposition, Cholesky decomposition, and QR decomposition, which typically decompose matrix A into the product of two matrices. These decomposition methods operate on individual matrices, so the decomposition process can be represented by a graph G(A).
[0186] LU decomposition decomposes a square matrix A into the product of a lower triangular matrix L and an upper triangular matrix U, i.e., A = LU. Since the diagonal elements of matrix U are all 1s, the two triangular matrices resulting from the decomposition can be stored simultaneously using a single matrix. The entire decomposition process is performed within a graph, and the decomposed values are stored in the original graph. The decomposition process mainly involves correcting each node, with the correction order proceeding in ascending order of node number. The correction of each node consists of the following three steps:
[0187] (1) Adjacent edge correction.
[0188] For each node p in the graph, the adjacent edges emanating from p need to be corrected first, such as... Figure 5 a in pj a pk and a pl The corrected formula is shown in Equation 12, which is the weight of each neighboring edge emanating from node p divided by the weight of the self-edge of node p.
[0189] a pi =a pi / a pp i(=u,v,w)>p (12)
[0190] (2) Self-edge correction.
[0191] Correct the self-edges of each neighbor pointed to by node p, such as... Figure 5 a in jj a kk a ll The corrected formula is shown in Equation 13.
[0192] a ii =a ii -a ip ×a pi i(=u,v,w)>p (13)
[0193] (3) Mutual correction.
[0194] The mutual edges of node p are corrected, such as... Figure 5 The correction method for all edges between nodes u, v, and w is shown in Equation 14.
[0195]
[0196] It is important to note here that for edges that do not exist in the original graph (such as...) Figure 5 (The virtual edges shown by the dashed lines) If the edge weight after mutual edge correction is not equal to 0, then these mutual edges need to be added to the graph. Corresponding to those off-diagonal elements in the matrix that were originally 0 but became non-zero due to matrix decomposition, these elements are called injection elements in this paper, and the edges in the graph corresponding to these injection elements are called injection edges.
[0197] Algorithm 3: The specific process of the directed graph edge injection algorithm is as follows:
[0198] Step 1: Traverse each node v in graph G and perform the following steps.
[0199] Step 2: Find all node pairs (i, j) in graph G that meet the requirements, where node i points to node j through node v, and the numbers of both node i and node j are greater than those of node v.
[0200] Step 3: If the edge e (i→j) pointing from i to j does not exist in the edge set E of graph G, then insert the edge i→j into the edge set of graph G.
[0201] Step 4: Find the node pair (i, j) that meets the requirements in graph G. The node v points to node i and points to j at the same time, and the node numbers of i and j are both greater than v.
[0202] Step 5: For all node pairs (i, j) found in Step 4, if the edge e(i→j) pointing from i to j does not exist in the edge set E of graph G, then insert the edges e(i→j) and e(j→i) into the edge set of graph G.
[0203] Step 6: The loop traversal corresponding to Step 1 ends.
[0204] The number and position of injected elements (edges) can generally be determined before matrix decomposition. Therefore, before decomposing the graph, an operation to insert injected edges is usually required. The process of inserting injected edges is shown in Algorithm 3.
[0205] After the edge injection process is completed, the number of nodes and the weights of each edge in the original graph remain unchanged, but the number of edges increases. After the operation is completed, G(V,E,A) evolves into G(V,E′,A).
[0206] Algorithm 4: The matrix decomposition method includes the following specific steps:
[0207] Step 1: From the node set V of graph G, traverse the nodes in ascending order of their numbers, selecting a node p each time, and then perform the following steps.
[0208] Step 2: Select all nodes i from the node set V that satisfy the requirement that node p points to node i and the node number of i is greater than p, and then perform steps 3 and 4.
[0209] Step 3: Update the edge weight of edge (p→i): divide the edge weight of edge (p→i) by the self-edge weight of node p.
[0210] Step 4: Update the self-edge weight of node i: subtract the product of the edge weights of edges (p→i) and (i→p) from the self-edge weight of node i.
[0211] Step 5: Select all node pairs (i, j) from the edge set V that satisfy the requirement that node i points to node j through node p, and then perform step 6.
[0212] Step 6: Update the edge weight of edge (i→j): subtract the product of the edge weights of edges (i→p) and (p→j) from the edge weight of edge (i→j).
[0213] Step 7: Select all node pairs (i, j) from the edge set V that satisfy the requirement that node p points to both node i and node j, and then perform steps 8 and 9.
[0214] Step 8: Update the edge weight of edge (i→j): subtract the product of the edge weights of edges (i→p) and (p→j) from the edge weight of edge (i→j).
[0215] Step 9: Update the edge weight of edge (j→i): subtract the product of the edge weights of edges (j→p) and (p→i) from the edge weight of edge (j→i).
[0216] Step 10: The loop corresponding to step 1 ends.
[0217] Here, only LU decomposition is taken as an example. For Cholesky decomposition, the matrix is also decomposed into the product of an upper triangular matrix and a lower triangular matrix. The calculation logic is still applicable except for some slight differences in calculation steps. Based on this, matrix multiplication and matrix decomposition operations can be completed on the graph model after modeling data as a graph model using a graph database, so that some regular matrix calculation contents can be performed in the database.
[0218] Secondly, the linear equation solving method based on graph structure is introduced.
[0219] Linear equations are generally represented in the form of Ax = b. In order to reduce the number of solutions, a matrix decomposition method as shown in equation (15) is often used, and then the classical forward-back substitution operation is performed. Taking LU decomposition as an example, the graph description process of linear equation solving is described. After the matrix A is decomposed into a lower triangular matrix L and an upper triangular matrix U, the forward-back substitution processes are shown in equations (16) and (17), respectively.
[0220] Ax = Lux = LL T x = LDL T x=b (15)
[0221] Lz=b (16)
[0222] Ux=z (17)
[0223] (1) Previous generation calculation.
[0224] In the previous process, it is necessary to obtain the vector z, and the matrix L is a lower triangular matrix, which can be obtained from equation (16):
[0225]
[0226] Right now:
[0227]
[0228]
[0229] As can be seen from equation (18), each term z in vector z i All are related to the preceding z0 to z i-1 Furthermore, equation (19) can be derived. Therefore, it is necessary to calculate from the index in ascending order, which corresponds to calculating from the node number in ascending order in the graph. For ease of calculation, in the previous generation process, the value of each element in vector b is assigned to the self-edge of each node in the graph as the second edge weight other than the adjacency matrix A, and then this attribute is named z. The calculation process of the previous generation operation based on the graph description is shown in Algorithm 5.
[0230] The specific process of Algorithm 5 is as follows:
[0231] Step 1: From the node set V of graph G, traverse the nodes in ascending order of their numbers, selecting a node p each time, and then perform the following steps.
[0232] Step 2: Select all nodes i that meet the requirements from the node set V, where node p points to node i and the node number of i is less than p. Then execute step 3.
[0233] Step 3: Update the z value of the edge from node p: Subtract the product of the edge weight of edge (p→i) and the z attribute of node i from the z value of the edge from node p.
[0234] Step 4: After steps 2 and 3 are completed, divide the z value of the self-edge of node p by the weight of the self-edge of node p.
[0235] Step 5: The loop traversal corresponding to Step 1 ends.
[0236] (2) Back substitution calculation.
[0237] The back substitution process needs to obtain the final solution vector x according to the vector z calculated in the previous generation and the upper triangular matrix U, and the calculation process is shown in formula (20). It can be seen that each item x i in the vector x i+1 is related to each subsequent item x n , and formula (21) can be further obtained.
[0238] Therefore, in the back substitution process, it is necessary to start calculating from the subscript in descending order, and the corresponding graph node number should also start from the largest. Similar to the previous generation process, the initial value of x is the result of the previous generation calculation, that is, the vector x is initialized with the vector z. The calculation process based on the graph description is shown in Algorithm 6, in which the previous attribute z is called the attribute x, and the second edge weight of the self-edge of each node in the graph after the calculation is the value of the vector x.
[0239]
[0240] That is:
[0241]
[0242]
[0243] Algorithm 6: The specific steps of back substitution operation are as follows:
[0244] Step 1: From the node set V of the graph G, traverse in order from small to large according to the node number, select a node p each time, and then execute the following steps.
[0245] Step 2: Select all nodes i that meet the requirements from the node set V, the requirement is that the node i is pointed to by the node p and the node number of i is greater than p, and then execute step 3.
[0246] Step 3: Update the x attribute of the self-edge of node p: subtract the product of the edge weight of edge (p→i) and the x attribute of the self-edge of node i from the x attribute of the self-edge of node p.
[0247] Step 4: The loop corresponding to step 1 ends.
[0248] Based on the above forward and back substitution operations, the solution vector x of the linear equation set can be solved by using a graph and a newly added self-edge attribute, without the need to further map the matrix to the graph. Based on this, the matrix operation can be completed on the graph model after the data is modeled as a graph model by using the graph database, so that some regular matrix calculation contents can be placed in the database.
[0249] Finally, the principle of power flow graph parallel calculation is introduced.
[0250] The parallel computation of the graph includes node parallel computation of the graph and hierarchical parallel computation of the graph.
[0251] (1) Node parallel computation based on the graph.
[0252] In the graph computation, each node is independent of each other, and the computation of each node is only related to the neighbor nodes, and is not related to other nodes, so that the synchronous parallel of all nodes can be realized at the same time. The calculation and analysis in the power system often perform a lot of matrix operations, and the inherent node parallel computation capability of the graph computation can avoid the redundant computation caused by the sparse matrix, save the computation cost, and improve the computation efficiency.
[0253] (2) Hierarchical parallel computation based on the graph.
[0254] In the graph computation, the nodes are processed in layers according to the computation correlation, and the nodes in the same layer can be independently calculated at the same time. The computation of each layer is only related to the computation result of the previous layer. This kind of computation method in which the nodes in the same layer are parallel and the nodes in different layers are serial is the hierarchical parallel computation of the graph. Specifically, in the matrix operation in the power system calculation task, the matrix decomposition is often used. In the matrix decomposition and equation solving process, the nodes in the matrix can be constructed into a tree of elimination based on the tree of elimination theory. The nodes in each layer of the tree of elimination do not have a dependent relationship in the computation, and can be calculated at the same time, so as to achieve the purpose of hierarchical parallel computation.
[0255] In addition, in the specific application of the power flow calculation method based on the graph computation, the TigerGraph database is good at parallel processing while performing each task. The large-scale parallel processing (MPP: Massively Parallel Processor) architecture adopted by the TigerGraph database enables all nodes in the graph to send and receive messages through the edges connected between the nodes. Each node and edge can be associated with a calculation function, and each node and edge can simultaneously serve as a parallel storage unit. Through the full use of multi-core CPU and memory calculation, parallel computation can be performed on each node and edge. The ACCUM and POST-ACCUM clauses are introduced in the GSQL language of the TigerGraph to support the original Map-Reduce semantics in the SELECT block. The ACCUM clause acts as the Map step and processes all matched edges in parallel. The POST-ACCUM clause acts as the Reduce step and combines the messages from the source or target points sent by the ACCUM clause. Therefore, the TigerGraph can well meet the requirements of node parallel and hierarchical parallel computation in the power flow calculation.
[0256] The key steps of the power flow calculation mainly include generating the admittance matrix according to the topological structure and element parameters of the power system, generating the Jacobian matrix by derivation of the node power equation, calculating the active power and reactive power variation by the node power equation, and solving the voltage phase and amplitude correction by the Jacobian iteration.
[0257] The calculation principle of the active power and reactive power variation is shown in formula (1), and the calculation process based on the graph structure is shown in algorithm 7.
[0258] The specific steps of algorithm 7 are as follows:
[0259] Step 1: Find all paths s-(e)-t in the graph, and require that the start point s and the end point t are both Bus types, and the edge e is a Branch type. Take s as i and t as j, and perform the calculation process after the first equal sign in formulas 3-6 to calculate the active power and reactive power of each node, where V i , V j are the voltage attributes of node i and node j, i.e., s.V, t.V. δ ij is the phase angle difference between node i and node j, which can be obtained by the difference between the phase angle attributes of the two nodes, i.e., s.A-t.A. G ij and B ij are the conductance and susceptance between the nodes i and j, respectively, corresponding to the real part and imaginary part of the element in the ith row and jth column of the admittance matrix, i.e., Y[s.idx][t.idx][0] and Y[s.idx][t.idx][1];
[0260] Step 2: Find all Bus nodes, and if the node type is pq or pv, subtract the active power calculated in step 1 from the injected active power of the node, and if the node type is pv, also subtract the injected reactive power of the node from the calculated reactive power in step 1.
[0261] In algorithm 7, Y is the admittance matrix, where [0] represents the real part of the element at this position, [1] represents the imaginary part of the element at this position, ACCM represents matching each path, i.e., the operation under ACCUM will be performed for each matched pattern such as s-(e)-t. POST-ACCUM represents matching each node, i.e., the pattern such as s-(e)-t, even for the same s there may be multiple different t, but it will only be executed once for the same s.
[0262] After calculating the power variation of each node by formula (1), the correction of the voltage phase and amplitude of each node can be calculated by formula (2), and the calculation process based on the graph structure is as follows:
[0263] (1) Calculate the power variation ΔP and ΔQ of each node based on algorithm 7.
[0264] (2) Perform matrix decomposition on the Jacobian matrix as shown in Algorithm 4.
[0265] (3) Perform forward substitution based on Algorithm 5.
[0266] (4) Perform back substitution based on Algorithm 6 to solve Δδ and ΔV.
[0267] where the elements in the admittance matrix and the Jacobian matrix are only related to the bus node and its neighbor nodes corresponding to the element, and the values of each node do not change during the calculation process. Therefore, the values in the admittance matrix and the Jacobian matrix can be calculated simultaneously, and the same applies to the calculation of active power and reactive power changes. This can fully exploit the parallel computing advantage of the graph database. Under the premise of ensuring that all calculations are performed in the graph data, a preliminary design of a power flow calculation algorithm based on graph computation is made, and the pseudo code is shown in Algorithm 8. With the parallel computing advantage of TigerGrph, the node parallel requirement can be met. To realize the hierarchical parallel of graph computation, the hierarchical parallel implementation method of Choleshy elimination algorithm is used in the query traversal of Algorithm 8.
[0268] Algorithm 8: Hierarchical parallel implementation method of power flow calculation includes the following steps:
[0269] Step 1: Query all patterns like s-(e)-t in the graph, where s and t are Bus bus node types, and e is a Branch type.
[0270] Step 2: For each edge e found, its edge attributes e.R, e.X, e.B, e.Ratio, etc. can be obtained. For each node s found, its self-edge attributes s.G and s.B can be obtained. Based on these attributes, the real part and imaginary part of the node admittance matrix Y, and the block matrices H and L in the Jacobian matrix are calculated according to the node admittance matrix calculation formula and the Jacobian matrix calculation formula, respectively.
[0271] Step 2: Query each node s in the graph, and calculate its injected power based on the node injected power formula using the node attributes s.LoadP, s.LoadQ, s.GenP, and s.GenQ.
[0272] Step 3: Construct the elimination tree of matrices H and L.
[0273] Step 4: Find each node in the elimination tree and assign the node level attribute with the current layer number of the node in the elimination tree.
[0274] Step 5: FOR loop, from 0 to maxLevel, the maximum number of layers, each time select a node with attribute level l, and perform matrix decomposition according to Algorithm 4.
[0275] Step 6: initialize iteration counter i as 0.
[0276] Step 7: when i is less than total iteration times, loop step 8 to step 12.
[0277] Step 8: execute algorithm 7 to calculate the node power change amount.
[0278] Step 9: find the maximum value of the power change amount of each Bus node in the graph and the current maximum power change amount maxPQ, and assign the maximum value to maxPQ.
[0279] Step 10: judge the size of maxPQ and the convergence limit, if greater than the convergence limit, exit the loop.
[0280] Step 11: FOR loop, from 0 to the maximum level maxLevel, each time select the node with attribute level l, and perform the previous generation and back substitution process according to algorithm 5 and X2 to calculate the power imbalance amount.
[0281] Step 12: query all Bus node types s, and update attributes s.V and s.A, and add the newly obtained deltV and deltA to them.
[0282] Step 13: the loop of step 7 ends.
[0283] In algorithm 8, the purpose of the query traversal operation in step 1 is to generate the node admittance matrix, in which the non-diagonal elements, mutual admittance, are numerically represented as the negative value of the admittance between two nodes, and the diagonal elements, self-admittance, are numerically represented as the sum of the admittances of all branches connected to the node. It can be seen that the generation of each non-zero element in the matrix is only related to the node associated with it, so the generation of the admittance matrix can be parallel to the nodes, and all non-zero elements in the admittance matrix can be calculated independently. In order to facilitate subsequent use, each element in the matrix is stored according to the real part and the imaginary part respectively, and the entire calculation process is regarded as a separate query function installed in the database for subsequent calculation and calling.
[0284] In a possible implementation, the power flow calculation method based on graph calculation further includes the following steps:
[0285] S9: based on the power flow calculation result, dividing the buses with the same generator power supply into a region, and merging the power transmission circuits with consistent power direction between different regions into a chain to obtain a power system state graph.
[0286] S10: calculating the adjacency matrix of the power system state graph, and obtaining a path matrix according to the adjacency matrix.
[0287] S11: taking the chain where the overload branch is located as a target chain, calculating a start adjoint matrix and a termination adjoint matrix of the target chain according to a path matrix, and obtaining parallel power transmission sections and parallel power receiving sections of the target chain according to the start adjoint matrix and the termination adjoint matrix of the target chain; and taking a union of the parallel power transmission sections and the parallel power receiving sections of the target chain to obtain parallel sections of the overload branch.
[0288] Specifically, after the power flow calculation is completed, a power grid system state diagram is drawn according to real-time active power flow directions and distribution of the power grid and a network topology structure, simple matrix operations are performed according to an adjacency matrix and a path matrix obtained from a directed graph in graph theory, the corresponding path matrix is obtained from the adjacency matrix, and finally only sparse matrix calculation is needed to search for power transmission sections related to the overload branch, that is, power transmission sections most seriously affected by the overload branch circuit fault can be quickly found, so that safety protection can be performed in a targeted manner, cascading trips caused by unclear selection are prevented, and basic requirements of protection are met.
[0289] In a possible implementation, the calculation of the start adjoint matrix and the termination adjoint matrix of the target chain according to the path matrix, and the obtaining of the parallel power transmission sections and the parallel power receiving sections of the target chain according to the start adjoint matrix and the termination adjoint matrix of the target chain include:
[0290] The start adjoint matrix T and the termination adjoint matrix R of the target chain are calculated by the following formula:
[0291]
[0292]
[0293] wherein k is a start region serial number of the target chain, Q k = QM k Q is an intermediate matrix, which is obtained by adding a unit matrix to the path matrix, M k is a jth column vector of the unit matrix, represents that all elements in Q k are first negated and then transposed, represents that corresponding elements of two matrices are subjected to logical and operation, A is an adjacency matrix of the power grid state diagram; g is a termination region serial number of the target chain, Q g = QM g M g is a gth column vector of the unit matrix, represents that all elements in Q g are first negated and then transposed.
[0294] The chain combination corresponding to the non-zero elements in the start adjoint matrix T is taken as the parallel power transmission section of the target chain.
[0295] The chain combination corresponding to the non-zero elements in the termination adjoint matrix R is used as the parallel power receiving section of the target chain.
[0296] Specifically, the general steps for calculating the tidal current section are as follows:
[0297] (1) Given a directed graph G(V,E), assuming the graph has n vertices, then the adjacency matrix is an n×n square matrix (a ij )n×n, when line v i and v j There exists a line from v i Pointing to v j When there is a directed edge, then a ij =1, otherwise a ij =0. Similarly, if there is a path from v in a directed graph... j Departure and final arrival at v i The path, then a ij =1, otherwise a ij =0. Therefore, the adjacency matrix A of the directed graph G(V,E) can be expressed as:
[0298]
[0299] (2) If there are n nodes in a directed graph G(V,E), then the path matrix P corresponding to the directed graph can be represented as:
[0300]
[0301] The path matrix represents whether a directed path exists between any two nodes. When the starting point and ending point of line k are νi and νj respectively, its upstream node, i.e., the power source, is the non-zero element in the i-th column of the path matrix P; its downstream node, i.e., the load, is the non-zero element in the j-th column of the path matrix P.
[0302] (3) Using relevant knowledge of graph theory, some nodes that do not affect the calculation are eliminated and merged to obtain the simplified network graph G0(V0,E0). The following describes two typical cases that can be simplified.
[0303] Eliminate nodes with zero injected power. For example... Figure 6 As shown, the injected power of node 3 is zero, and the power of lines l13 and l32 remains the same, so they can be considered as a single branch. Therefore, node 3 is unnecessary and can be eliminated directly. Suspended nodes are merged. (As shown...) Figure 7 As shown, node 3 only receives power injected by node 4, so node 3 is not affected by other nodes. Node 4 is the suspending node of node 3. These two nodes can be merged into a new node with injected power of W3+W4 to achieve simplification.
[0304] (4) Establish the system state diagram, divide the buses with the same generator supply into a region, and combine the transmission circuits with the same power direction between different regions into a chain, denoted as Gr(Vr, Er). The following takes the 6-bus system as shown in Fig. 1 as an example to illustrate the process of establishing the system state diagram. Figure 8
[0305] a. Determine the power supply relationship between the buses and the generators Figure 8 The analysis can obtain:
[0306] 1) Generator A supplies power to all buses.
[0307] 2) Generator B supplies power to buses 3, 4, 5, and 6.
[0308] 3) Generator C supplies power to bus 6.
[0309] b. Determine the region supplied by the same generator, and the bus set supplied by multiple generators as a region. Through such a definition, it can be determined that a bus belongs to and only belongs to one region. Thus, Figure 8 The 6-bus system of Fig. 1 can be divided into 3 regions:
[0310] 1) Region ① consisting of buses 1 and 2 directly connected and supplied by generator A.
[0311] 2) Region ② consisting of buses 3, 4, and 5 directly connected and supplied by generators A and B.
[0312] 3) Region ③ consisting of bus 6 and supplied by generators A, B, and C.
[0313] According to the above region division principle, the transmission branches of the system are divided into two parts: intra-regional transmission branches and inter-regional transmission branches. A chain is a set of branches connecting two regions with the same active power flow direction from beginning to end. Taking Figure 8 as an example, the 6-bus system includes 3 chains: chain L1 consisting of branches 1-3 and 2-5 connecting regions ① and ②; chain L2 consisting of branches 4-6 and 5-6 connecting regions ② and ③; and chain L3 consisting of branch 2-6 connecting regions ① and ③. After completing the above steps, the system state diagram as shown in Fig. 2 is established. In the diagram, the circles represent the regions, and the lines with arrows represent the chains. Figure 9
[0314] (5) Obtain the adjacency matrix A of the system state diagram Gr(Vr, Er). Create an n×n order square matrix (a ij (n×n), where n represents the number of regions in the system state diagram. If there is a chain between region i and region j, and the power flow direction of this chain is from region i to region j, then the element a in the adjacency matrix is... ij =1, otherwise a ij =0. Therefore, we can obtain... Figure 9 The adjacency matrix of the state diagram of the 6-bus system shown is represented as follows:
[0315] (6) Obtain the path matrix P from the adjacency matrix A. Based on the method for constructing the path matrix summarized above, when there is a directed path between two regions, i.e., from region i to region j, the element P in the path matrix... ij =1, otherwise p ij =0. Therefore, we can obtain... Figure 9 The path matrix of the state diagram of the 6-bus system shown can be represented as:
[0316] (7) The path matrix P is added to an n×n identity matrix E to obtain matrix Q.
[0317] (8) Let Q J Let M be the j-th column vector of matrix Q. j Let Q be the j-th column vector of the identity matrix E, and obtain the matrix Q using the following formula. j =QM j .
[0318] (9) Let the starting zone number of the chain Linki containing the overload branch be k, then the adjoint matrix T corresponding to the chain Linki can be obtained, and its calculation formula is: in, Indicates Q k Invert all elements and then transpose them. This indicates a logical AND operation between corresponding elements of two matrices.
[0319] (10) By taking the union of the parallel power transmission section Link(T) and the parallel power receiving section Link(R), the parallel section of the overload branch to be searched can be obtained.
[0320] Specifically, based on the above explanation, combined with Figure 9 As shown in the system state diagram, the starting region number of link2 is ②, from which its corresponding starting adjoint matrix can be obtained. The calculation yields:
[0321] By observing the initial accompanying matrix T, it can be found that t13 and t23 are non-zero elements, so the corresponding chain Link1-3 and chain Link2-3 jointly constitute the parallel power transmission section Link(T) of Link2. According to the relationship between the system state diagram and the initial simplified network diagram, it can be found that the parallel power transmission section of the overload branch 5-6 is composed of branch 2-6 and branch 4-6. Similarly, it can be known that the parallel power receiving section of Link2 is also jointly composed of chain Link1-3 and chain Link2-3. The Link(R) calculation process is the same as Link(T).
[0322] (11) The parallel transmission section Link(T) and the parallel receiving section Link(R) are taken as a set, and the parallel section of the overload branch to be searched is obtained.
[0323] In this embodiment, the parallel section of the overload branch 5-6 is branch 2-6 and 4-6.
[0324] In summary, the application first proposes a matrix calculation method based on a graph structure, which converts matrix calculation and matrix decomposition into graph data addition, deletion, modification and query operations in a graph database. At the same time, in order to improve the efficiency of power graph calculation and realize the storage and calculation integration of power graph calculation, the application replaces all matrix calculation and matrix decomposition steps in the PQ decomposition method (one of the power flow calculation methods) with matrix calculation and matrix decomposition operations based on a graph structure, realizing the storage and calculation integration of power graph parallel calculation.
[0325] Compared with the traditional power calculation method, the application adopts a graph parallel calculation method to complete the calculation, each node is independent of each other, and their calculation is only related to their neighbor nodes and unrelated to other nodes, so the synchronous parallel of all nodes can be realized at the same time. The calculation and analysis in the power system often involve a lot of matrix operations. By using the inherent node parallel calculation capability of graph calculation, redundant calculation caused by sparse matrix can be avoided, the calculation cost can be saved, and the calculation efficiency can be improved.
[0326] In addition, compared with the storage and calculation separation type power graph calculation method based on a graph database + graph calculation engine, the application realizes a software level storage and calculation integrated power graph calculation method by converting matrix calculation into an operation in a graph database. When a large sparse power graph is encountered, data does not need to be frequently imported from the graph database into the graph calculation engine, the matrix operation efficiency is improved, and the power graph calculation efficiency is improved.
[0327] The following is a device embodiment of the application, which can be used to execute the method embodiment of the application. For details not disclosed in the device embodiment, please refer to the method embodiment of the application.
[0328] Reference Figure 10In still another embodiment of the present application, a power flow calculation system based on graph computation is provided, which can be used to implement the power flow calculation method based on graph computation described above. Specifically, the power flow calculation system based on graph computation comprises a data query module, a construction module, a matrix decomposition module, an iteration module, a power calculation module, a discrimination module, and a voltage calculation module.
[0329] The data query module is configured to obtain the node admittance matrix of the power system, and the upper-left corner block matrix and the lower-right corner block matrix of the Jacobian matrix according to the topological structure diagram of the power system. The construction module is configured to construct the elimination tree of the upper-left corner block matrix and the lower-right corner block matrix of the Jacobian matrix, perform node layer division based on the elimination tree, and assign a layer attribute to each node of the power system. The matrix decomposition module is configured to traverse each node in the order from 0 to the maximum layer number based on the layer attribute of each node, and perform matrix decomposition on the Jacobian matrix by using a matrix decomposition method based on graph structure to obtain an upper triangular matrix and a lower triangular matrix. The iteration module is configured to obtain the current iteration number, and trigger the power calculation module, the discrimination module, and the power flow calculation module when the current iteration number is less than the preset maximum iteration number. Otherwise, the iteration is ended. The power calculation module is configured to calculate the power variation of each node by using a power variation calculation method based on graph structure according to the node admittance matrix. The discrimination module is configured to obtain the maximum power variation in the power variations of each node, and end the iteration when the maximum power variation is greater than the preset convergence limit. The voltage calculation module is configured to traverse each node in the order from 0 to the maximum layer number, obtain a previous generation calculation vector by using a previous generation calculation method based on graph structure according to the lower triangular matrix, and update the voltage amplitude and the voltage phase angle of each node by using a back substitution calculation method based on graph structure according to the power variation, the previous generation calculation vector, and the upper triangular matrix.
[0330] In a possible implementation, the power flow calculation system based on graph computation further comprises a section calculation module configured to divide buses having the same generator power supply into a region, and combine power transmission circuits with consistent power directions between different regions into a chain based on the power flow calculation result, to obtain a power system state diagram; calculate an adjacency matrix of the power system state diagram, and obtain a path matrix according to the adjacency matrix; take the chain where the overload branch is located as a target chain, calculate the starting companion matrix and the terminal companion matrix of the target chain according to the path matrix, and obtain the parallel power transmission section and the parallel power receiving section of the target chain according to the starting companion matrix and the terminal companion matrix of the target chain; and obtain the parallel section of the overload branch by taking the union of the parallel power transmission section and the parallel power receiving section of the target chain.
[0331] All the related contents of the steps involved in the foregoing embodiment of the power flow calculation method based on graph calculation can be cited to the function description of the function module corresponding to the power flow calculation system based on graph calculation in the embodiment of the present application, and will not be repeated here.
[0332] The division of the modules in the embodiment of the present application is illustrative, and is only a logical function division. In actual implementation, there can be another division manner. In addition, each function module in each embodiment of the present application can be integrated in one processor, or can be a separate physical existence, or two or more modules can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software function module.
[0333] In another embodiment of the present application, a computer device is provided, which includes a processor and a memory. The memory is configured to store a computer program, and the computer program includes program instructions. The processor is configured to execute the program instructions stored in the computer storage medium. The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor is the computing core and control core of the terminal, and is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions in the computer storage medium to implement a corresponding method flow or a corresponding function. The processor in the embodiment of the present application can be used for the operation of the power flow calculation method based on graph calculation.
[0334] In still another embodiment, the present application also provides a storage medium, specifically a computer readable storage medium (Memory), which is a memory device in a computer device, for storing programs and data. It can be understood that the computer readable storage medium here can include the built-in storage medium in the computer device, and of course can also include the expansion storage medium supported by the computer device. The computer readable storage medium provides a storage space, which stores the operating system of the terminal. Moreover, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer readable storage medium here can be a high-speed RAM memory, or a non-volatile memory such as at least one disk memory. The one or more instructions stored in the computer readable storage medium can be loaded and executed by the processor to realize the corresponding steps of the power flow calculation method based on graph calculation in the above embodiment.
[0335] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.
[0336] The present application is described with reference to the flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device implemented in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that implements the function specified in the flow(s) or block(s).
[0337] These computer program instructions can also be stored in a computer readable memory that can direct the computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including instruction apparatus, which implements the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocksFigure 1 the function specified in the one or more blocks.
[0338] These computer program instructions can also be loaded into computer or other programmable data processing devices, so that a series of operation steps are performed on the computer or other programmable data processing devices to generate computer-implemented processes, thus the instructions executed on the computer or other programmable data processing devices provide a process for implementing the flow Figure 1 the flow or flows and / or blocks Figure 1 the steps of the function specified in the one or more blocks.
[0339] Finally, it should be noted that: the above examples are only used to illustrate the technical solutions of the present application, but not to limit it, although the present application has been described in detail with reference to the above examples, those skilled in the art should understand: the specific embodiments of the present application can still be modified or replaced by the equivalent, without departing from the spirit and scope of the present application, any modification or equivalent replacement, which should be covered within the protection scope of the claims of the present application.
Claims
1. A method for power flow calculation based on graph computation, characterized in that, The method comprises the following steps: S1: obtaining a node admittance matrix of a power system, and a left upper corner block matrix and a right lower corner block matrix of a Jacobian matrix according to a topology diagram of the power system; S2: constructing a elimination tree of the left upper corner block matrix and the right lower corner block matrix of the Jacobian matrix, performing node layer division based on the elimination tree, and assigning a layer attribute to each node of the power system; S3: traversing each node in order from 0 to the maximum layer number based on the layer attribute of each node, and performing matrix decomposition on the Jacobian matrix based on a graph structure to obtain an upper triangular matrix and a lower triangular matrix; S4: obtaining a current iteration number, and when the current iteration number is less than a preset maximum iteration number, performing S5-S7; otherwise, ending the iteration; S5: calculating power variation of each node based on the node admittance matrix by using a power variation calculation method based on a graph structure; S6: obtaining a maximum power variation in the power variation of each node, and when the maximum power variation is greater than a preset convergence limit, ending the iteration; S7: traversing each node in order from 0 to the maximum layer number, obtaining a previous generation calculation vector based on the lower triangular matrix by using a previous generation calculation method based on a graph structure, and updating the voltage amplitude and the voltage phase angle of each node based on the power variation, the previous generation calculation vector and the upper triangular matrix by using a back substitution calculation method based on a graph structure; The matrix decomposition method based on a graph structure comprises the following steps: Step 1-1: traversing the node set V of the topology diagram of the power system in ascending order of node number, selecting each node as node p, and performing steps 1-2 to 1-9; Step 1-2: selecting all nodes i from the node set V of the topology diagram of the power system; wherein node i is pointed to by node p and the node number of node i is greater than that of node p; Step 1-3: dividing the edge weight of edge p→i by the self-edge edge weight of node p; Step 1-4: subtracting the product of the edge weights of edges p→i and i→p from the self-edge edge weight of node i; Step 1-5: selecting all node pairs t, j from the edge set W of the topology diagram of the power system; wherein node t points to node j through node p; Step 1-6: subtracting the product of the edge weights of edges t→p and p→j from the edge weight of edge t→j; Step 1-7: selecting all node pairs (r, y) from the edge set W of the topology diagram of the power system; wherein node p points to both node r and node y; Step 1-8: subtracting the product of the edge weights of edges r→p and p→y from the edge weight of edge r→y; Step 1-9: subtracting the product of the edge weights of edges y→p and p→r from the edge weight of edge y→r; The method further comprises the following steps: S8: dividing buses with the same generator power supply into a region, and merging power transmission circuits with consistent power directions between different regions into a chain to obtain a power system state diagram based on the power flow calculation result; S9: calculating an adjacency matrix of the power system state diagram, and obtaining a path matrix based on the adjacency matrix; S10: taking the chain where the overload branch is located as a target chain, calculating a starting adjoint matrix and a terminal adjoint matrix of the target chain according to the path matrix, and obtaining parallel power transmission sections and parallel power receiving sections of the target chain according to the starting adjoint matrix and the terminal adjoint matrix of the target chain; and taking the parallel power transmission sections and the parallel power receiving sections of the target chain as a union to obtain parallel sections of the overload branch; the starting adjoint matrix and the terminal adjoint matrix of the target chain are calculated according to the path matrix, and the parallel power transmission sections and the parallel power receiving sections of the target chain are obtained according to the starting adjoint matrix and the terminal adjoint matrix of the target chain, and the parallel sections of the overload branch are obtained by taking the parallel power transmission sections and the parallel power receiving sections of the target chain as a union, comprising: the starting adjoint matrix T and the terminal adjoint matrix R of the target chain are calculated by the following formula: in, This is the starting region number of the target chain. = , The intermediate matrix is obtained by adding an identity matrix to the path matrix. The first unit of the identity matrix Column vectors Indicates will Invert all elements and then transpose them. This indicates a logical AND operation between corresponding elements of two matrices, where A is the adjacency matrix of the power system state diagram; This is the sequence number of the terminating region of the target chain. = , The first unit of the identity matrix Column vectors Indicates will Invert all elements and then transpose them. the chain combination corresponding to the non-zero element in the starting adjoint matrix T is taken as the parallel power transmission section of the target chain; the chain combination corresponding to the non-zero element in the terminal adjoint matrix R is taken as the parallel power receiving section of the target chain.
2. The graph computation-based power flow calculation method according to claim 1, characterized in that, the power variation of each node is calculated by the power variation calculation method based on the graph structure, comprising: Find all s-(e)-t paths in the topology graph of the power system, where s and t represent node types, and (e) represents edge types; and take s as i , and t as j , and calculate the power change of each node by the following formula, which includes active power imbalance and reactive power imbalance: wherein is the active power imbalance at node i , is the reactive power imbalance at node i , is the injected active power at node i , is the injected reactive power at node i , is the voltage phase angle at node i , is the real part of the admittance of node i to node j in the node admittance matrix, is the imaginary part of the admittance of node i to node j in the node admittance matrix, is the phase angle difference of node i to node j . 3.The graph-computation-based power flow calculation method according to claim 1, wherein, the pre-generation calculation vector is obtained by the pre-generation calculation method based on the graph structure, comprising: Step 2-1: assigning the power variation of each node to the self-edge of each node in the topological structure graph of the power system as the z value of the self-edge of each node; Step 2-2: from the node set V of the topological structure graph of the power system, traverse in order from small to large according to the node number, and each time select a node p to execute steps 2-3 to 2-5; Step 2-3: select all nodes i from the node set V of the topological structure graph of the power system; wherein the node i is pointed to by the node p and the node number of the node i is smaller than the node p; Step 2-4: subtract the product of the edge weight of the edge p→i and the z value of the self-edge of the node i from the z value of the self-edge of the node p; Step 2-5: divide the z value of the self-edge of the node p by the edge weight of the self-edge of the node p; Step 2-6: arrange the z values of the self-edges of the nodes row by row to obtain the pre-generation calculation vector.
4. The graph computation based power flow calculation method of claim 1, wherein, the voltage amplitude and the voltage phase angle of each node are updated by the back-generation calculation method based on the graph structure, comprising: Step 3-1: taking each element value in the pre-generation calculation vector as the x attribute value of the self-edge of each node; Step 3-2: from the node set V of the topological structure graph of the power system, traverse in order from small to large according to the node number, and each time select a node p to execute steps 3-3 to 3-4; Step 3-3: select all nodes i from the node set V of the topological structure graph of the power system; wherein the node i is pointed to by the node p and the node number of the node i is greater than the node p; Step 3-4: subtract the product of the edge weight of the edge p→i and the x attribute value of the self-edge of the node i from the x attribute value of the self-edge of the node p; Step 3-5: obtaining the voltage amplitude variation and the voltage phase angle variation of each node according to the x attribute value of the self-edge of each node; and updating the voltage amplitude and the voltage phase angle of each node according to the voltage amplitude variation and the voltage phase angle variation of each node.
5. A power flow calculation system based on the graph calculation of the power flow calculation method of claim 1, characterized by, comprising: a data query module, configured to obtain a node admittance matrix of the power system, and a left upper corner block matrix and a right lower corner block matrix of a Jacobian matrix according to a topological structure graph of the power system; The constructing module is configured to construct an elimination tree of upper-left square matrices and lower-right square matrices of the Jacobian matrix, perform node level division based on the elimination tree, and assign a level attribute to each node of the power system; The matrix decomposition module is configured to traverse the nodes in an order from 0 to the maximum level based on the level attribute of each node, and perform matrix decomposition on the Jacobian matrix by using a matrix decomposition method based on a graph structure to obtain an upper triangular matrix and a lower triangular matrix; The iteration module is configured to obtain a current iteration number, trigger the power calculation module, the discrimination module, and the power flow calculation module when the current iteration number is less than a preset maximum iteration number; Otherwise, the iteration is ended; The power calculation module is configured to calculate the power variation of each node by using a power variation calculation method based on a graph structure according to the node admittance matrix; The discrimination module is configured to obtain a maximum power variation in the power variations of the nodes, and end the iteration when the maximum power variation is greater than a preset convergence limit; The voltage calculation module is configured to traverse the nodes in an order from 0 to the maximum level, obtain a previous generation calculation vector by using a previous generation calculation method based on a graph structure according to the lower triangular matrix, and update the voltage amplitude and the voltage phase angle of each node by using a back substitution calculation method based on a graph structure according to the power variation, the previous generation calculation vector, and the upper triangular matrix.
6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the power flow calculation method based on graph calculation according to any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, wherein the computer program comprises the following steps of: receiving a request for a resource from a client; determining whether the client is authorized to access the resource; and if the client is authorized to access the resource, providing the resource to the client. The computer program is executed by the processor to implement the steps of the power flow calculation method based on graph calculation according to any one of claims 1 to 4.
Citation Information
Patent Citations
Static security analysis double-layer parallel method based on GPU-CUP heterogeneous computing platform
CN105576648A
Power flow risk perception method for power grid
CN110212537A