Method and system for quickly generating factor graph after power grid node splitting based on graph calculation
Through the graph calculation method, a factor graph after power grid node split is generated, which solves the problems of insufficient parallel processing capabilities and low data processing efficiency in the prior art, and realizes efficient factor graph correction and rapid generation.
Patent Information
- Application Number
- CN202411180819.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2025-01-07
AI Technical Summary
The serial design structure of the existing methods limits its parallel processing capabilities, cannot effectively exert the computing power of modern hardware resources, and the computing methods based on relational databases are inefficient in dealing with complex multi-source data.
The rapid generation method of the grid node split factor graph based on graph calculation is adopted, and the corrected factor graph is generated by generating the original grid topology graph, local topology analysis to determine the change type, calculate incremental information, and parallel processing factor graph correction.
It improves algorithm efficiency, reduces the time loss of interactions of multiple types of data structures, makes full use of hardware resources, and improves the rapid generation speed of power grid factor graphs.
Smart Images

Figure CN119272448A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric power automation, and in particular to a method and system for quickly generating a factor graph after a power grid node is split based on graph calculation. Background Art
[0002] With the continuous expansion of the power grid system and the rapid construction of new power systems, the challenges faced by the power system are becoming increasingly severe and diversified. In this process, the substation bus, as the core link of power transmission and distribution, has become more frequent and flexible in its operation mode and operation strategy. Bus splitting operations are often required in substations to cope with complex and changing power grid environments. After topological analysis, the bus splitting in the plant will be manifested as the splitting of the electrical nodes of the power grid, which will eventually lead to an increase in the number of nodes in the node branch model. Flow calculation is the basis for static safety analysis and safety verification of the power grid. Changes in the node branch model of the power grid will lead to changes in the factor table in the flow calculation, making it impossible to directly perform flow calculation according to the factor table of the base state model. Traditional methods often directly regenerate the factor table for the power grid model after the electrical node splitting. This method does not use the known information of the factor table of the base state model, resulting in a lot of time loss.
[0003] The edge addition method also plays a role in the rapid generation of factor tables after electrical node splitting, but the traditional serial design structure limits its parallel processing capabilities and cannot effectively exert the powerful computing power of modern hardware resources. In addition, the relational database and matrix operation technology that the edge addition method relies on are gradually falling into bottlenecks when dealing with new power systems with rapidly growing grid computing scales, and are difficult to cope with new challenges. Graph databases and graph computing engines can make full use of underlying hardware resources, but no method for rapid generation of factor graphs after electrical node splitting based on graph databases, graph computing engines, and parallel design architectures has been proposed. Summary of the invention
[0004] In view of the above-mentioned problems, the present invention is proposed.
[0005] Therefore, the problem to be solved by the present invention is: how to solve the problem that the serial design structure of the existing method limits its parallel processing capability and cannot effectively exert the powerful computing power of modern hardware resources; how to solve the inefficiency of the computing method based on relational database in dealing with complex multi-source data.
[0006] To solve the above technical problems, the present invention provides the following technical solutions: a method for quickly generating a factor graph after the splitting of a power grid node based on graph calculation, comprising: S1: generating an original power grid topology map according to power grid data, and performing factor decomposition based on graph calculation to obtain the original power grid factor graph; S2: after the power grid topology changes, the type of power grid topology change is determined by local topology analysis. If the change type is an increase in the number of electrical nodes, a power grid topology map after the change is generated according to a method for increasing the number of electrical nodes; S3: based on the original power grid topology map and the power grid topology map after the change, an incremental information calculation method is performed to generate incremental information; S4: based on the original power grid factor graph and the incremental information, a correction method for the electrical node increase factor graph based on graph calculation is performed to generate a corrected factor graph.
[0007] As a preferred solution of the method for quickly generating a factor graph after the splitting of power grid nodes based on graph calculation described in the present invention, the original power grid topology graph refers to a graph model established based on a matrix describing specific information of the power grid before the increase of electrical nodes in the actual power grid occurs; the changed power grid topology graph refers to a graph model established based on a matrix describing specific power grid information after the increase of electrical nodes in the actual power grid occurs; the factor decomposition algorithm based on graph calculation refers to factorizing the matrix corresponding to the graph, also known as triangular decomposition, the decomposition process adopts a graph calculation method, and the decomposition result is stored according to the graph; the original power grid factor graph refers to a graph model established based on a factor table matrix, and the factor table refers to a factor table obtained after the matrix describing specific information of the power grid is factorized before the increase of electrical nodes in the actual power grid occurs; the increase in the number of nodes refers to the addition of nodes to the changed power grid topology graph on the basis of the original power grid topology graph, and the node numbers, node self-edge values, and edge values of the changed power grid topology graph corresponding to the original power grid topology graph are exactly the same.
[0008] As a preferred solution of the method for quickly generating a factor graph after the splitting of a power grid node based on graph calculation described in the present invention, the local topology analysis only performs topology analysis on the affected equipment range to obtain the changed power grid topology, as well as the changed location and type; the method for increasing the numbering of electrical nodes refers to adding new nodes to the original power grid topology map, and the new node number is the number value that increases sequentially from the largest node number in the original power grid topology map to generate the changed power grid topology map.
[0009] As a preferred solution of the method for quickly generating a factor graph after the splitting of power grid nodes based on graph calculation described in the present invention, the incremental information calculation method includes step 11: subtracting the original power grid topology map from the changed power grid topology map to obtain a temporary incremental graph, wherein the changed power grid topology map minus the original power grid topology map is the self-edge value of each node in the changed power grid topology map minus the self-edge value of the corresponding node in the original power grid topology map, the edge value of each edge of the changed power grid topology map minus the edge value of the corresponding edge in the original power grid topology map, the nodes in the temporary incremental graph are the newly added nodes and the nodes of the original power grid topology map connected to the newly added nodes, and the edges in the temporary incremental graph are the newly added nodes and the The connection relationship of each node in the temporary incremental graph, the self-edge value and edge value of the temporary incremental graph are obtained by calculation; step 12: split the temporary incremental graph into graph C and graph D, the nodes of graph C are the newly added nodes, the edges of graph C are the connection relationship between the newly added nodes, the self-edge value of the nodes of graph C is the self-edge value of the corresponding nodes of the temporary incremental graph, the edge value of the edge of graph C is the edge value of the corresponding edge of the temporary incremental graph, and graph D is obtained by subtracting graph C from the temporary incremental graph, where the temporary incremental graph minus graph C is the self-edge value of each node of the temporary incremental graph minus the self-edge value of the corresponding node of graph D, the edge value of each edge of the temporary incremental graph minus the edge value of the corresponding edge of graph C, and graph C and graph D are used as incremental information.
[0010] As a preferred solution of the method for quickly generating a factor graph after the power grid node splitting based on graph calculation according to the present invention, the method for correcting the electrical node adding factor graph based on graph calculation includes: step 21: according to the original power grid factor graph, performing parallel previous generation operations and normalization operations based on graph calculation on graph D to obtain graph u1, wherein the nodes of graph u1 are the newly added nodes and some nodes in the original power grid topology graph, wherein some nodes in the original power grid topology graph are obtained by previous generation operations and normalization operations, and the edges of graph u1 are the connection relationships between the newly added nodes and some nodes in the original power grid topology graph, the self-edge values of the nodes are set to 0, and the edge values of the edges are obtained by calculation; step 22: calculating the temporary graph u2 expressed as:
[0011]
[0012] Among them, u2 is the matrix corresponding to the temporary graph u2, C is the matrix corresponding to the graph C, and D dis the diagonal matrix corresponding to the diagonal elements in the original power grid factor graph, u1 is the triangular matrix corresponding to graph u1, and * is the matrix multiplication based on graph calculation; Step 23: Execute the factor decomposition algorithm based on graph calculation on the temporary graph u2 to obtain the temporary graph l, temporary graph d, and temporary graph u3. The temporary graph d is a one-dimensional graph model. The nodes of the temporary graph d are the newly added nodes. The self-edge values of the temporary graph d are obtained by factor decomposition. The temporary graph d has no edges. The nodes of the temporary graph u3 are the newly added nodes. The edges of the temporary graph u3 are the connection relationships between the newly added nodes. The edge values are obtained by factor decomposition, and the self-edge values are set to 0; Step 24: Set the temporary graphs u1, temporary graph d, temporary graph u3, The modified factor graph is obtained by adding the original power grid factor graphs. Graph addition refers to adding the self-edge values of the same nodes of all graphs as the self-edge value of the corresponding node, and adding the edge values of the same edges of all graphs as the edge value of the corresponding edge. If a graph G contains nodes that other graphs do not have, then corresponding new nodes are created in other graphs, and the new node numbers are consistent with the node numbers in graph G. If a graph G contains edges that other graphs do not have, then corresponding new edges are created in other graphs, and the node numbers at both ends of the new edges are consistent with the node numbers in graph G; the same nodes refer to the same node numbers; the same edges refer to the node numbers at both ends of an edge being the same as the node numbers at both ends of another edge.
[0013] As a preferred solution of the method for quickly generating a factor graph after splitting of a power grid node based on graph calculation according to the present invention, the parallel previous generation operation and normalization operation based on graph calculation in step 23 include: step 31: splitting graph D into c subgraphs, wherein c refers to the number of newly added nodes, each newly added node corresponds to a subgraph, the nodes of each subgraph are the corresponding newly added nodes and the nodes in graph D connected to the newly added nodes, the edges of each subgraph are the connection relationship between the corresponding newly added nodes and the nodes connected to the newly added nodes in graph D, the self-edge value and edge value of each subgraph are obtained from graph D, and steps 32, 33, and 34 are executed in parallel for all subgraphs; step 32: generating a path tree union of the nodes of the original power grid factor graph corresponding to the subgraph in the original power grid factor graph, wherein the original power grid factor graph corresponding to the subgraph The node number is the number of all nodes in the subgraph connected to the newly added node, and a temporary factor graph is created. The temporary factor graph is completely consistent with the original power grid factor graph, and all nodes in the path tree union corresponding to the subgraph in the temporary factor graph are activated; Step 33: Add a new attribute E to all activated nodes in the temporary factor graph, and set the value of E to the edge value of the newly added node and the corresponding activated node in the subgraph; Step 34: Execute the E value correction algorithm based on graph parallel computing; Step 35: When all subgraphs have completed steps 32, 33, and 34, create graph u1, the nodes of u1 include the newly added nodes and the nodes of the path tree union of all subgraphs, the self-edge values of all nodes are 0, the newly added nodes are only connected to the nodes of the path tree union of their corresponding subgraphs, and the edge values of the two are the E values of the nodes of the corresponding path tree union in the subgraph.
[0014] As a preferred solution of the method for quickly generating factor graphs after node splitting of power grid based on graph calculation according to the present invention, the E value correction algorithm based on graph parallel calculation in step 34 includes: step 41: taking the node with the smallest node number among all activated nodes as the root node. If there is no activated node, execute step 44; step 42: using graph parallel calculation, correcting the E values of all activated nodes connected to the root node, the correction method is: subtracting the product of the E of the root node and the edge value of the edge between the two nodes from the E of the node connected to the root node; step 43: setting the current root node to an unactivated state, then execute step 41; step 44: using graph parallel calculation, simultaneously correcting the E values of the nodes contained in the union of all path trees, the correction method is to divide the E of the nodes contained in the union of all path trees by the self-edge value of the node.
[0015] Another object of the present invention is to provide a system for quickly generating factor graphs after power grid node splitting based on graph computing, which can solve the problem of quickly generating factor graphs after power grid node splitting based on graph computing by constructing a factor graph fast generation system.
[0016] To solve the above technical problems, the present invention provides the following technical solutions: a system for quickly generating a factor graph after the splitting of a power grid node based on graph calculation, comprising an initialization module, a module for generating a power grid topology map after the change, a module for calculating the incremental information of the power grid topology and a module for generating a modified factor graph; the initialization module is used to generate an original power grid topology map according to power grid data, and to perform factor decomposition based on graph calculation to obtain the original power grid factor graph; the module for generating the power grid topology map after the change is used to determine the type of power grid topology change through local topology analysis after the power grid topology changes, and if the change type is an increase in the number of electrical nodes, generate a power grid topology map after the change according to a method for increasing the number of electrical nodes; the incremental information calculation module for the power grid topology is used to perform an incremental information calculation method based on the original power grid topology map and the power grid topology map after the change, and generate incremental information; the modified factor graph generation module is used to perform an electrical node increase factor graph correction method based on graph calculation based on the original power grid factor graph and the incremental information, and generate a modified factor graph.
[0017] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method for quickly generating a factor graph after a power grid node split based on graph calculation as described above are implemented.
[0018] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for quickly generating a factor graph after a power grid node split based on graph calculation as described above.
[0019] The beneficial effects of the present invention are as follows: the method for quickly generating a factor graph after the power grid node splitting based on graph calculation provided by the present invention splits the correction amount between the corrected topology graph and the original power grid topology graph into graph C and graph D, wherein graph C contains the connection relationship between the newly added nodes and the newly added nodes, and graph D contains the connection relationship between the newly added nodes and the original nodes. Graph D is processed using parallel previous generation operations and normalization operations based on graph calculation, and graph C is processed using a graph multiplication based on matrix multiplication and a parallel factor decomposition algorithm based on graph calculation, and the processing results of the two are added to the original power grid factor graph to obtain a corrected factor graph. The present invention models the main data models required in the local correction process of the power grid factor graph as graph models, uses graph calculation technology to process the operation logic between graph models, excludes zero element storage and zero element calculation as much as possible, reduces the time loss of multi-type data structures and multi-association table interactions, and improves the algorithm efficiency. At the same time, it adopts parallel design ideas such as multi-subgraphs and multi-processes, comprehensively considers coarse and fine-grained parallel computing architectures, mines parallel points in the algorithm, makes full use of underlying hardware resources, and further improves the algorithm operation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0021] Figure 1 A flowchart of a method for quickly generating a factor graph after power grid node splitting based on graph computing provided in the first embodiment of the present invention.
[0022] Figure 2 A schematic diagram of an electrical node splitting numbering method and an original power grid factor graph of a method for quickly generating a factor graph after power grid node splitting based on graph calculation provided in the first embodiment of the present invention.
[0023] Figure 3 A schematic diagram of electrical node splitting incremental information of a method for quickly generating a factor graph after power grid node splitting based on graph calculation provided in the first embodiment of the present invention.
[0024] Figure 4 A schematic diagram of a method for correcting a factor graph of electrical grid electrical nodes splitting based on graph computing, which is a method for quickly generating a factor graph after grid node splitting based on graph computing, is provided in the first embodiment of the present invention.
[0025] Figure 5 A schematic diagram of graph multiplication based on matrix multiplication of a method for quickly generating a factor graph after power grid node splitting based on graph computing provided in the first embodiment of the present invention.
[0026] Figure 6 A schematic diagram of parallel previous generation operations and normalization operations based on graph computing of a method for quickly generating a factor graph after power grid node splitting based on graph computing provided in the first embodiment of the present invention.
[0027] Figure 7 A structural diagram of a system for quickly generating factor graphs after power grid node splitting based on graph computing provided in a second embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.
[0029] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0030] Example 1, reference Figure 1 to Figure 6 , which is the first embodiment of the present invention, and provides a method for quickly generating a factor graph after the splitting of a power grid node based on graph calculation, including: generating an original power grid topology map according to power grid data, and performing factor decomposition based on graph calculation to obtain the original power grid factor graph; after the power grid topology changes, judging the type of power grid topology change through local topology analysis, if the change type is an increase in the number of electrical nodes, generating a power grid topology map after the change according to the method for increasing the number of electrical nodes; executing an incremental information calculation method based on the original power grid topology map and the power grid topology map after the change to generate incremental information; executing an electrical node increase factor graph correction method based on graph calculation based on the original power grid factor graph and the incremental information to generate a corrected factor graph.
[0031] S1: Generate the original power grid topology map according to the power grid data, and perform factor decomposition based on graph calculation to obtain the original power grid factor map.
[0032] Graph model: The graph model uses nodes and edges as basic storage units, and each node and edge can store a set number of attributes. Unless otherwise stated, all nodes and edges of all graphs contain only one attribute, where the attribute of the node is the self-edge value, and the attribute of the edge is the edge value. All graphs in the embodiments of the present invention are undirected graphs, that is, the edges have no direction. Each symmetric matrix can correspond to a graph model, the self-edge value of the graph model node is equal to the diagonal element value of the corresponding matrix, and the edge value of the graph model edge is equal to the non-diagonal element value of the corresponding matrix.
[0033] Original grid topology: refers to a graph model established based on a matrix describing grid-specific information before the addition of electrical nodes to the actual grid. The matrix describing grid-specific information refers to all matrices that need to be factored, including the admittance matrix. The matrices describing grid-specific information in this embodiment are all symmetric matrices. This topology refers to the electrical topology of the grid, not the equipment or physical topology of the grid.
[0034] The changed power grid topology diagram refers to a graph model established by a matrix describing specific power grid information after the addition of electrical nodes in the actual power grid. In this embodiment, the matrices describing specific power grid information after the changes are all symmetric matrices.
[0035] Factor decomposition algorithm based on graph computing: refers to factoring the matrix corresponding to the graph (also called triangular decomposition). The decomposition process uses graph computing methods, and the decomposition results are stored according to the graph.
[0036] Original power grid factor graph: refers to a graph model established based on a factor table matrix. The factor table here refers to the factor table obtained after the matrix describing specific information of the power grid is factorized before the addition of electrical nodes in the actual power grid.
[0037] Modified factor graph: refers to a graphical model established based on a factor table matrix. The factor table here refers to the factor table obtained after the matrix describing the specific information of the power grid is factorized after the increase of electrical nodes in the actual power grid.
[0038] Path tree: Path tree is also called factored path, point path, and factored road of node. It records the position of a node in the factor table (graph) when solving a linear equation system. The factor table column (row) elements that are not on the path tree do not participate in the calculation. The concept of path tree comes from the sparse vector method, which completely avoids unnecessary calculations in solving linear equation systems, making the power flow calculation based on Newton's method practical.
[0039] Path tree union: Path tree union, also called road tree, refers to the union of path trees of multiple nodes.
[0040] The method for quickly generating factor graphs after adding electrical nodes based on graph computing provided by the present invention models the main data models required in the local correction process of the power grid factor graph as graph models, uses graph computing technology to process the operation logic between graph models, excludes zero element storage and zero element calculation as much as possible, reduces the time loss of multiple data structures and multiple association tables, and improves the efficiency of the algorithm. At the same time, it adopts parallel design ideas such as multi-subgraphs and multi-processes, comprehensively considers coarse and fine-grained parallel computing architectures, mines parallel points in the algorithm, makes full use of underlying hardware resources, and further improves the algorithm operation efficiency.
[0041] S2: After the grid topology changes, the type of grid topology change is determined through local topology analysis. If the change type is an increase in the number of electrical nodes, the grid topology diagram after the change is generated according to the method of increasing the number of electrical nodes.
[0042] It is worth noting that local topology analysis only performs topology analysis on the affected equipment range, and can quickly obtain the changed power grid topology, as well as the changed location and type. The change type referred to in the present invention is an increase in the number of electrical nodes, which means that the changed power grid topology diagram adds electrical nodes on the basis of the original power grid topology diagram, and the node numbers, node self-edge values, and edge values of the changed power grid topology diagram corresponding to the original power grid topology diagram are exactly the same.
[0043] The method of increasing the numbering of electrical nodes refers to adding new nodes to the original power grid topology diagram. The new node number is the number value that increases in sequence from the largest node number in the original power grid topology diagram to generate the changed power grid topology diagram.
[0044] Specifically, Figure 2 (1) is the original power grid topology. After topology search, it can be known that the change type is the increase in the number of electrical nodes, and the number of newly added nodes is 2. The electrical node increase numbering method is implemented. Since the number of newly added nodes is 2 and the maximum node number of the original power grid topology is 4, the numbers of the newly added nodes are 5 and 6 respectively, and the numbers of the remaining nodes and the self-edge values and mutual edge values remain unchanged. The power grid topology after the change is as follows Figure 2 The original power grid factor diagram is shown in (2). Figure 2 As shown in (3).
[0045] S3: Execute the incremental information calculation method according to the original power grid topology diagram and the changed power grid topology diagram.
[0046] In an optional embodiment, the incremental information calculation method described in step S3 includes the following steps:
[0047] Step 11: Subtract the original power grid topology from the changed power grid topology to obtain a temporary incremental graph. The meaning of subtracting the original power grid topology from the changed power grid topology is that the self-edge value of each node in the changed power grid topology is subtracted from the self-edge value of the corresponding node in the original power grid topology, and the edge value of each edge in the changed power grid topology is subtracted from the edge value of the corresponding edge in the original power grid topology. The nodes in the temporary incremental graph are the newly added nodes and the nodes of the original power grid topology connected to the newly added nodes. The edges in the temporary incremental graph are the connection relationship between the newly added nodes and the nodes in the temporary incremental graph. The self-edge value and edge value of the temporary incremental graph are obtained by calculation.
[0048] Step 12: Split the temporary incremental graph into graph C and graph D. The nodes of graph C are the newly added nodes, and the edges of graph C are the connection relationships between the newly added nodes. The self-edge values of the nodes of graph C are the self-edge values of the corresponding nodes of the temporary incremental graph, and the edge values of the edges of graph C are the edge values of the corresponding edges of the temporary incremental graph. Graph D is obtained by subtracting graph C from the temporary incremental graph. The meaning of subtracting graph C from the temporary incremental graph is that the self-edge values of each node of the temporary incremental graph are subtracted from the self-edge values of the corresponding nodes of graph D, and the edge values of each edge of the temporary incremental graph are subtracted from the edge values of the corresponding edges of graph C. Graph C and graph D are used as incremental information.
[0049] Specifically, Figure 2 (2) minus Figure 2 (1), we get Figure 3 (1). Figure 3 (1) is the temporary increment graph of this example. Figure 3 (1) is split into Figure 3 (2) and (3) of which Figure 3 (2) and (3) are Figures C and D in step 12 respectively.
[0050] S4: Based on the original power grid factor graph and incremental information, the electrical node added factor graph correction method based on graph calculation is executed to generate a corrected factor graph.
[0051] In an optional embodiment, the electrical node addition factor graph correction method based on graph calculation in step S4 includes the following steps:
[0052] Step 21: Based on the original power grid factor graph, perform graph-based parallel previous generation operations and normalization operations on graph D to obtain graph u1. It is worth noting that the graph u1 calculated based on the above process has nodes that are newly added nodes and some nodes in the original power grid topology graph, where some nodes in the original power grid topology graph can be obtained by previous generation operations and normalization operations. The edges of graph u1 are the connection relationships between the newly added nodes and some nodes in the original power grid topology graph, and the self-edge values of the nodes are set to 0, and the edge values of the edges are obtained by the above calculations.
[0053] Step 22: Calculate the temporary graph u2 as:
[0054]
[0055] Among them, u2 is the matrix corresponding to the temporary graph u2, C is the matrix corresponding to the graph C, and D d is the diagonal matrix corresponding to the diagonal elements in the original power grid factor graph, and u1 is the triangular matrix corresponding to graph u1. The multiplication in this step refers to the matrix multiplication based on graph calculation, which can be implemented in the graph calculation engine through user-defined algorithms or built-in methods.
[0056] Step 23: Execute the factor decomposition algorithm based on graph calculation on the temporary graph u2 to obtain the temporary graph l, temporary graph d, and temporary graph u3. Since the matrix corresponding to the temporary graph u2 is a symmetric matrix, the temporary graph u3 is the same as the temporary graph l, and only the temporary graph u3 is saved. It is worth noting that the temporary graph d is a one-dimensional graph model. The nodes of the temporary graph d are newly added nodes, and their self-edge values are obtained by factor decomposition. The temporary graph d has no edges. The nodes of the temporary graph u3 are newly added nodes, and its edges are the connection relationships between the newly added nodes. The edge values are obtained by factor decomposition, and the self-edge values are set to 0.
[0057] Step 24: Add the temporary graph u1, temporary graph d, temporary graph u3, and the original power grid factor graph to obtain the modified factor graph. It is worth noting that the graph addition mentioned in this step refers to adding the self-edge values of the same nodes of all graphs as the self-edge values of the corresponding nodes; adding the edge values of the same edges of all graphs as the edge values of the corresponding edges; if a graph G contains nodes that other graphs do not have, then create corresponding new nodes in other graphs, and the new node numbers are consistent with the node numbers in graph G; if a graph G contains edges that other graphs do not have, then create corresponding new edges in other graphs, and the node numbers at both ends of the new edges are consistent with the node numbers in graph G.
[0058] It is worth noting that the same node mentioned in step 24 refers to the same node number; the same edge mentioned in step 24 refers to the same node numbers at both ends of an edge as the same node numbers at both ends of another edge.
[0059] Specifically, Figure 3 (3) is the graph D of this example. Perform the parallel previous generation operation and normalization operation based on graph calculation on graph D to obtain graph u1, as shown in Figure 4 As shown in (1). It can be seen that the nodes of this example graph u1 are the newly added nodes 5 and 6, and the nodes 2, 3, and 4 of the original power grid topology graph connected to the newly added nodes. The edges of u1 are the connection relationship between the newly added nodes and the nodes of the original power grid topology, and there is no connection relationship between the newly added nodes. The self-edge values of all nodes are 0.
[0060] Perform a matrix multiplication-based graph multiplication on u1 to obtain a temporary graph u2, such as Figure 4 (2) is shown in the figure. The matrix corresponding to the diagonal graph Dd in step 22 is Figure 5 (1), the matrix corresponding to Figure C is Figure 5 (2), the matrix corresponding to u1 is Figure 5 (3).
[0061] Execute the factorization algorithm based on graph computing on the temporary graph u2 to obtain temporary graphs d and u3, where d is Figure 4 As shown in (3), we can find that d is a one-dimensional graph, whose nodes are newly added nodes and have no edges. Figure 4As shown in (4), it can be found that the node u3 is a newly added node, the edge is the connection relationship between the newly added nodes, and the edge value of each node is 0. The original power grid factor graph of this example is as follows Figure 2 As shown in (3). Figure 2 (3) Figure 4 Add (1), (3), and (4) to obtain the correction factor graph, as shown in Figure 4 As shown in (5), this figure is similar to Figure 2 The results obtained by directly factoring (2) are completely consistent. However, this example makes full use of the original power grid factor graph information and avoids the inefficiency caused by re-factoring the modified topology graph.
[0062] In an optional embodiment, the parallel previous generation operation and normalization operation based on graph computing in step 23 includes the following steps:
[0063] Step 31: Split graph D into c subgraphs, where c refers to the number of newly added nodes. Each newly added node corresponds to a subgraph, and the nodes of each subgraph are the corresponding newly added node and the nodes in graph D connected to the newly added node. The edges of each subgraph are the connection relationship between the corresponding newly added node and the nodes in graph D connected to the newly added node. The self-edge value and edge value of each subgraph are obtained from graph D. Execute steps 32, 33, and 34 in parallel for all subgraphs.
[0064] Step 32: Generate the path tree union of the original power grid factor graph nodes corresponding to the subgraph in the original power grid factor graph, where the numbers of the original power grid factor graph nodes corresponding to the subgraph are: the numbers of all nodes in the subgraph connected to the newly added nodes. Create a temporary factor graph, which is completely consistent with the original power grid factor graph. Activate all nodes in the path tree union corresponding to the subgraph in the temporary factor graph.
[0065] Step 33: Add a new attribute E to all activated nodes in the temporary factor graph, and set the value of E to the edge value between the newly added node and the corresponding activated node in the subgraph.
[0066] Step 34: Execute the E-value correction algorithm based on graph parallel computing.
[0067] Step 35: When all subgraphs have completed steps 32, 33, and 34, create graph u1. The nodes of u1 include the newly added nodes and the nodes of the union of all subgraph path trees. The self-edge values of all nodes are 0. The newly added nodes are only connected to the nodes of the union of the path trees of their corresponding subgraphs. The edge values of the two are the E values of the corresponding nodes of the union of the path trees in the subgraph.
[0068] In an optional embodiment, the E-value correction algorithm based on graph parallel computing in step 34 includes the following steps:
[0069] Step 41: The node with the smallest node number among all activated nodes is used as the root node. If there is no activated node, go to step 44.
[0070] Step 42: Use graph parallel computing to correct the E values of all activated nodes connected to the root node. The correction method is: subtract the product of the E of the root node and the edge value of the edge between the two nodes from the E of the node connected to the root node.
[0071] Step 43: Set the current root node to an inactive state and execute step 41.
[0072] Step 44: Use graph parallel computing to simultaneously correct the E values of the nodes included in the union of all path trees. The correction method is to divide the E of the nodes included in the union of all path trees by the self-edge value of the node. The algorithm ends.
[0073] Specifically, Figure 6 (1) is the graph D of this example. Graph D is split into two sub-graphs. Steps 32, 33, and 34 are executed in parallel on the two sub-graphs. The processing of each sub-graph is described separately. It is worth noting that although the processing of the two sub-graphs is described separately, the two sub-graphs are actually processed in parallel.
[0074] The first sub-graph is Figure 6 As shown in (2), this subgraph is the subgraph corresponding to the newly added node 5. Its nodes are the newly added node 5 and nodes 2 and 3 connected to the newly added node 5 in graph D. Its self-edge values are all 0, and the mutual edge values are obtained from graph D. Generate the path tree union of nodes 2 and 3 in the subgraph. Since the path tree of node 2 is [2,3,4] and the path tree of node 3 is [3,4], the path tree union of the subgraph is [2,3,4]. Create a temporary factor graph, activate nodes 2, 3, and 4 in the temporary factor graph, and create a new attribute E in the activated nodes. The value of E is obtained from the edge value of the corresponding edge of the subgraph. The result is as follows: Figure 6 As shown in (3), the dotted line represents the newly added attribute E. Execute the E value correction algorithm based on graph parallel computing. Take node 2 as the root node, and correct the E values of nodes 3 and 4 connected to node 2 in parallel. The result is as follows Figure 6 As shown in (4). Taking node 3 as the root node, correct the E value of node 4 connected to node 3. After the execution is completed, the E values of nodes 2, 3, and 4 are divided by their own edge values in parallel, and the result is as follows Figure 6 As shown in (5), the E value of the first sub-graph is corrected.
[0075] The second sub-graph is Figure 6As shown in (6), this subgraph is the subgraph corresponding to the newly added node 6. Its nodes are the newly added node 6 and the node 3 connected to the newly added node 6 in the graph D. Its self-edge values are all 0, and the mutual edge values are obtained from the graph D. Generate the path tree union of node 3 in the subgraph. Since the path tree of node 3 is [3,4], the path tree union of the subgraph is [3,4]. Create a temporary factor graph, activate nodes 3 and 4 in the temporary factor graph, and create a new attribute E in the activated node. The value of E is obtained from the edge value of the corresponding edge of the subgraph. The result is as follows Figure 6 As shown in (7), the dotted line represents the newly added attribute E. Execute the E value correction algorithm based on graph parallel computing. Take node 3 as the root node and correct the E value of node 4 connected to node 3. The result is as follows Figure 6 After the execution is completed, the E values of nodes 3 and 4 are divided by their own edge values, and the result is Figure 6 As shown in (9), the E value of the second sub-graph is corrected.
[0076] When both sub-graphs are corrected, follow step 35 to obtain graph u1, as shown in Figure 6 As shown in (10) in .
[0077] The method for quickly generating a factor graph after the addition of electrical nodes based on graph calculation provided in this embodiment completely describes the whole process of the method for quickly generating a factor graph when the type of change is an increase in the number of electrical nodes and the number of nodes added is 2. Since the main data in the process of rapid change of the factor graph are modeled as a graph model, and the main matrix operation processes are designed as graph calculation forms, the present invention can fully utilize the storage advantages of the graph database, such as short information transmission time and fast query speed, and the computational advantages of reducing unnecessary operations. At the same time, the present invention fully explores the parallel points in the algorithm, and further improves the efficiency of the algorithm based on graph parallel computing. Finally, the proposed method only makes local corrections to the original power grid factor table, avoiding the time loss of full factor decomposition, and significantly improving the speed of factor table generation in the scenario of increased electrical nodes.
[0078] Example 2, reference Figure 7 , which is the second embodiment of the present invention, is different from the previous embodiment in that it provides a system for quickly generating a factor graph after a power grid node split based on graph calculation, including: an initialization module, a module for generating a power grid topology graph after a change, a module for calculating incremental information of a power grid topology, and a module for generating a correction factor graph.
[0079] The initialization module is used to generate the original power grid topology map according to the power grid data, and perform factor decomposition based on graph calculation to obtain the original power grid factor map.
[0080] The module for generating the grid topology after the change is used to determine the type of grid topology change through local topology analysis after the grid topology changes. If the change type is an increase in the number of electrical nodes, the grid topology after the change is generated according to the method of increasing the number of electrical nodes.
[0081] The grid topology incremental information calculation module is used to execute the incremental information calculation method based on the original grid topology map and the changed grid topology map to generate incremental information.
[0082] The correction factor graph generation module is used to execute the electrical node increase factor graph correction method based on graph calculation according to the original power grid factor graph and incremental information to generate a corrected factor graph.
[0083] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0084] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0085] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0086] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0087] Embodiment 3 is the third embodiment of the present invention. It is different from the first two embodiments in that it is used to verify the technical effects adopted in the present invention so as to verify the real effects of the method.
[0088] Traditional methods mainly refer to factor decomposition and edge addition method. After the electrical nodes are split, the factor decomposition method directly regenerates the factor table for the power grid model, without utilizing the information in the original power grid factor table, which results in a long time consumption. The edge addition method uses relational database and matrix operation technology to process the reconstruction of the factor table, which belongs to a serial design structure and cannot fully utilize the performance of modern computer hardware. It is inefficient when dealing with large-scale power grid models.
[0089] This embodiment compares the traditional method with the method of the present invention. The traditional method includes factor decomposition and edge addition method, which are named as traditional method 1 and 2 respectively. The detection comparison results are shown in Table 1 and Table 2 below:
[0090] Table 1 Comparison table between traditional method 1 and the method of the present invention
[0091]
[0092] Table 2 Comparison table of traditional method 2 and the method of the present invention
[0093]
[0094] As can be seen from the above table, the method of the present invention has shown significant performance improvement under various simulation conditions. When the number of newly added nodes is small, the speed of the proposed method is significantly greater than that of the traditional factor decomposition method. Even when the number of newly added nodes has reached 800, the speed can still be increased by more than 1 times. In the actual production application of the power grid, the number of newly added nodes generally does not exceed two digits. This comparative case verifies the excellent performance of the method of the present invention. At the same time, the method of the present invention can increase the speed by about 10 times (12-thread hardware environment) compared with the serial edge addition method, which is very close to the physical acceleration upper limit, proving the superiority of the method of the present invention in parallel design. This performance improvement is mainly attributed to the use of graph computing methods such as parallel predecessors and normalization operations based on graph computing, graph-based sparse matrix multiplication, etc. in the method of the present invention, and parallel processing strategies are designed in multiple links. At the same time, unnecessary zero element storage and calculation are eliminated by reasonably constructing the graph model.
[0095] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A method for quickly generating factor graphs after node splitting of power grid based on graph computing, characterized in that: include: S1: Generate the original power grid topology map according to the power grid data, and perform factor decomposition based on graph calculation to obtain the original power grid factor graph; S2: After the grid topology changes, the type of grid topology change is determined through local topology analysis. If the change type is an increase in the number of electrical nodes, a grid topology diagram after the change is generated according to the method for increasing the number of electrical nodes; S3: executing an incremental information calculation method according to the original power grid topology diagram and the changed power grid topology diagram to generate incremental information; S4: Based on the original power grid factor graph and incremental information, the electrical node added factor graph correction method based on graph calculation is executed to generate a corrected factor graph.
2. The method for quickly generating a factor graph after node splitting of a power grid based on graph computing according to claim 1, characterized in that: The original power grid topology diagram refers to a graph model established based on a matrix describing specific information of the power grid before the addition of electrical nodes occurs in the actual power grid; The post-change power grid topology diagram refers to a graph model established by a matrix describing specific power grid information after the actual power grid has an increase in electrical nodes; The factor decomposition algorithm based on graph computing refers to factoring the matrix corresponding to the graph, also known as triangular decomposition. The decomposition process uses graph computing methods, and the decomposition results are stored according to the graph; The original power grid factor graph refers to a graph model established based on a factor table matrix, and the factor table refers to a factor table obtained by factorizing a matrix describing specific information of a power grid before an electrical node is added to the actual power grid; The increase in the number of nodes means that the changed power grid topology diagram adds electrical nodes based on the original power grid topology diagram, and the node numbers, node self-edge values, and edge values of the changed power grid topology diagram corresponding to the original power grid topology diagram are exactly the same.
3. The method for quickly generating a factor graph after node splitting of a power grid based on graph computing according to claim 1, characterized in that: The local topology analysis only performs topology analysis on the affected equipment range to obtain the changed power grid topology, as well as the changed location and type; The method for increasing the numbering of electrical nodes refers to adding new nodes to the original power grid topology diagram, and the new node numbers are number values that increase in sequence from the largest node number in the original power grid topology diagram to generate a changed power grid topology diagram.
4. The method for quickly generating a factor graph after node splitting of a power grid based on graph computing according to claim 1, characterized in that: The incremental information calculation method comprises: Step 11: subtract the original power grid topology map from the changed power grid topology map to obtain a temporary incremental map, wherein the subtraction of the changed power grid topology map from the original power grid topology map is the subtraction of the self-edge value of each node in the changed power grid topology map from the self-edge value of the corresponding node in the original power grid topology map, and the subtraction of the edge value of each edge in the changed power grid topology map from the edge value of the corresponding edge in the original power grid topology map. The nodes in the temporary incremental map are the newly added nodes and the nodes of the original power grid topology map connected to the newly added nodes. The edges in the temporary incremental map are the connection relationship between the newly added nodes and the nodes in the temporary incremental map. The self-edge value and edge value of the temporary incremental map are obtained by calculation. Step 12: Split the temporary incremental graph into graph C and graph D. The nodes of graph C are the newly added nodes, the edges of graph C are the connection relationships between the newly added nodes, the self-edge values of the nodes of graph C are the self-edge values of the corresponding nodes of the temporary incremental graph, the edge values of the edges of graph C are the edge values of the corresponding edges of the temporary incremental graph, and graph D is obtained by subtracting graph C from the temporary incremental graph, where the temporary incremental graph minus graph C is the self-edge values of each node of the temporary incremental graph minus the self-edge values of the corresponding nodes of graph D, and the edge values of each edge of the temporary incremental graph minus the edge values of the corresponding edges of graph C, and graphs C and D are used as incremental information.
5. The method for quickly generating a factor graph after node splitting of a power grid based on graph computing according to claim 1, characterized in that: The electrical node addition factor graph correction method based on graph calculation includes: Step 21: According to the original power grid factor graph, perform parallel previous generation operations and normalization operations based on graph calculation on graph D to obtain graph u1, where the nodes of graph u1 are the newly added nodes and some nodes in the original power grid topology graph, where some nodes in the original power grid topology graph are obtained by previous generation operations and normalization operations, and the edges of graph u1 are the connection relationships between the newly added nodes and some nodes in the original power grid topology graph, the self-edge values of the nodes are set to 0, and the edge values of the edges are obtained by calculation; Step 22: Calculate the temporary graph u2 as, Among them, u2 is the matrix corresponding to the temporary graph u2, C is the matrix corresponding to the graph C, and D d is the diagonal matrix corresponding to the diagonal elements in the original power grid factor graph, u1 is the triangular matrix corresponding to graph u1, and * is the matrix multiplication based on graph calculation; Step 23: Execute the factor decomposition algorithm based on graph calculation on the temporary graph u2 to obtain the temporary graph l, temporary graph d, and temporary graph u3. The temporary graph d is a one-dimensional graph model. The nodes of the temporary graph d are newly added nodes. The self-edge values of the temporary graph d are obtained by factor decomposition. The temporary graph d has no edges. The nodes of the temporary graph u3 are newly added nodes. The edges of the temporary graph u3 are the connection relationships between the newly added nodes. The edge values are obtained by factor decomposition, and the self-edge values are set to 0. Step 24: Add the temporary graph u1, temporary graph d, temporary graph u3, and the original power grid factor graph to obtain a modified factor graph. Graph addition refers to adding the self-edge values of the same nodes of all graphs as the self-edge values of the corresponding nodes, and adding the edge values of the same edges of all graphs as the edge values of the corresponding edges. If a graph G contains nodes that other graphs do not have, then create corresponding new nodes in other graphs, and the new node numbers are consistent with the node numbers in graph G. If a graph G contains edges that other graphs do not have, then create corresponding new edges in other graphs, and the node numbers at both ends of the new edges are consistent with the node numbers in graph G. The same node refers to the same node number; The same edge refers to that the node numbers at both ends of an edge are the same as the node numbers at both ends of another edge.
6. The method for quickly generating a factor graph after node splitting of a power grid based on graph computing according to claim 5, characterized in that: The parallel previous generation operation and normalization operation based on graph calculation in step 23 include: Step 31: Split graph D into c subgraphs, where c refers to the number of newly added nodes, each newly added node corresponds to a subgraph, the nodes of each subgraph are the corresponding newly added nodes and the nodes in graph D connected to the newly added nodes, the edges of each subgraph are the connection relationship between the corresponding newly added nodes and the nodes in graph D connected to the newly added nodes, the self-edge value and edge value of each subgraph are obtained from graph D, and steps 32, 33, and 34 are performed on all subgraphs in parallel; Step 32: Generate a path tree union of the nodes of the original power grid factor graph corresponding to the subgraph in the original power grid factor graph, where the numbers of the nodes of the original power grid factor graph corresponding to the subgraph are the numbers of all nodes in the subgraph connected to the newly added nodes, create a temporary factor graph, the temporary factor graph is completely consistent with the original power grid factor graph, and activate all nodes in the path tree union corresponding to the subgraph in the temporary factor graph; Step 33: Add a new attribute E to all activated nodes in the temporary factor graph, and set the value of E to the edge value between the newly added node and the corresponding activated node in the subgraph; Step 34: Execute the E-value correction algorithm based on graph parallel computing; Step 35: When all subgraphs have completed steps 32, 33, and 34, create graph u1. The nodes of u1 include the newly added nodes and the nodes of the union of all subgraph path trees. The self-edge values of all nodes are 0. The newly added nodes are only connected to the nodes of the union of the path trees of their corresponding subgraphs. The edge values of the two are the E values of the corresponding nodes of the union of the path trees in the subgraphs.
7. The method for quickly generating a factor graph after node splitting of a power grid based on graph computing according to claim 6, characterized in that: The E-value correction algorithm based on graph parallel computing in step 34 includes: Step 41: The node with the smallest node number among all activated nodes is taken as the root node. If there is no activated node, execute step 44; Step 42: Use graph parallel computing to correct the E values of all activated nodes connected to the root node. The correction method is to subtract the product of the E of the root node and the edge value between the two nodes from the E of the node connected to the root node. Step 43: Set the current root node to an inactive state, and then execute step 41; Step 44: Use graph parallel computing to simultaneously correct the E values of the nodes included in the union of all path trees. The correction method is to divide the E of the nodes included in the union of all path trees by the self-edge value of the node. The algorithm ends.
8. A system using the method for quickly generating a factor graph after node splitting of a power grid based on graph calculation as claimed in any one of claims 1 to 7, characterized in that: include: Initialization module, post-change power grid topology map generation module, power grid topology incremental information calculation module and correction factor map generation module; The initialization module is used to generate an original power grid topology map according to the power grid data, and perform factor decomposition based on graph calculation to obtain the original power grid factor map; The post-change grid topology map generation module is used to determine the type of grid topology change through local topology analysis after the grid topology changes. If the change type is an increase in the number of electrical nodes, the post-change grid topology map is generated according to the method for increasing the number of electrical nodes; The power grid topology incremental information calculation module is used to execute the incremental information calculation method according to the original power grid topology map and the changed power grid topology map to generate incremental information; The correction factor graph generation module is used to execute an electrical node addition factor graph correction method based on graph calculation according to the original power grid factor graph and incremental information to generate a corrected factor graph.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for quickly generating a factor graph after a power grid node split based on graph calculation according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for quickly generating a factor graph after a power grid node split based on graph calculation according to any one of claims 1 to 7 are implemented.