High-performance storage and query method and device for knowledge graph of power grid security and stability

By dividing the knowledge graph of the power grid safety and stability situation into graph structure data and time-varying attribute data, and adopting a memory-disk tiered storage solution, the problems of storage resource waste and low query efficiency caused by frequent updates of the power grid safety and stability situation graph are solved, and efficient storage and query performance is achieved.

CN116126978BActive Publication Date: 2025-09-26ELECTRIC POWER SCI RES INST OF STATE GRID XINJIANG ELECTRIC POWER CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211687065.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-27
Publication Date
2025-09-26
Estimated Expiration
2042-12-27

AI Technical Summary

Technical Problem

The existing knowledge graph storage method results in waste of storage resources and decreased query efficiency when the power grid security and stability status map is frequently updated, and cannot meet the high-performance storage requirements of the power grid security and stability status map.

Method used

A storage method based on time-varying graphs is adopted to divide the knowledge graph of power grid safety and stability into graph structure data and time-varying attribute data. A memory-disk tiered storage scheme and data elimination mechanism are used to construct database key values ​​through time-varying attribute IDs and time stamps to achieve efficient storage and query.

Benefits of technology

It greatly saves storage space, reduces storage time, and improves the storage and query performance of the knowledge graph of power grid safety and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116126978B_ABST
    Figure CN116126978B_ABST
Patent Text Reader

Abstract

The present invention relates to a high-performance storage and query method and device for a knowledge graph of the safety and stability status of a power grid. The method comprises: obtaining a knowledge graph of the safety and stability status of a power grid; dividing the power grid entities, the attribute data of the power grid entities, and the relationships between the power grid entities into time-varying attribute data and graph structure data based on temporal changes, and calculating the time-varying attribute timestamps and time-varying attribute IDs of the time-varying attribute data; storing the time-varying attribute data in a database; constructing an original knowledge graph based on the graph structure data, and using the time-varying attribute IDs and time-varying attribute timestamps as graph structure attributes, binding them to the attributes of the corresponding power grid entities or the relationships between the power grid entities in the original knowledge graph to obtain a final knowledge graph; obtaining and parsing query conditions to obtain query results based on the final knowledge graph and the database. The present disclosure implements high-performance storage management of the knowledge graph of the safety and stability status of a power grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of knowledge graph storage and query, and specifically to a high-performance storage and query method and device for a knowledge graph of power grid security and stability status. Background Art

[0002] As the scale of smart grids continues to grow, the volume and variety of measurement data are surging, making security analysis increasingly difficult. Intelligent technologies are urgently needed to effectively integrate, analyze, and categorize grid status information, thereby improving information utilization and, in turn, the quality of grid security analysis. Knowledge graphs, as a knowledge representation method, can describe entities and concepts in the real world and the relationships between them. In the field of power grid dispatching, a knowledge graph of power grid security and stability status can be constructed to organize, manage, and utilize massive amounts of grid status information. This enables intelligent knowledge extraction, reasoning, storage, and retrieval, helping grid dispatchers understand the grid's operating status and enhance grid security defenses.

[0003] Currently, the main storage methods for knowledge graphs are RDF graph storage and graph database storage. The RDF graph is a graph model that provides a unified standard for describing entities. The RDF graph is constructed by a node and directed edges. Both nodes and edges are marked with Uniform Resource Identifiers (URIs). When using RDF to store knowledge graphs, the subject, predicate, and object forms are used to associate them with triples in the knowledge graph. Graph databases are composed of nodes and edges. Nodes are used to identify entities, edges identify various types of relationships between entities, and attributes are used to describe the characteristics of nodes or edges. In the above storage methods, when the knowledge graph changes, the overall change of the graph is usually adopted. The common methods are regular data updates (snapshots) and version maintenance.

[0004] The knowledge graph of power grid security and stability situation uses a graph model to describe the complex spatiotemporal relationship between operational situation knowledge such as power grid stability assessment and optimization decision-making and equipment objects at all levels. It can be described that its entities are power grid nodes (such as stations, etc.), the relationship between entities is the relationship between power grid nodes, and the entity attributes are the state quantities of power grid nodes (such as the voltage, active power, reactive power, etc. of the power grid nodes). With the continuous operation of the power grid, the relationship between entities and the entity attributes in the knowledge graph of power grid security and stability situation will change frequently, and have locality and discreteness. The snapshot or version management update method in the traditional storage method will, on the one hand, occupy a large amount of storage resources to store different versions of the graph, resulting in a huge waste of storage resources. On the other hand, due to the large scale of power grid nodes, the storage of the entire graph each time the graph is updated is very time-consuming, resulting in a decrease in the storage and query efficiency of the knowledge graph of security and stability situation. Therefore, the existing knowledge graph storage method cannot meet the needs of frequent updates of the power grid security and stability situation graph. Summary of the Invention

[0005] In response to the problems of low storage performance and resource waste in traditional knowledge graph storage methods when the graph is frequently updated, the present invention provides a method and device for storing and querying a knowledge graph of power grid safety and stability based on a time-varying graph. When the graph is frequently updated, storage resources can be saved and storage performance can be improved, thereby realizing high-performance storage management of the knowledge graph of power grid safety and stability.

[0006] According to a first aspect of an embodiment of the present disclosure, a high-performance storage and query method for a knowledge graph of power grid security and stability status is provided, comprising:

[0007] Obtaining a knowledge graph of the security and stability status of the power grid; the knowledge graph is constructed based on the relationships between power grid entities and power grid entities at all times;

[0008] Based on temporal changes, the grid entities, the attribute data of the grid entities, and the relationships between the grid entities are divided into time-varying attribute data and graph structure data, and a time-varying attribute time stamp and a time-varying attribute ID of the time-varying attribute data are calculated;

[0009] Storing the time-varying attribute data in a database; wherein the key value of the database is composed of the time-varying attribute time stamp and the time-varying attribute ID of the time-varying attribute data;

[0010] According to the graph structure data, an original knowledge graph is constructed, and the time-varying attribute ID and the time-varying attribute time scale are used as graph structure attributes, and are bound to the attributes of the corresponding power grid entity or the relationship between power grid entities in the original knowledge graph to obtain a final knowledge graph;

[0011] Obtain and parse query conditions to obtain query results based on the final knowledge graph and the database.

[0012] Furthermore, based on temporal changes, the grid entities, the attribute data of the grid entities, and the relationships between the grid entities are divided into time-varying attribute data and graph structure data, and the time-varying attribute timestamp and the time-varying attribute ID of the time-varying attribute data are calculated, including:

[0013] The grid entities, attribute data of the grid entities, and relationships between the grid entities that change with time are used as time-varying attribute data; wherein the attribute data that change with time includes: measurement attribute data and indicator entity data;

[0014] Establishing a globally unique time-varying attribute ID for the time-varying attribute data, and obtaining a time-varying attribute timestamp for the time-varying attribute data; wherein the time-varying attribute timestamp includes: a time-varying start time and a time-varying end time;

[0015] The grid entities that do not change with time, the attribute data of the grid entities, and the relationships between the grid entities are used as graph structure data; wherein the attribute data that does not change with time includes: entity name and time-varying attribute ID.

[0016] Furthermore, the measurement attribute data includes: voltage, active power and reactive power; the indicator entity data includes: static indicators and transient indicators.

[0017] Furthermore, the database includes: a distributed memory database and a distributed column database.

[0018] Furthermore, storing the time-varying attribute data in a database includes:

[0019] Set a time window;

[0020] Determining the association between the time-varying attribute data and the time window based on the time-varying attribute time scale;

[0021] storing the time-varying attribute data outside the time window in a distributed memory database;

[0022] The time-varying attribute data within the time window is stored in a distributed column-based database.

[0023] Furthermore, the acquiring and parsing of query conditions to obtain query results based on the final knowledge graph and the distributed database includes:

[0024] Obtaining and parsing query conditions to determine a query target in the query conditions; wherein the query target includes: graph structure data or time-varying attribute data;

[0025] In the case where the query target is the graph structure data, converting the query condition into a graph database query language Cypher to obtain a query result;

[0026] When the query target is the time-varying attribute data, the time-varying attribute timestamp and time-varying attribute ID corresponding to the query condition are calculated, and by comparing the time-varying attribute timestamp and the time window, the query result is obtained from the distributed memory database and / or the distributed column database.

[0027] Furthermore, the method further includes:

[0028] The query result is returned to the client in the form of JSON.

[0029] According to a second aspect of an embodiment of the present disclosure, a high-performance storage and query device for a knowledge graph of power grid security and stability is provided, characterized in that the device includes:

[0030] A graph acquisition module is used to obtain a knowledge graph of the security and stability status of the power grid; the knowledge graph is constructed based on the relationship between power grid entities and power grid entities at all times;

[0031] an attribute classification module for classifying the grid entities, the attribute data of the grid entities, and the relationships between the grid entities into time-varying attribute data and graph structure data based on temporal changes, and calculating the time-varying attribute timestamp and time-varying attribute ID of the time-varying attribute data;

[0032] A data storage module, configured to store the time-varying attribute data in a database; wherein the key value of the database is composed of the time-varying attribute time stamp and the time-varying attribute ID of the time-varying attribute data;

[0033] A graph construction module is used to construct an original knowledge graph based on the graph structure data, and use the time-varying attribute ID and the time-varying attribute time scale as graph structure attributes, binding them to the attributes of the corresponding power grid entity or the relationship between power grid entities in the original knowledge graph to obtain a final knowledge graph;

[0034] A graph query module is used to obtain and parse query conditions to obtain query results based on the final knowledge graph and the database.

[0035] According to a third aspect of an embodiment of the present disclosure, a storage medium is provided, characterized in that a computer program is stored in the storage medium, wherein the computer program is configured to execute, at runtime, a high-performance storage query method for the power grid security and stability situation knowledge graph provided by the first aspect of the present disclosure.

[0036] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the high-performance storage and query method of the power grid security and stability situation knowledge graph provided by the first aspect of the present disclosure are implemented.

[0037] Compared with the prior art, the present invention has the following positive effects:

[0038] This invention utilizes a time-varying graph to divide the knowledge graph of power grid security and stability into graph structure data storage and time-varying attribute data storage. By establishing a corresponding storage model, it adapts to application scenarios where the graph is frequently updated. When the graph is frequently updated, the present invention minimizes the storage of redundant data, greatly saving storage space and reducing storage time. Furthermore, the present invention effectively improves the storage and query performance of the knowledge graph of power grid security and stability by developing a memory-disk tiered storage solution and a data elimination mechanism. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 This is a schematic diagram of the storage process of the knowledge graph of the power grid security and stability situation.

[0040] Figure 2 It is a schematic diagram of the graph structure storage model of the knowledge graph of power grid security and stability status.

[0041] Figure 3 This is a schematic diagram of the knowledge graph query process for the power grid security and stability situation. DETAILED DESCRIPTION

[0042] The following will clearly and completely describe the technical solutions of the present invention in conjunction with the embodiments and drawings. It will be understood that the embodiments described are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.

[0043] The high-performance storage and query method of the power grid security and stability situation knowledge graph of the present invention includes power grid security and stability situation knowledge graph storage and power grid security and stability situation knowledge graph query.

[0044] (1) Knowledge graph storage of power grid security and stability

[0045] The storage process of the knowledge graph of power grid security and stability status is as follows: Figure 1 The specific steps are as follows:

[0046] Step 1) In combination with the time-varying graph model, a grid security and stability situation knowledge graph storage model is established, and the data in the grid security and stability situation knowledge graph is divided into time-varying attribute data and graph structure data according to the data update frequency;

[0047] Step 1.1) Divide the measurement attributes (voltage, active power, reactive power, etc.) and indicator entities (static indicators, transient indicators, etc.) of the entities in the power grid security and stability knowledge graph into time-varying attribute data and store them using a key-value model;

[0048] Step 1.2) Divide the association relationships between entities in the knowledge graph of power grid security and stability and the static attributes of the entities (name, time-varying attribute ID, etc.) into graph structure data, add the start time and end time attributes to the association relationship to record the timeliness of the relationship, and use the graph model to store it. The specific storage structure is as follows: Figure 2 As shown;

[0049] Step 2) Create a globally unique time-varying attribute ID and bind the ID to the corresponding entity / relationship attribute as a graph structure attribute. The time-varying attribute timestamp and the unique attribute ID together constitute the key value in the KV model.

[0050] Step 2.1) Randomly arrange the time-varying attributes and generate auto-incrementing IDs. Record the maximum ID to facilitate subsequent time-varying attribute ID generation.

[0051] Step 2.2) Convert the time-varying attribute timestamp into the format of "yyyy-MM-dd HH:mm:ss", for example, convert January 1, 2021, 17:16:32 into "2021-01-01 17:16:32";

[0052] Step 2.3) Concatenate the converted time stamp and attribute ID using the "_" character to form the key value in the KV model. For example, for a time-varying attribute with ID 10, its key value at 17:16:32 on January 1, 2021 is "2021-01-0117:16:32_10";

[0053] Step 3) Formulate a knowledge graph storage strategy for power grid security and stability to achieve storage of time-varying attributes and graph structures;

[0054] Step 3.1) Develop a distributed storage solution for time-varying attribute data based on a memory cache strategy, divide the time-varying attribute data into hot and cold data, and implement historical data storage management;

[0055] Step 3.2) Set the time window to five minutes based on business needs, and store all data from the five minutes before the current moment in a distributed memory database, such as a Redis database;

[0056] Step 3.3) Store the data between the current time and five minutes in a distributed columnar database, such as an HBase database;

[0057] Step 3.4) For graph-structured data, a graph database is used for storage, with entities as nodes, relationships as edges, and time-invariant attributes as node and edge properties. By adding the start and end time attributes to the edges, time-varying relationships can be recorded.

[0058] (2) Knowledge graph query on power grid security and stability

[0059] The query process of the knowledge graph of power grid security and stability situation is as follows: Figure 3 The specific steps are as follows:

[0060] Step 1) For graph structure queries, convert the query conditions into the graph database query language Cypher, and convert the returned results into JSON format and return them to the client; for example, to query the topology information of all 500kV AC lines at 17:16:32 on January 1, 2021, the Cypher query statement is as follows, where 1609492592 is the number of seconds.

[0061]

[0062] Step 2) For time-varying attribute queries, first, the attribute IDs that meet the query conditions are obtained from the graph structure. Then, based on the query time range, the query range is determined to be within five minutes of the current time. Data within the time window is obtained from the in-memory database, while data outside the time window is obtained from the column-based database. Finally, the time stamp and attribute ID are used to obtain the corresponding data from the in-memory database and the column-based database, and the data is returned to the client in JSON format.

[0063] In summary, the present invention meets the needs for updating nodes, edges, and node attributes in the power grid security and stability status graph through a knowledge graph of non-time-varying attribute data and a storage method for time-varying attribute data.

[0064] The above embodiments are intended only to illustrate the principles and effects of the present invention and are not intended to limit the scope of the present invention. Any person skilled in the art may modify or alter the embodiments without departing from the technical principles and spirit of the present invention. The scope of protection of the present invention shall be determined by the claims.

Claims

1. A high-performance storage and query method for a knowledge graph of power grid security and stability, characterized by: The method comprises: Obtaining a knowledge graph of the security and stability status of the power grid; the knowledge graph is constructed based on the relationships between power grid entities and power grid entities at all times; Based on temporal changes, the grid entities, the attribute data of the grid entities, and the relationships between the grid entities are divided into time-varying attribute data and graph structure data, and a time-varying attribute time stamp and a time-varying attribute ID of the time-varying attribute data are calculated; Storing the time-varying attribute data in a database; wherein the key value of the database is composed of the time-varying attribute time stamp and the time-varying attribute ID of the time-varying attribute data; According to the graph structure data, an original knowledge graph is constructed, and the time-varying attribute ID and the time-varying attribute time scale are used as graph structure attributes, and are bound to the attributes of the corresponding power grid entity or the relationship between power grid entities in the original knowledge graph to obtain a final knowledge graph; Obtain and parse query conditions to obtain query results based on the final knowledge graph and the database.

2. The method according to claim 1, wherein The method of dividing the grid entities, the attribute data of the grid entities, and the relationships between the grid entities into time-varying attribute data and graph structure data based on temporal changes, and calculating the time-varying attribute timestamp and the time-varying attribute ID of the time-varying attribute data, includes: The grid entities, attribute data of the grid entities, and relationships between the grid entities that change with time are used as time-varying attribute data; wherein the attribute data that change with time includes: measurement attribute data and indicator entity data; Establishing a globally unique time-varying attribute ID for the time-varying attribute data, and obtaining a time-varying attribute timestamp for the time-varying attribute data; wherein the time-varying attribute timestamp includes: a time-varying start time and a time-varying end time; The grid entities that do not change with time, the attribute data of the grid entities, and the relationships between the grid entities are used as graph structure data; wherein the attribute data that does not change with time includes: entity name and time-varying attribute ID.

3. The method according to claim 2, wherein The measurement attribute data includes: voltage, active power and reactive power; the indicator entity data includes: static indicators and transient indicators.

4. The method according to claim 1, wherein The database includes: a distributed memory database and a distributed column database.

5. The method according to claim 4, wherein Storing the time-varying attribute data in a database includes: Set a time window; Determining the association between the time-varying attribute data and the time window based on the time-varying attribute time scale; storing the time-varying attribute data outside the time window in a distributed memory database; The time-varying attribute data within the time window is stored in a distributed column-based database.

6. The method according to claim 5, wherein The acquiring and parsing query conditions to obtain query results based on the final knowledge graph and the database includes: Obtaining and parsing query conditions to determine a query target in the query conditions; wherein the query target includes: graph structure data or time-varying attribute data; In the case where the query target is the graph structure data, converting the query condition into a graph database query language Cypher to obtain a query result; When the query target is the time-varying attribute data, the time-varying attribute timestamp and time-varying attribute ID corresponding to the query condition are calculated, and by comparing the time-varying attribute timestamp and the time window, the query result is obtained from the distributed memory database and / or the distributed column database.

7. The method according to any one of claims 1 to 6, wherein: The method further comprises: The query result is returned to the client in the form of JSON.

8. A high-performance storage and query device for a knowledge graph of power grid security and stability, characterized by: The device comprises: A graph acquisition module is used to obtain a knowledge graph of the security and stability status of the power grid; the knowledge graph is constructed based on the relationship between power grid entities and power grid entities at all times; an attribute classification module for classifying the grid entities, the attribute data of the grid entities, and the relationships between the grid entities into time-varying attribute data and graph structure data based on temporal changes, and calculating the time-varying attribute timestamp and time-varying attribute ID of the time-varying attribute data; A data storage module, configured to store the time-varying attribute data in a database; wherein the key value of the database is composed of the time-varying attribute time stamp and the time-varying attribute ID of the time-varying attribute data; A graph construction module is used to construct an original knowledge graph based on the graph structure data, and use the time-varying attribute ID and the time-varying attribute time scale as graph structure attributes, binding them to the attributes of the corresponding power grid entity or the relationship between power grid entities in the original knowledge graph to obtain a final knowledge graph; The graph query module is used to obtain and parse query conditions to obtain query results based on the final knowledge graph and the database.

9. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when run.

10. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • A fast storage and query method of time-varying graph data

    CN109145121A

  • Method, system and device for processing data in knowledge graph and medium

    CN114416891A