A method and device for automatically generating a power grid diagram data model

The multi-source heterogeneous data of the power grid is integrated through the clustering algorithm and power grid diagram data model mapping rules, which solves the problem of the unity of the power grid data model and realizes data integration and value mining.

CN117453937BActive Publication Date: 2024-09-17GLOBAL ENERGY INTERCONNECTION RES INST CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311514624.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-14
Publication Date
2024-09-17
Estimated Expiration
2043-11-14

AI Technical Summary

Technical Problem

The existing technology lacks methods for integrating multi-source heterogeneous data in the power grid and establishing a unified graph data model, resulting in poor real-time data sharing and the inability to fully tap the value of power grid data.

Method used

By acquiring multi-source heterogeneous data from the power grid, using clustering algorithms for data fusion, and generating a power grid data model based on preset power grid data model mapping rules, data integration and unification are achieved.

Benefits of technology

It realizes the integration and superposition of multi-source heterogeneous data, reduces data complexity, reduces duplicate information, establishes a unified power grid diagram data model, and fully taps the value of power grid data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117453937B
    Figure CN117453937B
Patent Text Reader

Abstract

The present invention relates to the field of electric power information technology, and discloses a method and device for automatically generating a power grid diagram data model, the method comprising: obtaining multi-source heterogeneous data of the power grid; using a clustering algorithm to fuse the multi-source heterogeneous data of the power grid to obtain fused power grid data; generating a power grid diagram data model according to the fused power grid data based on a preset power grid diagram data model mapping rule. The present invention realizes the integration and superposition of multi-source heterogeneous data, achieves the purpose of reducing data complexity and reducing duplicate information, realizes the purpose of integrating cross-link power grid data and establishing a unified data model, achieves the effect of fully tapping the value of power grid data, and solves the problem of the lack of a method for fusing multi-source heterogeneous data to establish a unified graph data model in the related technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electric power information technology, and in particular to a method and device for automatically generating a power grid diagram data model. Background Art

[0002] With the rapid development of intelligent and information-based power grids and the continuous expansion of their scale, the topological structure of power grids has become increasingly complex, and the amount of collected data involved is also extremely large. The data sources of power grids cover multiple links such as power generation, transmission, distribution, and power consumption, and are generally characterized by wide sources, large scale, and complex types. The data models of various business departments are different, data sharing is not real-time, and there is a lack of a unified data model that supports the temporal evolution of complex networks, which makes it impossible to fully explore and use the data value of power grids. Therefore, there is an urgent need for a method to fuse multi-source heterogeneous data across multiple links of power grids and establish a unified graph data model. Summary of the invention

[0003] In view of this, the present invention provides a method and device for automatically generating a power grid diagram data model to solve the problem in the prior art of lacking a method for fusing multi-source heterogeneous data to establish a unified diagram data model.

[0004] In a first aspect, the present invention provides a method for automatically generating a power grid diagram data model, comprising: acquiring multi-source heterogeneous data of the power grid; performing data fusion on the multi-source heterogeneous data of the power grid using a clustering algorithm to obtain fused power grid data; and generating a power grid diagram data model according to the fused power grid data based on preset power grid diagram data model mapping rules.

[0005] In an embodiment of the present invention, similar data in multi-source heterogeneous data are fused through a clustering algorithm, thereby realizing the integration and superposition of multi-source heterogeneous data, achieving the purpose of reducing data complexity and reducing repeated information, and the preset power grid diagram data model mapping rules define a unified power grid diagram data structure, and a power grid diagram data model is generated based on the fused power grid data based on the rules, thereby realizing the purpose of integrating cross-link power grid data and establishing a unified data model, achieving the effect of fully tapping the value of power grid data, and solving the problem of lack of a method for fusing multi-source heterogeneous data and establishing a unified graph data model in related technologies.

[0006] In an optional implementation, obtaining multi-source heterogeneous data of the power grid includes: establishing a shared connection between multiple database servers; calling a preset multi-database connection interface to obtain multi-source heterogeneous data of the power grid from multiple databases; and cleaning and standardizing the multi-source heterogeneous data of the power grid to obtain pre-processed multi-source heterogeneous data of the power grid.

[0007] In the embodiment of the present invention, by establishing a multi-database server shared connection and calling a preset multi-database connection interface, the purpose of conveniently and quickly acquiring multi-source heterogeneous data of the power grid is achieved.

[0008] In an optional embodiment, the multi-source heterogeneous data of the power grid are cleaned and standardized, including: deleting or correcting the erroneous values, missing values ​​and abnormal values ​​in the multi-source heterogeneous data of the power grid to obtain the cleaned multi-source heterogeneous data of the power grid; obtaining the data format and unit corresponding to the power grid diagram data model; and standardizing the cleaned multi-source heterogeneous data of the power grid based on the data format and unit corresponding to the power grid diagram data model.

[0009] In the embodiment of the present invention, the purpose of improving data fusion efficiency is achieved by cleaning, correcting and converting the multi-source heterogeneous data of the power grid into a unified format and unit.

[0010] In an optional embodiment, the multi-source heterogeneous data of the power grid includes attribute information and topology information corresponding to multiple devices. The multi-source heterogeneous data of the power grid are fused using a clustering algorithm to obtain fused power grid data, including: generating a sample data set containing multiple samples based on the attribute information and topology information corresponding to the multiple devices, wherein any sample in the sample data set is a multidimensional feature vector generated by the attribute information and topology information corresponding to any device; clustering the samples in the sample data set based on the K-means clustering algorithm to obtain a clustering result; and fusing the attribute information and topology information corresponding to the multiple devices based on the clustering result to obtain the fused power grid data.

[0011] In an embodiment of the present invention, similar attribute information of devices is integrated through the K-means clustering algorithm, thereby achieving the effect of deleting redundant attributes and normalizing and merging data with similar characteristics in different data sources (multiple databases), thereby achieving the purpose of reducing data complexity, reducing duplicate information, and integrating and superimposing data.

[0012] In an optional embodiment, the samples in the sample data set are clustered based on the K-means clustering algorithm to obtain clustering results, including: selecting preset samples from the sample data set as multiple cluster centers; clustering the samples in the sample data set according to the distances between the samples in the sample data set and the multiple cluster centers to obtain multiple clusters; determining new cluster centers corresponding to the multiple clusters according to the means of the samples respectively contained in the multiple clusters; judging whether the new cluster centers corresponding to the multiple clusters are consistent with the multiple cluster centers; if the new cluster centers corresponding to the multiple clusters are inconsistent with the multiple cluster centers, updating the cluster centers with the new cluster centers, and repeatedly performing the steps of clustering the samples in the sample data set, determining the new cluster centers corresponding to the multiple clusters, and judging whether the new cluster centers corresponding to the multiple clusters are consistent with the multiple cluster centers; if the new cluster centers corresponding to the multiple clusters are consistent with the multiple cluster centers, outputting the clustering results.

[0013] In the embodiment of the present invention, specific implementation steps of the K-means clustering algorithm are given, and the purpose of clustering samples in the sample data set is achieved through multiple iterations.

[0014] In an optional embodiment, the multi-source heterogeneous data of the power grid also includes: power grid business information corresponding to multiple devices, generating a power grid diagram data model according to the fused power grid data based on the preset power grid diagram data model mapping rules, including: extracting attribute information, topology information and power grid business information corresponding to the device from the fused power grid data; constructing a node model and an edge model according to the attribute information, topology information and power grid business information corresponding to the device based on the preset power grid diagram data model mapping rules; generating a power grid diagram data model according to the node model and the edge model.

[0015] In an embodiment of the present invention, information is extracted from the fused power grid data using preset power grid diagram data model mapping rules, and a node model and an edge model are constructed based on the extracted information. Then, a power grid diagram data model is generated based on the node model and the edge model, thereby achieving the purpose of establishing a unified power grid diagram data model and achieving the effect of fully tapping the value of power grid data.

[0016] In an optional embodiment, the node model includes a vertex model and a sub-node model, the edge model includes an edge model corresponding to the sub-node model and the vertex model, and an edge model corresponding to the vertex model and the vertex model. The node model and the edge model are constructed based on the preset power grid diagram data model mapping rules according to the attribute information corresponding to the device, the topology information and the power grid business information, including: generating a vertex model according to the attribute information corresponding to the device based on the preset power grid diagram data model mapping rules; generating a sub-node model and an edge model corresponding to the sub-node model and the vertex model according to the power grid business information; generating a vertex model and an edge model corresponding to the vertex model according to the topology information.

[0017] In an embodiment of the present invention, the preset power grid diagram data model mapping rules define the mapping rules and conversion mechanisms for the power grid diagram data structure, solve the problem of integrating and superimposing data from multiple data sources, achieve the purpose of splicing and fusing multi-source heterogeneous data of the power grid, and achieve the effect of improving the efficiency of power grid diagram data aggregation.

[0018] In a second aspect, the present invention provides an automatic generation device for a power grid diagram data model, comprising: a power grid data acquisition module for acquiring multi-source heterogeneous data of the power grid; a power grid data fusion module for performing data fusion on the multi-source heterogeneous data of the power grid using a clustering algorithm to obtain fused power grid data; and a graph data model construction module for generating a power grid diagram data model according to the fused power grid data based on preset power grid diagram data model mapping rules.

[0019] In an optional embodiment, the power grid data acquisition module includes: a shared connection establishment unit, which is used to establish a shared connection between multiple database servers; a data acquisition unit, which is used to call a preset multi-database connection interface to acquire multi-source heterogeneous data of the power grid from multiple databases; and a preprocessing unit, which is used to clean and standardize the multi-source heterogeneous data of the power grid to obtain preprocessed multi-source heterogeneous data of the power grid.

[0020] In an optional embodiment, the preprocessing unit includes: a deletion and correction subunit, which is used to delete or correct erroneous values, missing values ​​and abnormal values ​​in the multi-source heterogeneous data of the power grid to obtain cleaned multi-source heterogeneous data of the power grid; a format acquisition subunit, which is used to obtain the data format and unit corresponding to the power grid diagram data model; and a standardization processing subunit, which is used to standardize the cleaned multi-source heterogeneous data of the power grid based on the data format and unit corresponding to the power grid diagram data model.

[0021] In an optional embodiment, the multi-source heterogeneous data of the power grid includes attribute information and topology information corresponding to multiple devices, and the power grid data fusion module includes: a sample data set generation unit, which is used to generate a sample data set containing multiple samples based on the attribute information and topology information corresponding to the multiple devices, and any sample in the sample data set is a multidimensional feature vector generated by the attribute information and topology information corresponding to any device; a clustering unit, which is used to cluster the samples in the sample data set based on the K-means clustering algorithm to obtain clustering results; and a fusion unit, which is used to fuse the attribute information and topology information corresponding to the multiple devices according to the clustering results to obtain fused power grid data.

[0022] In an optional embodiment, the clustering unit includes: an initialization subunit, which is used to select a preset number of samples from the sample data set as multiple cluster centers; a clustering subunit, which is used to cluster the samples in the sample data set according to the distances between the samples in the sample data set and the multiple cluster centers to obtain multiple clusters; a cluster center determination subunit, which is used to determine new cluster centers corresponding to the multiple clusters according to the means of the samples respectively contained in the multiple clusters; a judgment subunit, which is used to judge whether the new cluster centers corresponding to the multiple clusters are consistent with the multiple cluster centers; an iteration subunit, which is used to update the cluster centers using the new cluster centers if the new cluster centers corresponding to the multiple clusters are inconsistent with the multiple cluster centers, and repeatedly perform the steps of clustering the samples in the sample data set, determining the new cluster centers corresponding to the multiple clusters, and judging whether the new cluster centers corresponding to the multiple clusters are consistent with the multiple cluster centers; a result output subunit, which is used to output the clustering results if the new cluster centers corresponding to the multiple clusters are consistent with the multiple cluster centers.

[0023] In an optional embodiment, the multi-source heterogeneous data of the power grid also includes: power grid business information corresponding to multiple devices, and the graph data model construction module includes: an information extraction unit, used to extract attribute information, topology information and power grid business information corresponding to the device from the fused power grid data; a node and edge construction unit, used to construct a node model and an edge model according to the attribute information, topology information and power grid business information corresponding to the device based on preset power grid graph data model mapping rules; a model generation unit, used to generate a power grid graph data model based on the node model and the edge model.

[0024] In an optional embodiment, the node model includes a vertex model and a sub-node model, the edge model includes an edge model corresponding to the sub-node model and the vertex model, and the vertex model and the edge model corresponding to the vertex model, and the node and edge construction unit includes: a vertex generation sub-unit, which is used to generate a vertex model according to the attribute information corresponding to the device based on a preset power grid diagram data model mapping rule; a sub-node and edge generation sub-unit, which is used to generate a sub-node model and the edge model corresponding to the sub-node model and the vertex model according to the power grid business information; an edge generation sub-unit, which is used to generate a vertex model and an edge model corresponding to the vertex model according to the topology information.

[0025] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for automatically generating a power grid diagram data model according to the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0026] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for automatically generating a power grid diagram data model according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0028] Figure 1 is a schematic diagram of a flow chart of a method for automatically generating a power grid diagram data model according to an embodiment of the present invention;

[0029] Figure 2 is a flow chart of another method for automatically generating a power grid diagram data model according to an embodiment of the present invention;

[0030] Figure 3 is a schematic diagram of the overall framework of a method for automatically generating a power grid diagram data model according to an embodiment of the present invention;

[0031] Figure 4 is a structural block diagram of a device for automatically generating a power grid diagram data model according to an embodiment of the present invention;

[0032] Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0034] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected, it can be indirectly connected through an intermediate medium, it can also be the internal communication of two elements, it can be a wireless connection, or it can be a wired connection. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood in specific circumstances.

[0035] With the rapid development of intelligent and information-based power grids, the scale of power grids continues to expand, the complexity of power grid topology and the coverage of various data acquisition devices are also increasing, the frequency of data acquisition is getting higher and higher, and the data granularity is getting smaller and smaller. The sources of power grid data cover multiple links such as power generation, transmission, distribution, and power consumption. Overall, they are characterized by wide sources, large scale, and complex types. The data models of various business departments are different, data sharing is not real-time, and there is a lack of a unified data model that supports the temporal evolution of complex networks, which makes it impossible to fully explore and use the data value of the power grid. Therefore, it is particularly important to accurately describe and efficiently store massive power grid data and realize unified modeling and management of power grid data.

[0036] As a natural network graph system, the power grid has a complex topological structure. When using traditional relational databases to model massive power grid data, it is unable to effectively describe its network topological characteristics. At the same time, it has deficiencies in storage scale, query speed, and scalability. Graph databases use graph structures to store data, which have a clear mapping relationship with the topological structure of the power grid system. When querying, only nodes and edges need to be traversed, which can better adapt to the complexity and scalability requirements of the power grid system. Compared with traditional relational databases, graph databases have excellent performance in splicing and fusing massive heterogeneous data. There are two main issues to consider when automatically generating power grid graph data models: (1) How to homogenize heterogeneous nodes and realize the fusion of multi-source heterogeneous data. (2) How to define mapping and conversion rules for power grid graph data structures and establish a unified power grid graph data model.

[0037] According to an embodiment of the present invention, an embodiment of a method for automatically generating a power grid diagram data model is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0038] In this embodiment, a method for automatically generating a power grid diagram data model is provided, which can be used in the above-mentioned mobile terminal, such as a central processing unit, a server, etc. Figure 1 FIG. 1 is a flow chart of a method for automatically generating a power grid diagram data model according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0039] Step S101, obtaining multi-source heterogeneous data of the power grid. Optionally, multi-source heterogeneous data of the power grid refers to data from different data sources (such as multiple business systems of the power grid) and different formats and types. These data are usually difficult to directly merge and share, which brings great challenges to data integration, management and analysis. The acquisition of multi-source heterogeneous data of the power grid can be achieved by establishing a shared link between multiple databases, calling a preset interface to obtain, or by establishing a data middle station.

[0040] Step S102, using a clustering algorithm to fuse the multi-source heterogeneous data of the power grid to obtain fused power grid data. Optionally, the clustering algorithm can aggregate similar data together, thereby achieving the purpose of fusing and deduplicating data sets expressing the same physical entity in multiple databases, thereby reducing the complexity of the data. The clustering algorithm can adopt a K-Means clustering algorithm, a hierarchical clustering algorithm, a mean shift clustering algorithm, and the like.

[0041] Step S103, generating a power grid diagram data model according to the fused power grid data based on the preset power grid diagram data model mapping rules. Optionally, after clustering and fusing the data in step S102, extract target information from the fused power grid data according to the preset power grid diagram data model mapping rules, and generate a power grid diagram data model according to the target information. The target information may be information such as the topological structure and attributes of nodes and edges required to establish the power grid diagram data model.

[0042] In an embodiment of the present invention, similar data in multi-source heterogeneous data are fused through a clustering algorithm, thereby realizing the integration and superposition of multi-source heterogeneous data, achieving the purpose of reducing data complexity and reducing repeated information, and the preset power grid diagram data model mapping rules define a unified power grid diagram data structure, and a power grid diagram data model is generated based on the fused power grid data based on the rules, thereby realizing the purpose of integrating cross-link power grid data and establishing a unified data model, achieving the effect of fully tapping the value of power grid data, and solving the problem of lack of a method for fusing multi-source heterogeneous data and establishing a unified graph data model in related technologies.

[0043] In this embodiment, a method for automatically generating a power grid diagram data model is provided, which can be used in the above-mentioned mobile terminal, such as a central processing unit, a server, etc. Figure 2 FIG. 1 is a flow chart of another method for automatically generating a power grid diagram data model according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0044] Step S201, acquiring multi-source heterogeneous data of the power grid. In an optional implementation, the above step S201 includes:

[0045] Step S2011, establish a shared connection between multiple database servers. Specifically, multiple databases can be databases of multiple business systems across multiple links of the power grid. By establishing a shared connection between the graph database and multiple database servers, the purpose of connecting and accessing the power grid data of multiple databases can be achieved by the graph database. It should be noted that the source of multi-source heterogeneous data can be different power grid source database systems or existing relational database systems.

[0046] Step S2012, calling a preset multi-database connection interface to obtain multi-source heterogeneous data of the power grid from multiple databases. Optionally, when accessing multiple source databases is required in a graph database access environment, the purpose of connecting and accessing multiple databases to obtain power grid data is achieved by calling a preset multi-database connection interface at the interface layer.

[0047] Step S2013, cleaning and standardizing the multi-source heterogeneous data of the power grid to obtain pre-processed multi-source heterogeneous data of the power grid. Specifically, step S2013 includes:

[0048] Step a1, delete or correct the error values, missing values ​​and abnormal values ​​in the multi-source heterogeneous data of the power grid to obtain the cleaned multi-source heterogeneous data of the power grid. Optionally, the error values, missing values ​​and abnormal values ​​are deleted or filled with statistics such as mean, median and mode.

[0049] Step a2, obtaining the data format and unit corresponding to the power grid diagram data model.

[0050] Step a3: standardize the cleaned multi-source heterogeneous data of the power grid based on the data format and unit corresponding to the power grid diagram data model. Optionally, standardize the multi-source heterogeneous data according to the data format and unit corresponding to the power grid diagram data model and convert them into a unified format and unit.

[0051] Step S202, using a clustering algorithm to perform data fusion on the multi-source heterogeneous data of the power grid to obtain fused power grid data. In an optional implementation, the multi-source heterogeneous data of the power grid includes attribute information and topology information corresponding to multiple devices. Optionally, the attribute information is used to describe the type, number, location and other information of the device, and the topology information is used to describe the connection relationship between the devices. The above step S202 includes:

[0052] Step S2021, generating a sample data set including multiple samples according to the attribute information and topology information corresponding to the multiple devices, wherein any sample in the sample data set is a multidimensional feature vector generated by the attribute information and topology information corresponding to any device. As an example, the sample data set generated according to the attribute information and topology information corresponding to the multiple devices can be expressed as: X = {x i |x i ∈R d ,i=1,2,...,N}, where x i represents the i-th sample, is a d-dimensional feature vector, and N represents the sample capacity.

[0053] Step S2022, clustering the samples in the sample data set based on the K-means clustering algorithm to obtain a clustering result. Specifically, step S2022 includes:

[0054] Step b1: select a preset number of samples from the sample data set as multiple cluster centers. Optionally, select k samples from the sample data set X: c1, c2, ..., c k As multiple (initial) cluster centers, the preset number k can be set according to the number of device entities.

[0055] Step b2: cluster the samples in the sample data set according to the distances between the samples in the sample data set and multiple cluster centers to obtain multiple clusters. Optionally, calculate each sample x i The distance from multiple cluster centers, the sample x i Assign to the category to which the nearest cluster center belongs. The distance can be Euclidean distance, Manhattan distance, cosine similarity, etc. This embodiment takes Euclidean distance as an example and uses the following formula to calculate any sample x i With any cluster center c j The distance dist(x i ,c j ):

[0056]

[0057] Among them, x i represents the i-th sample, c j represents the jth cluster center. It should be noted that both the sample and the cluster are d-dimensional feature vectors, x im represents the value of the m-th dimension component in the i-th sample, c jm Represents the value of the m-th dimension component in the j-th cluster center, N is the sample size, and k is the number of cluster centers.

[0058] Step b3: Determine the new cluster centers corresponding to the multiple clusters according to the mean values ​​of the samples contained in the multiple clusters. Optionally, for each cluster, calculate the mean value of all its samples to obtain the new cluster center c' j , the calculation formula is as follows:

[0059]

[0060] Among them, W j Indicates that c j The cluster centered on n(W j ) is the number of samples in the cluster.

[0061] Step b4, determine whether the new cluster centers corresponding to the multiple clusters are consistent with the multiple cluster centers. That is, for each new cluster center c' j , judge c j =c' j Is it true?

[0062] Step b5: If the new cluster centers corresponding to the multiple clusters are inconsistent with the multiple cluster centers, the cluster centers are updated using the new cluster centers, and the steps of clustering the samples in the sample data set, determining the new cluster centers corresponding to the multiple clusters, and judging whether the new cluster centers corresponding to the multiple clusters are consistent with the multiple cluster centers are repeated. Specifically, if c j =c' j If the new cluster center of any cluster is inconsistent with the cluster center, let c j =c' j , return to step b2 and continue execution.

[0063] Step b6: If the new cluster centers corresponding to multiple clusters are consistent with the multiple cluster centers, output the clustering results. j =c' j Once the center points of each cluster no longer change, the clustering results are output.

[0064] Step S2023, according to the clustering result, the attribute information and topology information corresponding to the multiple devices are integrated to obtain the integrated power grid data. It can be understood that clustering is the process of dividing the data set expressing the same device (physical entity) in multiple databases. Each cluster after clustering represents a device entity. For the same or similar data fields in the same device entity, data integration is performed and duplicate data is deleted.

[0065] Step S203, generating a power grid diagram data model according to the fused power grid data based on the preset power grid diagram data model mapping rules. In an optional implementation, the power grid multi-source heterogeneous data also includes: power grid business information corresponding to multiple devices, and optionally, the power grid business information corresponding to the device may include: the business type involved in the device and specific business data, and the above step S203 includes:

[0066] Step S2031, extracting attribute information, topology information and grid business information corresponding to the equipment from the fused grid data. Optionally, extracting equipment information required for building a grid diagram data model, such as attribute information, topology information and grid business information.

[0067] Step S2032, based on the preset power grid data model mapping rules, a node model and an edge model are constructed according to the attribute information, topology information and power grid business information corresponding to the device. Specifically, the node model includes a vertex model and a child node model, and the edge model includes an edge model corresponding to the child node model and the vertex model, and an edge model corresponding to the vertex model and the vertex model. The above step S2032 includes:

[0068] Step c1, based on the preset power grid diagram data model mapping rules, a vertex model is generated according to the attribute information corresponding to the device. Optionally, the preset power grid diagram data model mapping rules specify what data is used and how to generate the vertices, subnodes, edges between vertices and subnodes, and edges between vertices in the power grid diagram data model. As an example. The vertex model is a model corresponding to the power grid device, that is, the device is used as a node, and the attribute information corresponding to the device is used as the attribute contained in the node.

[0069] Step c2, generating a subnode model and an edge model corresponding to the subnode model and the vertex model according to the power grid business information. Optionally, assuming that the power grid business information includes the power grid business type, specific business information and business association information, illustratively, using a subnode to represent the business type, the business type includes: power transmission business, power distribution business, electricity price business, security monitoring business, operation and maintenance business, etc., using the business association information to generate the subnode model and the edge model corresponding to the vertex model, the specific business information corresponding to any business type can be stored as the attribute of the subnode.

[0070] Step c3, generating a vertex model and an edge model corresponding to the vertex model according to the topology information. Optionally, the vertex model is a model corresponding to a power grid device, and the topology information is used to describe the connection relationship between devices. Then, the association relationship between the vertex models can be established using the topology information.

[0071] Step S2033, generating a power grid graph data model according to the node model and the edge model. Specifically, a unified power grid graph data model is established using the node model and the edge model generated in the above step S2032.

[0072] In an embodiment of the present invention, similar data in multi-source heterogeneous data are fused through a clustering algorithm, thereby realizing the integration and superposition of multi-source heterogeneous data, achieving the purpose of reducing data complexity and reducing repeated information, and the preset power grid diagram data model mapping rules define a unified power grid diagram data structure, and a power grid diagram data model is generated based on the fused power grid data based on the rules, thereby realizing the purpose of integrating cross-link power grid data and establishing a unified data model, achieving the effect of fully tapping the value of power grid data, and solving the problem of lack of a method for fusing multi-source heterogeneous data and establishing a unified graph data model in related technologies.

[0073] In an optional embodiment, Figure 3 Schematic diagram of the overall framework of the method for automatically generating a power grid diagram data model according to an embodiment of the present invention. Figure 3 As shown, the process of the automatic generation method of the power grid diagram data model is as follows:

[0074] First, you need to establish a shared connection between multiple database servers, call the preset interface, connect multiple databases to obtain the panoramic data of the power grid, that is, obtain the multi-source heterogeneous data of the power grid from multiple databases. Figure 2 Step S2011 and step S2012 of the illustrated embodiment are not described in detail here.

[0075] Then, data cleaning is performed according to the data cleaning rules, that is, the acquired multi-source heterogeneous data of the power grid is cleaned according to the data cleaning rules and converted into a unified format and unit. Figure 2 Step S2013 of the illustrated embodiment will not be described in detail here.

[0076] Next, perform K-means cluster analysis; select k initial cluster centers c1, c2, ..., c from the data k ; Calculate the Euclidean distance dist(x) from the sample to each cluster center i ,c j ); assign each data sample to the closest cluster; recalculate each cluster center c' j ; judge c j =c' jIs it true? If not, let c j =c' j ; Then calculate the Euclidean distance dist(x) from the sample to each cluster center i ,c j ) and its subsequent steps; if c j =c' j If true, the clustering result is output. For details, see Figure 2 Step S2022 of the illustrated embodiment will not be described in detail here.

[0077] Then, the device attribute information of the power grid equipment, the topological structure information of the power grid equipment and the power grid service type information are extracted; according to the mapping conversion rules of the power grid diagram data model, the power grid equipment entity and the basic attribute information are established as a vertex model. In an optional implementation, the power grid diagram data model is first defined: the power grid diagram data model is an undirected graph G = (V, E), where V = (v1, v2, ..., v p ) is the vertex set, E=(e1,e2,...,e q ) is the edge set. E = v × v, indicating that each edge is a binary subset of the set V, where the node set (vertex set) is unordered. The preset power grid diagram data model mapping rules include:

[0078] Rule 1: The vertices and edges in the power grid data model have corresponding types. Vertices are used to describe physical device objects. The type set of vertices is T. V Contains various equipment types, such as busbars, cables, switches, terminals, generators, transformers, etc. Edges are used to describe the association between nodes. The edge type set T E Contains: high voltage lines, low voltage lines, etc.

[0079] Rule 2: Each vertex and edge in the graph data model has a set of attributes to fully describe its characteristics. Each vertex includes a unique node identifier and each edge includes a unique edge identifier to ensure that the computer can distinguish between different device objects.

[0080] Rule 3: The device object nodes described by the vertices in the graph data model should be mapped one by one to the real device entities, and the association information described by the edges should be mapped to the connection relationship between different real device entities.

[0081] Rule 4: Each device object vertex has a set of child nodes. The power grid business data is classified to obtain the business type. The child node type set T CVIt includes various types of power grid services, such as power transmission, power distribution, electricity price, security monitoring, operation and maintenance, etc. A service type sub-node connected to the device node is established according to the service type in which the device entity participates. The attribute information of the sub-node should contain the specific service data of the relevant service.

[0082] Next, a business information subnode model connected to the device core node is established according to the business type classification; for each business, an edge model associated with the device node is established; and an edge model associated with the devices is established according to the topological relationship of the devices. In an optional implementation, the node and edge models of the graph data model are constructed according to the above-mentioned power grid graph data model definition and the preset power grid graph data model mapping rules, including:

[0083] (1) Extract the basic attribute information of each power grid device from the clustered data, including device type, device number, physical location, etc. Configure different device entities into multiple device core nodes (as vertex models) according to the attribute information, and store this attribute information as node attributes on the node.

[0084] (2) Determine the sub-node type according to different business needs and management objectives, including power transmission business, power distribution business, electricity price business, security monitoring business, operation and maintenance business, etc. Among them, the power transmission and distribution business can configure sub-nodes according to attribute information such as different voltage levels and geographical locations; the electricity price business can configure attribute information such as billing information, power consumption information, and electricity price information as sub-nodes; the security monitoring business can configure attribute information such as power grid monitoring equipment information, power grid monitoring data, and power grid diagnosis reports as sub-nodes; the operation and maintenance business can configure attribute information such as maintenance information, equipment list, and maintenance records as sub-nodes.

[0085] (3) For each business type sub-node, an edge is established to associate the device node according to its fields and sources (such as the associated device and business system source); for each device node, an edge is established to associate the device nodes according to the topological structure of the power system, and the association information is stored on the edge as an edge attribute.

[0086] Finally, a unified power grid graph data model is established based on the structure of nodes, edges, and attributes.

[0087] This embodiment is a strategic method, which obtains power grid (multi-source heterogeneous / panoramic) data by calling interfaces connected to multiple databases, and uses K-means clustering algorithm to fuse the panoramic data of the power grid, so as to realize the integration and superposition of data from multiple data sources. Then, a specific power grid diagram data model mapping rule is defined, that is, a preset power grid diagram data model mapping rule is defined, and the node and edge data of the power grid diagram data model are constructed based on the device attribute information, topology (structure) information, and business information extracted from the fused power grid data by using the mapping rule, and finally a unified power grid diagram data model is established according to the structure of nodes, edges, and attributes. In this embodiment, by defining a unified power grid diagram data structure for multi-source and fragmented cross-link power grid data, a mapping rule and conversion mechanism for the power grid diagram data structure are defined for relational power grid data at the data level, which solves the problem of heterogeneous nodes and node homogeneity of the power grid, that is, the fusion of heterogeneous data and the integration and superposition of similar data, so as to achieve the purpose of splicing and fusing multi-source heterogeneous power grid data, and achieve the effect of improving the aggregation efficiency of power grid diagram data.

[0088] In this embodiment, a device for automatically generating a power grid diagram data model is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0089] This embodiment provides a device for automatically generating a power grid diagram data model. Figure 4 As shown, it includes: a power grid data acquisition module 401, which is used to acquire multi-source heterogeneous data of the power grid; a power grid data fusion module 402, which is used to use a clustering algorithm to fuse the multi-source heterogeneous data of the power grid to obtain fused power grid data; a graph data model construction module 403, which is used to generate a power grid graph data model according to the fused power grid data based on a preset power grid graph data model mapping rule.

[0090] In an optional embodiment, the power grid data acquisition module includes: a shared connection establishment unit, which is used to establish a shared connection between multiple database servers; a data acquisition unit, which is used to call a preset multi-database connection interface to acquire multi-source heterogeneous data of the power grid from multiple databases; and a preprocessing unit, which is used to clean and standardize the multi-source heterogeneous data of the power grid to obtain preprocessed multi-source heterogeneous data of the power grid.

[0091] In an optional embodiment, the preprocessing unit includes: a deletion and correction subunit, which is used to delete or correct erroneous values, missing values ​​and abnormal values ​​in the multi-source heterogeneous data of the power grid to obtain cleaned multi-source heterogeneous data of the power grid; a format acquisition subunit, which is used to obtain the data format and unit corresponding to the power grid diagram data model; and a standardization processing subunit, which is used to standardize the cleaned multi-source heterogeneous data of the power grid based on the data format and unit corresponding to the power grid diagram data model.

[0092] In an optional embodiment, the multi-source heterogeneous data of the power grid includes attribute information and topology information corresponding to multiple devices, and the power grid data fusion module includes: a sample data set generation unit, which is used to generate a sample data set containing multiple samples based on the attribute information and topology information corresponding to the multiple devices, and any sample in the sample data set is a multidimensional feature vector generated by the attribute information and topology information corresponding to any device; a clustering unit, which is used to cluster the samples in the sample data set based on the K-means clustering algorithm to obtain clustering results; and a fusion unit, which is used to fuse the attribute information and topology information corresponding to the multiple devices according to the clustering results to obtain fused power grid data.

[0093] In an optional embodiment, the clustering unit includes: an initialization subunit, which is used to select a preset number of samples from the sample data set as multiple cluster centers; a clustering subunit, which is used to cluster the samples in the sample data set according to the distances between the samples in the sample data set and the multiple cluster centers to obtain multiple clusters; a cluster center determination subunit, which is used to determine new cluster centers corresponding to the multiple clusters according to the means of the samples respectively contained in the multiple clusters; a judgment subunit, which is used to judge whether the new cluster centers corresponding to the multiple clusters are consistent with the multiple cluster centers; an iteration subunit, which is used to update the cluster centers using the new cluster centers if the new cluster centers corresponding to the multiple clusters are inconsistent with the multiple cluster centers, and repeatedly perform the steps of clustering the samples in the sample data set, determining the new cluster centers corresponding to the multiple clusters, and judging whether the new cluster centers corresponding to the multiple clusters are consistent with the multiple cluster centers; a result output subunit, which is used to output the clustering results if the new cluster centers corresponding to the multiple clusters are consistent with the multiple cluster centers.

[0094] In an optional embodiment, the multi-source heterogeneous data of the power grid also includes: power grid business information corresponding to multiple devices, and the graph data model construction module includes: an information extraction unit, used to extract attribute information, topology information and power grid business information corresponding to the device from the fused power grid data; a node and edge construction unit, used to construct a node model and an edge model according to the attribute information, topology information and power grid business information corresponding to the device based on preset power grid graph data model mapping rules; a model generation unit, used to generate a power grid graph data model based on the node model and the edge model.

[0095] In an optional embodiment, the node model includes a vertex model and a sub-node model, the edge model includes an edge model corresponding to the sub-node model and the vertex model, and the vertex model and the edge model corresponding to the vertex model, and the node and edge construction unit includes: a vertex generation sub-unit, which is used to generate a vertex model according to the attribute information corresponding to the device based on a preset power grid diagram data model mapping rule; a sub-node and edge generation sub-unit, which is used to generate a sub-node model and the edge model corresponding to the sub-node model and the vertex model according to the power grid business information; an edge generation sub-unit, which is used to generate a vertex model and an edge model corresponding to the vertex model according to the topology information.

[0096] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0097] The automatic generation device of the power grid diagram data model in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0098] The embodiment of the present invention also provides a computer device having the above Figure 4 The power grid diagram data model automatic generation device shown.

[0099] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.

[0100] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0101] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0102] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0103] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0104] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0105] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0106] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for automatically generating a power grid diagram data model, characterized in that: The method comprises: Acquire multi-source heterogeneous data of power grid; Using a clustering algorithm to fuse the multi-source heterogeneous data of the power grid to obtain fused power grid data; Generate a power grid diagram data model based on the fused power grid data based on a preset power grid diagram data model mapping rule; The multi-source heterogeneous data of the power grid includes attribute information and topology information corresponding to multiple devices, and the clustering algorithm is used to perform data fusion on the multi-source heterogeneous data of the power grid to obtain fused power grid data, including: Generate a sample data set including a plurality of samples according to the attribute information and topology information corresponding to the plurality of devices, wherein any sample in the sample data set is a multidimensional feature vector generated by the attribute information and topology information corresponding to any device; Clustering the samples in the sample data set based on the K-means clustering algorithm to obtain a clustering result; According to the clustering result, attribute information and topology information corresponding to multiple devices are integrated to obtain integrated power grid data; The power grid multi-source heterogeneous data also includes: power grid business information corresponding to multiple devices, and generating a power grid diagram data model according to the fused power grid data based on a preset power grid diagram data model mapping rule, including: Extracting attribute information, topology information and grid business information corresponding to the equipment from the integrated grid data; Constructing a node model and an edge model according to the attribute information, topology information and power grid service information corresponding to the device based on a preset power grid diagram data model mapping rule; Generate a power grid diagram data model according to the node model and the edge model; The node model includes a vertex model and a child node model, the edge model includes an edge model corresponding to the child node model and the vertex model, and an edge model corresponding to the vertex model and the vertex model, and the node model and the edge model are constructed based on the preset power grid graph data model mapping rule according to the attribute information, topology information and power grid business information corresponding to the device, including: Generate a vertex model according to the attribute information corresponding to the device based on a preset power grid diagram data model mapping rule; Generate a subnode model and an edge model corresponding to the subnode model and the vertex model according to the power grid business information; A vertex model and an edge model corresponding to the vertex model are generated according to the topology information.

2. The method for automatically generating a power grid diagram data model according to claim 1, characterized in that: The acquiring of multi-source heterogeneous data of the power grid includes: Establish a shared connection between multiple database servers; Call the preset multi-database connection interface to obtain multi-source heterogeneous data of the power grid from multiple databases; The multi-source heterogeneous data of the power grid are cleaned and standardized to obtain pre-processed multi-source heterogeneous data of the power grid.

3. The method for automatically generating a power grid diagram data model according to claim 2, characterized in that: The cleaning and standardization of the multi-source heterogeneous data of the power grid includes: Delete or correct the erroneous values, missing values ​​and abnormal values ​​in the multi-source heterogeneous data of the power grid to obtain the cleaned multi-source heterogeneous data of the power grid; Get the data format and unit corresponding to the power grid diagram data model; The cleaned multi-source heterogeneous data of the power grid is standardized based on the data format and unit corresponding to the power grid diagram data model.

4. The method for automatically generating a power grid diagram data model according to claim 1, characterized in that: The clustering of the samples in the sample data set based on the K-means clustering algorithm to obtain the clustering results includes: Selecting a preset number of samples from the sample data set as multiple cluster centers; Clustering the samples in the sample data set according to the distances between the samples in the sample data set and the multiple cluster centers to obtain multiple clusters; Determine new cluster centers corresponding to multiple clusters according to the mean values ​​of samples respectively contained in multiple clusters; Determine whether the new cluster centers corresponding to multiple clusters are consistent with multiple cluster centers; If the new cluster centers corresponding to the multiple clusters are inconsistent with the multiple cluster centers, the cluster centers are updated using the new cluster centers, and the steps of clustering the samples in the sample data set, determining the new cluster centers corresponding to the multiple clusters, and judging whether the new cluster centers corresponding to the multiple clusters are consistent with the multiple cluster centers are repeated; If the new cluster centers corresponding to multiple clusters are consistent with multiple cluster centers, the clustering results are output.

5. A device for automatically generating a power grid diagram data model, characterized in that: The device comprises: A power grid data acquisition module, used to acquire multi-source heterogeneous data of the power grid; A power grid data fusion module is used to fuse the multi-source heterogeneous data of the power grid using a clustering algorithm to obtain fused power grid data; A graph data model building module, used for generating a power grid graph data model according to the fused power grid data based on a preset power grid graph data model mapping rule; The multi-source heterogeneous data of the power grid includes attribute information and topology information corresponding to multiple devices. The power grid data fusion module includes: a sample data set generation unit, which is used to generate a sample data set containing multiple samples according to the attribute information and topology information corresponding to multiple devices, and any sample in the sample data set is a multidimensional feature vector generated by the attribute information and topology information corresponding to any device; a clustering unit, which is used to cluster the samples in the sample data set based on the K-means clustering algorithm to obtain clustering results; a fusion unit, which is used to fuse the attribute information and topology information corresponding to multiple devices according to the clustering results to obtain fused power grid data; The multi-source heterogeneous data of the power grid also includes: power grid business information corresponding to multiple devices, and the graph data model construction module includes: an information extraction unit, which is used to extract attribute information, topology information and power grid business information corresponding to the device from the fused power grid data; a node and edge construction unit, which is used to construct a node model and an edge model according to the attribute information, topology information and power grid business information corresponding to the device based on the preset power grid graph data model mapping rules; a model generation unit, which is used to generate a power grid graph data model according to the node model and the edge model; The node model includes a vertex model and a sub-node model, the edge model includes an edge model corresponding to the sub-node model and the vertex model, and an edge model corresponding to the vertex model and the vertex model. The node and edge construction unit includes: a vertex generation sub-unit, which is used to generate a vertex model according to the attribute information corresponding to the device based on a preset power grid diagram data model mapping rule; a sub-node and edge generation sub-unit, which is used to generate a sub-node model and an edge model corresponding to the sub-node model and the vertex model according to the power grid business information; an edge generation sub-unit, which is used to generate a vertex model and an edge model corresponding to the vertex model according to the topology information.

6. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for automatically generating a power grid diagram data model according to any one of claims 1 to 4 by executing the computer instructions.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for automatically generating a power grid diagram data model according to any one of claims 1 to 4.