Method and system for quickly generating factor graph based on local change of power grid topology
By judging the type of power grid topology correction and calculating incremental information, and correcting the factor graph based on graph calculation technology, the problem of low calculation efficiency of factor graph correction in the existing technology is solved, and the rapid generation and efficient correction of factor graphs after the topology changes of power grid are achieved.
Patent Information
- Application Number
- CN202411421238.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-02-14
AI Technical Summary
After the power grid topology changes, the calculation efficiency of generating correction factor graphs is low and takes a long time, making it difficult to meet the needs of static safety analysis of super-large-scale power grids.
By judging the grid topology correction type, calculate the grid topology increment information, and perform factor diagram correction based on the original grid factor diagram to generate the corrected factor diagram. This method uses graph computing technology to avoid unnecessary computing steps and improve storage and computing efficiency.
The rapid correction of the factor graph after the topology of the power grid is achieved, which significantly improves the computing efficiency and storage space utilization, and can handle the rapid correction of the factor table with arbitrary value, meeting the needs of a larger-scale power grid.
Smart Images

Figure CN119442541A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power automation, and in particular to a method and system for quickly generating a factor graph based on local changes in power grid topology. Background Art
[0002] With the continuous development and construction of new power systems, the scale of physical equipment and electrical nodes in the power grid has shown a trend of significant expansion year by year. In view of the current practical needs, the static safety analysis algorithm must be able to quickly and accurately analyze the ultra-large-scale power grid topology to ensure the stability and safety of the power system. Static safety analysis is essentially a method to verify the operating status of the system after the forced exit of the transmission and transformation equipment. During the calculation process, the original power grid topology needs to be repeatedly modified locally, which is reflected in the local changes of the node admittance matrix, and the factor table after the node admittance matrix is modified is generated. Finally, the power flow calculation is performed to solve the power grid status. In most scenarios, the number of nodes in the power grid topology remains unchanged or decreases after the change.
[0003] Existing technologies often reuse LDU decomposition to generate factor tables for each locally modified power grid topology. This method does not consider the cause sub-table information, resulting in a large amount of computing resource loss. Some technologies use factor table correction methods based on relational databases and matrix operations, use data structures such as matrices to store key data, and use rank 1 correction method or factor table local re-decomposition method to solve the corrected factor table. Although this method uses the cause sub-table information, the relational database has the problem of low efficiency in data interaction and querying "association table" information; although matrix operations based on sparse vector technology can avoid zero element operations to eliminate unnecessary calculation steps, the modeling is difficult, the operation logic is complex, and parallel processing is difficult. Traditional technologies based on relational databases and matrix operations are difficult to meet the needs of static security analysis of ultra-large-scale power grids. Although graph computing based on graph data structures can overcome the shortcomings of traditional technologies, graph computing is currently only used in fields such as power flow calculation and topology analysis, and there is little research on factor table correction under power grid topology changes. In addition, the traditional rank 1 correction method can only handle the case where the rank is 1, and lacks a processing method when the rank is greater than 1. Summary of the invention
[0004] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.
[0005] In view of the above existing problems, the present invention is proposed.
[0006] Therefore, the present invention provides a method and system for quickly generating a factor graph based on local changes in power grid topology to solve the problem that the existing method has low computational efficiency and long time consumption in generating a modified factor graph after the power grid topology changes.
[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0008] In a first aspect, an embodiment of the present invention provides a method for quickly generating a factor graph based on a local change in a power grid topology, comprising: when a topology change occurs in an original power grid topology graph, determining a power grid topology correction type according to the change and generating a corrected power grid topology graph;
[0009] Based on the original power grid topology map and the revised power grid topology map, calculating the power grid topology incremental information through the power grid topology correction type;
[0010] According to the original power grid factor graph and the power grid topology incremental information, the factor graph is corrected to generate a corrected factor graph.
[0011] As a preferred solution of the method for quickly generating a factor graph based on local changes in power grid topology described in the present invention, determining the type of power grid topology correction according to the change situation includes:
[0012] When the original power grid topology graph undergoes a topological change, if the node numbers of the changed topology graph and the original power grid topology graph are the same, and only the self-edge value of the node or the edge value of the edge changes, then the power grid topology correction type is determined to be the node number unchanged;
[0013] When the original power grid topology graph undergoes a topological change, if the changed topology graph deletes some nodes and their connected edges on the basis of the original power grid topology graph, and the numbers of the remaining nodes, the values of the self-edges, and the values of the remaining edges remain unchanged, then it is judged that the power grid topology correction type is a reduction in the number of nodes.
[0014] As a preferred solution of the method for quickly generating a factor graph based on local changes in power grid topology described in the present invention, generating a revised power grid topology graph includes:
[0015] When the modification type is that the number of nodes remains unchanged, the node numbers and the connection relationships between nodes in the modified power grid topology are the same as those in the original power grid topology, and the self-edge values of the nodes and the edge values of the edges are the same as those in the modified topology;
[0016] When the correction type is a reduction in the number of nodes, the node numbers and the connection relationships between nodes in the corrected power grid topology are the same as those in the original power grid topology. The self-edge values of the reduced nodes are set to a large number, and the self-edge values and edge values of the remaining nodes are the same as those in the original power grid topology.
[0017] As a preferred solution of the method for quickly generating a factor graph based on local changes in power grid topology described in the present invention, the calculation of the power grid topology incremental information by the power grid topology correction type includes:
[0018] When the correction type in which the number of nodes remains unchanged is executed, the modified power grid topology map is subtracted from the original power grid topology map to obtain a temporary incremental map; eigenvalue decomposition is performed on the matrix corresponding to the temporary incremental map, and b groups of eigenvectors and eigenvalues are extracted from the matrix of the temporary incremental map, each group including an eigenvector and an eigenvalue; each eigenvector is mapped to a first incremental information graph model, which includes a number of isolated nodes, node numbers and self-edge values, and b groups of power grid topology incremental information are obtained based on the positions and values of non-zero elements of the eigenvectors, each group of information including a first incremental information graph model and an eigenvalue;
[0019] When the correction type of reducing the number of nodes is executed, a second incremental information graph model is constructed based on each deleted node, wherein the second incremental information graph model only contains one deleted node and the self-edge value of the node is set to a large number, and each group of second incremental information graph models is paired with a corresponding eigenvalue to obtain the incremental information of the power grid topology.
[0020] As a preferred solution of the method for quickly generating a factor graph based on local changes in power grid topology described in the present invention, the modified factor graph includes:
[0021] Create a temporary factor graph, and the temporary factor graph has the same structure as the original power grid factor graph;
[0022] When all the incremental information of the power grid topology is processed, if the correction type is that the number of nodes remains unchanged, the temporary factor graph is used as the corrected factor graph and the correction is ended; if the correction type is that the number of nodes is reduced, the nodes and their connecting edges removed in the changed topology are deleted from the temporary factor graph, and the temporary factor graph is used as the corrected factor graph and the correction is ended.
[0023] As a preferred solution of the method for quickly generating a factor graph based on local changes in power grid topology described in the present invention, it also includes:
[0024] If there is unprocessed incremental information of power grid topology, a group of unprocessed incremental information of power grid topology is randomly selected, and the nodes contained in the incremental information graph model in the group of incremental information of power grid topology are formed into a first set, and a path tree union of the nodes contained in the first set in the temporary factor graph is generated;
[0025] Activate the nodes in the union of the path trees on the temporary factor graph, and set the activated node with the smallest number as the root node;
[0026] If the current root node number is greater than the largest activated node number, the processing of the incremental information of the power grid topology is completed, and the processing of the incremental information of the power grid topology continues to be judged; if the current root node number is not greater than the largest activated node number, the current root node is corrected, and the correction includes correcting the self-edge value of the root node and then correcting the edge values of all activated nodes connected to the root node;
[0027] Set the state of the current root node to inactive, and use the smallest activated node with a larger number than the current root node as the new root node. If there is no smallest activated node with a larger number than the current root node, increase the root node number by 1 and continue checking the root node.
[0028] When the number of the current root node is greater than the maximum number of all activated nodes and there is no other incremental information, the correction ends.
[0029] In a second aspect, the present invention provides a factor graph rapid generation system based on local changes in power grid topology, including: a modified power grid topology map generation module, which is used to determine the type of power grid topology correction according to the change situation and generate a modified power grid topology map when the original power grid topology map undergoes a topological change;
[0030] A power grid topology incremental information calculation module, used to calculate the power grid topology incremental information based on the original power grid topology map and the revised power grid topology map through the power grid topology correction type;
[0031] The factor graph correction module is used to correct the factor graph according to the original power grid factor graph and the power grid topology incremental information to generate a corrected factor graph.
[0032] As a preferred solution of the factor graph rapid generation system based on local changes in power grid topology described in the present invention, wherein:
[0033] The power grid topology incremental information calculation module includes:
[0034] When the correction type in which the number of nodes remains unchanged is executed, the modified power grid topology map is subtracted from the original power grid topology map to obtain a temporary incremental map; eigenvalue decomposition is performed on the matrix corresponding to the temporary incremental map, and b groups of eigenvectors and eigenvalues are extracted from the matrix of the temporary incremental map, each group including an eigenvector and an eigenvalue; each eigenvector is mapped to a first incremental information graph model, which includes a number of isolated nodes, node numbers and self-edge values, and b groups of power grid topology incremental information are obtained based on the positions and values of non-zero elements of the eigenvectors, each group of information including a first incremental information graph model and an eigenvalue;
[0035] When the correction type of reducing the number of nodes is executed, a second incremental information graph model is constructed based on each deleted node, wherein the second incremental information graph model only contains one deleted node and the self-edge value of the node is set to a large number, and each group of second incremental information graph models is paired with a corresponding eigenvalue to obtain the incremental information of the power grid topology.
[0036] In a third aspect, the present invention provides a computing device, comprising:
[0037] Memory and processor;
[0038] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the method for quickly generating a factor graph based on local changes in power grid topology are implemented.
[0039] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the method for rapidly generating a factor graph based on local changes in power grid topology.
[0040] Compared with the prior art, the present invention has the following beneficial effects: the present invention makes full use of the original power grid factor graph information corresponding to the original power grid topology graph to complete the rapid correction of the factor graph after the power grid topology changes; the main data models required in the local correction process of the power grid factor graph are all modeled as graph models, and the graph model is processed using the graph calculation method. Compared with the traditional technology based on relational database and matrix operation, the storage space utilization efficiency is improved, the problem of low efficiency in data interaction and processing of "association table" information is overcome, and non-essential calculation steps such as zero element calculation are avoided, which significantly improves the storage and calculation efficiency. In addition, the present invention digs out the independent parallel points of each operation step as much as possible, and uses the clone graph technology and graph parallel technology to realize parallel calculation of each independent parallel point, further improving the operation efficiency to meet the demand for rapid generation of factor graphs under the local topology changes of larger-scale power grids, and uses the eigenvalue decomposition based on graph calculation, so that the present invention has the ability to quickly correct the factor table with arbitrary rank. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:
[0042] Figure 1 A method flow chart of a method and system for quickly generating a factor graph based on local changes in power grid topology according to an embodiment of the present invention;
[0043] Figure 2 A schematic diagram of a method for quickly generating a factor graph based on a local change in a power grid topology and a correction diagram of a system with unchanged number of nodes according to an embodiment of the present invention;
[0044] Figure 3 A schematic diagram of a method for quickly generating a factor graph based on local changes in power grid topology and a system for reducing and correcting the number of nodes according to an embodiment of the present invention;
[0045] Figure 4 A schematic diagram of a method and system for quickly generating a factor graph based on local changes in power grid topology according to an embodiment of the present invention, wherein the correction type is a calculation process of incremental information of a power grid topology with a constant number of nodes;
[0046] Figure 5 A schematic diagram of a method and system for quickly generating a factor graph based on local changes in power grid topology according to an embodiment of the present invention, wherein the correction type is a calculation process of incremental information of a power grid topology with a reduction in the number of nodes;
[0047] Figure 6 A factor graph of a 20-node power grid according to a method and system for quickly generating a factor graph based on local changes in power grid topology according to an embodiment of the present invention;
[0048] Figure 7 A schematic diagram of a method for quickly generating a factor graph based on a local change in a power grid topology and a correction method for a factor graph in which the number of nodes remains unchanged according to an embodiment of the present invention;
[0049] Figure 8 A schematic diagram of a process of a factor graph correction method in which the correction type of the factor graph based on local changes in power grid topology and the system is a node number reduction method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the above-mentioned purposes, 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 drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0051] 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.
[0052] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0053] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0054] The relevant terms involved in the embodiments of this application are:
[0055] 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, the nodes and edges of all graphs in this application 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 application 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.
[0056] Original grid topology: refers to a graph model established based on a matrix describing grid-specific information before the actual grid topology changes. The matrix describing grid-specific information refers to all matrices that need to be factorized, including the admittance matrix. The matrices describing grid-specific information in the embodiments of the present application are all symmetric matrices.
[0057] The changed topology graph refers to a graph model established based on the changed matrix describing specific grid information after the actual grid topology changes. In the embodiments of the present application, the changed matrices describing specific grid information are all symmetric matrices.
[0058] Corrected power grid topology diagram: refers to the power grid topology diagram obtained by performing corresponding correction methods on the original power grid topology diagram and the changed topology diagram according to the correction type.
[0059] Original power grid factor graph: refers to a graph model established based on a factor table matrix, where the factor table refers to the factor table obtained after the matrix describing the specific information of the power grid is factorized before the actual power grid topology changes.
[0060] Modified factor graph: refers to a graph model established based on a factor table matrix, where the factor table refers to the factor table obtained after the matrix describing the specific information of the power grid is factorized after the actual power grid topology changes.
[0061] 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.
[0062] Path tree union: Path tree union, also called road tree, refers to the union of path trees of multiple nodes.
[0063] Example 1
[0064] Reference Figure 1 to Figure 5 , is an embodiment of the present invention, which provides a method for quickly generating a factor graph based on local changes in power grid topology, including:
[0065] S1: When the original power grid topology map undergoes a topology change, the power grid topology correction type is determined according to the change and a corrected power grid topology map is generated;
[0066] In the embodiment of the present application, judging the type of power grid topology correction according to the change situation includes:
[0067] When the original power grid topology graph undergoes a topological change, if the node numbers of the changed topology graph and the original power grid topology graph are the same, and only the self-edge value of the node or the edge value of the edge changes, then the power grid topology correction type is determined to be the node number unchanged;
[0068] When the original power grid topology graph undergoes a topological change, if the changed topology graph deletes some nodes and their connected edges on the basis of the original power grid topology graph, and the numbers of the remaining nodes, the values of the self-edges, and the values of the remaining edges remain unchanged, then it is judged that the power grid topology correction type is a reduction in the number of nodes.
[0069] In an optional embodiment, if the self-edge values of the remaining nodes in the topological graph other than the deleted node change after the change, or the edge values of the remaining edges other than the deleted edge change, it can be processed first according to the type of unchanged number of nodes, and then processed according to the type of reduced number of nodes.
[0070] In an embodiment of the present application, generating a modified power grid topology diagram includes:
[0071] When the modification type is that the number of nodes remains unchanged, the node numbers and the connection relationship between nodes in the modified power grid topology are the same as those in the original power grid topology, and the self-edge values of the nodes and the edge values of the edges are the same as those in the modified topology;
[0072] When the correction type is a reduction in the number of nodes, the node numbers and the connection relationships between nodes in the corrected power grid topology are the same as those in the original power grid topology. The self-edge values of the reduced nodes are set to a large number, and the self-edge values and edge values of the remaining nodes are the same as those in the original power grid topology.
[0073] It should be noted that in the embodiment of the present application, the self-edge value of the reduced node is set to a large number in order to simulate the situation where the node has been removed or is unavailable in the actual power grid. The self-edge value setting can be set to 10 6 . Specifically, when the modification type is a reduction in the number of nodes, that is, when the grid topology changes and some nodes are deleted, in order to indicate in the mathematical model that the nodes have actually been deleted, but do not want to remove them directly from the graph to avoid complex reconstruction operations, the self-edge values of these nodes will be set to a large number. In the subsequent calculation process, the paths or connections involving these nodes will not be selected due to high costs, thereby effectively achieving the purpose of removing these nodes.
[0074] In an optional embodiment, if Figure 2 As shown, Figure 2 (1) is the original power grid topology diagram. Figure 2 (2) is the topology after the change. It can be seen that the modification type is that the number of nodes remains unchanged. Therefore, the node number and connection relationship between nodes of the modified power grid topology are consistent with those of the original power grid topology. The self-edge value and edge value are consistent with the changed topology. Figure 1 The corrected grid topology is as follows: Figure 2 As shown in (3). Figure 2 (1), (2), and (3) in the figure are all four-node power grid topology diagrams, with nodes numbered 1 to 4. The edge value of each node is represented by an arc, and the edge value of each edge is represented near the edge. Figure 2 The self-edge value of node 2 in (1) is 2, and the mutual edge value between nodes 2 and 3 is -1.
[0075] In an optional embodiment, if Figure 2 As shown, Figure 3 (1) is the original power grid topology diagram. Figure 3 (2) is the topology after the change. It can be seen that the modification type is the reduction of the number of nodes. Therefore, the node numbers of the modified power grid topology are consistent with those of the original power grid topology, and the connection relationship between the nodes is consistent. The self-edge value of the reduced node is set to a large number, and the large number is set to 10. 6, the self-edge values and edge values of all other nodes are completely consistent with the original power grid topology. The topology after the change is as follows Figure 3 As shown in (3) in .
[0076] S2: Based on the original power grid topology map and the revised power grid topology map, the power grid topology incremental information is calculated through the power grid topology correction type;
[0077] In an embodiment of the present application, calculating the grid topology incremental information by the grid topology correction type includes:
[0078] When the correction type with unchanged number of nodes is executed, the temporary incremental graph is obtained by subtracting the corrected power grid topology graph from the original power grid topology graph.
[0079] Among them, the temporary incremental graph obtained by subtracting the corrected power grid topology graph from the original power grid topology graph is obtained by subtracting the self-edge value of each node in the corrected power grid topology graph from the self-edge value of the original power grid topology graph, and the edge value of the edge in the corrected power grid topology graph from the edge value of the corresponding edge in the original power grid topology graph.
[0080] Perform eigenvalue decomposition on the matrix corresponding to the temporary incremental graph, extract b groups of eigenvectors and eigenvalue combinations from the matrix of the temporary incremental graph, each group contains an eigenvector and an eigenvalue; map each eigenvector to a first incremental information graph model, which contains a number of isolated nodes, node numbers and self-edge values, and obtain b groups of power grid topology incremental information based on the positions and values of the non-zero elements of the eigenvector, each group of information includes a first incremental information graph model and an eigenvalue.
[0081] The incremental information graph model is a one-dimensional graph model, which uses the feature vector to build a one-dimensional graph model. The one-dimensional graph model has only isolated nodes and no edges. The node numbers in the graph model are the serial numbers of the corresponding non-zero elements in the feature vector, and the self-edge values of the nodes in the graph model are the corresponding non-zero element values in the corresponding feature vector.
[0082] Exemplarily, the matrix corresponding to the temporary incremental graph is decomposed into a temporary working matrix A and a temporary diagonal matrix B. When the number of nodes of the temporary incremental graph is a and the rank of the matrix corresponding to the temporary incremental graph is b, the dimension of the temporary working matrix A is a*b, and the dimension of the temporary diagonal matrix B is b*b. The eigenvectors in the temporary working matrix A and the eigenvalues in the temporary diagonal matrix B are divided into b groups according to the corresponding relationship, and each group has an eigenvector and an eigenvalue. After the eigenvector is modeled as a one-dimensional graph model, it is named the incremental information graph model, combined with the corresponding eigenvalue, as a group of topology incremental information, and a total of b groups of power grid topology incremental information are obtained.
[0083] In an optional embodiment, if Figure 4 As shown, Figure 4 (1) in Figure 2Incremental information graph of the represented instance. Figure 4 (2) in is the matrix corresponding to the incremental information graph of this example. Figure 4 (3) and (4) are the temporary working matrix A and the temporary diagonal matrix B. Since the rank of the matrix corresponding to the incremental information graph is 2, it can be divided into two groups of incremental information. Figure 4 (5) and (6) are the two sets of incremental information obtained.
[0084] When the correction type of reducing the number of nodes is executed, a second incremental information graph model is constructed based on each deleted node, the second incremental information graph model only contains one deleted node and the self-edge value of the node is set to a large number, and each group of second incremental information graph models is paired with a corresponding eigenvalue to obtain the incremental information of the power grid topology.
[0085] Exemplarily, when the number of nodes reduced is e, the power grid topology incremental information includes a total of e groups of power grid topology incremental information, each group of power grid topology incremental information includes an incremental information graph model and a corresponding eigenvalue. All eigenvalues are 1, all incremental information graph models contain only one corresponding deleted node, and the node's self-edge value is 10 6 , there are no other nodes.
[0086] In an alternative embodiment, Figure 5 for Figure 3 The power grid topology incremental information of the represented instance has only one set of power grid topology incremental information because only one node is deleted. Therefore, the embodiment of the present application has only one set of power grid topology incremental information.
[0087] S3: According to the original power grid factor graph and the power grid topology incremental information, the factor graph is corrected to generate a corrected factor graph;
[0088] It should be noted that the core data in the factor graph rapid generation method are all modeled as graph models, unnecessary calculation steps are removed as much as possible, the parallel points in the method are fully explored, and the distributed parallel computing capabilities of graph computing are used to improve the efficiency of rapid factor graph generation under local changes in large-scale power grid topology.
[0089] In the embodiment of the present application, the correction factor graph includes:
[0090] Create a temporary factor graph, and the temporary factor graph has the same structure as the original power grid factor graph;
[0091] When all the incremental information of the power grid topology is processed, if the correction type is that the number of nodes remains unchanged, the temporary factor graph is used as the corrected factor graph and the correction is ended; if the correction type is that the number of nodes is reduced, the nodes and their connecting edges removed in the changed topology are deleted from the temporary factor graph, and the temporary factor graph is used as the corrected factor graph and the correction is ended.
[0092] In the embodiment of the present application, it also includes:
[0093] If there is unprocessed incremental information of power grid topology, a group of unprocessed incremental information of power grid topology is randomly selected, and the nodes contained in the incremental information graph model in the group of incremental information of power grid topology are formed into a first set, and a path tree union of the nodes contained in the first set in the temporary factor graph is generated;
[0094] Specifically, the path tree union generation method includes:
[0095] The numbers of all nodes whose path trees need to be found are grouped into the first set T1. A second set T2 is created to store the union of the found path trees, and T2 is initially equal to T1. The number of program computing units is c, and c groups of independent computing programs can be executed simultaneously. The largest node number of the temporary factor graph is k.
[0096] Perform the following steps in parallel for c computational programs:
[0097] Step 1: Select the node with the smallest number from T1 for processing and use it as the root node of the corresponding calculation program. The node numbers selected by different calculation programs are inconsistent. If there is no node to select, execute step 6.
[0098] Step 2: Determine whether the root node number is equal to k. If so and T2 does not contain k, add it to T2 and execute step 4. Otherwise, traverse all nodes connected to the root node and with a number greater than the root node, and use the node with the smallest number as the new root node. If T2 does not contain the root node number, add the root node to set T2 and execute step 3. If T2 already contains the root node number, execute step 4.
[0099] Step 3: Follow step 2.
[0100] Step 4: Delete all elements in T2 from T1. If the number of elements in T1 is greater than or equal to 1, proceed to step 5, otherwise proceed to step 6.
[0101] Step 6: The calculation unit is processed. If all calculation units are processed, the algorithm ends and the elements in T2 are sorted from small to large as the path tree union. Otherwise, wait for other calculation units to be processed.
[0102] Activate the nodes in the path tree union on the temporary factor graph, and set the activated node with the smallest number as the root node; if the current root node number is greater than the activated node with the largest number, the processing of the incremental information of the power grid topology of this group is completed, and continue to judge the processing status of the incremental information of the power grid topology; if the current root node number is not greater than the activated node with the largest number, perform a correction on the current root node, which includes correcting the self-edge value of the root node and then correcting the edge values of all activated nodes connected to the root node.
[0103] Specifically, the correction algorithm includes:
[0104] Create intermediate variables k1 and k2; define b i is the self-edge value of the node numbered i in the incremental information graph; d is the self-edge value of the root node in the temporary factor graph; u ij is the edge value between the node numbered i and the node numbered j in the temporary factor graph; a is the eigenvalue of this group of incremental information; the root node is numbered m, and the number of activated nodes except the root node is N.
[0105] Correct the boundary values and intermediate variables, and the corrected formula is:
[0106] k1=a* b m
[0107] d=d+k1*b m
[0108] k2=k1 / d
[0109] a=a-k1*k2
[0110] When an activated node number is n, the edge value u of the temporary factor graph mn The correction formula is:
[0111] b n =b n -u mn *b m
[0112] u mn =u mn +k2 * b n
[0113] At the same time, the aforementioned correction formula is executed in parallel on N activated nodes to complete the correction of the edges between all activated nodes and the root node.
[0114] It should be noted that the numbers of activated nodes are greater than or equal to the number of the root node.
[0115] Set the state of the current root node to inactive, and use the smallest activated node with a larger number than the current root node as the new root node. If there is no smallest activated node with a larger number than the current root node, increase the root node number by 1 and continue checking the root node.
[0116] When the number of the current root node is greater than the maximum number of all activated nodes and there is no other incremental information, the correction ends.
[0117] The above is a schematic scheme of a method for rapidly generating factor graphs based on local changes in power grid topology in this embodiment. It should be noted that the technical scheme of the system for rapidly generating factor graphs based on local changes in power grid topology and the technical scheme of the method for rapidly generating factor graphs based on local changes in power grid topology mentioned above belong to the same concept. For details not described in detail in the technical scheme of the system for rapidly generating factor graphs based on local changes in power grid topology in this embodiment, please refer to the description of the technical scheme of the method for rapidly generating factor graphs based on local changes in power grid topology mentioned above.
[0118] In this embodiment, a factor graph rapid generation system based on local changes in power grid topology includes:
[0119] A modified power grid topology map generation module is used to determine the type of power grid topology correction according to the change situation and generate a modified power grid topology map when the original power grid topology map undergoes a topology change;
[0120] A power grid topology incremental information calculation module, used to calculate the power grid topology incremental information based on the original power grid topology map and the revised power grid topology map through the power grid topology correction type;
[0121] The factor graph correction module is used to correct the factor graph according to the original power grid factor graph and the power grid topology incremental information to generate a corrected factor graph.
[0122] In the embodiment of the present application, the power grid topology incremental information calculation module includes:
[0123] When the correction type in which the number of nodes remains unchanged is executed, a temporary incremental graph is obtained by subtracting the corrected power grid topology graph from the original power grid topology graph; eigenvalue decomposition is performed on the matrix corresponding to the temporary incremental graph, and b groups of eigenvectors and eigenvalues are extracted from the matrix of the temporary incremental graph, each group including an eigenvector and an eigenvalue; each eigenvector is mapped to a first incremental information graph model, which includes a number of isolated nodes, node numbers and self-edge values, and b groups of power grid topology incremental information are obtained based on the positions and values of non-zero elements of the eigenvectors, each group of information including a first incremental information graph model and an eigenvalue;
[0124] When the correction type of reducing the number of nodes is executed, a second incremental information graph model is constructed based on each deleted node, the second incremental information graph model only contains one deleted node and the self-edge value of the node is set to a large number, and each group of second incremental information graph models is paired with a corresponding eigenvalue to obtain the incremental information of the power grid topology.
[0125] In an optional embodiment, the modified power grid topology map generation module includes a modification type judgment module and a modified topology map generation unit. The modification type judgment unit can judge the modification type according to the difference between the input modified topology map and the original power grid topology map. The modification type includes a reduction in the number of nodes and an unchanged number of nodes. If it does not belong to these two types, a data exception is returned. The modified topology map generation unit can execute corresponding processing methods for different modification types according to the results output by the modification type judgment module, and output a modified power grid topology map.
[0126] In an optional embodiment, the power grid topology incremental information calculation unit includes a graph subtraction unit and an eigenvalue decomposition unit. The graph subtraction unit can adaptively select a serial or parallel algorithm according to the graph scale to implement a fast custom graph subtraction function; the eigenvalue decomposition unit can perform eigenvalue decomposition on the sparse matrix corresponding to the input temporary incremental graph, and process the results of the eigenvalue decomposition into multiple groups of power grid topology incremental information.
[0127] In an optional embodiment, the factor graph correction module includes a path tree union generation unit and an E-value correction unit. The path tree union generation unit can use parallel computing technology to quickly obtain the path tree union of the selected node on the selected graph; the E-value correction unit can use hierarchical parallelism and full-node parallelism technology to realize the correction of the E-value of the input graph.
[0128] This embodiment further provides a computing device, which is applicable to the method for quickly generating a factor graph based on a local change in power grid topology, and includes:
[0129] A memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute computer executable instructions to implement the method for quickly generating a factor graph based on local changes in power grid topology as proposed in the above embodiment.
[0130] This embodiment further provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for quickly generating a factor graph based on local changes in power grid topology proposed in the above embodiment is implemented.
[0131] The storage medium proposed in this embodiment and the method for quickly generating a factor graph based on local changes in the power grid topology proposed in the above embodiment belong to the same inventive concept. The technical details not described in detail in this embodiment can be found in the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0132] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ReadOnly, Memory, ROM), random access memory (RandomAccess Memory, RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform the methods of various embodiments of the present invention.
[0133] Example 2
[0134] Reference Figures 1 to 8 , is an embodiment of the present invention. This embodiment is different from the first embodiment in that it provides a factor graph correction method to verify the beneficial effects of the present invention.
[0135] In this embodiment, the factor graph corresponding to a 20-node power grid topology graph is drawn as Figure 6 , use the path tree generation method to obtain the path tree union of nodes 5, 8, 10, 12, and 16 in parallel. The number of computing units c = 2, and the two computing units are called c1 and c2 respectively. T1 = {5, 8, 10, 12, 16}, T2 = {}, and the largest node number k in the factor graph is 20.
[0136] Select the two nodes with the smallest numbers from T1 for parallel processing. c1 selects node 5 as the root node, c2 selects node 8 as the root node, and adds 5 and 8 to T2, T2 = {5, 8}. All nodes connected to the root nodes 5 and 8 and with numbers greater than the root node are {13, 20} and {15, 18}, so add 13 and 15 to T2, T2 = {5, 8, 13, 15}, and use 13 and 15 as new root nodes.
[0137] All nodes connected to the root nodes 13 and 15 and with numbers greater than the root nodes are {18, 19, 20} and {17, 18, 20} respectively, so 18 and 17 are added to T2, T2 = {5, 8, 13, 15, 17, 18}, and 18 and 17 are used as new root nodes.
[0138] All nodes connected to the root nodes 18 and 17 and with numbers greater than the root nodes are {19, 20} and {18, 19, 20} respectively, so 19 and 18 are used as root nodes. Since 18 is already included in T2, c2 no longer searches for the path tree of this node and deletes all elements contained in T2 in T1. T1 = {10, 12, 16}. c2 uses 10 as the new root node, and c1 uses 19 as the new root node. 10 and 19 are added to T2. T2 = {5, 8, 10, 13, 15, 17, 18, 19}.
[0139] All nodes connected to root nodes 19 and 10 and with numbers greater than the root nodes are {20} and {13, 18} respectively. 20 and 13 are used as root nodes. 20 is added to T2, T2 = {5, 8, 10, 13, 15, 17, 18, 19, 20}. Since the number of root node 20 is greater than or equal to k, and 13 is already in T2, all elements contained in T2 are deleted from T1, T1 = {12, 16}. c1 uses 12 as the new root node, c2 uses 16 as the new root node, and 12 and 16 are added to T2, T2 = {5, 8, 10, 12, 13, 15, 16, 17, 18, 19, 20}.
[0140] All nodes connected to the root nodes 12 and 16 and with numbers greater than the root nodes are {15, 20} and {17, 19, 20} respectively, so 15 and 17 are taken as root nodes. Since 15 and 17 are both in T2, all elements contained in T2 are deleted from T1, T1 is an empty set, and both computing units are processed. Therefore, the path tree union is T2 = {5, 8, 10, 12, 13, 15, 16, 17, 18, 19, 20}.
[0141] Figure 7 (1) represents Figure 2 The original power grid factor diagram corresponding to (1) in . Figure 4 It can be seen that this example has two sets of incremental information. The original power grid factor graph needs to be corrected according to each set of incremental information. The correction type of this example is that the number of nodes remains unchanged. First, a temporary factor graph is created. The temporary factor graph is completely consistent with the original power grid factor graph, so it is still used. Figure 7 (1) in . Select the first set of incremental information with a feature value of 1. It can be seen that the node numbers in the first set of incremental information are 2 and 3. Execute the path tree generation algorithm to obtain the path tree union as follows Figure 7 As shown in (2) in , we can see that the nodes in the path tree union are numbered 2, 3, and 4. Activate the nodes numbered 2, 3, and 4 in the temporary factor graph and obtain Figure 7 (3) in . Set node 2 as the root node, first correct the self-edge value of node 2, then correct the edge values between node 2 and node 3, and between node 2 and node 4 in parallel. The corrected result is as follows Figure 7As shown in (4) in . Set node 2 to an inactive state, take node 3 as the root node, first correct the self-edge value of node 3, then correct the mutual edge value of node 3 and node 4. The corrected result is as follows Figure 7 As shown in (5) in . Set node 3 to an inactive state, take node 4 as the root node, and first correct the self-edge value of node 4. Since there is no activated node with a larger number than node 4, the processing of this group of incremental information is completed, and the temporary factor graph is obtained as Figure 7 (7) in the following. Figure 7 (7) in the figure is used as the temporary factor graph processed by the second set of incremental information. The second set of incremental information is processed in the same way and the process is recorded as Figure 7 (8), (9), (10), (11), (12) in the above. Finally, the temporary factor graph is obtained as Figure 7 As shown in (13) in , it is assigned to the modified factor graph, and the whole algorithm ends. It should be noted that for the convenience of understanding, Figure 7 Only the activated nodes are drawn, because the self-edge values and edge values of the undrawn nodes and edges remain unchanged, so they are omitted. When the processing of this group of incremental information is completed, all omitted nodes and edges are displayed again. Figure 8 Since the node number reduction example represented is relatively simple, the entire factor graph is displayed without any omissions.
[0142] Specifically, Figure 8 (1) represents Figure 3 The original power grid factor graph corresponding to (1) in . Figure 5 It can be seen that this example has a set of incremental information, and the correction type is the reduction of the number of nodes. First, a temporary factor graph is created. The temporary factor graph is completely consistent with the original power grid factor graph, so it is still used Figure 8 (1) in . Select the incremental information, and we know that the feature value in the incremental information is 1 and the node number is 3. Execute the path tree generation algorithm and obtain the path tree union as follows Figure 8 As shown in (2), we can see that the nodes in the path tree union are numbered 3 and 4. Activate the nodes numbered 3 and 4 in the temporary factor graph, set node 3 as the root node, and first correct the self-edge value of node 3. The result is as follows Figure 8 Then the edge values of nodes 3 and 4 are corrected, and the corrected result is as follows: Figure 8 As shown in (4) in . Set node 3 to an inactive state, take node 4 as the root node, and first correct the self-edge value of node 4. The corrected result is as follows Figure 8 As shown in (5), since there is no edge between the activated node and node 4, the edge value is not corrected. Node 4 is set to an inactive state. Since there is no activated node with a larger number than node 4, the processing of this group of incremental information is completed, and the temporary factor graph is obtained as Figure 8(5) in . Delete the deleted nodes in the temporary factor graph and obtain Figure 8 (6) in the figure. This figure is directly related to Figure 3 The factorization results of (2) in are exactly the same.
[0143] The method for rapidly generating factor graphs under local changes in the power grid topology provided by the present invention completely describes the whole process of the method for rapidly generating factor graphs when the correction type is that the number of nodes remains unchanged and the matrix rank corresponding to the temporary incremental graph is 2, and describes the whole process of the method for rapidly generating factor graphs when the correction type is that the number of nodes is reduced and the number of reductions is 1. Since the main data in the process of rapid changes of the factor graph are modeled as graph models and the main matrix operation processes are designed as graph calculation forms, the present invention can make full use of the storage advantages of the graph database with short information transmission time and fast query speed and the computing advantages of reducing unnecessary operations, thereby improving the efficiency of local correction of factor graphs. 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.
[0144] 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 based on local changes in power grid topology, characterized in that: include: When the original power grid topology map undergoes a topological change, the power grid topology correction type is determined according to the change and a corrected power grid topology map is generated; Based on the original power grid topology map and the revised power grid topology map, calculating the power grid topology incremental information through the power grid topology correction type; According to the original power grid factor graph and the power grid topology incremental information, the factor graph is corrected to generate a corrected factor graph.
2. The method for rapidly generating a factor graph based on local changes in power grid topology according to claim 1, characterized in that: The types of grid topology corrections determined based on the changes include: When the original power grid topology graph undergoes a topological change, if the node numbers of the changed topology graph and the original power grid topology graph are the same, and only the self-edge value of the node or the edge value of the edge changes, then the power grid topology correction type is determined to be the node number unchanged; When the original power grid topology graph undergoes a topological change, if the changed topology graph deletes some nodes and their connected edges on the basis of the original power grid topology graph, and the numbers of the remaining nodes, the values of the self-edges, and the values of the remaining edges remain unchanged, then it is judged that the power grid topology correction type is a reduction in the number of nodes.
3. The method for rapidly generating a factor graph based on local changes in power grid topology according to claim 2, characterized in that: Generating a revised power grid topology diagram includes: When the modification type is that the number of nodes remains unchanged, the node numbers and the connection relationships between nodes in the modified power grid topology are the same as those in the original power grid topology, and the self-edge values of the nodes and the edge values of the edges are the same as those in the modified topology; When the correction type is a reduction in the number of nodes, the node numbers and the connection relationships between nodes in the corrected power grid topology are the same as those in the original power grid topology. The self-edge values of the reduced nodes are set to a large number, and the self-edge values and edge values of the remaining nodes are the same as those in the original power grid topology.
4. The method for rapidly generating a factor graph based on local changes in power grid topology according to claim 3, characterized in that: Calculating the grid topology increment information by using the grid topology correction type includes: When the correction type in which the number of nodes remains unchanged is executed, the modified power grid topology map is subtracted from the original power grid topology map to obtain a temporary incremental map; eigenvalue decomposition is performed on the matrix corresponding to the temporary incremental map, and b groups of eigenvectors and eigenvalues are extracted from the matrix of the temporary incremental map, each group including an eigenvector and an eigenvalue; each eigenvector is mapped to a first incremental information graph model, which includes a number of isolated nodes, node numbers and self-edge values, and b groups of power grid topology incremental information are obtained based on the positions and values of non-zero elements of the eigenvectors, each group of information including a first incremental information graph model and an eigenvalue; When the correction type of reducing the number of nodes is executed, a second incremental information graph model is constructed based on each deleted node, wherein the second incremental information graph model only contains one deleted node and the self-edge value of the node is set to a large number, and each group of second incremental information graph models is paired with a corresponding eigenvalue to obtain the incremental information of the power grid topology.
5. The method for rapidly generating a factor graph based on local changes in power grid topology according to claim 4, characterized in that: The correction factor graph includes: Create a temporary factor graph, and the temporary factor graph has the same structure as the original power grid factor graph; When all the incremental information of the power grid topology is processed, if the correction type is that the number of nodes remains unchanged, the temporary factor graph is used as the corrected factor graph and the correction is ended; if the correction type is that the number of nodes is reduced, the nodes and their connecting edges removed in the changed topology are deleted from the temporary factor graph, and the temporary factor graph is used as the corrected factor graph and the correction is ended.
6. The method for rapidly generating a factor graph based on local changes in power grid topology according to claim 5, characterized in that: Also includes: If there is unprocessed incremental information of power grid topology, a group of unprocessed incremental information of power grid topology is randomly selected, and the nodes contained in the incremental information graph model in the group of incremental information of power grid topology are formed into a first set, and a path tree union of the nodes contained in the first set in the temporary factor graph is generated; Activate the nodes in the union of the path trees on the temporary factor graph, and set the activated node with the smallest number as the root node; If the current root node number is greater than the largest activated node number, the processing of the incremental information of the power grid topology is completed, and the processing of the incremental information of the power grid topology continues to be judged; if the current root node number is not greater than the largest activated node number, the current root node is corrected, and the correction includes correcting the self-edge value of the root node and then correcting the edge values of all activated nodes connected to the root node; Set the state of the current root node to inactive, and use the smallest activated node with a larger number than the current root node as the new root node. If there is no smallest activated node with a larger number than the current root node, increase the root node number by 1 and continue checking the root node. When the number of the current root node is greater than the maximum number of all activated nodes and there is no other incremental information, the correction ends.
7. A factor graph rapid generation system based on local changes in power grid topology, characterized in that: include: A modified power grid topology map generation module is used to determine the type of power grid topology correction according to the change situation and generate a modified power grid topology map when the original power grid topology map undergoes a topology change; A power grid topology incremental information calculation module, used to calculate the power grid topology incremental information based on the original power grid topology map and the revised power grid topology map through the power grid topology correction type; The factor graph correction module is used to correct the factor graph according to the original power grid factor graph and the power grid topology incremental information to generate a corrected factor graph.
8. The factor graph rapid generation system based on local changes in power grid topology according to claim 7, characterized in that: The power grid topology incremental information calculation module includes: When the correction type in which the number of nodes remains unchanged is executed, the modified power grid topology map is subtracted from the original power grid topology map to obtain a temporary incremental map; eigenvalue decomposition is performed on the matrix corresponding to the temporary incremental map, and b groups of eigenvectors and eigenvalues are extracted from the matrix of the temporary incremental map, each group including an eigenvector and an eigenvalue; each eigenvector is mapped to a first incremental information graph model, which includes a number of isolated nodes, node numbers and self-edge values, and b groups of power grid topology incremental information are obtained based on the positions and values of non-zero elements of the eigenvectors, each group of information including a first incremental information graph model and an eigenvalue; When the correction type of reducing the number of nodes is executed, a second incremental information graph model is constructed based on each deleted node, wherein the second incremental information graph model only contains one deleted node and the self-edge value of the node is set to a large number, and each group of second incremental information graph models is paired with a corresponding eigenvalue to obtain the incremental information of the power grid topology.
9. An electronic device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method for quickly generating a factor graph based on local changes in power grid topology as described in any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the method for quickly generating a factor graph based on local changes in power grid topology as described in any one of claims 1 to 6.
Citation Information
Cited By
Topological graph processing method, display device and readable storage medium
CN120182427A