Graph model-based whole network topology live-line state calculation and updating method and system

By constructing graph models in the power grid and performing parallel calculations, the problems of low live computing efficiency and insufficient real-time performance of existing topology are solved, and efficient live state update and current direction characterization are achieved.

CN119510866APending Publication Date: 2025-02-25NARI INFORMATION & COMM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411510621.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The existing topological live computing functions are inefficient, unable to meet real-time requirements, and cannot effectively characterize the current direction, especially when the topology changes, the calculation efficiency is low, and the live state is not updated in time.

Method used

The whole network topological live state calculation and update method is adopted based on the graph model. By constructing a graph model of power grid equipment and connection terminals in the graph database, the live state is initialized from all power points in parallel, and the local live state is updated according to topological changes or switch displacement.

Benefits of technology

It significantly improves computing efficiency, realizes real-time requirements, can effectively characterize the current direction, and quickly updates when topological changes, greatly improving computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119510866A_ABST
    Figure CN119510866A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for calculating and updating a whole-network topology live-line state based on a graph model, and the method comprises the steps: building the graph model in a graph database based on power grid resource equipment in a power grid resource business platform by taking the power grid equipment and a connection terminal as nodes and taking a topology connection relation between the power grid equipment and the connection terminal as an edge; based on the graph model, starting from all power supply points in parallel, carrying out whole-network live-line state initialization, and calculating the current direction of the initial live-line state of the equipment; updating graph nodes and edges of the graph model according to the topology change or switch displacement message, and calculating and updating a local electrification state and a current direction by taking the updated nodes and edges as starting points; compared with a traditional method, the method has the advantages that the whole-network topology charged state and the current direction can be calculated more efficiently, and the local topology charged state can be updated more efficiently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method and system for calculating and updating the energized state of the entire network topology, and in particular to a method and system for calculating and updating the energized state of the entire network topology based on a graph model, and belongs to the technical field of power grid topology analysis. Background Art

[0002] The full-network topology live calculation is to extract the full-network resource equipment model in the power grid resource business, and calculate the live, de-energized, and closed states of various electrical equipment based on the electrical connection relationship of the equipment and the real-time opening and closing status of the disconnecting equipment, combined with the power supply access situation.

[0003] The live calculation of the entire network topology mainly includes global live initialization calculation and local live update calculation: the global live initialization calculation is to initialize the live state assignment of the traversed devices from all power supply points after the topology is constructed, and calculate the live state of the devices and the current direction; the local live update calculation refers to the situation where the live state of the local power grid equipment changes due to topology changes (static topology grid update) or switch changes (real-time switch opening and closing state changes), and the live state and current direction of each device in the affected part of the power grid need to be recalculated.

[0004] Most of the existing topology live-power calculation functions are based on relational libraries. Different types of equipment and connection relationships are scattered in different tables. Topological analysis needs to be performed through multi-table link cascade query. The calculation efficiency is low, and it cannot meet the real-time requirements, and it cannot characterize the direction of the current passing through the equipment. In addition, when the topology changes, the existing system basically uses the method of re-initializing all power points for update, which has low calculation efficiency and untimely update of the live status. Summary of the invention

[0005] Purpose of the invention: The purpose of the present invention is to provide a method and system for calculating and updating the power-on state of the entire network topology based on a graph model, which can improve computing efficiency.

[0006] Technical solution: The method for calculating and updating the power state of the entire network topology based on a graph model described in the present invention includes:

[0007] Step 1: Based on the power grid resource equipment in the power grid resource business center, the power grid equipment and the connection terminals are used as nodes, and the topological connection relationship between the power grid equipment and the connection terminals is used as an edge to build a graph model in the graph database;

[0008] Step 2: Based on the graph model, start from all power points in parallel to initialize the power state of the entire network and calculate the current direction of the initial power state of the equipment;

[0009] Step 3: Update the graph nodes and edges of the graph model according to the topology change or switch position change message, and calculate and update the local power state and current direction based on the updated nodes and edges.

[0010] Furthermore, the step 1 comprises:

[0011] Step 1.1: Extract power grid equipment and attributes from the relational database of the power grid resource business center;

[0012] Step 1.2: Model the power grid device as a DEVICE type graph node, and model the attributes of the power grid device as the attributes of the DEVICE type graph node, wherein the attributes include a globally unique device ID, a device type, a device name, a power source identifier, a switch state, and a terminal number array;

[0013] Step 1.3: Add a new power-on state array attribute to the DEVICE type graph node;

[0014] Step 1.4: Model the connection terminals of the power grid equipment as CONNECTION type diagram nodes, with attributes including terminal number ID;

[0015] Step 1.5: Model the connection relationship between the power grid equipment and the connection terminal as a DZLINK type edge.

[0016] Furthermore, the power-on state array is an int type array, including 0, 1 and 2, 0 represents no power, 1 represents power and not on the power supply side, 2 represents power and on the power supply side;

[0017] The position of each element in the power-on state array is sorted according to the corresponding order of the terminal number array; the power-on state array is used to represent the direction of the current flowing through the device. When one side of the power-on state array of the DEVICE type graph node is 2 and the other side is 1, it means that the current flows from 2 to 1.

[0018] Furthermore, the step 2 comprises:

[0019] Starting from each power point, expand using the breadth-first search (BFS) method. For each point visited by the expansion, record the terminal number array of the point. If the point is a CONNECTION type node, do not do any processing and continue to expand outwards.

[0020] The terminal number array of the last accessed DEVICE type node is recorded as pre_connection; for each terminal in the terminal number array of the current DEVICE type node: if pre_connection is empty or the terminal is in pre_connection, then update the corresponding terminal's power state array to 2; if the terminal is not in pre_connection, then update the corresponding terminal's power state array as follows: when the original power state array is 2, it remains unchanged; when the power state array is 0 or 1, it is updated to 1;

[0021] During the traversal process, if a disconnected switch is encountered, the power supply side terminal power state array is modified to 2, the power states of other terminals are not modified, and the current path traversal is terminated; if a closed loop point is encountered, the power state of each terminal of the node is modified to 2;

[0022] All power points start traversal independently in parallel and share the global power-on status when all points are updated. When all paths are terminated, the power-on initialization of the entire network is completed.

[0023] Furthermore, the step 3 comprises:

[0024] Step 3.1: Subscribe to the topology change message of the power grid model in the power grid resource business center to obtain the devices and attributes of the topology change; subscribe to the switch position change message of the real-time measurement center to obtain the changed switch devices and switch status;

[0025] Step 3.2: For devices with changed topology or switches, add, modify, and delete DEVICE and CONNECTION type graph nodes and DZLINK type edges;

[0026] Step 3.3: Based on the addition and deletion operations of DZLINK type edges, when a DZLINK type edge is added, the local power-on state is calculated and updated based on the power-on update logic; when a DZLINK type edge is deleted, the local power-on state is calculated and updated based on the power-off update logic.

[0027] Furthermore, the step 3.2 includes:

[0028] For newly added devices, create corresponding DEVICE type graph nodes, CONNECTION type graph nodes, and DZLINK type edges;

[0029] For deleting a device, delete the corresponding DEVICE type graph node and the DZLINK type edge that was once connected to it;

[0030] To modify the device attributes, first delete the DZLINK type edge that was once connected to the node, then modify the node's attributes, and finally create a new DZLINK type edge according to the new terminal connection relationship;

[0031] After completing the addition, modification and deletion operations of all DEVICE type graph nodes, delete the isolated CONNECTION type graph nodes that are not connected to any DEVICE type graph nodes due to the graph model change.

[0032] Furthermore, the power-on update logic in step 3.3 specifically includes:

[0033] Assume that the graph nodes at both ends of the DZLINK type edge are Dev and Con, Dev is a DEVICE type graph node, Con is a CONNECTION type graph node, and set all DEVICE type graph nodes that have been connected to Con to Dev. i , i=1,2,…,n; n is the total number of other DEVICE type graph nodes connected to Con;

[0034] If Con is at position 2 in Dev's charged state array, no processing is done;

[0035] If Con is 1 in the power state array of Dev, then i Find the Dev whose corresponding charged state array is 2 or 1 in Con i , set the corresponding charged state array to 2; in Dev i Find the Dev whose corresponding charged state array is 0 in Con i , based on Dev i For the power point, initialize the power status according to step 2 to the other terminals that have been connected except Con;

[0036] If Con is at position 0 in the power state array of Dev, then i Find the Dev whose corresponding charged state array is 2 or 1 in Con i , based on Dev i For the power supply point, perform live initialization according to step 2 to the other connected terminals except Con.

[0037] Furthermore, the power-off update logic in step 3.3 specifically includes:

[0038] Assume that the graph nodes at both ends of the DZLINK edge are Dev and Con, Dev is a DEVICE type graph node, Con is a CONNECTION type graph node, and set all DEVICE type graph nodes that have been connected to Con to Dev. i, i=1,2,…,n; n is

[0039] The total number of other DEVICE type graph nodes connected to Con;

[0040] If the position of Con in the power-on state array of Dev is 2, then the power-off logic is performed from Con to Dev;

[0041] If Con is 1 in the power state array of Dev, then i Find the Dev whose corresponding charged state array is 2 in Con i , from Con to Dev i Direction is power-off logic;

[0042] If the position of Con in Dev's power state array is 0, no processing is done.

[0043] Furthermore, the power-off logic from Con to Dev includes:

[0044] Mark Con as visited, and then start traversing from the other terminals of Dev. The traversed device is recorded as Dev. j , j = 1, 2, ..., m; m is the total number of DEVICE type graph nodes traversed;

[0045] If Dev j If the switch state attribute is disconnected, the dotted state array of the corresponding position of the CONNECTION type graph node on the switch input side is set to 0 and the traversal is terminated; if Dev j If only the dotted state array corresponding to the node of the CONNECTION type graph on the incoming side is 2, and there is no 2 on the other sides, then all the power-on state arrays of this device are set to 0 and continue to traverse downwards; if Dev j If the dotted state array at the corresponding position of the CONNECTION type graph node on the other side has 2, the input side is first set to 0, and then the DEVICE type graph node is put into the closed loop point set, and the traversal is terminated;

[0046] When all traversals are completed or terminated, take out the DEVICE type graph nodes in the closed loop point set one by one to check whether the corresponding DEVICE type graph node still has a terminal with a power-on state array of 2. If so, use this node as the power supply point and follow step 2 to initialize the power-on state of all terminals whose power-on state array is not 2; if not, end.

[0047] Based on the same inventive concept, the present invention also provides a system for calculating and updating the power status of the entire network topology based on a graph model, comprising:

[0048] A graph model building module is used to build a graph model in a graph database based on the grid resource equipment in the grid resource business center, with the grid equipment and the connection terminals as nodes and the topological connection relationship between the grid equipment and the connection terminals as edges;

[0049] The full network topology live state initialization module is used to initialize the full network live state based on the graph model, starting from all power points in parallel, and calculate the current direction of the initial live state of the equipment;

[0050] The local topology live state update module updates the graph nodes and edges of the graph model according to the topology change or switch position change message, and calculates and updates the local live state and current direction based on the updated nodes and edges.

[0051] Beneficial effects: Compared with the prior art, the present invention constructs the whole network topology based on the graph model, realizes efficient query and update of associated data through the graph database, and has a performance improvement of 2 to 4 orders of magnitude compared with the traditional relational database; through the design of power-on logic and power-off logic, it realizes the local power-on status update calculation starting from the changed device, without the need to perform full network calculation from all original power supply points, which greatly improves the calculation efficiency; through the design of terminal array and power-on status array, it is possible to calculate the current direction flowing through the device while calculating the power-on state, providing an analysis basis for power flow analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 is a flow chart of a method according to an embodiment of the present invention;

[0053] Figure 2 A schematic diagram of relationship construction for a graph model according to an embodiment of the present invention;

[0054] Figure 3 Schematic diagram of system modules according to an embodiment of the present invention. DETAILED DESCRIPTION

[0055] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0056] As attached Figure 1 As shown, the method for calculating and updating the power-on state of the entire network topology based on the graph model of this embodiment includes:

[0057] Step 1: Based on the power grid resource equipment in the power grid resource business center, the power grid equipment and the connection terminals are used as nodes, and the topological connection relationship between the power grid equipment and the connection terminals is used as an edge to build a graph model in the graph database;

[0058] Step 2: Based on the graph model, start from all power points in parallel to initialize the power state of the entire network and calculate the current direction of the initial power state of the equipment;

[0059] Step 3: Update the graph nodes and edges of the graph model according to the topology change or switch position change message, and calculate and update the local power state and current direction based on the updated nodes and edges.

[0060] Specifically, step 1 is based on the power grid resource equipment model in the power grid resource business center, with power grid equipment and connection terminals as nodes, and the topological connection relationship between the power grid equipment and the connection terminals as edges, and building a graph model in the graph database specifically includes:

[0061] Step 1.1, extract the power grid equipment model and attributes from the relational database of the power grid resource business center;

[0062] Step 1.2: Model the power grid equipment as a graph node of the DEVICE type, and model the attributes of the power grid equipment as the attributes of the DEVICE type graph node, including but not limited to: device ID (globally unique), device type, device name, power supply ID, switch status, and terminal number array. The terminal number array stores the terminal number ID, indicating which terminals the current DEVICE node is connected to other DEVICE nodes through.

[0063] Step 1.3, add a power-on state array attribute to the DEVICE type diagram node. The power-on state array is an int type array, and the int enumeration value is as follows: 0 means no power, 1 means power and not on the power supply side, 2 means power and on the power supply side, and the position of each element in the power-on state array is sorted in the corresponding order of the terminal number array. The power-on state array can be used to indicate the direction of the current flowing through the device.

[0064] Step 1.4: Model the connection terminal of the power grid equipment as a graph node of the CONNECTION type, with attributes including but not limited to: terminal number ID (globally unique).

[0065] Step 1.5: Model the connection relationship between the power grid equipment and the connection terminal as a DZLINK type edge, that is, any DEVICE type graph node is connected to a CONNECTION type graph node through a DZLINK edge, such as Figure 2 shown.

[0066] Step 2: Based on the graph model, start from all power supply points in parallel to initialize the power state of the entire network and calculate the current direction of the initial power state of the equipment.

[0067] In the specific implementation, step 2 specifically includes: starting from the power source point, expanding through the bfs method, judging whether each terminal in the terminal number array of the DEVICE type node belongs to the power side or the non-point source side according to the order of the terminals visited, and updating the corresponding power status array.

[0068] Furthermore, the determination of whether the terminal belongs to the power supply side or the non-point source and updating the corresponding power-on status array specifically includes: for each point of extended access, recording the terminal number array of the point (if the point is a CONNECTION type node, no processing is performed and the expansion continues outward). The terminal number array of the last DEVICE type node accessed is recorded as pre_connection. For each terminal in the terminal number array of the current DEVICE type node accessed: if pre_connection is empty (i.e., the last DEVICE type node is a power supply) or the terminal is in pre_connection (i.e., the terminal is on the power supply side), then update the power-on status of the corresponding terminal: 0 / 1 / 2->2; if the terminal is not in pre_connection (i.e., the terminal is on the non-power supply side), then update the power-on status of the corresponding terminal as follows: 2->2, 0 / 1->1.

[0069] Furthermore, during the traversal process, if a disconnected switch is encountered (i.e., the switch state attribute is disconnected), the power state of the terminal on the power supply side is changed to 2, the power state of other terminals is not changed, and the current path traversal is terminated; if a closing point is encountered (i.e., the topology forms a loop, and power can be found on both sides of the closing point), the power state of each terminal of the node is changed to 2.

[0070] Furthermore, all power point traversals are parallel and independent, and all points share the global power-on status when updated. When all paths are terminated, the power-on initialization of the entire network is completed.

[0071] Step 3: Update the graph nodes and edges according to the topology change or switch position change message, and calculate and update the local power state and current direction with the updated nodes and edges as the starting point.

[0072] In specific implementation, step 3 specifically includes:

[0073] Step 3.1, subscribe to the topology change message of the power grid model of the power grid resource business center to obtain the equipment and attributes of the topology change; subscribe to the switch change message of the real-time measurement center to obtain the changed switch equipment and switch status.

[0074] Step 3.2: For devices with topology changes or switches with position changes, add, modify, and delete graph nodes (DEVICE and CONNECTION types) and edges (DZLINK type).

[0075] Furthermore, step 3.2 specifically includes:

[0076] For newly added devices, corresponding DEVICE type graph nodes, CONNECTION type graph nodes and DZLINK type edges are newly created; for deleted devices, the corresponding DEVICE type graph nodes and their once-connected DZLINK type edges are deleted; for modified device properties, the DZLINK type edges once connected to the node are first deleted, then the properties of the node are modified, and finally new DZLINK type edges are created according to the new terminal connection relationship; after completing the addition, modification and deletion operations of all the above DEVICE type graph nodes, the isolated CONNECTION type graph nodes that are not connected to any DEVICE type graph nodes formed due to the change of the graph model are deleted.

[0077] Step 3.3: According to the two operations of adding and deleting DZLINK edges (only adding and deleting DZLINK type edges will affect the charged state of other graph nodes), the local charged state is calculated and updated respectively.

[0078] Furthermore, step 3.3 specifically includes: power-on update logic caused by adding a DZLINK type edge and power-off update logic caused by deleting a DZLINK type edge.

[0079] Furthermore, the power-on update logic caused by the newly added DZLINK type edge specifically includes:

[0080] (1) Assume that the graph nodes at both ends of the DZLINK edge are Dev1 and Connection, and query the other first-degree DZLINKs of Connection connected to Dev2~Dev n ;

[0081] (2) If the Connection is at position 2 in the power-state array of Dev1, no processing is done;

[0082] (3) If the Connection is 1 in the power-on state array of Dev1, then in Dev2~Dev n Find the Dev whose connection has a power status of 2 or 1, set the power status to 2, and stop; nFind the Dev whose corresponding power-on state is 0 in Connection, take Dev as the power source point, and perform power-on initialization according to step 2 to the terminals connected to DZLINK except Connection.

[0083] (4) If the Connection is at position 0 in the power-up state array of Dev1 and can be n Find the Dev whose corresponding power-on status of Connection is 2 or 1, take Dev as the power source point, and perform power-on initialization according to step 2 to the terminals connected to DZLINK except Connection.

[0084] Furthermore, the power failure update logic caused by deleting the DZLINK type edge specifically includes:

[0085] (1) Assume that the graph nodes at both ends of the DZLINK edge are Dev1 and Connection, and query the other first-degree DZLINKs of Connection connected to Dev2~Dev n ;

[0086] (2) If the power state of Connection at the corresponding position of Dev1's power state array is 2, then the power-off logic is performed from Connection to Dev1;

[0087] (3) If the power state of the connection in the power state array of Dev1 is 1, then in Dev2~Dev n Find the Dev whose power-on state is 2 in Connection, and perform power-off logic from Connection to Dev;

[0088] (4) If the power status of the connection at the corresponding position in the power status array of Dev1 is 0, no processing is performed.

[0089] Furthermore, the power-off logic from Connection to Dev1 specifically includes:

[0090] (1) Mark the Connection as visited, and then start traversing from the other terminals of Dev1. The traversed device is recorded as Dev i :

[0091] (2) If Dev i If the switch status attribute is disconnected, the dotted status of the corresponding position of the switch input side Connection is set to 0 and the traversal is terminated; if Dev iIf only the dotted status of the corresponding position of the incoming connection is 2, and there is no 2 on the other sides, then all the power states of this device are set to 0 and continue to traverse downwards; if Dev i If the dotted state of the corresponding position of the Connection on the other side is 2, the incoming side is first set to 0, then the DEVICE node is put into the closed loop point set, and the traversal is terminated;

[0092] (3) When all traversals are completed or terminated, the DEVICE nodes in the closed-loop point set are taken out one by one to check whether there is still a terminal with a power state of 2 at this point. If so, this node is used as the power source point, and the power state of all terminals with a power state other than 2 is initialized according to step 2; if not, the process ends.

[0093] Based on the same inventive concept, this embodiment also provides a system for calculating and updating the power status of the entire network topology based on a graph model, such as Figure 3 As shown, the system can be implemented in software and / or hardware. The system includes a graph model building module 201, a full network topology power state initialization module 202 and a local topology power state update module 203. Each module is described in detail below.

[0094] The graph model construction module 201 is used to construct a graph model in a graph database with power grid equipment and connection terminals as nodes and the topological connection relationship between the power grid equipment and the connection terminals as edges. Specifically, it includes the following units: a data extraction unit, which is used to extract the power grid equipment model and attributes from the relational database of the power grid resource business middle station; a DEVICE type graph node creation unit, which is used to model the power grid equipment as a graph node of the DEVICE type, and model the attributes of the power grid equipment as the attributes of the DEVICE type graph node, and the attributes include but are not limited to: device ID (globally unique), device type, device name, power supply identification, switch status, terminal number array, and add the power-on state array attribute; a CONNECTION type graph node creation unit, which is used to model the connection terminal of the power grid equipment as a CONNECTION type graph node, and the attributes include but are not limited to: terminal number ID (globally unique); a DZLINK type edge creation unit, which is used to model the connection relationship between the power grid equipment and the connection terminal as a DZLINK type edge.

[0095] The whole network topology live state initialization module 202 is used to initialize the live state of the whole network based on the graph model and start from all power points in parallel, and calculate the current direction of the initial live state of the device. Specifically, it includes the following units: a live initialization unit, starting from the power point, is expanded by means of bfs, and each terminal in the terminal number array of the DEVICE type node is judged to belong to the power side or the non-point source side according to the order of the terminals visited, and the corresponding live state array is updated. A parallel calculation unit is used to realize that the traversal from each power point is parallel and independent, and all points share the global live state when updating. When all paths are terminated, the whole network live initialization is completed.

[0096] The local topology power-on state update module 203 is used to update the graph nodes and edges according to the topology change or switch position change message, taking the updated nodes and edges as the starting point, executing the power-on update logic according to the addition of edges, and executing the power-off update logic according to the deletion of edges, so as to realize the calculation and update of the local power-on state and current direction. Specifically, it includes the following units: a topology change message acquisition unit, which is used to subscribe to the topology change message of the power grid model of the power grid resource business center, and obtain the equipment and attributes of the topology change; a switch position change message acquisition unit, which is used to subscribe to the switch position change message of the real-time measurement center, and obtain the changed switch equipment and switch state; a graph model update unit, which is used to add, modify and delete DEVICE and CONNECTION type graph nodes and DZLINK type edges for the topology changed equipment or the changed switches; a power-on update unit, which is used to calculate and update the changes in the power-on state array of the DEVICE type graph nodes caused by the addition of DZLINK type edges; and a power-off update unit, which is used to calculate and update the changes in the power-on state array of the DEVICE type graph nodes caused by the deletion of DZLINK type edges.

[0097] The system provided in the embodiment of the present invention can be used to execute the method provided in the first embodiment of the present invention, and has the corresponding functions and beneficial effects of the execution method.

[0098] It is worth noting that in the above-mentioned embodiment of the determination system, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0099] The embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, or of course, it can be implemented only by hardware, as long as the function or effect can be achieved.

Claims

1. A method for calculating and updating the power-on state of the entire network topology based on a graph model, characterized in that: include: Step 1: Based on the power grid resource equipment in the power grid resource business center, the power grid equipment and the connection terminals are used as nodes, and the topological connection relationship between the power grid equipment and the connection terminals is used as an edge to build a graph model in the graph database; Step 2: Based on the graph model, start from all power points in parallel to initialize the power state of the entire network and calculate the current direction of the initial power state of the equipment; Step 3: Update the graph nodes and edges of the graph model according to the topology change or switch position change message, and calculate and update the local power state and current direction based on the updated nodes and edges.

2. The method for calculating and updating the power state of the entire network topology based on the graph model according to claim 1 is characterized in that: The step 1 comprises: Step 1.1: Extract power grid equipment and attributes from the relational database of the power grid resource business center; Step 1.2: Model the power grid device as a DEVICE type graph node, and model the attributes of the power grid device as the attributes of the DEVICE type graph node, wherein the attributes include a globally unique device ID, a device type, a device name, a power source identifier, a switch state, and a terminal number array; Step 1.3: Add a new power-on state array attribute to the DEVICE type graph node; Step 1.4: Model the connection terminals of the power grid equipment as CONNECTION type diagram nodes, with attributes including terminal number ID; Step 1.5: Model the connection relationship between the power grid equipment and the connection terminal as a DZLINK type edge.

3. The method for calculating and updating the charged state of the whole network topology based on the graph model according to claim 2 is characterized in that: The power state array is an int type array, including 0, 1 and 2, 0 means no power, 1 means power and not on the power side, 2 means power and on the power side; The position of each element in the power-on state array is sorted according to the corresponding order of the terminal number array; the power-on state array is used to represent the direction of the current flowing through the device. When one side of the power-on state array of the DEVICE type graph node is 2 and the other side is 1, it means that the current flows from 2 to 1.

4. The method for calculating and updating the power status of the entire network topology based on the graph model according to claim 3 is characterized in that: The step 2 comprises: Starting from each power point, expand using the breadth-first search (BFS) method. For each point visited by the expansion, record the terminal number array of the point. If the point is a CONNECTION type node, do not do any processing and continue to expand outwards. The terminal number array of the last accessed DEVICE type node is recorded as pre_connection; for each terminal in the terminal number array of the current DEVICE type node: if pre_connection is empty or the terminal is in pre_connection, then update the corresponding terminal's power state array to 2; if the terminal is not in pre_connection, then update the corresponding terminal's power state array as follows: when the original power state array is 2, it remains unchanged; when the power state array is 0 or 1, it is updated to 1; During the traversal process, if a disconnected switch is encountered, the power supply side terminal power state array is modified to 2, the power states of other terminals are not modified, and the current path traversal is terminated; if a closed loop point is encountered, the power state of each terminal of the node is modified to 2; All power points start traversal independently in parallel and share the global power-on status when all points are updated. When all paths are terminated, the power-on initialization of the entire network is completed.

5. The method for calculating and updating the charged state of the whole network topology based on the graph model according to claim 4 is characterized in that: The step 3 comprises: Step 3.1: Subscribe to the topology change message of the power grid model in the power grid resource business center to obtain the devices and attributes of the topology change; subscribe to the switch position change message of the real-time measurement center to obtain the changed switch devices and switch status; Step 3.2: For devices with changed topology or switches, add, modify, and delete DEVICE and CONNECTION type graph nodes and DZLINK type edges; Step 3.3: Based on the addition and deletion operations of DZLINK type edges, when a DZLINK type edge is added, the local power-on state is calculated and updated based on the power-on update logic; when a DZLINK type edge is deleted, the local power-on state is calculated and updated based on the power-off update logic.

6. The method for calculating and updating the charged state of the entire network topology based on the graph model according to claim 5 is characterized in that: The step 3.2 comprises: For newly added devices, create corresponding DEVICE type graph nodes, CONNECTION type graph nodes, and DZLINK type edges; For deleting a device, delete the corresponding DEVICE type graph node and the DZLINK type edge that was once connected to it; To modify the device attributes, first delete the DZLINK type edge that was once connected to the node, then modify the node's attributes, and finally create a new DZLINK type edge according to the new terminal connection relationship; After completing the addition, modification and deletion operations of all DEVICE type graph nodes, delete the isolated CONNECTION type graph nodes that are not connected to any DEVICE type graph nodes due to the graph model change.

7. The method for calculating and updating the power status of the entire network topology based on the graph model according to claim 5 is characterized in that: The power-on update logic described in step 3.3 specifically includes: Assume that the graph nodes at both ends of the DZLINK type edge are Dev and Con, Dev is a DEVICE type graph node, Con is a CONNECTION type graph node, and all other DEVICE type graph nodes connected to Con except Dev are Dev. i , i=1,2,…,n; n is the total number of other DEVICE type graph nodes connected to Con; If Con is at position 2 in Dev's charged state array, no processing is done; If Con is 1 in the power state array of Dev, then i Find the Dev whose corresponding charged state array is 2 or 1 in Con i , set the corresponding charged state array to 2; in Dev i Find the Dev whose corresponding charged state array is 0 in Con i , based on Dev i For the power point, initialize the power status according to step 2 to the other terminals that have been connected except Con; If Con is at position 0 in the power state array of Dev, then i Find the Dev whose corresponding charged state array is 2 or 1 in Con i , based on Dev i For the power supply point, perform live initialization according to step 2 to the other connected terminals except Con.

8. The method for calculating and updating the charged state of the entire network topology based on the graph model according to claim 5 is characterized in that: The power-off update logic in step 3.3 specifically includes: Assume that the graph nodes at both ends of the DZLINK edge are Dev and Con, Dev is a DEVICE type graph node, Con is a CONNECTION type graph node, and set all DEVICE type graph nodes that have been connected to Con to Dev. i , i=1,2,…,n; n is the total number of other DEVICE type graph nodes connected to Con; If the position of Con in the power-on state array of Dev is 2, then the power-off logic is performed from Con to Dev; If Con is 1 in the power state array of Dev, then i Find the Dev whose corresponding charged state array is 2 in Con i , from Con to Dev i Direction is power-off logic; If the position of Con in Dev's power state array is 0, no processing is done.

9. The method for calculating and updating the power status of the entire network topology based on the graph model according to claim 8, characterized in that: The power-off logic from Con to Dev includes: Mark Con as visited, and then start traversing from the other terminals of Dev. The traversed device is recorded as Dev. j , j = 1, 2, ..., m; m is the total number of DEVICE type graph nodes traversed; If Dev j If the switch state attribute is disconnected, the dotted state array of the corresponding position of the CONNECTION type graph node on the switch input side is set to 0 and the traversal is terminated; if Dev j If only the dotted state array corresponding to the node of the CONNECTION type graph on the incoming side is 2, and there is no 2 on the other sides, then all the power-on state arrays of this device are set to 0 and continue to traverse downwards; if Dev j If the dotted state array at the corresponding position of the CONNECTION type graph node on the other side has 2, the input side is first set to 0, and then the DEVICE type graph node is put into the closed loop point set, and the traversal is terminated; When all traversals are completed or terminated, take out the DEVICE type graph nodes in the closed loop point set one by one to check whether the corresponding DEVICE type graph node still has a terminal with a power-on state array of 2. If so, use this node as the power supply point and follow step 2 to initialize the power-on state of all terminals whose power-on state array is not 2; if not, end.

10. A system for calculating and updating the power status of the entire network topology based on a graph model, characterized in that: include: A graph model building module is used to build a graph model in a graph database based on the grid resource equipment in the grid resource business center, with the grid equipment and the connection terminals as nodes and the topological connection relationship between the grid equipment and the connection terminals as edges; The full network topology live state initialization module is used to initialize the full network live state based on the graph model, starting from all power points in parallel, and calculate the current direction of the initial live state of the equipment; The local topology live state update module updates the graph nodes and edges of the graph model according to the topology change or switch position change message, and calculates and updates the local live state and current direction based on the updated nodes and edges.