Power grid simulation model data modification method, device and equipment based on hierarchical graph index
By automatically processing power grid simulation model data based on hierarchical graph indexing, the problems of complicated modification of power grid simulation model data and high error rate in the existing technology are solved, and the rapid and accurate modification and management of power grid model data are achieved.
Patent Information
- Application Number
- CN202510375652.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-07-18
AI Technical Summary
The existing grid simulation model data modification method manually and explicitly executes multiple relational database modification commands, resulting in cumbersome process and high error rate, and it is impossible to ensure the consistency of the linked modification of data.
Using a hierarchical graph indexing method, the graph index includes the relationship between nodes and nodes, and searches and processes model modification data in the database through the graph index to automatically add, modify or delete the power grid simulation model data.
It improves the efficiency of modifying grid model data, ensures the correctness of data and subordinate relationships in the database, and improves the efficiency of management and maintenance of grid model data.
Smart Images

Figure CN120336299A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of statistical analysis of power system data, and in particular to a method, device and equipment for modifying power grid simulation model data based on hierarchical graph indexing. Background Art
[0002] The power grid simulation model data is the basis of power system simulation analysis, and it has structured characteristics. For the convenience of management, the power grid simulation model data is often stored based on a relational database, and the data of different power grid simulation model types are stored in different data tables. The graph characteristics of the real power grid have a two-layer organizational structure of the grid layer and the plant layer; the grid layer contains elements such as the plant, the inter-plant line, and the plant layer contains equipment elements such as busbars and transformers. The various devices are interconnected and subordinate to the plant, which makes the data of different power grid simulation models have complex subordinate and connection relationships. When modifying a piece of data in the power grid simulation model, it may be necessary to modify the related data in multiple data tables in a linked manner, otherwise the completeness of the power grid simulation model data cannot be guaranteed. In the face of this problem, the existing method for modifying the power grid simulation model data realizes the linked modification of data by manually and explicitly executing multiple relational database modification commands, but this method has problems such as cumbersome process and high error rate. Summary of the invention
[0003] The present application provides a method, device and equipment for modifying power grid simulation model data based on hierarchical graph index, which is used to solve the technical problems that the existing method for modifying power grid simulation model data realizes the linkage modification of data by manually and explicitly executing multiple relational database modification commands, which has cumbersome process and high error rate.
[0004] In order to achieve the above objectives, this application provides the following technical solutions:
[0005] On the one hand, a method for modifying power grid simulation model data based on hierarchical graph index is provided, comprising the following steps:
[0006] Acquire a database of a power grid simulation model, construct a graph index for the database, the graph index includes a plurality of nodes and relationships between nodes, each of the nodes stores index information of a power grid simulation model data, the index information includes a node id, a model data type, a node type, a relational data table, and an index id corresponding to the model data in the relational data table;
[0007] Acquire model modification data, and search the database for model data to be modified corresponding to the model modification data through the graph index according to the model modification data; the model modification data includes a modification type and modification data;
[0008] Perform addition, modification, or deletion processing on the model data to be modified according to the modification data to obtain the modified power grid simulation model data.
[0009] Preferably, performing addition, modification, or deletion processing on the model data to be modified according to the modification data to obtain the modified power grid simulation model data includes:
[0010] If the modification type is adding a node, determine the node type according to the model data type of the modification data, insert the added node into the graph index according to the node type to obtain a new graph index structure, and assign a node ID to the added node;
[0011] Determine the connection information of the added node according to the power equipment corresponding to the node type and model data type of the modification data; if the node type is a grid layer node, the connection information includes an added connection relationship; if the node type is a substation layer node, the connection information includes an added connection relationship and an added subordination relationship;
[0012] Establish connections between nodes for the added node on the new graph index structure according to the connection information to obtain the modified power grid simulation model data.
[0013] Preferably, determining the connection information of the added node according to the power equipment corresponding to the model data type of the modification data includes:
[0014] If the node type is a grid layer node, determine the nodes connected to the added node on the new graph index structure according to the power equipment corresponding to the model data type of the modification data; obtain the index id of the nodes connected to the added node; establish a connection relationship between each pair of nodes according to the node ID and all the index ids to obtain an added connection relationship;
[0015] Or,
[0016] If the node type is a substation layer node, determine the nodes connected to the added node on the new graph index structure according to the power equipment corresponding to the model data type of the modification data, and determine the subordinate nodes of the substation nodes connected to the added node on the new graph index structure according to the substation information corresponding to the model data type of the modification data; obtain the index id of the nodes connected to the added node and obtain the index id of each subordinate node to obtain a subordinate id; establish a connection relationship between each pair of nodes according to the node ID and all the index ids to obtain an added connection relationship; establish a subordination relationship between each pair of nodes according to the node ID and all the subordinate ids to obtain an added subordination relationship.
[0017] Preferably, adding, modifying, or deleting the model data to be modified according to the modification data to obtain the modified power grid simulation model data includes:
[0018] If the modification type is to modify or delete a certain piece of the power grid simulation model data, search in the database according to the modification data through the graph index to obtain the node data to be processed that matches the modification data, and the node data to be processed includes nodes and the relationships between nodes;
[0019] Determine the method of modifying or deleting the node data to be processed according to whether the attribute of the node type in the modification data is a unique attribute to obtain the modification method;
[0020] Modify or delete the node data to be processed according to the modification data and the modification method to obtain the modified power grid simulation model data.
[0021] Preferably, modifying or deleting the node data to be processed according to the modification data and the modification method to obtain the modified power grid simulation model data includes:
[0022] If the modification method is a direct processing method, extract the index information to be processed from the modification data, and modify or delete the node data to be processed according to the relational data table and index id of the index information to be processed according to the modification data to obtain the modified power grid simulation model data;
[0023] If the modification method is an associated processing method, perform an associated modification or deletion on the subordinate relationship and connection relationship of the node data to be processed according to the modification data to obtain the modified power grid simulation model data;
[0024] Among them, performing an associated modification or deletion on the subordinate relationship of the node data to be processed according to the modification data includes: according to the node data of the grid layer in the modification data, modifying or deleting all the data corresponding to each substation layer node that has a subordinate relationship with the node data of the grid layer in the node data to be processed;
[0025] Performing an associated modification or deletion on the connection relationship of the node data to be processed according to the modification data includes: according to a certain node data in the modification data, modifying or deleting all the data corresponding to each node that has a connection relationship with the node data in the node data to be processed.
[0026] Preferably, the database includes a substation layer and a grid layer, the node type is used to reflect the geographical location of the power equipment on the graph index, the node type includes grid layer nodes and substation layer nodes, and the relationships between nodes include subordinate relationships and connection relationships;
[0027] The subordination relationship is used to represent the relationship between the nodes of the substation layer and the nodes of the grid layer;
[0028] The connection relationship is used to represent the connection relationship between two nodes of the same node type.
[0029] On the other hand, a device for modifying data of a power grid simulation model based on a hierarchical graph index is provided, including a graph index construction module, a search module, and a data modification module;
[0030] The graph index construction module is used to obtain the database of the power grid simulation model, construct a graph index for the database. The graph index includes several nodes and relationships between nodes. Each node stores index information of a piece of power grid simulation model data. The index information includes a node id, a model data type, a node type, a relational data table, and an index id corresponding to the model data in the relational data table;
[0031] The search module is used to obtain model modification data, and search for the to-be-modified model data corresponding to the model modification data in the database through the graph index; the model modification data includes a modification type and modification data;
[0032] The data modification module is used to perform addition, modification, or deletion processing on the to-be-modified model data according to the modification data, and obtain the modified power grid simulation model data.
[0033] Preferably, when the modification type is adding a node according to the data modification module, the node type is determined according to the model data type of the modification data, the new node is inserted into the graph index according to the node type to obtain a new graph index structure, and a node ID is assigned to the new node; the connection information of the new node is determined according to the power equipment corresponding to the node type and model data type of the modification data; if the node type is a grid layer node, the connection information includes a new connection relationship; if the node type is a substation layer node, the connection information includes a new connection relationship and a new subordination relationship; node-to-node connections are established for the new node on the new graph index structure according to the connection information, and the modified power grid simulation model data is obtained.
[0034] Preferably, the data modification module is further configured to modify or delete a certain piece of the power grid simulation model data according to the modification type, search in the database through the graph index according to the modification data, and obtain the to-be-processed node data corresponding to and matching the modification data, where the to-be-processed node data includes nodes and relationships between nodes; determine the method for modifying or deleting the to-be-processed node data according to whether the attribute of the node type in the modification data is a unique attribute, so as to obtain the modification method; modify or delete the to-be-processed node data according to the modification data and the modification method, and obtain the modified power grid simulation model data.
[0035] On the other hand, a terminal device is provided, including a processor and a memory;
[0036] The memory is used to store program codes and transmit the program codes to the processor;
[0037] The processor is configured to execute the above-mentioned method for modifying power grid simulation model data based on a hierarchical graph index according to the instructions in the program codes.
[0038] The method, device, and equipment for modifying power grid simulation model data based on a hierarchical graph index. The method for modifying power grid simulation model data based on a hierarchical graph index includes obtaining a database of a power grid simulation model, constructing a graph index for the database, where the graph index includes several nodes and relationships between nodes, and each node stores index information of a piece of power grid simulation model data, and the index information includes a node id, a model data type, a node type, a relational data table, and an index id corresponding to the model data in the relational data table; obtaining model modification data, and searching in the database for the to-be-modified model data corresponding to the model modification data through the graph index; the model modification data includes a modification type and modification data; performing addition, modification, or deletion processing on the to-be-modified model data according to the modification data, and obtaining the modified power grid simulation model data.
[0039] From the above technical solutions, it can be seen that the present application has the following advantages: The method for modifying power grid simulation model data based on a hierarchical graph index is used to quickly add, modify, or delete power grid model data in the database, improve the modification efficiency, further ensure the correctness of the data and the subordinate relationship in the database, and thus improve the management and maintenance efficiency of the power grid model data, solving the technical problems that the existing method for modifying power grid simulation model data realizes the linked modification of data by manually and explicitly executing multiple relational database modification commands, which is cumbersome and has a high error rate.
[0040] The power grid simulation model data modification device based on a hierarchical graph index can quickly add, modify, or delete power grid model data in a database through a graph index construction module, a search module, and a data modification module, further ensuring the correctness of the data and subordination relationships in the database, and thus improving the management and maintenance efficiency of power grid model data. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0042] Figure 1 It is a flowchart of the steps of the power grid simulation model data modification method based on a hierarchical graph index according to the embodiment of the present application;
[0043] Figure 2 It is a topological schematic diagram of the graph index in the power grid simulation model data modification method based on a hierarchical graph index according to the embodiment of the present application;
[0044] Figure 3 It is a framework schematic diagram of the power grid simulation model data modification device based on a hierarchical graph index according to the embodiment of the present application;
[0045] Figure 4 It is a schematic diagram of the terminal device according to the embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0046] In order to make the invention objectives, features, and advantages of the present application more obvious and understandable, the following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the embodiments described below are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0047] In the description of the embodiments of the present application, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present application, "a plurality" means two or more, unless otherwise specifically defined.
[0048] In the embodiments of the present application, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral one; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0049] The embodiments of the present application provide a method, device and equipment for modifying power grid simulation model data based on hierarchical graph index, which solves the technical problems that the existing method for modifying power grid simulation model data realizes linkage modification of data by manually and explicitly executing multiple relational database modification commands, and has cumbersome process and high error rate. The method, device and equipment for modifying power grid simulation model data based on hierarchical graph index is based on the graph index of the database, which can more naturally express the hierarchical structure of the power grid and its complex relationships. By modifying all related power grid simulation model data in the database in linkage according to the model modification data combined with the graph index, the accuracy of the power grid topology relationship and physical connection can be effectively maintained, and a strong mapping relationship between the power grid simulation model and the actual power grid can be ensured.
[0050] Embodiment 1:
[0051] Figure 1 This is a flowchart of the steps of the method for modifying power grid simulation model data based on hierarchical graph indexing according to an embodiment of the present application. Figure 2 A topological diagram of a graph index in a power grid simulation model data modification method based on a hierarchical graph index as described in an embodiment of the present application.
[0052] like Figure 1 and Figure 2 As shown, the embodiment of the present application provides a method for modifying power grid simulation model data based on a hierarchical graph index, comprising the following steps:
[0053] S1. Obtain a database of a power grid simulation model and construct a graph index for the database. The graph index includes several nodes and relationships between nodes. Each node stores index information of a power grid simulation model data. The index information includes node id, model data type, node type, relational data table, and index id corresponding to the model data in the relational data table.
[0054] It should be noted that step S1 is to first obtain the database of the power grid simulation model, and then construct the structure of the graph index based on the database. In this embodiment, the graph index is implemented based on the database, and the graph index consists of nodes and relationships between nodes, such as Figure 2As shown in the figure. The relationships between nodes are used to reflect the connections between power equipment models. Each node stores the index information of a piece of power grid model data. The index information specifically includes the unique node id, the model data type, the node type, the relational data table where the real data is located, and the index id corresponding to the model data in the relational data table. The index information does not store the real power grid data information, but is stored in the relational database of the power grid simulation model in the form of data table + unique node id in the table and in an indexed manner. The model data type corresponds to the real power equipment type described by the data in the database. The model data types include types such as substations, cross-substation lines, buses, lines, transformers, etc.
[0055] In the embodiment of the present application, the database includes a substation layer and a grid structure layer. The node type is used to reflect the geographical location of the power equipment on the graph index. The node types include grid structure layer nodes and substation layer nodes. The relationships between nodes include a subordination relationship and a connection relationship. The subordination relationship is used to represent the relationship between the nodes in the substation layer and the nodes in the grid structure layer. The connection relationship is used to represent the connection relationship between two nodes of the same node type.
[0056] It should be noted that the node type is determined by the model data type. For example, if the model data types are substations and cross-substation lines, the node type belongs to the grid structure layer nodes, corresponding to substations in the real power grid. If the model data types are other types (such as buses, lines, transformers, etc.), the node type belongs to the substation layer nodes, corresponding to power equipment in the real power grid. The subordination relationship exists between the substation layer nodes and the grid structure layer nodes, and is used to reflect the important relationship that power equipment exists inside the substation in the real power grid. For example, each substation layer node needs to be subordinate to at least one grid structure layer node. The connection relationship exists between two nodes of the same node type and is used to reflect the connection relationships between substations and between equipment. For example, for a node, it can have connection relationships with multiple nodes.
[0057] S2. Obtain model modification data, and search for the model data to be modified corresponding to the model modification data in the database through the graph index according to the model modification data. The model modification data includes a modification type and modification data.
[0058] It should be noted that in step S2, first, model modification data is obtained. The model modification data includes a modification type and modification data. The modification data is the power grid model data to be modified, and the modification types include adding a node, modifying certain power grid simulation model data, deleting certain power grid simulation model data, etc. Second, based on the model modification data, a search is performed in the database according to the graph index to obtain the model data to be modified corresponding to the model modification data. In this embodiment, if the modification type is adding a node, the model data to be modified can be adding a node and its relationships with other nodes in the database in a linked manner. If the modification type is modifying certain power grid simulation model data, the model data to be modified can be quickly searching for the power grid model data related to modifying certain power grid simulation model data through the topology of the graph index. If the modification type is deleting certain power grid simulation model data, the model data to be modified can be quickly searching for the power grid model data related to deleting certain power grid simulation model data through the topology of the graph index.
[0059] S3. Perform addition, modification, or deletion processing on the model data to be modified according to the modification data to obtain the modified power grid simulation model data.
[0060] It should be noted that in step S3, addition, modification, or deletion processing is performed on the model data to be modified obtained in step S2 to obtain the modified power grid simulation model data, so as to realize hierarchical management and adjustment of the power grid model data in the database in an automated manner, improve the efficiency of adding, deleting, and modifying power equipment in the database, and further help improve the maintenance and statistical analysis capabilities of the power system database.
[0061] In the embodiment of this application, through the method for modifying power grid simulation model data based on a hierarchical graph index, the power grid model data in the database can be quickly added, modified, or deleted, further ensuring the correctness of the data and the subordinate relationships in the database, and then improving the management and maintenance efficiency of the power grid model data. The method for modifying power grid simulation model data based on a hierarchical graph index can simplify the steps of data modification through the graph index, improve the modification efficiency and ensure no missed modification, so as to meet the requirements of flexibility and operability for modifying power grid model data, and can be widely applied to the field of maintenance and analysis of power system databases.
[0062] A method for modifying power grid simulation model data based on a hierarchical graph index provided by the present application includes obtaining a database of a power grid simulation model, constructing a graph index for the database, where the graph index includes several nodes and relationships between nodes. Each node stores index information of a piece of power grid simulation model data, and the index information includes a node ID, a model data type, a node type, a relational data table, and an index ID corresponding to the model data in the relational data table; obtaining model modification data, and searching for to-be-modified model data corresponding to the model modification data in the database through the graph index according to the model modification data; the model modification data includes a modification type and modification data; performing addition, modification, or deletion processing on the to-be-modified model data according to the modification data to obtain modified power grid simulation model data. Through the method for modifying power grid simulation model data based on a hierarchical graph index, the addition, modification, or deletion of power grid model data in the database is realized quickly, the modification efficiency is improved, the correctness of the data and the subordinate relationship in the database is further ensured, and thus the management and maintenance efficiency of the power grid model data is improved, solving the technical problems that the existing method for modifying power grid simulation model data realizes the linked modification of data by manually and explicitly executing multiple relational database modification commands, which is cumbersome and has a high error rate.
[0063] In an embodiment of the present application, performing addition, modification, or deletion processing on the to-be-modified model data according to the modification data to obtain modified power grid simulation model data includes:
[0064] If the modification type is adding a node, determining the node type according to the model data type of the modification data, inserting the newly added node into the graph index according to the node type to obtain a new graph index structure, and assigning a node ID to the newly added node;
[0065] Determining the connection information of the newly added node according to the power equipment corresponding to the node type and the model data type of the modification data; if the node type is a grid layer node, the connection information includes newly added connection relationships; if the node type is a substation layer node, the connection information includes newly added connection relationships and newly added subordinate relationships;
[0066] Establishing connections between nodes for the newly added node on the new graph index structure according to the connection information to obtain modified power grid simulation model data.
[0067] It should be noted that the node type is determined according to the model data type in the power grid model data of the newly added node. Then, according to the node type, the newly added node is inserted into the graph index in the database using the insert statement "create(n:'model data type'{layer: 'node type'})" to obtain a new graph index structure; the inserted node will be automatically assigned a unique node ID. During the process of constructing the new graph index structure, when the model data type is a substation, the newly added node is classified as a node in the grid layer, and the corresponding insert statement is: "create(n:'substation'{layer: 'grid layer'})"; when the model data type is a busbar, the newly added node is classified as a node in the substation layer, and the corresponding insert statement is "create(n: 'busbar'{layer:'substation layer'})". In this embodiment, since the model data type in the power grid model data of the newly added node contains connection relationship information, the connection relationship information includes newly added connection relationships and newly added subordination relationships.
[0068] In the embodiment of the present application, the connection information of the newly added node determined according to the power equipment corresponding to the model data type of the modified data includes:
[0069] If the node type is a node in the grid layer, then the nodes connected to the newly added node are determined on the new graph index structure according to the power equipment corresponding to the model data type of the modified data; the index id of the node connected to the newly added node is obtained; the connection relationships between pairwise nodes are established according to the node ID and all index ids to obtain newly added connection relationships;
[0070] Or,
[0071] If the node type is a node in the substation layer, then the nodes connected to the newly added node are determined on the new graph index structure according to the power equipment corresponding to the model data type of the modified data, and the subordinate nodes of the substation nodes connected to the newly added node are determined on the new graph index structure according to the substation information corresponding to the model data type of the modified data; the index id of the node connected to the newly added node and the index id of each subordinate node are obtained to obtain the subordinate id; the connection relationships between pairwise nodes are established according to the node ID and all index ids to obtain newly added connection relationships; the subordination relationships between pairwise nodes are established according to the node ID and all subordinate ids to obtain newly added subordination relationships.
[0072] It should be noted that the number of newly added connection relationships depends on how many nodes the power equipment corresponding to the power grid model data has that are connected to the newly added node. For example, the model data type of the power grid model data in the modified data is a cross-plant line, and the cross-plant line has two connection points, which connect two plant stations respectively. Therefore, two new connection relationships are added to connect the newly added node of the cross-plant line to the plant station node; the statement for executing the operation of adding a new connection relationship is: "match(n: cross-plant line {Id: 'cross-plant line node ID'}, source: plant station {Id: 'index id of plant station 1 data node'}), (target: plant station {Id: 'index id of plant station 2 data node'}), create(source)-[: 'connection relationship']->(n); create(target)-[: 'connection relationship']->(n)"; where the match statement is used to match the cross-plant line, plant station 1, and plant station 2 that need to add a new connection relationship, and assign aliases to n, source, and target respectively. The create statement is used to create a connection relationship between n and source and target. The addition of a subordinate relationship only occurs when a node is added at the plant level. It is necessary to create a subordinate relationship between the modified data and the plant data based on the plant information contained in the modified data; for example, after adding a bus data modification data, it is necessary to add a subordinate relationship between the bus and the plant where it is located; the statement to perform the operation of adding a subordinate relationship is: "match(d: bus {Id: node ID of bus data}, s: plant {Id: index id of plant data}), create(s)-[:'Subordinate relationship']->(d)"; wherein the match statement is used to match the bus and plant to which a new relationship needs to be added, and assign aliases of d and s respectively; the create statement is used to create a subordinate relationship between s and d. In this embodiment, the cypher statement is a type of graph database query language, which can be understood as a proper noun, and the match statement and the create statement are both a type of cypher statement.
[0073] In one embodiment of the present application, the model data to be modified is added, modified or deleted according to the modification data, and the modified power grid simulation model data is obtained, including:
[0074] If the modification type is to modify or delete a certain power grid simulation model data, search in the database through the graph index according to the modified data to obtain the to-be-processed node data corresponding to the modified data, and the to-be-processed node data includes nodes and relationships between nodes;
[0075] Determine a method for modifying or deleting the node data to be processed according to whether the attribute of the node type in the modified data is a unique attribute, and obtain a modification method;
[0076] Modify or delete the to-be-processed node data according to the modification data and modification method, and obtain the modified power grid simulation model data;
[0077] Among them, modifying or deleting the to-be-processed node data according to the modification data and modification method to obtain the modified power grid simulation model data includes:
[0078] If the modification method is the direct processing method, extract the to-be-processed index information from the modification data, and modify or delete the to-be-processed node data according to the relational data table and index id of the to-be-processed index information according to the modification data, and obtain the modified power grid simulation model data;
[0079] If the modification method is the linkage processing method, perform linkage modification or deletion on the subordinate relationship and connection relationship of the to-be-processed node data according to the modification data, and obtain the modified power grid simulation model data;
[0080] Among them, performing linkage modification or deletion on the subordinate relationship of the to-be-processed node data according to the modification data includes: according to the grid layer node data of the modification data, modify or delete all the data corresponding to each substation layer node in the to-be-processed node data that has a subordinate relationship with the grid layer node data;
[0081] Performing linkage modification or deletion on the connection relationship of the to-be-processed node data according to the modification data includes: according to a certain node data of the modification data, modify or delete all the data corresponding to each node in the to-be-processed node data that has a connection relationship with the node data.
[0082] It should be noted that according to Figure 2The topology of the graph index shown refers to a topology composed of the nodes of the graph index as points and the relationships between nodes as edges. The topology of the graph index intuitively reflects the direct and indirect relationships between data. The topology of the graph index is used to quickly search for the power grid model data related to the modified data, which means starting from a certain power grid model data to be modified or deleted, finding the data directly related to the modified data through the subordinate relationship and connection relationship, and obtaining the node data to be processed. Then, according to the attributes of the modified data and its node type, it is judged whether it is necessary to modify or delete the node data to be processed in a linked manner. The attribute name is judged first. If it is a unique attribute of the node, there is no need to modify or delete it in a linked manner. Otherwise, it may be necessary to modify the attributes of other data in a linked manner, mainly including the linked modification or deletion caused by the subordinate relationship and the linked modification or deletion caused by the connection relationship. Among them, there are several attributes for each type of node, and there is a linkage deletion and modification relationship between some attributes of each type of node (for example: for the connection relationship, there are mainly attributes such as the name of the connected bus and the voltage of the connected bus, which corresponds to the situation where the relevant attributes of the connected device need to be saved in one piece of equipment data. For the subordinate relationship, there are mainly attributes such as the name of the plant and the location of the plant, which corresponds to the situation where the grid layer node attributes need to be saved in a plant layer equipment node. These situations are attributes that need to be modified or deleted in a linkage relationship), and there is no linkage relationship between another part of the attributes of each type of node. The attributes that do not have a linkage relationship are called the unique attributes of the nodes in each type of node.
[0083] In the embodiment of the present application, it is determined based on the attributes of the modified data and its node type that the node data to be processed does not need to be modified or deleted in conjunction.
[0084] It should be noted that modifying the data of the node to be processed refers to extracting index information from the node that needs to modify the data, and modifying the data of the node to be processed that matches the index information in the database according to the modified data based on the data table in the index information + the index id in the table. Deleting the data of the node to be processed refers to extracting index information from the node that needs to modify the data, and deleting the data of the node to be processed that matches the index information in the database according to the modified data based on the data table in the index information + the index id in the table. Among them, in the process of deleting the data, the nodes in the node data to be processed will be deleted together with the data. It can be understood that when deleting the node data to be processed, its corresponding nodes and the relationship between the nodes and other nodes also need to be deleted when deleting the data.
[0085] In the embodiment of the present application, the linkage modification caused by the subordinate relationship of the node data to be processed means that when the attribute of the grid model data corresponding to the grid layer node is modified, the corresponding attributes of each plant and station layer node that has a subordinate relationship with the grid model data need to be modified. For example, when the name Name of the grid layer node changes, the plant and station name Station Name of each data of its subordinate plant and station layer nodes needs to be modified accordingly.
[0086] In an embodiment of the present application, the linkage modification caused by the connection relationship of the node data to be processed means that when the attributes of a certain node are modified, the corresponding attributes of the nodes that have a connection relationship with the node need to be modified. For example, when the voltage of the bus data changes, the attribute voltage of the data of each power equipment connected to the bus needs to be changed.
[0087] In the embodiment of the present application, the linkage deletion caused by the subordinate relationship of the node data to be processed means that when the grid layer node is deleted, the data corresponding to each plant and station layer node that has a subordinate relationship with the grid layer node needs to be deleted. For example, when a plant and station data (grid layer node) is deleted, all circuit equipment data (plant and station layer nodes) inside the plant and station must be deleted.
[0088] In the embodiment of the present application, the linkage deletion caused by the connection relationship of the node data to be processed means that when a node is deleted, the attributes of each node that has a connection relationship with the node are deleted or processed in the same way as the deletion function. For example, when a bus node is deleted, the various devices originally connected to the bus are no longer connected to it, so it is necessary to delete / zero / empty all data related to the bus, such as the bus voltage attribute needs to be set to 0, indicating that there is no bus voltage data.
[0089] Embodiment 2:
[0090] Figure 3 A schematic diagram of the framework of a power grid simulation model data modification device based on hierarchical graph indexing described in an embodiment of the present application.
[0091] like Figure 3 As shown, the embodiment of the present application provides a power grid simulation model data modification device based on hierarchical graph index, including a graph index construction module 10, a search module 20 and a data modification module 30;
[0092] A graph index building module 10 is used to obtain a database of a power grid simulation model and build a graph index for the database. The graph index includes a number of nodes and relationships between nodes. Each node stores index information of a power grid simulation model data. The index information includes a node id, a model data type, a node type, a relational data table, and an index id corresponding to the model data in the relational data table.
[0093] A search module 20, configured to obtain model modification data, and search for to-be-modified model data corresponding to the model modification data in a database through a graph index; the model modification data includes a modification type and modification data.
[0094] A data modification module 30, configured to perform addition, modification, or deletion processing on the to-be-modified model data according to the modification data, to obtain modified power grid simulation model data.
[0095] It should be noted that the content of the modules in the apparatus of the second embodiment has been elaborated in the steps of the method of the first embodiment, and the content of the modules of the power grid simulation model data modification apparatus based on the hierarchical graph index will not be repeated in this embodiment. In this embodiment, the power grid simulation model data modification apparatus based on the hierarchical graph index can quickly add, modify, or delete power grid model data in the database through the graph index construction module, the search module, and the data modification module, further ensuring the correctness of the data and the subordinate relationship in the database, and thereby improving the management and maintenance efficiency of the power grid model data.
[0096] In an embodiment of the present application, the data modification module 30 is further configured to, according to the modification type being adding a node, determine the node type according to the model data type of the modification data, insert the newly added node into the graph index according to the node type, obtain a new graph index structure, and assign a node ID to the newly added node; determine the connection information of the newly added node according to the power equipment corresponding to the node type and the model data type of the modification data; if the node type is a grid layer node, the connection information includes a newly added connection relationship; if the node type is a substation layer node, the connection information includes a newly added connection relationship and a newly added subordinate relationship; establish connections between nodes for the newly added node on the new graph index structure according to the connection information, to obtain modified power grid simulation model data.
[0097] In an embodiment of the present application, the data modification module 30 is further configured to, according to the modification type being modifying or deleting a certain power grid simulation model data, search in the database through the graph index according to the modification data, to obtain to-be-processed node data that matches the modification data, and the to-be-processed node data includes nodes and relationships between nodes; determine the modification or deletion method for the to-be-processed node data according to whether the attribute of the node type in the modification data is a unique attribute, to obtain a modification method; modify or delete the to-be-processed node data according to the modification data and the modification method, to obtain modified power grid simulation model data.
[0098] Embodiment Three:
[0099] Figure 4 A schematic diagram of a terminal device according to an embodiment of the present application.
[0100] As Figure 4As shown, an embodiment of the present application provides a terminal device, including a processor and a memory;
[0101] The memory is used to store program code and transmit the program code to the processor;
[0102] The processor is used to execute the above-mentioned method for modifying power grid simulation model data based on hierarchical graph indexing according to the instructions in the program code.
[0103] It should be noted that the processor is used to execute the steps in the above-mentioned embodiment of a method for modifying power grid simulation model data based on hierarchical graph indexing according to the instructions in the program code. Alternatively, when the processor executes a computer program, it implements the functions of each module / unit in the above-mentioned system / device embodiments.
[0104] Exemplarily, the computer program can be divided into one or more modules / units. One or more modules / units are stored in the memory and executed by the processor to complete the present application. One or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program in the terminal device.
[0105] The terminal device can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that this does not limit the terminal device, and it may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the terminal device may also include input / output devices, network access devices, a bus, etc.
[0106] The so-called processor may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or the processor may also be any conventional processor, etc.
[0107] The memory can be an internal storage unit of the terminal device, such as the hard disk or memory of the terminal device. The memory can also be an external storage device of the terminal device, such as a plug-in hard disk equipped on the terminal device, a SmartMedia Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory can also include both the internal storage unit and the external storage device of the terminal device. The memory is used to store computer programs and other programs and data required by the terminal device. The memory can also be used to temporarily store the data that has been output or will be output.
[0108] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0109] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.
[0110] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0111] In addition, each functional unit in various embodiments of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0112] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.
[0113] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present application.
Claims
1. A method for modifying power grid simulation model data based on a hierarchical graph index, characterized in that, Including the following steps: Obtain the database of the power grid simulation model, and construct a graph index for the database. The graph index includes several nodes and the relationships between the nodes. Each node stores the index information of a piece of power grid simulation model data. The index information includes the node id, the model data type, the node type, the relational data table, and the index id corresponding to the model data in the relational data table; Obtain the model modification data, and search for the model data to be modified corresponding to the model modification data in the database through the graph index according to the model modification data. The model modification data includes the modification type and the modification data; Perform addition, modification, or deletion processing on the model data to be modified according to the modification data to obtain the modified power grid simulation model data.
2. The method for modifying power grid simulation model data based on a hierarchical graph index according to claim 1, wherein Performing addition, modification, or deletion processing on the model data to be modified according to the modification data to obtain the modified power grid simulation model data includes: If the modification type is to add a node, determine the node type according to the model data type of the modification data, insert the added node into the graph index according to the node type to obtain a new graph index structure, and assign a node ID to the added node; Determine the connection information of the added node according to the power equipment corresponding to the node type and the model data type of the modification data. If the node type is a grid layer node, the connection information includes the added connection relationship. If the node type is a substation layer node, the connection information includes the added connection relationship and the added subordination relationship; Establish connections between nodes for the added node on the new graph index structure according to the connection information to obtain the modified power grid simulation model data.
3. The method for modifying power grid simulation model data based on a hierarchical graph index according to claim 2, wherein Determining the connection information of the added node according to the power equipment corresponding to the model data type of the modification data includes: If the node type is a grid layer node, determine the nodes connected to the added node on the new graph index structure according to the power equipment corresponding to the model data type of the modification data; obtain the index id of the nodes connected to the added node; establish connection relationships between pairwise nodes according to the node ID and all the index ids to obtain the added connection relationship; Or, If the node type is a substation layer node, determine the nodes connected to the added node on the new graph index structure according to the power equipment corresponding to the model data type of the modification data, and determine the subordinate nodes of the substation nodes connected to the added node on the new graph index structure according to the substation information corresponding to the model data type of the modification data; obtain the index id of the nodes connected to the added node and obtain the index id of each subordinate node to obtain the subordinate id; establish connection relationships between pairwise nodes according to the node ID and all the index ids to obtain the added connection relationship; establish subordination relationships between pairwise nodes according to the node ID and all the subordinate ids to obtain the added subordination relationship.
4. The method for modifying power grid simulation model data based on a hierarchical graph index according to claim 1, wherein Performing addition, modification, or deletion processing on the model data to be modified according to the modification data to obtain the modified power grid simulation model data includes: If the modification type is to modify or delete a certain piece of power grid simulation model data, search in the database according to the modification data through the graph index to obtain the to-be-processed node data corresponding to and matching the modification data; Determine the method of modifying or deleting the to-be-processed node data according to whether the attribute of the node type in the modification data is a unique attribute, and obtain the modification method; Modify or delete the to-be-processed node data according to the modification data and the modification method to obtain the modified power grid simulation model data.
5. The method for modifying power grid simulation model data based on a hierarchical graph index according to claim 4, characterized in that Modifying or deleting the to-be-processed node data according to the modification data and the modification method to obtain the modified power grid simulation model data includes: If the modification method is a direct processing method, extract the to-be-processed index information from the modification data, and modify or delete the to-be-processed node data according to the relational data table and index id of the to-be-processed index information according to the modification data to obtain the modified power grid simulation model data; If the modification method is an associated processing method, perform an associated modification or deletion on the subordinate relationship and connection relationship of the to-be-processed node data according to the modification data to obtain the modified power grid simulation model data; Among them, performing an associated modification or deletion on the subordinate relationship of the to-be-processed node data according to the modification data includes: according to the node data of the grid layer in the modification data, modify or delete all the data corresponding to each substation layer node in the to-be-processed node data that has a subordinate relationship with the node data of the grid layer; Performing an associated modification or deletion on the connection relationship of the to-be-processed node data according to the modification data includes: according to a certain node data in the modification data, modify or delete all the data corresponding to each node in the to-be-processed node data that has a connection relationship with the node data.
6. The method for modifying power grid simulation model data based on a hierarchical graph index according to any one of claims 1-5, characterized in that The database includes a substation layer and a grid layer. The node type is used to reflect the geographical location of the power equipment on the graph index. The node type includes grid layer nodes and substation layer nodes. The node relationship includes a subordinate relationship and a connection relationship; The subordinate relationship is used to represent the relationship between the nodes of the substation layer and the nodes of the grid layer; The connection relationship is used to represent the connection relationship between two nodes of the same node type.
7. A power grid simulation model data modification device based on a hierarchical graph index, characterized in that Including: A graph index construction module, a search module, and a data modification module; The graph index construction module is used to obtain the database of the power grid simulation model, construct a graph index for the database. The graph index includes several nodes and node relationships. Each node stores the index information of a piece of power grid simulation model data. The index information includes a node id, a model data type, a node type, a relational data table, and an index id corresponding to the model data in the relational data table; The search module is used to obtain model modification data, and search for the to-be-modified model data corresponding to the model modification data in the database through the graph index; the model modification data includes a modification type and modification data; The data modification module is used to perform addition, modification, or deletion processing on the model data to be modified according to the modification data, so as to obtain the modified power grid simulation model data.
8. The device for modifying power grid simulation model data based on a hierarchical graph index according to claim 7, wherein The data modification module is further used to determine that the modification type is to add a node, then determine the node type according to the model data type of the modification data, insert the added node into the graph index according to the node type to obtain a new graph index structure, and assign a node ID to the added node; determine the connection information of the added node according to the power equipment corresponding to the node type and model data type of the modification data; If the node type is a grid layer node, the connection information includes an added connection relationship; if the node type is a substation layer node, the connection information includes an added connection relationship and an added subordination relationship; establish node-to-node connections for the added node on the new graph index structure according to the connection information to obtain the modified power grid simulation model data.
9. The device for modifying power grid simulation model data based on a hierarchical graph index according to claim 7, wherein The data modification module is further used to determine that the modification type is to modify or delete a certain piece of the power grid simulation model data, search in the database through the graph index according to the modification data to obtain the to-be-processed node data corresponding to the modification data; determine the method of modifying or deleting the to-be-processed node data according to whether the attribute of the node type in the modification data is a unique attribute to obtain the modification method; modify or delete the to-be-processed node data according to the modification data and the modification method to obtain the modified power grid simulation model data.
10. A terminal device, characterized in that, It includes a processor and a memory; The memory is used to store program codes and transmit the program codes to the processor; The processor is used to execute the method for modifying power grid simulation model data based on a hierarchical graph index according to the instructions in the program codes as described in any one of claims 1-6.