技术领域technical field
本发明涉及电力拓扑数据查询领域,具体涉及一种基于图数据库的电网设备可达性查询方法及系统。The invention relates to the field of power topology data query, in particular to a method and system for querying accessibility of power grid equipment based on a graph database.
背景技术Background technique
随着智能电网技术的发展,大量一次电网设备投入使用,设备量的爆炸式增长给电网设备及其拓扑连接的管理与查询带来了严峻的挑战。同时,配电网的重构、运行方式检测与调整、故障处理辅助决策等应用急需一种设备可达性快速分析方法。然而传统的关系型数据库在实现大规模图数据存储、拓扑分析等功能时效率低下,并且目前尚没有针对设备拓扑设计的可达性分析算法。With the development of smart grid technology, a large number of primary grid equipment has been put into use, and the explosive growth of equipment has brought severe challenges to the management and query of grid equipment and their topological connections. At the same time, applications such as distribution network reconfiguration, operation mode detection and adjustment, and fault handling auxiliary decision-making urgently need a rapid analysis method for equipment accessibility. However, traditional relational databases are inefficient in implementing functions such as large-scale graph data storage and topology analysis, and there is currently no reachability analysis algorithm for device topology design.
发明内容Contents of the invention
本发明要解决的技术问题在于克服现有关系型数据库在实现大规模图数据可达性分析效率低下,并且缺少针对设备拓扑设计的可达性分析算法的问题。The technical problem to be solved by the present invention is to overcome the low efficiency of the existing relational database in realizing the accessibility analysis of large-scale graph data and the lack of an accessibility analysis algorithm for device topology design.
根据第一方面,本发明实施例提供了一种基于图数据库的电网设备可达性查询方法,包括:根据电网设备间的拓扑连接关系,建立电网设备物理连接的图模型,得到初始连通分量索引树;根据所述初始连通分量索引树查找两电网设备之间的最近共同祖先节点,并判断所述最近共同祖先节点是否为非根节点;当所述最近共同祖先节点为非根节点时,则判定所述两电网设备之间可达。According to the first aspect, an embodiment of the present invention provides a graph database-based grid equipment reachability query method, including: establishing a graph model of the physical connection of grid equipment according to the topological connection relationship between grid equipment, and obtaining the initial connected component index tree; according to the initial connected component index tree, search for the nearest common ancestor node between the two power grid devices, and judge whether the nearest common ancestor node is a non-root node; when the nearest common ancestor node is a non-root node, then It is determined that the two power grid devices are reachable.
可选地,当所述最近共同祖先节点不是非根节点时,则判定所述两电网设备之间不可达。Optionally, when the nearest common ancestor node is not a non-root node, it is determined that the two power grid devices are not reachable.
可选地,在建立电网设备物理连接的图模型,得到初始连通分量索引树之后、根据所述初始连通分量索引树查找两电网设备之间的最近共同祖先节点之前,所述的电网设备可达性查询方法,还包括:当所述图模型改变拓扑时,则对所述初始连通分量索引树进行更新,生成改变拓扑后的连通分量索引树;用改变拓扑后的连通分量索引树替换所述初始连通分量索引树。Optionally, after establishing the graph model of the physical connection of grid equipment, obtaining the initial connected component index tree, and before finding the nearest common ancestor node between the two grid equipment according to the initial connected component index tree, the grid equipment can reach The query method further includes: when the graph model changes topology, updating the initial connected component index tree to generate a connected component index tree after topology change; replacing the connected component index tree with the topology change The initial connected component index tree.
可选地,对所述初始连通分量索引树进行更新,包括:在所述初始连通分量索引树的版本图中沿表示拓扑更改操作的有向边搜索当前运行的版本,得到所述改变拓扑后的连通分量索引树;其中,当存在所述当前运行的版本对应的版本索引节点时,则所述改变拓扑后的连通分量索引树为以所述版本索引节点为根节点的连通分量索引树;当不存在所述版本索引节点时,则建立新增版本图,所述改变拓扑后的连通分量索引树为修正后的新增节点的连通分量索引树。Optionally, updating the initial connected component index tree includes: searching for the currently running version along the directed edge representing the topology change operation in the version graph of the initial connected component index tree, and obtaining the changed topology connected component index tree; wherein, when there is a version index node corresponding to the currently running version, the connected component index tree after the topology change is a connected component index tree with the version index node as the root node; When the version index node does not exist, a newly added version graph is established, and the connected component index tree after the topology change is the corrected connected component index tree of the newly added node.
可选地,对所述初始连通分量索引树进行更新,还包括:对所述新增节点的连通分量索引树进行修正,包括:在所述新增节点的连通分量索引树中寻找待删除边连接所述两电网设备的最近共同祖先节点的对应子图,并对所述对应子图的连通分量索引子树进行深度优先搜索,得到所述改变拓扑后的连通分量索引树。Optionally, updating the initial connected component index tree further includes: modifying the connected component index tree of the newly added node, including: finding an edge to be deleted in the connected component index tree of the newly added node Connecting the corresponding subgraphs of the nearest common ancestor nodes of the two power grid devices, and performing a depth-first search on the connected component index subtrees of the corresponding subgraphs, to obtain the connected component index tree after the topology change.
根据第二方面,本发明实施例提供了一种基于图数据库的电网设备可达性查询系统,包括:电网设备图模型构建模块,用于根据电网设备的拓扑连接关系,建立电网设备物理连接的图模型,得到初始连通分量索引树;可达性检测模块,用于根据所述初始连通分量索引树查找两电网设备之间的最近共同祖先节点,并判断所述最近共同祖先节点是否为非根节点;当所述最近共同祖先节点为非根节点时,则判定所述两电网设备之间可达。According to the second aspect, an embodiment of the present invention provides a graph database-based grid equipment reachability query system, including: a grid equipment graph model building module, used to establish the physical connection of the grid equipment according to the topological connection relationship of the grid equipment The graph model is used to obtain the initial connected component index tree; the reachability detection module is used to search for the nearest common ancestor node between the two power grid devices according to the initial connected component index tree, and determine whether the nearest common ancestor node is a non-root node; when the nearest common ancestor node is a non-root node, it is determined that the two power grid devices are reachable.
可选地,所述可达性检测模块判断的所述最近共同祖先节点不是非根节点时,则判定所述两电网设备之间不可达。Optionally, when the nearest common ancestor node determined by the reachability detection module is not a non-root node, it is determined that the two power grid devices are not reachable.
可选地,所述电网设备可达性查询系统还包括:初始连通分量索引树更新模块,用于当所述图模型改变拓扑时,则对所述初始连通分量索引树进行更新,生成改变拓扑后的连通分量索引树;用改变拓扑后的连通分量索引树替换所述初始连通分量索引树。Optionally, the grid equipment reachability query system further includes: an initial connected component index tree update module, configured to update the initial connected component index tree when the topology of the graph model is changed, and generate a changed topology The connected component index tree after changing the topology; replace the initial connected component index tree with the connected component index tree after topology change.
可选地,所述初始连通分量索引树更新模块包括:改变拓扑后的连通分量索引树获取子模块,用于在所述初始连通分量索引树的版本图中沿表示拓扑更改操作的有向边搜索当前运行的版本,得到所述改变拓扑后的连通分量索引树;其中,当存在所述当前运行的版本对应的版本索引节点时,则所述改变拓扑后的连通分量索引树为以所述版本索引节点为根节点的连通分量索引树;当不存在所述版本索引节点时,则建立新增版本图,所述改变拓扑后的连通分量索引树为修正后的所述新增节点的连通分量索引树。Optionally, the initial connected component index tree update module includes: a connected component index tree acquisition submodule after topology change, used to follow the directed edge representing the topology change operation in the version graph of the initial connected component index tree Search the currently running version to obtain the connected component index tree after the topology change; wherein, when there is a version index node corresponding to the current running version, the connected component index tree after the topology change is based on the The version index node is the connected component index tree of the root node; when the version index node does not exist, a newly added version graph is established, and the connected component index tree after the topology change is the connected component index tree of the newly added node after modification Component index tree.
可选地,所述初始连通分量索引树更新模块还包括:修正子模块,用于对所述新增节点的连通分量索引树进行修正;在所述新增节点的连通分量索引树中寻找待删除边连接所述两电网设备的最近共同祖先节点的对应子图,并对所述对应子图的连通分量索引子树进行深度优先搜索,得到所述改变拓扑后的连通分量索引树。Optionally, the initial connected component index tree updating module further includes: a correction submodule, configured to correct the connected component index tree of the newly added node; Deleting the corresponding subgraph whose edge connects the nearest common ancestor nodes of the two power grid devices, and performing a depth-first search on the connected component index subtree of the corresponding subgraph, to obtain the connected component index tree after the topology change.
根据第三方面,本发明实施例提供了一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行第一方面或者第一方面的任意一种可选方式中所述的电网设备可达性查询方法。According to a third aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause the computer to execute the first aspect Or the method for querying the reachability of grid equipment described in any optional manner of the first aspect.
根据第四方面,本发明实施例提供了一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行第一方面或者第一方面的任意一种可选方式中所述的电网设备可达性查询方法。According to a fourth aspect, an embodiment of the present invention provides a computer program product, the computer program product includes a computing program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, and when the program When the instructions are executed by a computer, the computer is made to execute the grid equipment reachability query method described in the first aspect or any optional manner of the first aspect.
本发明实施例所提供的基于图数据库的电网设备可达性查询方法及系统,通过在连通分量索引树中搜寻两设备节点的最近共同祖先节点是否为非根节点即可判断两设备可达性,实现了电网设备的可达性查询功能,在面对大规模图数据及密集型可达性查询任务时大大提高了效率;并且在电网系统运行方式改变,使图模型改变拓扑时,能够通过更新初始连通分量索引树生成新的索引信息提供高效的可达性查询,从而提高了电网设备可达性查询方法的自适应性和实时性。The graph database-based power grid equipment accessibility query method and system provided by the embodiments of the present invention can determine the accessibility of two equipment by searching whether the nearest common ancestor node of the two equipment nodes is a non-root node in the connected component index tree , realizes the accessibility query function of power grid equipment, and greatly improves the efficiency in the face of large-scale graph data and intensive reachability query tasks; and when the operation mode of the power grid system changes and the topology of the graph model changes, it can pass Updating the initial connected component index tree to generate new index information provides efficient reachability query, thereby improving the adaptability and real-time performance of the grid equipment reachability query method.
附图说明Description of drawings
为了更清楚地说明本发明具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the specific implementation of the present invention or the technical solutions in the prior art, the following will briefly introduce the accompanying drawings that need to be used in the specific implementation or description of the prior art. Obviously, the accompanying drawings in the following description The drawings show some implementations of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative work.
图1为本发明实施例1中基于图数据库的电网设备可达性查询方法的流程图;FIG. 1 is a flow chart of a graph database-based grid equipment reachability query method in Embodiment 1 of the present invention;
图2为本发明实施例1中电网设备实际连接的示意图;2 is a schematic diagram of the actual connection of grid equipment in Embodiment 1 of the present invention;
图3为本发明实施例1中连通分量索引树的示意图;3 is a schematic diagram of a connected component index tree in Embodiment 1 of the present invention;
图4为本发明实施例1中设备实际连接的另一示意图;Fig. 4 is another schematic diagram of the actual connection of the equipment in Embodiment 1 of the present invention;
图5为本发明实施例1中连通分量索引树的另一示意图;FIG. 5 is another schematic diagram of a connected component index tree in Embodiment 1 of the present invention;
图6为本发明实施例1中基于图数据库的电网设备可达性查询方法的另一流程图;FIG. 6 is another flow chart of the graph database-based grid equipment reachability query method in Embodiment 1 of the present invention;
图7为本发明实施例1中更新初始连通分量索引树的流程图;FIG. 7 is a flow chart of updating the initial connected component index tree in Embodiment 1 of the present invention;
图8为本发明实施例1中运行方式版本图的示意图Fig. 8 is a schematic diagram of the operating mode version diagram in Embodiment 1 of the present invention
图9A为本发明实施例2中基于图数据库的电网设备可达性查询系统的结构示意图;9A is a schematic structural diagram of a graph database-based reachability query system for power grid equipment in Embodiment 2 of the present invention;
图9B为本发明实施例2中基于图数据库的电网设备可达性查询系统的另一结构示意图;FIG. 9B is another schematic structural diagram of a graph database-based reachability query system for power grid equipment in Embodiment 2 of the present invention;
图10为本发明实施例2中初始连通分量索引树更新模块的结构示意图;10 is a schematic structural diagram of an initial connected component index tree update module in Embodiment 2 of the present invention;
图11为本发明实施例3中电子设备的结构示意图。FIG. 11 is a schematic structural diagram of an electronic device in Embodiment 3 of the present invention.
具体实施方式detailed description
下面将结合附图对本发明的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Apparently, the described embodiments are some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
此外,下面所描述的本发明不同实施方式中所涉及的技术特征只要彼此之间未构成冲突就可以相互结合。In addition, the technical features involved in the different embodiments of the present invention described below may be combined with each other as long as there is no conflict with each other.
实施例1Example 1
本发明实施例提供一种基于图数据库的电网设备可达性查询方法,其流程如图1所示,该电网设备可达性查询方法包括:An embodiment of the present invention provides a method for querying the accessibility of power grid equipment based on a graph database, the process of which is shown in Figure 1. The method for querying the accessibility of power grid equipment includes:
步骤S1:根据电网设备间的拓扑连接关系,建立电网设备物理连接的图模型,得到初始连通分量索引树。Step S1: According to the topological connection relationship between grid equipment, establish a graph model of physical connection of grid equipment, and obtain an index tree of initial connected components.
步骤S2:根据初始连通分量索引树查找两电网设备之间的最近共同祖先节点,并判断最近共同祖先节点是否为非根节点;当最近共同祖先节点为非根节点时,则判定两电网设备之间可达。Step S2: Find the nearest common ancestor node between the two grid equipment according to the initial connected component index tree, and judge whether the nearest common ancestor node is a non-root node; if the nearest common ancestor node is a non-root node, then determine the reachable.
本发明实施例提供的电网设备可达性查询方法,实现了对电网设备的可达性查询功能,并提高了查询效率。The method for querying the reachability of grid equipment provided by the embodiment of the present invention realizes the function of querying the reachability of grid equipment and improves the query efficiency.
在一较佳实施例中,上述最近共同祖先节点不是非根节点时,则判定上述两电网设备之间不可达。In a preferred embodiment, when the above-mentioned nearest common ancestor node is not a non-root node, it is determined that the above-mentioned two power grid devices are unreachable.
具体地,在一实施例中,上述步骤S1中的图模型分为电网设备拓扑图模型、连通分量索引树模型和版本图模型。其中电网设备拓扑图模型是唯一的,对于版本图模型中的每个节点都存在一个以该节点为根的连通分量索引树,且所有连通索引树的叶子节点包含且仅包含电网拓扑图模型中的所有设备节点。Specifically, in an embodiment, the graph models in the above step S1 are divided into a grid device topology graph model, a connected component index tree model, and a version graph model. The power grid equipment topology graph model is unique. For each node in the version graph model, there is a connected component index tree rooted at the node, and all leaf nodes of the connected index tree contain and only contain All device nodes of .
进一步地,上述初始连通分量索引树能够通过在电网拓扑图中进行深度优先搜索得到,初始连通分量索引树中的每个非根节点均为对应版本图的设备拓扑图中的一个连通分量,初始连通分量索引树中根节点的子节点间存在有向边表示多个连通分量之间的关系。Further, the above-mentioned initial connected component index tree can be obtained by performing a depth-first search in the power grid topology graph, and each non-root node in the initial connected component index tree is a connected component in the device topology graph of the corresponding version graph. There are directed edges between the child nodes of the root node in the connected component index tree to represent the relationship between multiple connected components.
具体地,在一实施例中,图2是上述电网设备拓扑图模型示例图,图中带有数字标号的节点代表实际的具有物理实体的设备,边代表实体设备间的物理连接。图3是图2电网设备物理拓扑图的初始连通分量索引树,图中A和B节点代表了设备拓扑图(图2)中对应字母所在的虚线范围所示的连通分量,即节点A代表了节点1、2、3、4组成的连通分量,节点B代表了节点5、6、7组成的连通分量。图3中R节点为全图组成的连通分量节点,V0是连通分量索引树的根节点。在图2中,除根节点V0其余节点均为连通分量节点。连通分量索引树中实线代表了从属关系,及子节点为父亲节点所代表连通分量的子集。初始连通分量索引树可以通过简单的深度优先搜索或Tarjan算法等现有算法实现。例如,图3中设备节点1和设备节点3的最近共同祖先为节点A,而节点A为非根节点,则两设备互相可达。删除边1-5并维护连通分量索引树后,设备拓扑如图4所示,连通分量索引树如图5所示,节点V2是此时的连通分量索引树的根节点,而设备节点1和设备节点7的最近共同祖先为节点V2,则两设备互不可达。Specifically, in an embodiment, FIG. 2 is an example diagram of the above-mentioned power grid equipment topology graph model, in which nodes with numerical labels represent actual devices with physical entities, and edges represent physical connections between physical devices. Figure 3 is the initial connected component index tree of the physical topology diagram of the power grid equipment in Figure 2. Nodes A and B in the figure represent the connected components shown in the dotted line range corresponding to the letter in the equipment topology diagram (Figure 2), that is, node A represents The connected component composed of nodes 1, 2, 3, and 4, and node B represents the connected component composed of nodes 5, 6, and 7. In Figure 3, the R node is a connected component node composed of the whole graph, and V0 is the root node of the connected component index tree. In Figure 2, all nodes except the root node V0 are connected component nodes. The solid line in the connected component index tree represents the affiliation relationship, and the child nodes are the subsets of the connected components represented by the parent node. The initial connected component index tree can be realized by simple depth-first search or existing algorithms such as Tarjan's algorithm. For example, in FIG. 3 , the nearest common ancestor of device node 1 and device node 3 is node A, and node A is a non-root node, then the two devices are reachable to each other. After deleting edges 1-5 and maintaining the connected component index tree, the device topology is shown in Figure 4, and the connected component index tree is shown in Figure 5. Node V2 is the root node of the connected component index tree at this time, and device nodes 1 and The nearest common ancestor of device node 7 is node V2, and the two devices are inaccessible to each other.
在一较佳实施例中,如图6所示,建立电网设备物理连接的图模型,得到初始连通分量索引树之后,根据初始连通分量索引树查找两电网设备之间的最近共同祖先节点之前,上述电网设备可达性查询方法还包括:In a preferred embodiment, as shown in FIG. 6, a graphical model of the physical connection of grid equipment is established, and after obtaining the initial connected component index tree, before searching for the nearest common ancestor node between the two grid equipment according to the initial connected component index tree, The above-mentioned grid equipment accessibility query method also includes:
步骤S3:当上述图模型改变拓扑时,则对上述初始连通分量索引树进行更新,生成改变拓扑后的连通分量索引树;用改变拓扑后的连通分量索引树替换上述初始连通分量索引树。Step S3: When the graph model changes topology, update the initial connected component index tree to generate a topology-changed connected component index tree; replace the above-mentioned initial connected component index tree with the topology-changed connected component index tree.
具体地,如图7所示,对上述初始连通分量索引树进行更新,主要包括以下过程:Specifically, as shown in Figure 7, updating the above-mentioned initial connected component index tree mainly includes the following process:
步骤S31:在上述初始连通分量索引树的版本图中沿表示拓扑更改操作的有向边搜索当前运行的版本,得到上述改变拓扑后的连通分量索引树;其中,当存在当前运行的版本对应的版本索引节点时,则上述改变拓扑后的连通分量索引树为以版本索引节点为根节点的连通分量索引树;当不存在上述版本索引节点时,则建立新增版本图,上述改变拓扑后的连通分量索引树为修正后的新增节点的连通分量索引树。Step S31: In the version graph of the above-mentioned initial connected component index tree, search for the currently running version along the directed edge representing the topology change operation, and obtain the above-mentioned connected component index tree after the topology change; wherein, when there is a corresponding When the version index node is used, the connected component index tree after the above topology change is the connected component index tree with the version index node as the root node; when the above version index node does not exist, a new version graph is created, and the above topology change The connected component index tree is the connected component index tree of the newly added node after modification.
进一步地,上述版本图为有向无环图,其具有唯一源节点且源节点为初始版本节点,上述有向边代表通过增删设备拓扑图中的一条边,版本图的有向出节点所对应的版本可以转化为入节点所对应的版本。Further, the above version graph is a directed acyclic graph, which has a unique source node and the source node is the initial version node, and the above directed edge represents an edge in the device topology graph through addition and deletion, and the directed output node of the version graph corresponds to The version of can be converted to the version corresponding to the ingress node.
具体地,在一实施例中,图4为图2所示的设备拓扑图将边1-5删除后形成的拓扑图,图5为其对应的连通分量索引树。图8为不同版本的电网拓扑的版本节点)组成的有向无环图,图中每个节点代表设备拓扑的一个版本,每条有向边代表两个版本间差异所对应的删除边操作。例如,图2所示的设备网络拓扑对应图8中的V0节点,而图4所示的设备网络拓扑对应图8中的V2节点。Specifically, in an embodiment, FIG. 4 is a topology diagram formed by deleting edges 1-5 from the device topology diagram shown in FIG. 2 , and FIG. 5 is a corresponding connected component index tree. Figure 8 is a directed acyclic graph composed of version nodes of different versions of the power grid topology), each node in the figure represents a version of the device topology, and each directed edge represents the delete edge operation corresponding to the difference between the two versions. For example, the device network topology shown in FIG. 2 corresponds to the V0 node in FIG. 8 , and the device network topology shown in FIG. 4 corresponds to the V2 node in FIG. 8 .
进一步地,如图7所示,对上述初始连通分量索引树进行更新,还包括:Further, as shown in Figure 7, updating the above-mentioned initial connected component index tree also includes:
步骤S32:对上述新增节点的连通分量索引树进行修正,包括:在上述新增节点连通分量索引树中寻找待删除边连接两电网设备的最近共同祖先节点的对应子图,并对对应子图的连通分量索引子树进行深度优先搜索,得到上述改变拓扑后的连通分量索引树。Step S32: Correct the connected component index tree of the above-mentioned newly added node, including: find the corresponding subgraph of the nearest common ancestor node of the edge to be deleted connecting the two power grid devices in the connected component index tree of the above newly added node, and compare the corresponding subgraph A depth-first search is performed on the connected component index subtree of the graph to obtain the above-mentioned connected component index tree after changing the topology.
具体地,在一实施例中,如图8所示,V0为V2的父亲节点,则图3所对应的连通分量索引树为V2版本的原型树。节点1和节点5的最近共同祖先为R,则重构后的连通分量索引树,R的两子连通分量A与B间的边被删除,V2版本的连通分量树如图5所示。Specifically, in one embodiment, as shown in FIG. 8 , V0 is the parent node of V2, and the connected component index tree corresponding to FIG. 3 is the prototype tree of the V2 version. The nearest common ancestor of node 1 and node 5 is R, then the reconstructed connected component index tree, the edge between the two sub-connected components A and B of R is deleted, and the connected component tree of the V2 version is shown in Figure 5.
上述基于图数据库的电网设备可达性查询方法,实现了电网设备的可达性查询功能,提高可达性查询的效率;并且在电网系统运行方式改变,通过更新初始连通分量索引树生成新的索引信息提供高效的可达性查询,从而提高了电网设备可达性查询方法的自适应性和实时性。The above graph database-based grid equipment accessibility query method realizes the accessibility query function of grid equipment and improves the efficiency of accessibility query; and when the grid system operation mode changes, a new index tree is generated by updating the initial connected component index tree The index information provides efficient reachability query, thereby improving the adaptability and real-time performance of the grid equipment reachability query method.
实施例2Example 2
本发明实施例提供一种基于图数据库的电网设备可达性查询系统,如图9A所示,包括:电网设备图模型构建模块1,用于根据电网设备的拓扑连接关系,建立电网设备物理连接的图模型,得到初始连通分量索引树;可达性检测模块2,用于根据初始连通分量索引树查找两电网设备之间的最近共同祖先节点,并判断最近共同祖先节点是否为非根节点;当最近共同祖先节点为非根节点时,则判定两电网设备之间可达。An embodiment of the present invention provides a graph database-based grid equipment reachability query system, as shown in FIG. 9A , including: grid equipment graph model building module 1, used to establish physical connections of grid equipment according to the topological connection relationship of grid equipment The graph model of the initial connected component index tree is obtained; the reachability detection module 2 is used to find the nearest common ancestor node between the two power grid devices according to the initial connected component index tree, and judge whether the nearest common ancestor node is a non-root node; When the nearest common ancestor node is a non-root node, it is determined that the two power grid devices are reachable.
本发明实施例提供的基于图数据库的电网设备可达性查询系统,具备了电网设备可达性查询的功能,提高了可达性查询效率。The grid equipment reachability query system based on the graph database provided by the embodiment of the present invention has a power grid equipment reachability query function, and improves the reachability query efficiency.
在一较佳实施例中,当上述可达性检测模块2判断的上述最近共同祖先节点不是非根节点时,则判定上述两电网设备之间不可达。In a preferred embodiment, when the above-mentioned nearest common ancestor node determined by the above-mentioned reachability detection module 2 is not a non-root node, it is determined that the above-mentioned two power grid devices are not reachable.
在一较佳实施例中,如图9B所示,上述电网设备可达性查询系统还包括:初始连通分量索引树更新模块3,用于当上述图模型改变拓扑时,则对上述初始连通分量索引树进行更新,生成改变拓扑后的连通分量索引树;用改变拓扑后的连通分量索引树替换上述初始连通分量索引树。In a preferred embodiment, as shown in FIG. 9B, the system for querying the accessibility of power grid equipment further includes: an initial connected component index tree updating module 3, which is used to update the initial connected component when the topology of the graph model changes. The index tree is updated to generate a connected component index tree after topology change; the above initial connected component index tree is replaced by the connected component index tree after topology change.
进一步地,如图10所示,上述初始连通分量索引树更新模块3包括:改变拓扑后的连通分量索引树获取子模块31,用于在上述初始连通分量索引树的版本图中沿表示拓扑更改操作的有向边搜索当前运行的版本,得到上述改变拓扑后的连通分量索引树;其中,当存在当前运行的版本对应的版本索引节点时,则上述改变拓扑后的连通分量索引树为以版本索引节点为根节点的连通分量索引树;当不存在版本索引节点时,则建立新增版本图,上述改变拓扑后的连通分量索引树为修正后的新增节点的连通分量索引树。Further, as shown in FIG. 10 , the above-mentioned initial connected component index tree update module 3 includes: a connected component index tree acquisition sub-module 31 after topology change, which is used to represent topology changes along the version graph of the above-mentioned initial connected component index tree The directed edge of the operation searches the currently running version to obtain the above-mentioned connected component index tree after the topology change; where, if there is a version index node corresponding to the current running version, the above-mentioned connected component index tree after the topology change is the version The index node is the connected component index tree of the root node; when there is no version index node, a newly added version graph is established, and the above connected component index tree after the topology change is the corrected connected component index tree of the newly added node.
进一步地,如图10所示,上述初始连通分量索引树更新模块3还包括:修正子模块32,用于对上述新增节点的连通分量索引树进行修正;在上述新增节点的连通分量索引树中寻找待删除边连接两电网设备的最近共同祖先节点的对应子图,并对对应子图的连通分量索引子树进行深度优先搜索,得到上述改变拓扑后的连通分量索引树。Further, as shown in FIG. 10 , the above-mentioned initial connected component index tree update module 3 also includes: a correction sub-module 32 for correcting the connected component index tree of the above-mentioned newly added node; In the tree, find the corresponding subgraph of the nearest common ancestor node connecting the two power grid devices to be deleted, and perform a depth-first search on the connected component index subtree of the corresponding subgraph, and obtain the connected component index tree after the above topology change.
上述基于图数据库的电网设备可达性查询系统,通过电网设备图模型构建模块1和可达性检测模块2实现了电网设备的可达性查询功能,提高了系统的可达性查询效率,并通过初始连通分量索引树更新模块3的设置,使得在电网系统更改运行方式时,仍然可以提供高效的可达性查询,从而提高了电网设备可达性查询系统的自适应性和实时性。The above graph database-based grid equipment accessibility query system realizes the grid equipment accessibility query function through the grid equipment graph model building module 1 and the accessibility detection module 2, improves the accessibility query efficiency of the system, and Through the setting of the initial connected component index tree update module 3, when the power grid system changes its operation mode, efficient reachability query can still be provided, thereby improving the adaptability and real-time performance of the power grid equipment reachability query system.
实施例3Example 3
本发明实施例提供一种非暂态计算机存储介质,该计算机存储介质存储有计算机可执行指令,该计算机可执行指令可执行上述任意实施例1中的基于图数据库的电网设备可达性查询方法。其中,上述存储介质可为磁碟、光盘、只读存储记忆体(Read-OnlyMemory,ROM)、随机存储记忆体(Random Access Memory,RAM)、快闪存储器(FlashMemory)、硬盘(Hard Disk Drive,缩写:HDD)或固态硬盘(Solid-State Drive,SSD)等;该存储介质还可以包括上述种类的存储器的组合。An embodiment of the present invention provides a non-transitory computer storage medium, the computer storage medium stores computer-executable instructions, and the computer-executable instructions can execute the graph database-based power grid equipment reachability query method in any of the first embodiments above. . Wherein, the above-mentioned storage medium can be a magnetic disk, an optical disk, a read-only memory (Read-OnlyMemory, ROM), a random access memory (Random Access Memory, RAM), a flash memory (FlashMemory), a hard disk (Hard Disk Drive, Abbreviation: HDD) or solid-state drive (Solid-State Drive, SSD), etc.; the storage medium may also include a combination of the above types of storage.
本领域技术人员可以理解,实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,的存储介质可为磁碟、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。Those skilled in the art can understand that all or part of the processes in the methods of the above-mentioned embodiments can be completed by instructing related hardware through computer programs, and the programs can be stored in a computer-readable storage medium. , may include the flow of the embodiments of the above-mentioned methods. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), and the like.
实施例4Example 4
本发明实施例提供一种执行电网设备可达性查询方法的电子设备,其结构示意图如图11所示,该设备包括:一个或多个处理器410以及存储器420,图11中以一个处理器410为例。An embodiment of the present invention provides an electronic device for executing a method for querying the reachability of power grid equipment. Its structural diagram is shown in FIG. 11 . 410 as an example.
执行电网设备可达性查询方法的电子设备还可以包括:输入装置430和输出装置440。The electronic equipment executing the method for querying the reachability of grid equipment may further include: an input device 430 and an output device 440 .
处理器410、存储器420、输入装置430和输出装置440可以通过总线或者其他方式连接,图11中以通过总线连接为例。The processor 410, the memory 420, the input device 430, and the output device 440 may be connected through a bus or in other ways, and connection through a bus is taken as an example in FIG. 11 .
处理器410可以为中央处理器(Central Processing Unit,CPU)。处理器410还可以为其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等芯片,或者上述各类芯片的组合。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 410 may be a central processing unit (Central Processing Unit, CPU). The processor 410 may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate array (Field-Programmable Gate Array, FPGA) or Other chips such as programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above-mentioned types of chips. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
存储器420作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序、非暂态计算机可执行程序以及模块,如本申请实施例中的电网设备可达性查询方法对应的程序指令/模块,处理器410通过运行存储在存储器420中的非暂态软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例的电网设备可达性查询方法。The memory 420, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs and modules, such as the program corresponding to the power grid equipment reachability query method in the embodiment of the present application Instructions/modules, the processor 410 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions and modules stored in the memory 420, that is, to realize the grid equipment reachability query in the above method embodiment method.
存储器420可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据电网设备可达性查询的处理装置的使用所创建的数据等。此外,存储器420可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施例中,存储器420可选包括相对于处理器410远程设置的存储器,这些远程存储器可以通过网络连接至电网设备可达性查询装置。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 420 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application program required by at least one function; data etc. In addition, the memory 420 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the storage 420 may optionally include storages that are remotely located relative to the processor 410, and these remote storages may be connected to the power grid equipment reachability query device through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
输入装置430可接收输入的数字或字符信息,以及产生与电网设备可达性查询操作的处理装置的用户设置以及功能控制有关的键信号输入。输出装置440可包括显示屏等显示设备。The input device 430 can receive input numbers or character information, and generate key signal input related to the user setting and function control of the processing device for the grid equipment reachability query operation. The output device 440 may include a display device such as a display screen.
一个或者多个模块存储在存储器420中,当被一个或者多个处理器410执行时,执行如图1所示的方法。One or more modules are stored in the memory 420, and when executed by the one or more processors 410, perform the method shown in FIG. 1 .
上述产品可执行本发明实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,具体可参见如图1-8所示的实施例中的相关描述。The above-mentioned products can execute the methods provided by the embodiments of the present invention, and have corresponding functional modules and beneficial effects for executing the methods. For technical details that are not described in detail in this embodiment, please refer to the related description in the embodiment shown in FIGS. 1-8 for details.
显然,上述实施例仅仅是为清楚地说明所作的举例,而并非对实施方式的限定。对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动。这里无需也无法对所有的实施方式予以穷举。而由此所引伸出的显而易见的变化或变动仍处于本发明创造的保护范围之中。Apparently, the above-mentioned embodiments are only examples for clear description, rather than limiting the implementation. For those of ordinary skill in the art, other changes or changes in different forms can be made on the basis of the above description. It is not necessary and impossible to exhaustively list all the implementation manners here. And the obvious changes or changes derived therefrom are still within the scope of protection of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710823452.3ACN107679107B (en) | 2017-09-13 | 2017-09-13 | Graph database-based power grid equipment reachability query method and system |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710823452.3ACN107679107B (en) | 2017-09-13 | 2017-09-13 | Graph database-based power grid equipment reachability query method and system |
| Publication Number | Publication Date |
|---|---|
| CN107679107Atrue CN107679107A (en) | 2018-02-09 |
| CN107679107B CN107679107B (en) | 2020-10-27 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201710823452.3AActiveCN107679107B (en) | 2017-09-13 | 2017-09-13 | Graph database-based power grid equipment reachability query method and system |
| Country | Link |
|---|---|
| CN (1) | CN107679107B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109634987A (en)* | 2018-11-22 | 2019-04-16 | 全球能源互联网研究院有限公司 | The querying method and device of power grid chart database |
| CN110543494A (en)* | 2019-08-19 | 2019-12-06 | 湖南麟淇网络科技股份有限公司 | Method for constructing reachable graph based on cache table |
| CN114090831A (en)* | 2020-08-24 | 2022-02-25 | 中关村海华信息技术前沿研究院 | Node connectivity query method, system, computer equipment and storage medium |
| CN115809533A (en)* | 2022-12-21 | 2023-03-17 | 上海博般数据技术有限公司 | Graph database-based power grid topology splicing method and using method |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101441681A (en)* | 2008-12-24 | 2009-05-27 | 东南大学 | Property analysis method and system of general-purpose Petri net based on quasi-perfect finite reachable tree |
| CN102929697A (en)* | 2012-10-09 | 2013-02-13 | Tcl集团股份有限公司 | State machine, scheduling method and device and universal serial bus (USB) media play control device |
| US20140136468A1 (en)* | 2012-11-14 | 2014-05-15 | Robust Links, LLC | Quantitative assessment of similarity of categorized data |
| CN103824234A (en)* | 2014-03-18 | 2014-05-28 | 国家电网公司 | Blocking and hierarchical structure based power distribution system reliability evaluation method |
| CN106815657A (en)* | 2017-01-05 | 2017-06-09 | 国网福建省电力有限公司 | A kind of power distribution network bi-level programming method for considering timing and reliability |
| CN107153647A (en)* | 2016-03-02 | 2017-09-12 | 奇简软件(北京)有限公司 | Carry out method, device, system and the computer program product of data compression |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101441681A (en)* | 2008-12-24 | 2009-05-27 | 东南大学 | Property analysis method and system of general-purpose Petri net based on quasi-perfect finite reachable tree |
| CN102929697A (en)* | 2012-10-09 | 2013-02-13 | Tcl集团股份有限公司 | State machine, scheduling method and device and universal serial bus (USB) media play control device |
| US20140136468A1 (en)* | 2012-11-14 | 2014-05-15 | Robust Links, LLC | Quantitative assessment of similarity of categorized data |
| CN103824234A (en)* | 2014-03-18 | 2014-05-28 | 国家电网公司 | Blocking and hierarchical structure based power distribution system reliability evaluation method |
| CN107153647A (en)* | 2016-03-02 | 2017-09-12 | 奇简软件(北京)有限公司 | Carry out method, device, system and the computer program product of data compression |
| CN106815657A (en)* | 2017-01-05 | 2017-06-09 | 国网福建省电力有限公司 | A kind of power distribution network bi-level programming method for considering timing and reliability |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109634987A (en)* | 2018-11-22 | 2019-04-16 | 全球能源互联网研究院有限公司 | The querying method and device of power grid chart database |
| CN110543494A (en)* | 2019-08-19 | 2019-12-06 | 湖南麟淇网络科技股份有限公司 | Method for constructing reachable graph based on cache table |
| CN110543494B (en)* | 2019-08-19 | 2023-03-24 | 湖南麟淇网络科技股份有限公司 | Method for constructing reachable graph based on cache table |
| CN114090831A (en)* | 2020-08-24 | 2022-02-25 | 中关村海华信息技术前沿研究院 | Node connectivity query method, system, computer equipment and storage medium |
| CN114090831B (en)* | 2020-08-24 | 2025-01-10 | 中关村海华信息技术前沿研究院 | Node connectivity query method, system, computer device and storage medium |
| CN115809533A (en)* | 2022-12-21 | 2023-03-17 | 上海博般数据技术有限公司 | Graph database-based power grid topology splicing method and using method |
| Publication number | Publication date |
|---|---|
| CN107679107B (en) | 2020-10-27 |
| Publication | Publication Date | Title |
|---|---|---|
| CN104462260B (en) | A kind of community search method in social networks based on k- cores | |
| CN107679107B (en) | Graph database-based power grid equipment reachability query method and system | |
| CN103138981B (en) | A kind of social network analysis method and apparatus | |
| EP3371717A1 (en) | Virtual edge of a graph database | |
| CN105302803A (en) | Product BOM difference analyzing and synchronous updating method | |
| CN107679049A (en) | Obtain the method, apparatus and system of the hop of tree structure data two | |
| CN111309868A (en) | A knowledge graph construction and retrieval method and device | |
| US20170032052A1 (en) | Graph data processing system that supports automatic data model conversion from resource description framework to property graph | |
| CN103778251A (en) | SPARQL parallel query method facing large-scale RDF graph data | |
| WO2018184305A1 (en) | Group search method based on social network, device, server and storage medium | |
| CN117194668A (en) | Knowledge graph construction method, device, equipment and storage medium | |
| CN106202167B (en) | An Adaptive Index Construction Method for Directed Labeled Graphs Based on Structural Summary Model | |
| JP2017537566A (en) | Routing table maintenance method, apparatus and storage medium | |
| CN116521956A (en) | A graph database query method, device, electronic equipment and storage medium | |
| CN101662489B (en) | Method, device and system for discovering semantic Web service | |
| CN106202102A (en) | Batch data querying method and device | |
| CN105701128A (en) | Query statement optimization method and apparatus | |
| CN111159577A (en) | Community division method and device, storage medium and electronic device | |
| CN108780452B (en) | A method and device for processing a stored procedure | |
| CN114048219A (en) | Graph database update method and device | |
| CN107592207B (en) | Network management service data management method and network management service data management device | |
| US12417247B2 (en) | Systems and methods for metadata based path finding | |
| CN112183567B (en) | Optimization method, device, equipment and storage medium of BIRCH algorithm | |
| CN112639761B (en) | Method and device for establishing index for data | |
| CN106991195A (en) | A kind of distributed subgraph enumeration methodology |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| CB02 | Change of applicant information | ||
| CB02 | Change of applicant information | Address after:102209 18 Riverside Avenue, Changping District science and Technology City, Beijing Applicant after:Global energy Internet Institute, Inc. Applicant after:State Grid Corporation of China Applicant after:State Grid Anhui Electric Power Company Address before:102209 18 Riverside Avenue, Changping District science and Technology City, Beijing Applicant before:Global energy Internet Institute, Inc. Applicant before:State Grid Corporation of China Applicant before:State Grid Anhui Electric Power Company | |
| GR01 | Patent grant | ||
| GR01 | Patent grant |