Power grid multi-temporal modeling method and device based on graph database and electronic equipment
By using schema names to identify multi-temporal power grid data in a graph database, the problem of low processing efficiency in multi-temporal power grid data management is solved, and high-efficiency data storage and query performance is achieved.
Patent Information
- Application Number
- CN202310619696.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-29
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2043-05-29
AI Technical Summary
In existing technologies, multi-temporal power grid data management based on graph databases suffers from low processing efficiency, especially when performing large-scale data queries due to the low efficiency caused by duplicate attributes.
Using schema names to identify any temporal state, and managing multi-temporal power grid data through a graph database, it is not necessary to provide additional attributes for each point or edge to store temporal or version fields. The power grid operating status is directly identified by schema names, and the data migration rules managed by transactions solve the problem of data migration consistency between different temporal states.
It saves storage space, provides a clear data model, reduces management costs, and improves query performance and data processing efficiency.
Smart Images

Figure CN116756115B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power grid graph database, and particularly relates to a power grid multi-time state modeling method and device based on a graph database and electronic equipment. BACKGROUND
[0002] With the development of associated networks such as power networks, the demand for storage of relationship graphs and analysis of network topology structure and functions based on relationship graphs has also increased accordingly, which has promoted the development of graph databases. A graph database is a data management system that takes points and edges as basic storage units and is designed to efficiently store and query graph data. Graph databases often manage graph instances through attribute graphs. Power graph computing is a technology that takes power grid topology graphs as objects, combines general graph computing methods with mathematical and physical methods of power system analysis, and models, analyzes, calculates, and optimizes decisions for multiple time states of power generation, transmission, transformation, distribution, use, and storage, as well as planning, operation, and maintenance. The implementation and management of multi-time state power grids is a key business requirement in power grid operation, that is, how to manage multiple forms (operation state, planning state, and construction state) of power grids. The operation state is the state data of the running power grid, the planning state is the state data of the planned power grid, and the construction state is the state data of the construction power grid. Different forms are different, but there are also correlations and evolution relationships between the forms.
[0003] Traditional multi-power grid time state implementation and management have two ways, using a relational database and a graph database. Based on a relational database, different databases in the relational database are used to store and manage different time states. Each time state stores power grid data in the corresponding database. Due to the complex correlation of power grid data and analysis algorithms, using a relational database to manage multi-time state power grid data has low processing efficiency and performance problems. Based on a graph database, different graph instances store multi-time state power grid data, and the data between different time states lacks correlation, making it difficult to obtain the connection relationship between the data between different time states. Based on a graph database, attributes (such as "time state", "time", and "version number") are added to power grid data resources (point data) to manage multi-time state data. Compared with the above-mentioned storage, analysis, and management of power grid time state data through "database" instances or "graph instances", this method is more flexible and can establish correlations between different time states. However, when analyzing data based on "attributes" and querying large-scale data based on "time state" or "version", a large number of repeated attributes result in low query efficiency. Therefore, the prior art has the problem of low processing efficiency of multi-time state data by a general method. SUMMARY
[0004] The application provides a power grid multi-time modeling method and device based on a graph database and electronic equipment to at least solve the problem of low efficiency of general methods in processing multi-time data.
[0005] According to a first aspect of an embodiment of the application, a power grid multi-time modeling method based on a graph database is provided, which comprises: using the name of a schema to identify any time state, the schema being a data model in any field of the graph database, the name of the schema being a label corresponding to any type of point or edge, and the any time state being any state of power grid operation; using the schema to manage data in any time state, the data being point data and edge data in the graph database.
[0006] Optionally, the time state comprises an operation state, a planning state and a construction state, and the using of the name of the schema to identify any time state comprises: for a graph database using an attribute to identify a device type, using the names of three schemas of the operation state, the planning state and the construction state to identify the three time states of the operation state, the planning state and the construction state, respectively; and for a graph database using a label to identify a device type, using the names of three schemas of the operation state plus a device type, the planning state plus a device type and the construction state plus a device type to identify the three time states of the operation state, the planning state and the construction state, respectively.
[0007] Optionally, the method further comprises: an attribute of a point in the graph database is used to save device attribute information or element attribute information; and an attribute of an edge in the graph database is used to save line attribute information.
[0008] Optionally, the method further comprises: for a graph database using an attribute to identify a device type, any time state and the name of the schema are matched to access data in any time state; for a graph database using a label to identify a device type, any time state plus any device type and the name of the schema are matched to access data of any device type in any time state; and for a graph database using an attribute or a label to identify a device type, the name of the schema of any point or edge is used to determine the time state corresponding to the any point or edge.
[0009] Optionally, the method further comprises: when the time state of all data in any time state is changed from an original time state to a new time state, the name of the schema corresponding to all data in the any time state is changed from the original time state to the new time state; and when the time state of part of data in any time state is changed from an original time state to a new time state, the part of data in the any time state is migrated to a schema with the name of the new time state.
[0010] Optionally, the method is managed by a graph database transaction, and when a time state of any partial data changes from an original time state to a new time state, the any partial data is migrated to a schema named the new time state, including: creating a point corresponding to the any partial data under the schema of the new time state; when two points connected by an edge corresponding to the any partial data exist under the schema of the new time state, creating the edge corresponding to the any partial data under the schema of the new time state; and deleting the edge and the points connected with the edge, which have been created under the schema of the new time state, in the schema of the original time state.
[0011] Optionally, the method further includes: if the point corresponding to the any partial data has an adjacent edge that has not changed from the original time state to the new time state under the schema of the original time state, retaining the point corresponding to the any partial data in the schema of the original time state.
[0012] According to the second aspect of the embodiments of the present application, a power grid multi-time state modeling device based on a graph database is further provided, which includes: an identification module configured to identify any time state by using a name of a schema, the schema being a data model in any field of the graph database, the name of the schema being a label corresponding to any type of point or edge, and the any time state being any state of power grid operation; and a management module configured to manage data in any time state by using the schema, the data being point data and edge data in the graph database.
[0013] Optionally, the time states include: a running state, a planning state, and a construction state, and the identification module includes: a first identification unit configured to identify the three time states of the running state, the planning state, and the construction state by using the names of the three schemas of the running state, the planning state, and the construction state, respectively, for a graph database using attributes to identify device types; and a second identification unit configured to identify the three time states of the running state, the planning state, and the construction state by using the names of the three schemas of the running state plus device types, the planning state plus device types, and the construction state plus device types, respectively, for a graph database using labels to identify device types.
[0014] Optionally, the attributes of the points in the graph database are used to save device attribute information or element attribute information, and the attributes of the edges in the graph database are used to save line attribute information.
[0015] Optionally, the apparatus further comprises: a first matching module configured to, for a graph database using attributes to identify device types, access data in any time state by matching the name of any time state and schema; a second matching module configured to, for a graph database using labels to identify device types, access data in any device type in any time state by matching the name of any time state plus any device type and schema; and a determination module configured to, for a graph database using attributes or labels to identify device types, determine the time state corresponding to any point or edge according to the name of the schema of the any point or edge.
[0016] Optionally, the apparatus further comprises: a modification module configured to, when the time state of all data in any time state is changed from an original time state to a new time state, modify the name of the schema corresponding to all data in the any time state from the original time state to the new time state; and a migration module configured to, when the time state of part of the data in any time state is changed from an original time state to a new time state, migrate part of the data in the any time state to a schema with the name of the new time state.
[0017] Optionally, the method is managed through a graph database transaction, and the migration module comprises: a first creation unit configured to create a point corresponding to part of the data in the any time state under a schema of the new time state; a second creation unit configured to, when two points connected by an edge corresponding to part of the data in the any time state exist under the schema of the new time state, create the edge corresponding to part of the data in the any time state under the schema of the new time state; and a deletion unit configured to delete, in a schema of the original time state, an edge that has been created under the schema of the new time state and a point connected to the edge.
[0018] Optionally, the apparatus further comprises a retention module configured to, if a point corresponding to part of the data in the any time state has an adjacent edge that is not changed from the original time state to the new time state under the schema of the original time state, retain the point corresponding to part of the data in the any time state in the schema of the original time state.
[0019] According to a third aspect of the embodiments of the present application, an electronic device is further provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus; the memory is configured to store a computer program; and the processor is configured to execute the graph database-based power grid multi-time state modeling method in any of the above embodiments by running the computer program stored on the memory.
[0020] According to the fourth aspect of the embodiments of the present application, a computer readable storage medium is also provided, which stores a computer program. The computer program is configured to execute the power grid multi-temporal modeling method based on a graph database when running.
[0021] In the embodiments of the present application, any temporal state is identified by using the name of a schema, the schema is a data model in any field of the graph database, the name of the schema is a label corresponding to any type of point or edge, and any temporal state is any state of power grid operation. The data in any temporal state is managed by using the schema, and the data is point data and edge data in the graph database. Since the schema based on the graph database is introduced to manage the multi-temporal data of the power grid, it is not necessary to provide additional attributes for each point or edge to store the temporal state or version field, thereby achieving the purposes of saving storage space, classifying data, and making the data model clear. The data of any schema, i.e., any type of data, directly reflects the state of the power grid operation, i.e., the temporal state, and it is not necessary to query the attributes to distinguish different temporal states or versions, thereby reducing the management cost and improving the query performance. Furthermore, the problem of low processing efficiency of the multi-temporal data by the general method in the prior art is solved.
[0022] In the embodiments of the present application, when the temporal state of all data in any temporal state is changed from an original temporal state to a new temporal state, the name of the schema corresponding to all data in any temporal state is modified from the original temporal state to the new temporal state. When the temporal state of part of the data in any temporal state is changed from the original temporal state to the new temporal state, the part of the data in any temporal state is migrated to the schema with the name of the new temporal state. The migration rule of the corresponding schema data is introduced, and the consistency of the data when the multi-temporal data is migrated between different temporal states after the temporal state is changed is solved. BRIEF DESCRIPTION OF DRAWINGS
[0023] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or the prior art description will be briefly introduced as follows. Obviously, those skilled in the art can obtain other drawings from these drawings without any creative effort.
[0025] Figure 1 is a schematic diagram of a hardware environment of an optional power grid multi-temporal modeling method based on a graph database according to an embodiment of the present application;
[0026] Figure 2is a flow diagram of an optional power grid multi-temporal modeling method based on a graph database according to an embodiment of the present application;
[0027] Figure 3 is a flow diagram of an optional power grid multi-temporal modeling method based on a graph database according to an embodiment of the present application;
[0028] Figure 4 is a structural block diagram of an optional power grid multi-temporal modeling device based on a graph database according to an embodiment of the present application;
[0029] Figure 5 is a structural block diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the personnel in the art better understand the present application scheme, the technical scheme in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.
[0031] It should be noted that, in the description of the present application, the terms "first", "second", etc. are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices. The terms "mount", "connect", "connect" should be understood broadly, for example, it can be fixedly connected, or it can be detachably connected, or integrally connected; it can be mechanically connected, or it can be electrically connected; it can be directly connected, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements, it can be wireless connection, or it can be wired connection. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0032] In addition, if the meaning of "and / or" appears in the present application, it includes three parallel solutions, for example, "A and / or B" includes A solution, or B solution, or A and B solution. In addition, the technical solutions of each embodiment can be combined with each other, but it must be based on the realization of ordinary skilled in the art, when the combination of technical solutions appears contradictory or cannot be realized, it should be considered that the combination of technical solutions does not exist, and is not within the protection scope required by the present application.
[0033] According to an aspect of an embodiment of the present application, a power grid multi-temporal modeling method based on a graph database is provided. Optionally, in the present embodiment, the power grid multi-temporal modeling method based on the graph database can be applied to the hardware environment as shown in Figure 1 As shown in Figure 1 The terminal 102 can include a memory 104, a processor 106, and a display 108 (optional component). The terminal 102 can be connected to the server 112 through the network 110, and the server 112 can be used to provide services (such as application services) for the terminal or the client installed on the terminal. The database 114 can be set on the server 112 or independently of the server 112, and can be used to provide data storage services for the server 112. In addition, the server 112 can run a processing engine 116, which can be used to execute the steps performed by the server 112.
[0034] Optionally, the terminal 102 can be, but is not limited to, a terminal that can calculate data, such as a mobile terminal (for example, a mobile phone, a tablet computer), a notebook computer, a PC (Personal Computer, personal computer), and the like. The network can include, but is not limited to, a wireless network or a wired network. The wireless network includes Bluetooth, WIFI (Wireless Fidelity, wireless fidelity), and other wireless communication networks. The wired network can include, but is not limited to, a wide area network, a metropolitan area network, and a local area network. The server 112 can include, but is not limited to, any hardware device that can perform calculations.
[0035] In addition, in the present embodiment, the power grid multi-temporal modeling method based on the graph database can also be, but is not limited to, applied to a separate processing device with strong processing capability, without the need for data interaction. For example, the processing device can be, but is not limited to, a terminal device with strong processing capability, that is, each operation in the power grid multi-temporal modeling method based on the graph database can be integrated in a separate processing device. The above is only an example, and the present embodiment does not make any limitation thereto.
[0036] Optionally, in the embodiment, the power grid multi-temporal modeling method based on the graph database can be executed by the server 112, can also be executed by the terminal 102, and can also be executed by the server 112 and the terminal 102 jointly. The terminal 102 executing the power grid multi-temporal modeling method based on the graph database in the embodiment of the application can also be executed by a client installed thereon.
[0037] Taking that the power grid multi-temporal modeling method based on the graph database is applied to a central processing unit as an example, Figure 2 is a flowchart of an optional power grid multi-temporal modeling method based on a graph database according to an embodiment of the application, as Figure 2 shown, the flow of the method can include the following steps:
[0038] In step S201, any temporal state is identified using the name of a schema, the schema is a data model in any field of the graph database, the name of the schema is a label corresponding to any type of point or edge, and any temporal state is any state of power grid operation. Optionally, the graph database is a data management system taking point and edge as basic storage units and taking efficient storage and query of graph data as a design principle. The graph database often manages graph instances through an attribute graph. The attribute graph is composed of vertices, edges, attributes (key:value), and labels. Vertices and edges can have labels (Label), and the characteristics are: topology relationship is expressed by points and edges; data is stored by attaching attributes to points and edges.
[0039] A schema of a graph database is equivalent to a data model in a field, and contains meaningful concept types in the field and attributes of the types. The set of all points (or edges) of a certain schema represents all points (or edges) of the type, so the schema also represents the type of a certain "entity" / "point" or "relationship" / "edge" in the business field. Usually, the name of the schema is called a label, which is a string, representing the name of the schema and can also be used to uniquely identify the schema.
[0040] It should be noted that English words or pinyin letters are usually used as labels of the schema in actual systems, such as "busbar" or "muxian" for bus identification. In the embodiment of the application, Chinese names will be directly used as the label name of the schema without causing ambiguity, such as "busbar". Based on this, multiple temporal states are used as the names of multiple schemas, i.e., labels, to achieve power grid multi-temporal modeling and management of power grid multi-temporal data.
[0041] In step S202, the data in any time state is managed using the schema, the data being point data and edge data in the graph database. Alternatively, the data in any time state can be managed according to the schema of the graph database, wherein the management can include storage, query, migration (maintenance), etc. Regardless of the graph database and the manner of managing the data, the point data and the edge data, i.e. the data in the graph database, always conforms to the definition of the schema.
[0042] In the embodiment of the application, any time state is identified by using the name of the schema, the schema being a data model in any field of the graph database, the name of the schema being a label corresponding to any type of point or edge, and the any time state being any state of power grid operation. The data in any time state is managed using the schema, the data being point data and edge data in the graph database. Since the schema based on the graph database is introduced to manage the multi-time state data of the power grid, it is not necessary to provide an additional attribute for each point or edge to store a time state or version field, thereby achieving the purposes of saving storage space, classifying data, and making the data model clear. The data of any schema, i.e. any type of data, directly reflects the state of power grid operation, i.e. the time state, without the need of querying the attribute to distinguish different time states or versions, thereby reducing the management cost and improving the query performance. Further, the problem of low processing efficiency of the multi-time state data by the general method in the prior art is solved.
[0043] As an optional embodiment, the time state includes an operation state, a planning state, and a construction state. The name of the schema is used to identify any time state, including: for the graph database using an attribute to identify the type of equipment, using the names of three schemas of the operation state, the planning state, and the construction state to identify the three time states of the operation state, the planning state, and the construction state, respectively; and for the graph database using a label to identify the type of equipment, using the names of three schemas of the operation state plus the type of equipment, the planning state plus the type of equipment, and the construction state plus the type of equipment to identify the three time states of the operation state, the planning state, and the construction state, respectively.
[0044] Optionally, the implementation and management of the multi-time-state power grid is a key business requirement in power grid operation, and how to manage multiple forms of power grid, such as running state, planning state and construction state, is studied. The running state is the state data of the running power grid, the planning state is the state data of the planned power grid, and the construction state is the state data of the construction power grid. Different forms are different, and there is a correlation and evolution relationship between the forms. A big feature of the multi-time-state power grid environment is that the number of time states is fixed and limited, such as the three time states of running state, planning state and construction state. The limited time states will bring a lot of repeated attributes to the technical solution based on graph properties, but they are very suitable for the name identification of any time state using schema proposed in the embodiment. Specifically, in a power grid management system based on a graph database, there are usually two ways to identify different devices or components:
[0045] (1) Use the attribute to identify the device type, such as the "type" attribute of a certain point in the graph database is a bus or other device type;
[0046] (2) Use labels to identify device types, that is, different labels are used for specific device or component types, such as different point labels are used to identify buses, substations, power sources and other devices in the power grid, and different labels are used for different devices; different edge labels are used to identify the power transmission lines between devices.
[0047] For the above two ways, the following two ways are used to identify any time state by the name of the schema:
[0048] (1) For the graph database using attributes to identify device types, use schemas named "running state", "planning state" and "construction state" to identify running state, planning state and construction state. In this way, new schemas are introduced to identify time states, that is, three schemas representing running state, planning state and construction state are used to manage point or edge data in the corresponding time state.
[0049] (2) For the graph database using labels to identify device types, identify running state, planning state and construction state by "time state" + "device type". In this way, time states and device types can be combined arbitrarily, that is, a single schema can represent a specific device, component type or connection line type in a specific time state.
[0050] As an optional embodiment, the method further comprises: the attribute of the point in the graph database is used to save the device attribute information or the element attribute information; and the attribute of the edge in the graph database is used to save the line attribute information. Optionally, for the above two ways of using the name of the schema to identify any time state, the schema created by either way is consistent in structure with the schema in the normal case without introducing time state. That is, each attribute of the schema of the point saves the device attribute information or the element attribute information; and the attribute of the edge is used to save the line attribute information. The attribute information can be position information, size information, production date, etc.
[0051] As an optional embodiment, the method further comprises: for the graph database using the attribute to identify the device type, the data in any time state is accessed by matching the name of any time state and the schema; for the graph database using the label to identify the device type, the data of any device type in any time state is accessed by matching the name of any time state plus any device type and the schema; and for the graph database using the attribute or the label to identify the device type, the time state corresponding to any point or edge is determined according to the name of the schema of the point or the edge.
[0052] Optionally, using the name of the schema to identify any time state actually encodes the time state information into the name of the schema. When the specific "time state" schema needs to be accessed, the specific "time state" data can be queried by string matching, etc. If all the schemas in a specific "time state" need to be accessed, all the schemas can be traversed, and the "time state" is matched as the prefix of the name of the schema. The schema matched by the prefix is the schema in the "time state" or the data of a certain type. Similarly, if the specific device schema (such as the bus) in a specific "time state" needs to be accessed, the "time state + device type (such as the bus)" and the name of the schema are matched. The "time state + device type" is the name of the schema of the device type in the "time state". In addition, when the "time state" corresponding to a certain schema needs to be known, the prefix of the name of the schema is taken, which is the "time state" name corresponding to the schema.
[0053] As an optional embodiment, when the point or edge data is stored, the data is stored into the corresponding schema according to the "time state" of the data. Specifically, for the graph database using the attribute to identify the device type, the "time state" information is directly encoded in the schema name. According to the "time state", the corresponding schema is found, and the corresponding point or edge data is directly stored; for the graph database using the label to identify the device type, the different device types in different time states are identified by "time state + device type". At this time, according to the device type, component type or line type of the point or edge data, combined with the "time state", the corresponding schema name can be determined, and the corresponding point or edge data is stored in the schema.
[0054] As an optional embodiment, the method further comprises: when the time state of all data in any time state changes from the original time state to the new time state, the name of the schema corresponding to all data in any time state is modified from the original time state to the new time state; when the time state of part of the data in any time state changes from the original time state to the new time state, the part of the data in any time state is migrated to the schema with the name of the new time state. Optionally, when the device or line, that is, the point or edge, "time state" changes, the point and edge data are migrated according to the rules defined in the embodiment. Specifically, the device or line "time state" change generally includes the following two cases:
[0055] (1) All data in the original time state changes (is migrated to) the new time state, such as migrating all data in the "planning state" to the "running state";
[0056] (2) Part of the data in the original time state changes (is migrated to) the new time state, and the other data remains in the original time state.
[0057] Case (1) is relatively simple, and is actually a schema renaming process, that is, the name of the schema is modified from the "original time state" to the "new time state". This operation is convenient and has low cost. For case (2), the migration principle of the embodiment is: first copy, then delete. That is, the part of the data (including point data and edge data) that needs to be migrated is first copied to the schema corresponding to the "new time state", and then the copied data is deleted from the schema corresponding to the "original time state".
[0058] In the embodiment of the application, when the time state of all data in any time state changes from the original time state to the new time state, the name of the schema corresponding to all data in any time state is modified from the original time state to the new time state; when the time state of part of the data in any time state changes from the original time state to the new time state, the part of the data in any time state is migrated to the schema with the name of the new time state. The migration rule of the corresponding schema data is introduced, and the consistency problem of the data when the multi-time state data is migrated between different time states after the time state changes is solved.
[0059] As an optional embodiment, the method is managed by a graph database transaction, when the time state of the partial data under any time state is changed from the original time state to the new time state, the partial data under any time state is migrated to the schema named the new time state, comprising: creating the corresponding point of the partial data under any time state under the schema of the new time state; when the two points connected by the edge corresponding to the partial data under any time state exist under the schema of the new time state, creating the edge corresponding to the partial data under any time state under the schema of the new time state; deleting the edge and the point connected by the edge which have been created under the schema of the new time state in the schema of the original time state.
[0060] Optionally, for case (2), the specific steps include:
[0061] (2.1) creating the point in the schema corresponding to the original time state in the schema corresponding to the new time state, that is, copying and creating the point in the data to be partially migrated in the schema corresponding to the new time state;
[0062] (2.2) creating the edge to be migrated in the schema corresponding to the original time state in the schema corresponding to the new time state. It should be noted that the prerequisite for creating the edge to be migrated is to ensure that the two points connected by the edge exist in the schema corresponding to the new time state, that is, the two points connected by the edge have been created in the schema corresponding to the new time state in the previous step. That is, during the migration process, there may be a case that the two points connected by an edge are not completely migrated, for example, one of the two points is migrated to the new time state, and the other point is not migrated to the new time state. For the two points connected by the edge which are not completely migrated, the edge is not migrated. Wait for the next migration or maintenance time to migrate or delete.
[0063] (2.3) deleting the edge to be migrated and having been created to the schema corresponding to the new time state in the schema corresponding to the original time state;
[0064] (2.4) deleting the migrated point in the schema corresponding to the original time state, it should be noted that only the point whose all edges have been migrated is deleted, and for the point whose edge has not been migrated, it still needs to be reserved in the original time state schema.
[0065] The time change migration process is managed by a graph database transaction. A transaction is a set of ordered database operations as a unit. If all operations in the group are successful, the transaction is determined to be successful. Even if only one operation fails, the transaction is determined to be unsuccessful. If all operations are completed, the transaction is committed, and its modifications will take effect on all other database processes. If an operation fails, the transaction will be rolled back, and the effects of all operations of the transaction will be cancelled. The data migration of the time change managed by the transaction improves the reliability and accuracy of the data migration of the graph database. In addition, during the migration process, the original time state and the new time state use the unique identification attribute (such as the device number) of the equipment or line to synchronize, so as to identify a certain point in the original time state in the corresponding schema of the new time state.
[0066] As an optional embodiment, the method further comprises: if the point corresponding to the partial data in any time state has an unconnected edge in the schema of the original time state that is not changed from the original time state to the new time state, the point corresponding to the partial data in any time state is retained in the schema of the original time state. Optionally, for the point corresponding to the partial data in any time state, that is, the to-be-migrated point, all the adjacent edges are not completely migrated, and the point is in a semi-migrated state and exists in the original time state and the new time state schema. That is, the corresponding point has been created in the schema corresponding to the new time state, but the point still exists in the schema of the original time state, and the point in the schema of the original time state can be deleted in the next migration or maintenance process. Wherein, the migration or maintenance is introduced, that is, for the semi-migrated or not completely migrated point or edge, the maintenance personnel can manually maintain (continue to complete the migration, modify or delete the point or edge, etc.).
[0067] As an optional embodiment, Figure 3 is a whole flowchart of an optional graph database-based power grid multi-time state modeling method according to an embodiment of the application, as shown in Figure 3 The flowchart of the method can include the following steps:
[0068] Step S301, a definition reflecting the time state is introduced to distinguish different time states. Optionally, the name of the schema is used to identify any time state, such as using the name of the schema of “time state” or “time state + device type” to identify the running state, the planning state and the construction state. By introducing the schema, the multi-time state data is managed, and additional attributes do not need to be provided for each point or edge to store the time state or version field, thereby saving storage space, reducing management cost and improving query performance.
[0069] In step S302, the data (points, edges) of different time states are stored into the schema representing the corresponding time state. Optionally, the schema corresponding to the time state can be found by matching the time state and the schema name, and then the data of different time states, i.e., the point data and the edge data, are stored into the schema of the corresponding time state.
[0070] In step S303, when the time state of the device or the connection changes, the point and edge data are migrated according to the defined rules. Optionally, since the time state of the point and the edge, i.e., the device and the connection, can change, the data also needs to be migrated according to the change of the time state, such as migration from the original time state to the new time state. In this case, the migration needs to follow the defined rules, i.e., all data migration under any time state is through modification of the name of the schema; partial data migration under any time state is through copying and then deleting, i.e., the partial data (including point data and edge data) to be migrated are first copied into the schema corresponding to the "new time state", and then the copied data are deleted from the schema corresponding to the "original time state". Through the data migration, the consistency of the multi-time state data after the change of the time state is ensured.
[0071] According to another aspect of the embodiment of the present application, there is also provided a device for multi-time state modeling of a power grid based on a graph database. Figure 4 is a structural block diagram of an optional device for multi-time state modeling of a power grid based on a graph database according to the embodiment of the present application, as shown in Figure 4 The device can include an identification module 401 for identifying any time state using the name of the schema, the schema being a data model in any field of the graph database, the name of the schema being a label corresponding to any type of point or edge, and the any time state being any state of the operation of the power grid; and a management module 402 for managing the data under any time state using the schema, the data being point data and edge data in the graph database.
[0072] It should be noted that the identification module 401 in this embodiment can be used to execute the above step S201, and the management module 402 in this embodiment can be used to execute the above step S202.
[0073] Through the above modules, since the schema based on the graph database is introduced to manage the multi-time state data of the power grid, no additional attribute needs to be provided for each point or edge to store the time state or version field, the storage space is saved, the data is classified, and the data model is clear; the data of any schema, i.e., any type of data, directly reflects the operation state of the power grid, i.e., the time state, and no attribute query is needed to distinguish different time states or versions, the management cost is reduced, and the query performance is improved. Thus, the problem of low efficiency of the general method in the prior art in processing multi-time state data is solved.
[0074] As an optional embodiment, the time states include a running state, a planning state and a construction state, and the identification module includes a first identification unit configured to identify the running state, the planning state and the construction state by using names of three schemas of the running state, the planning state and the construction state respectively for the graph database using attributes to identify device types; and a second identification unit configured to identify the running state, the planning state and the construction state by using names of three schemas of the running state plus device types, the planning state plus device types and the construction state plus device types respectively for the graph database using labels to identify device types.
[0075] As an optional embodiment, attributes of points in the graph database are used to save device attribute information or element attribute information, and attributes of edges in the graph database are used to save line attribute information.
[0076] As an optional embodiment, the device further includes a first matching module configured to access data in any time state by matching names of any time state and schema for the graph database using attributes to identify device types; a second matching module configured to access data of any device type in any time state by matching names of any time state plus any device type and schema for the graph database using labels to identify device types; and a determination module configured to determine a time state corresponding to any point or edge according to a name of a schema of the any point or edge for the graph database using attributes or labels to identify device types.
[0077] As an optional embodiment, the device further includes a modification module configured to modify a name of a schema corresponding to all data in any time state from an original time state to a new time state when the time state of the all data in the any time state is changed from the original time state to the new time state; and a migration module configured to migrate part of data in any time state to a schema with a name of a new time state when the time state of the part of data in the any time state is changed from an original time state to the new time state.
[0078] As an optional embodiment, the method is managed through a graph database transaction, and the migration module includes a first creation unit configured to create points corresponding to part of data in any time state under a schema of a new time state; a second creation unit configured to create an edge corresponding to the part of data in the any time state under the schema of the new time state when two points connected by the edge exist under the schema of the new time state; and a deletion unit configured to delete the edge and points connected by the edge which have been created under the schema of the new time state in a schema of an original time state.
[0079] As an optional embodiment, the apparatus further comprises a retaining module configured to retain the point corresponding to the partial data in the schema of the original time state if the point corresponding to the partial data in the original time state has no adjacent edge that is not changed from the original time state to the new time state. It should be noted that the above module has the same examples and application scenarios as the corresponding steps, but is not limited to the content disclosed in the above embodiments. It should be noted that the above module as part of the apparatus can run in the hardware environment shown in Figure 1 , which includes a network environment.
[0080] According to another aspect of the embodiments of the present application, an electronic device for implementing the above-mentioned power grid multi-time state modeling method based on a graph database is also provided, which can be a server, a terminal, or a combination thereof.
[0081] Figure 5 is a structural block diagram of an optional electronic device according to the embodiments of the present application, as shown in Figure 5 , which comprises a processor 501, a communication interface 502, a memory 503, and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 complete mutual communication through the communication bus 504, wherein the memory 503 is configured to store a computer program; the processor 501 is configured to execute the computer program stored in the memory 503 to implement the following steps:
[0082] The name of the schema is used to identify any time state, the schema is a data model in any field of the graph database, the name of the schema is a label corresponding to any type of point or edge, and the any time state is any state of the power grid operation; the schema is used to manage the data in any time state, and the data is point data and edge data in the graph database.
[0083] Optionally, in the present embodiment, the above-mentioned communication bus can be a PCI (Peripheral Component Interconnect, Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture, Extended Industry Standard Architecture) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, Figure 5 , only one thick line is used, but it does not mean that there is only one bus or one type of bus.
[0084] The communication interface is used for communication between the above-mentioned electronic device and other devices.
[0085] The memory can include a RAM and can also include a non-volatile memory, for example, at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.
[0086] As an example, as shown in Figure 5 The aforementioned memory 503 can include, but is not limited to, the identification module 401 and the management module 402 in the aforementioned graph database-based power grid multi-temporal modeling device. In addition, other module units in the aforementioned graph database-based power grid multi-temporal modeling device can also be included, but are not limited to, which will not be described herein again in this example.
[0087] The aforementioned processor can be a general-purpose processor, which can include, but is not limited to, a CPU (Central Processing Unit), a NP (Network Processor), etc. It can also be a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0088] In addition, the aforementioned electronic device further includes a display for displaying the graph database-based power grid multi-temporal modeling result.
[0089] Optionally, the specific examples in this embodiment can refer to the examples described in the above-described embodiments, which will not be described herein again in this embodiment.
[0090] Those of ordinary skill in the art can understand that, Figure 5 The structure shown is only schematic, and the device implementing the aforementioned graph database-based power grid multi-temporal modeling method can be a terminal device, which can be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, etc. Figure 5 The structure of the aforementioned electronic device is not limited. For example, the terminal device can further include more or less components (such as a network interface, a display device, etc.) than Figure 5 or have a different configuration than Figure 5 shown.
[0091] Those skilled in the art can understand that all or part of the steps of the various methods in the above embodiments can be completed by instructing the terminal device related hardware through a program, and the program can be stored in a computer readable storage medium, and the storage medium can include a flash disk, a ROM, a RAM, a magnetic disk or an optical disk, etc.
[0092] According to still another aspect of the embodiments of the present application, a storage medium is further provided. Optionally, in the present embodiment, the storage medium can be used to store program codes for executing the power grid multi-temporal modeling method based on a graph database.
[0093] Optionally, in the present embodiment, the storage medium can be located on at least one of the network devices in the network shown in the above embodiments.
[0094] Optionally, in the present embodiment, the storage medium is configured to store program codes for executing the following steps:
[0095] Any temporal state is identified using the name of a schema, the schema is a data model in any field of the graph database, the name of the schema is a label corresponding to any type of point or edge, and any temporal state is any state of power grid operation; the data in any temporal state is managed using the schema, and the data is point data and edge data in the graph database.
[0096] Optionally, specific examples in the present embodiment can refer to the examples described in the above embodiments, and the present embodiment will not be described here.
[0097] Optionally, in the present embodiment, the storage medium can include but is not limited to a U disk, a ROM, a RAM, a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0098] According to still another aspect of the embodiments of the present application, a computer program product or a computer program is further provided, the computer program product or the computer program includes computer instructions stored in a computer readable storage medium; a processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the power grid multi-temporal modeling method based on a graph database in any of the above embodiments.
[0099] The above embodiment numbers of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0100] The integrated units in the above embodiments, if implemented in the form of software function units and sold or used as independent products, can be stored in the above computer-readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in other words, the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a number of instructions to make one or more computer devices (which can be personal computers, servers or network devices, etc.) execute all or part of the steps of the power grid multi-time modeling method based on a graph database according to the embodiments of the present application.
[0101] In the above embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0102] In the several embodiments of the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the above-mentioned device embodiment is only schematic, for example, the division of units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be through some interface, indirect coupling or communication connection between units or modules, which can be electrical or other forms.
[0103] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place or distributed on multiple network units. Part or all of the units can be selected to achieve the purpose of the scheme provided in the embodiment according to actual needs.
[0104] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software function unit.
[0105] The above is only the preferred embodiment of the present application. It should be noted that for those skilled in the art, without departing from the principle of the present application, a number of improvements and refinements can be made, which should also be considered as the protection scope of the present application.
Claims
1. A method for power grid multi-temporal modeling based on a graph database, characterized in that, The method comprises: identifying any time state using the name of a schema, the schema being a data model in any field of a graph database, the name of the schema being a label corresponding to any type of point or edge, and the any time state being any state of power grid operation; managing data in any time state using the schema, the data being point data and edge data in the graph database; The method further comprises: when the time state of all data in any time state changes from an original time state to a new time state, modifying the name of the schema corresponding to all data in any time state from the original time state to the new time state; when the time state of part of the data in any time state changes from an original time state to a new time state, migrating part of the data in any time state to a schema with the name of the new time state, wherein the method is managed through a graph database transaction, and the migrating part of the data in any time state to a schema with the name of the new time state when the time state of part of the data in any time state changes from an original time state to a new time state comprises: creating points corresponding to part of the data in any time state under the schema of the new time state; when the two points connected by the edge corresponding to part of the data in any time state exist under the schema of the new time state, creating the edge corresponding to part of the data in any time state under the schema of the new time state; deleting the edge and the points connected to the edge that have been created under the schema of the new time state in the schema of the original time state; The method further comprises: if the point corresponding to part of the data in any time state has no adjacent edge that changes from the original time state to the new time state under the schema of the original time state, retaining the point corresponding to part of the data in any time state in the schema of the original time state.
2. The graph database based power grid multi-temporal modeling method of claim 1, wherein, The time state comprises: a running state, a planning state, and a construction state, and the identifying any time state using the name of a schema comprises: for a graph database using attributes to identify device types, using the names of three schemas of the running state, the planning state, and the construction state to identify the three time states of the running state, the planning state, and the construction state, respectively; for a graph database using labels to identify device types, using the names of three schemas of the running state plus device types, the planning state plus device types, and the construction state plus device types to identify the three time states of the running state, the planning state, and the construction state, respectively.
3. The graph database based power grid multi-temporal modeling method of claim 2, wherein, The method further comprises: attributes of points in the graph database are used to save device attribute information or element attribute information; attributes of edges in the graph database are used to save line attribute information.
4. The graph database based power grid multi-temporal modeling method of claim 2, wherein, The method further comprises: for a graph database using attributes to identify device types, accessing data in any time state by matching any time state and the name of a schema; for a graph database using labels to identify device types, accessing data of any device type in any time state by matching any time state plus any device type and the name of a schema; for a graph database using attributes or labels to identify device types, determining the time state corresponding to any point or edge according to the name of the schema of the any point or edge.
5. A graph database based multi-temporal modeling of power grid apparatus, characterized in that, The device comprises: An identification module is configured to identify any time state using a name of a schema, the schema being a data model in any field of a graph database, the name of the schema being a label corresponding to any type of point or edge, and the any time state being any state of power grid operation. A management module is configured to manage data in any time state using the schema, the data being point data and edge data in the graph database. The apparatus further includes a modification module configured to modify the name of the schema corresponding to all data in any time state from an original time state to a new time state when the time state of the all data in any time state is changed from the original time state to the new time state, and a migration module configured to migrate part of data in any time state to a schema with the name of the new time state when the time state of the part of data in any time state is changed from the original time state to the new time state. The apparatus is managed through a graph database transaction, and the migration module includes a first creation unit configured to create points corresponding to the part of data in any time state under the schema with the name of the new time state, a second creation unit configured to create edges corresponding to the part of data in any time state under the schema with the name of the new time state when two points connected by the edges exist under the schema with the name of the new time state, and a deletion unit configured to delete edges and points connected by the edges that have been created under the schema with the name of the new time state from the schema with the name of the original time state. The apparatus further includes a reservation module configured to reserve points corresponding to the part of data in any time state in the schema with the name of the original time state if the points exist in the schema with the name of the original time state without the adjacent edges changed from the original time state to the new time state.
6. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein, The processor, the communication interface, and the memory complete communication with each other through the communication bus, and the apparatus is characterized in that The memory is configured to store a computer program. The processor is configured to execute the graph database-based power grid multi-time state modeling method of any one of claims 1 to 4 by running the computer program stored on the memory.
7. A computer readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program is executed by the processor to implement the graph database-based power grid multi-time state modeling method of any one of claims 1 to 4. The storage medium stores a computer program, and the computer program is executed by the processor to implement the graph database-based power grid multi-time state modeling method of any one of claims 1 to 4.
Citation Information
Patent Citations
Detection of missing entities in graph schema
CN110704689A
Data processing method based on power grid resource data
CN115658642A