A method and system for generating electric power data knowledge graph
Through deep learning algorithms, the node characteristics and network characteristics of power graph data are integrated to predict the connection probability, and the problem of insufficient data barriers and knowledge expression dimensions in the power field is solved, efficient cross-professional data fusion and accurate knowledge graph expression are achieved, and the improvement of Grid data integration and value mining capabilities.
Patent Information
- Application Number
- CN202111172149.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-08
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-10-08
AI Technical Summary
The data barriers between businesses in the power field are serious. The existing graph generation, representation and fusion methods ignore node feature information, resulting in high cost of cross-professional data fusion. The existing methods need to design the objective function separately when mapping node information dimensionality, and poor scalability .
Using deep learning algorithms, the low-dimensional vector representation model of power graph data node characteristics and network features are integrated, and the graph node connection probability is established through the model predicted graph nodes, so as to realize the efficient fusion of graph data in multiple professional fields of power, and improve the accuracy of knowledge graph expression. . The specific steps include obtaining business data, converting it into subgraph data, obtaining low-dimensional graph representation vectors, updating graph node relationships, using GCN deep neural network to predict connection probability, and performing correlation and correction between graph data.
It has achieved efficient integration of power data across professional fields, improved the accuracy and scalability of data knowledge graphs, eliminated the performance bottlenecks in power graph data analysis and processing, and significantly improved the level of data integration, sharing and value mining in the entire power grid.
Smart Images

Figure CN113806560B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power data processing, and in particular relates to a method and system for generating a power data knowledge graph. Background Art
[0002] With the continuous development of business integration applications in the power sector, the demand for data integration between businesses based on deep learning algorithm models is also increasing. After more than ten years of development, the power sector has formed different field data based on professional divisions. There are data barriers between businesses. The processing cost of cross-professional data samples required by various algorithm models is extremely high, which has become a problem that needs to be solved urgently for full business data integration.
[0003] At present, there is still a lack of research on graph generation, representation and fusion methods in the power field. The existing traditional graph generation and representation methods mainly focus on spectral methods, node content representation methods combined with network structures, and deep learning-based methods. Most of these existing traditional methods only use the network information of graph data and ignore the node feature information which also plays an important role. In addition, in the process of reducing the dimension of node information and mapping it into a low-dimensional space vector, the existing methods need to design objective functions separately for different graph mining tasks, which have strong domain relevance and poor scalability. Summary of the invention
[0004] The purpose of the present invention is to provide a method and system for generating a knowledge graph of electric power data to solve one or more of the above-mentioned technical problems. The present invention uses a deep learning algorithm to propose a low-dimensional vector representation model that integrates the node characteristics of electric power graph data and network characteristics. It can complete the establishment and correction of associations between graph data based on the graph node connection probability predicted by the model, realize the efficient fusion generation of scattered graph data in multiple professional fields of electric power, and improve the accuracy of the expression of the knowledge graph of electric power data.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A method for generating a power data knowledge graph of the present invention comprises the following steps:
[0007] Obtain the business data and data models of each business system of the pre-selected power industry;
[0008] For each business system, the business data is converted into sub-graph data based on the acquired data model and the data processing rules of the business system;
[0009] Obtain the low-dimensional graph representation vector of each graph node in each subgraph data;
[0010] Based on the low-dimensional graph representation vector of each graph node in each subgraph data, the probability of the existence of connection between each graph node in each subgraph data is obtained by using the pre-trained node connection prediction model;
[0011] For each graph node in each subgraph data, based on the classification of the graph nodes and the probability of existence of connections, the relationship between graph nodes within the subgraph data and the relationship between graph nodes between subgraph data are updated to obtain the power data knowledge graph.
[0012] A further improvement of the present invention is that, for each business system, based on the acquired data model and the data processing rules of the business system, the step of converting the business data into subgraph data specifically includes:
[0013] When the business data is structured data, the conversion processing rules and processes include:
[0014] If the primary keys of any two tables in the structured data are the same and the attribute sets are disjoint, only one graph node is constructed to merge the attribute sets;
[0015] If the primary keys of any two tables in the structured data are the same and their attribute sets intersect, two graph nodes are constructed in the graph, and the attribute intersection of the two graph nodes is added to the relationship between the graph nodes;
[0016] If the primary keys of any two tables in the structured data are the same and there is a containment relationship between the attribute sets, two graph nodes are constructed in the graph, and the relationship between the graph nodes is increased by the containment relationship.
[0017] A further improvement of the present invention is that, for each business system, based on the acquired data model and the data processing rules of the business system, the step of converting the business data into subgraph data specifically includes:
[0018] When the business data is unstructured data, the conversion processing rules and processes include:
[0019] Convert unstructured data into text format;
[0020] Based on the data in the text format, the extracted graph nodes and relationship data are directly represented by triples (Entity1, RelationType, Entity2); wherein Entity1 and Entity2 are graph nodes in the extracted text, and RelationType is a predefined Entity1 and Entity2 relationship;
[0021] The label of the graph node object is defined as word position, relationship type and role. The data outside the graph node and relationship are represented as non-extracted objects to obtain the labeled corpus. Among them, the word position is used to represent the position of the word in the graph node; the relationship type is selected from the relationship set predefined in the business field; the role is used to represent the position of the graph node in the triple.
[0022] The annotated corpus is merged into triples based on the proximity principle of the annotation sequence.
[0023] A further improvement of the present invention is that, for each business system, based on the acquired data model and the data processing rules of the business system, the business data is converted into subgraph data, and further includes:
[0024] (1) Based on the same name or attribute value, the graph nodes contained in each generated subgraph data are roughly clustered;
[0025] (2) Using text similarity features, basic feature extraction algorithms, and mutually exclusive feature analysis to jointly calculate the similarity of graph nodes, the graph nodes whose similarity meets the preset requirements are merged;
[0026] (3) Based on the results of steps (1) and (2), a hierarchical clustering algorithm is used to align the graph nodes to form the Base version of the fusion data. A fixed ID value and current timestamp are encoded for each fused graph node.
[0027] A further improvement of the present invention is that the step of obtaining the low-dimensional graph representation vector of each graph node in each subgraph data specifically includes:
[0028] For each graph node in each subgraph data, obtain a positive sample set and a negative sample set and merge them to obtain a merged sample set;
[0029] Randomly initialize the representation vector parameters of the graph nodes in the objective function;
[0030] Divide the combined sample set into several batches of disjoint sets;
[0031] Based on the plurality of mutually disjoint sets of batches, a batch gradient descent method is used to optimize the objective function until the objective function converges to obtain an optimized objective function;
[0032] The representation vector parameters of the optimized objective function are concatenated with the prior feature vectors of the graph nodes to obtain the low-dimensional graph representation vectors of the graph nodes.
[0033] A further improvement of the present invention is that the expression of the objective function is:
[0034]
[0035] In the formula, D represents the set of all positive and negative samples, and the meaning of each element is expressed by γ: γ = 1 means v j Yes i The positive sample is a neighbor node; γ=-1 means v j Yes i Negative samples, v j Indicates that through P n(v) The obtained sampling node; σ(x) represents the sigmoid function; v i 、v j represents the i-th and j-th nodes in the generated original graph; Φ(v i ) represents the representation vector of node i; f j Represents the prior node attribute feature vector of node j.
[0036] A further improvement of the present invention is that the structure of the node connection prediction model is a GCN deep neural network including 1 input layer, multiple hidden layers and 1 output layer; wherein the input layer is used to input the low-dimensional graph representation vector of two graph nodes, and the output layer is used to output the probability that the two graph nodes are connected.
[0037] A further improvement of the present invention is that the step of obtaining the pre-trained node connection prediction model specifically includes:
[0038] The low-dimensional graph representation vectors generated by all sub-graph data are randomly divided into two parts to obtain the training set and the test set;
[0039] The GCN algorithm is used to train the training set in a full set manner to obtain the trained node connection prediction model;
[0040] The trained node connection prediction model is tested in a test set, and after the test passes, the pre-trained node connection prediction model is obtained.
[0041] A further improvement of the present invention is that after obtaining the power data knowledge graph, the method further comprises:
[0042] Count the degree of each node and the number of edge relationships in the graph to form a statistical list of nodes and edge relationships corresponding to the graph nodes. For super points in the list whose node degree or edge relationship number exceeds the threshold, use a hybrid optimization segmentation method to balance the graph.
[0043] When the node degree exceeds the threshold, the number of edges and edge relationships of the neighbor nodes of the super point are classified and counted, and the largest classification is selected for segmentation; it is determined whether the node degree is lower than the threshold. If it is not satisfied, the above operation is repeated until it is lower than the threshold;
[0044] When the number of edge relationships exceeds the threshold, the edge relationship attributes are classified and counted, the largest classification is separated, and a new node edge relationship is established; it is determined whether the number of edge relationships is lower than the threshold. If not, the above operation is repeated until it is lower than the threshold.
[0045] A power data knowledge graph generation system of the present invention includes:
[0046] The first acquisition module is used to acquire business data and data models of various business systems of the pre-selected power major;
[0047] A subgraph data acquisition module is used to convert business data into subgraph data for each business system based on the acquired data model and data processing rules of the business system;
[0048] A low-dimensional graph representation vector acquisition module is used to obtain a low-dimensional graph representation vector of each graph node in each subgraph data;
[0049] A probability acquisition module is used to obtain the probability of connection between each graph node in each subgraph data based on the low-dimensional graph representation vector of each graph node in each subgraph data and using a pre-trained node connection prediction model;
[0050] The knowledge graph acquisition module is used to update the relationship between graph nodes in each subgraph data and the relationship between graph nodes between subgraph data based on the classification of graph nodes and the probability of connection, so as to obtain the power data knowledge graph.
[0051] Compared with the prior art, the present invention has the following beneficial effects:
[0052] The method of the present invention aims at the data isolation caused by the silo-style management of various electric power disciplines, and the problems of insufficient knowledge expression dimension and precision in the value analysis process of massive structured data. Through data acquisition and processing, knowledge representation learning and graph fusion, the method realizes the interconnection and integration of cross-professional and multi-domain sub-graph data in the electric power industry. Among them, through a deep learning model, the high-dimensional, large-scale sparse graph data of the power grid can be converted into a low-dimensional graph feature vector that integrates the business attributes of multiple professional fields, thereby better meeting the data requirements of model training in the electric power field, eliminating the performance bottleneck of electric power graph data in analysis, processing and model application, and significantly improving the level of integrated sharing and value mining of all business data of the power grid. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art; obviously, the drawings described below are some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0054] Figure 1 It is a flow chart of a method for generating a power data knowledge graph according to an embodiment of the present invention;
[0055] Figure 2 It is a schematic diagram of a process of merging and generating original graphs in an embodiment of the present invention;
[0056] Figure 3It is a flowchart of a graph generation and representation method for power data knowledge fusion according to an embodiment of the present invention;
[0057] Figure 4 It is a schematic diagram of a graph generation and representation system for power data knowledge fusion according to an embodiment of the present invention. DETAILED DESCRIPTION
[0058] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme 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 only 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 ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0059] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings 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 variations thereof 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 that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0060] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0061] Among the current graph representation algorithms based on deep learning, the DeepWalk algorithm proposed by Perozzi et al., based on the random walk strategy of the word2vec algorithm, introduces word representation learning into graph representation learning; the Node2vec algorithm proposed by Jure Leskovec is based on DeepWalk, which adjusts the random walk process of the node to a depth-first and breadth-first strategy, and determines the next walk direction according to the probability of the edge between nodes, thereby improving the controllability of graph representation learning. The LINE algorithm proposed by Microsoft calculates the first-order similarity and second-order similarity of the graph node network, optimizes these two similarities to obtain two low-dimensional representations, and then splices them as the final representation of the node. These graph representation algorithms only consider the network information between nodes (i.e., node relationships) and ignore the attributes of the nodes themselves. The entity relationship of power data reflects the associates of the business process, and the entity attributes are the specific content that supports the execution of the business process. The graph representation results learned using the above algorithms cannot well express the characteristics of the generated graph data.
[0062] In addition, the Chinese invention patent application with application number 202110261429.6 discloses a method based on the idea of transfer learning, which uses semi-supervised learning to learn a small amount of labeled data to capture the common structure in unlabeled graph data to provide useful representation information or parameters for downstream target tasks. This invention constructs two global and local graph autoencoder pre-training models for graph representation learning, and adds an output layer related to the target task after the model in combination with deep learning methods. It is migrated to the model training of the target task together with the local features of the graph nodes, and the pre-trained model parameters are fine-tuned using labeled data to obtain the final graph neural network model, thereby enhancing the learning ability of the model.
[0063] Combined with the above analysis, we can see that although the data governance carried out in recent years has penetrated some business areas, the data is still self-contained, and the data representation and data storage still have the following deficiencies and defects:
[0064] 1) Lack of integration of network-wide perception data, including: “generation-transmission-transformation-distribution-use” within the power grid area is a natural network, but the relational data, text, and collected message data generated by various professions lack a convergence and sharing mechanism, and the data between businesses cannot be effectively connected, making it difficult to fully, accurately, and intuitively grasp the connection and dynamics between power grid operation and business operation;
[0065] 2) The application of multi-source data mining is poor, including: the large amount of data integrated through the power big data platform lacks data mining in different dimensions, such as label management of customer behavior and social attribute information, intuitive display of holographic related information such as power equipment traceability, operation, maintenance, and power diagram data representation for deep learning, etc.;
[0066] 3) Data storage has bottlenecks, including: The construction of knowledge graphs in the fields of power marketing, operation and maintenance, customer service, and integrated energy is based on relational data models, but mainstream graph data storage solutions cannot store data that is too large in scale. The most widely used Neo4J community version has a maximum node storage capacity of no more than 2 35 Byte, faced with PB-level power grid data, will not be able to guarantee the efficient storage and management of large-scale graph data.
[0067] In order to fully explore the application value of power big data, it is necessary to provide a graph generation and representation method for power data knowledge fusion, build an effective graph data storage architecture, and aggregate and extract system data tables, texts and power grid public data scattered in different business fields into a unified knowledge fusion center to facilitate data management and governance in all business fields. Combined with the natural graph topology of the power grid and the gradual extension of the business chain, a three-dimensionally associated "one map of the power grid" system is formed from equipment to system, from district and county power supply units to headquarters, from edge to whole. After the data is fully integrated and processed, it can be provided to the entire business field of the power grid for use, and it embodies important value in the innovation of cross-business multi-scenario applications of the power grid. The embodiment of the present invention belongs to the field of power artificial intelligence data processing technology, and discloses a graph generation, representation and fusion method for power data, including data acquisition and processing, original graph merging generation, knowledge representation learning, graph fusion and graph balancing.
[0068] See also Figure 1 , a method for generating a power data knowledge graph according to an embodiment of the present invention specifically comprises the following steps:
[0069] Step 1: Obtain business data and data models of preset power majors;
[0070] Step 2: for each business system in the preset power profession, based on the acquired data model and data processing rules, convert the business data into subgraph data; wherein the subgraph data includes entities, relationships, and attributes; and the data between subgraphs establish relationships through entity alignment and merging;
[0071] Step 3, obtaining a low-dimensional vector representation of the entity in each subgraph data;
[0072] Step 4: Input the obtained low-dimensional vector representations of the two entities into the pre-trained node connection prediction model to obtain the probability that the two graph nodes are connected;
[0073] Step 5: Based on the classification of entities and the probability of each classification, the relationship between entities in the subgraph data and the relationship between entities between subgraph data are updated to obtain the power data knowledge graph.
[0074] Among them, the structure of the node connection prediction model is a GCN deep neural network including 1 input layer, multiple hidden layers and 1 output layer. The input layer includes a low-dimensional graph representation vector input of two nodes, and the output layer outputs the probability that the two nodes are connected.
[0075] In the embodiment of the present invention, the training step of obtaining the pre-trained node connection prediction model specifically includes:
[0076] 1) The low-dimensional graph representation vectors generated by all subgraph nodes are randomly divided into two parts, as training set and test set respectively;
[0077] 2) Use the GCN algorithm to train a node connection prediction model on the training set in a full set manner, where the training-related epoch and batch parameters need to be set according to the data scale and computing resource scale;
[0078] 3) Test the trained node connection prediction model in the test set, randomly select two low-dimensional graph representation vectors in the test set within or between subgraphs, predict the probability of the existence of a connection, and verify it with the actual relationship between the corresponding two nodes in the graph. Statistic the prediction accuracy. If it is lower than the empirical threshold, adjust the epoch and batch and retrain until the prediction accuracy is greater than or equal to the empirical threshold.
[0079] The embodiment of the present invention specifically provides a method for generating a knowledge graph of electric power data, which can be applied to graph generation, knowledge representation and fusion methods of massive high-dimensional data in multiple business fields such as electric power marketing, operation and inspection, customer service, and integrated energy; specifically, the present invention aims at the data isolation caused by the silo-style management of various electric power professions, and the problems of insufficient knowledge expression dimension and precision in the value analysis process of massive structured data, and realizes the interconnection and integration of cross-professional and multi-field sub-graph data of electric power through data acquisition and processing, original graph merging and generation, knowledge representation learning and graph fusion; through a deep learning model, the high-dimensional, large-scale sparse graph data of the power grid can be converted into a low-dimensional graph feature vector that integrates the business attributes of multiple professional fields, so as to better meet the data requirements of model training in the power field, eliminate the performance bottlenecks of power graph data in analysis and processing, and model application, and significantly improve the level of integrated sharing and value mining of all business data of the power grid.
[0080] In the present invention, the attributes of the power graph data nodes themselves are used as prior knowledge and spliced with the learned representation vectors, so that the generated node vectors not only contain their own characteristics, but also can explain the network correlation characteristics of neighboring nodes, effectively improving the accuracy of the expression of power graph data nodes.
[0081] In the present invention, the node's own characteristic vector is integrated into the objective function as a known coefficient, and the conversion function is used to obtain the maximum value to be equivalent to the objective function, which significantly reduces the time complexity of the normalization term. The network information and node characteristics are integrated, and the performance is improved through the negative sampling optimization method. The complexity of the algorithm is linearly related to the scale of the graph, which can efficiently support large-scale power graph data generation and representation tasks.
[0082] Exemplarily, in step 1 of the embodiment of the present invention, data is imported into a local data domain to be processed in batches through a structured data interface and an object storage data interface, and the data is divided into structured data and unstructured data; wherein the preset power professional business data and data model specifically include:
[0083] 1) Marketing, including electricity customers, electricity contracts, distribution areas, operating meters, power outages, and electricity consumption;
[0084] 2) Operation and inspection, including substations, transformers, busbars, lines, and towers;
[0085] 3) Customer service, including customers, customer equipment, and complaint information;
[0086] 4) Integrated energy, including smart terminals, power sales contracts, power generation, power consumption, and customer assets.
[0087] Exemplarily, step 2 of the embodiment of the present invention specifically includes:
[0088] (2.1) For structured data, according to its defined data model and data conversion processing rules, the graph data construction tool provided by the power graph database is used to convert it into triple data. After data preprocessing is completed by calling the ETL tool provided by the power big data platform, it is imported into the graph database to generate sub-graph data, which is used to quickly construct the core concepts in the field and their relationships.
[0089] In the embodiment of the present invention, the conversion processing rules and process of structured data are as follows:
[0090] 1) If the primary keys of any two tables in the structured data are the same and the attribute sets are disjoint, only one entity is constructed and the attribute sets are merged;
[0091] 2) If the primary keys of any two tables in the structured data are the same and their attribute sets intersect, two entities are constructed in the graph, and the attribute intersection of the two entities is added to the relationship between the entities;
[0092] 3) If the primary keys of any two tables in the structured data are the same and there is a containment relationship between the attribute sets, two entities are constructed in the graph and the containment relationship is added between the entities.
[0093] (2.2) For unstructured data, mainly including text, documents and other data, the entity-relationship joint extraction method is used to obtain the entities, relationships and attributes in the above types of data, and the extraction process is converted into a labeling task based on specific unstructured data conversion processing rules. Using the graph data construction tool of the power graph database, the triples generated by the labeling are imported into the graph database to generate unstructured subgraph data.
[0094] In the embodiment of the present invention, the unstructured data conversion processing rules and processes are as follows:
[0095] 1) Convert text and document data content into text format data;
[0096] 2) The extracted entity and relationship data are directly represented by triples (Entity1, RelationType, Entity2), where Entity1 and Entity2 are entities in the extracted text, and RelationType is the predefined relationship between Entity1 and Entity2;
[0097] 3) The label of the entity object is defined as three parts: word position, relationship type and role. The word position is annotated in the "BIES" way, indicating the position of the word in the entity; the relationship type is selected from the relationship set predefined in the business field. The relationship set is obtained by combing the core business data of the business field and named in the form of the first letters of the English name. If there is a repeated name in the relationship set, the first two letters of the first word of the later extracted relationship are taken, and so on; the role is the number "1" or "2", which is used to indicate the position of the entity in the triple;
[0098] 4) Data other than entities and relations are represented as “O”, i.e. non-extracted objects;
[0099] 5) The annotated corpus is merged into triplets according to the proximity principle of the annotated sequence, where the annotated sequence is encoded using the traditional BiLSTM algorithm.
[0100] Exemplarily, step 3 of the embodiment of the present invention specifically includes:
[0101] 1) For each node in the graph data, use the DeepWalk algorithm to generate a set of positive samples with a walk length of α1 and a sliding window of α2. For each positive sample node, according to P n (v) Distribute and extract the corresponding nodes to form the corresponding negative sample subset, extract samples from them according to the ratio α3, add them to the negative sample set, repeat α4 times, and finally merge the positive and negative sample sets;
[0102] 2) Randomly initialize the representation vector parameters of the nodes in the objective function;
[0103] 3) Divide the merged sample set into several batches of disjoint sets;
[0104] 4) The batch gradient descent method is used to optimize the objective function. Since the prior feature vector of the node is known, it is only necessary to adjust the representation vector parameters and repeat the operation according to the sample batch and gradient update step until the objective function converges;
[0105] 5) The representation vector parameters after the objective function optimization are concatenated with the node's prior feature vector to obtain the node's final representation vector.
[0106] See also Figure 2 In the embodiment of the present invention, entity alignment and merging are performed on the graph data generated by the structured data and the triple graph data generated by the unstructured data, and multiple sub-graph data generated by the structured and unstructured data in the business field are merged into one graph through the following steps. The specific execution process is described as follows:
[0107] (1) Data bucketing
[0108] The entity data contained in the generated multiple subgraphs are roughly clustered. The coarse clustering method buckets the data based on simple rules. The specific rule is that entities with the same name (original name or alias) are grouped in one data bucket. In addition to name matching, some entity-specific attribute values can also be grouped in one bucket to improve the aggregation of entities.
[0109] (2) Entity Similarity Calculation
[0110] The entity similarity calculation is carried out jointly using text similarity features, basic feature extraction algorithms and mutually exclusive feature analysis to determine whether two entities can be merged in order to solve the under-fusion problem caused by sparse similar attributes. This is the core link of entity alignment processing.
[0111] (3) Clustering and merging of similar entities
[0112] Based on the above steps, the hierarchical clustering algorithm is used to align the entities in each bucket to form the Base version of fusion data. The naming rules are as follows: the entity and attribute names are preferentially based on the names in the structured data model, and then the names in the standard and specification documents are selected according to the importance of the source documents of the entity names. Finally, a fixed ID value and current timestamp are encoded for each fused entity.
[0113] The power graph model building tool is used to extract and generate the graph node network and the attribute information of each node, and the known attribute information of each node is used as prior knowledge. Based on the idea of transforming graph representation learning into word representation learning proposed by the DeepWalk algorithm, an objective function that considers the similarity of graph node network and node attributes is designed. By continuously optimizing and iterating the function, a low-dimensional representation vector that integrates the graph node network information and node attribute feature information is obtained.
[0114] The skip-gram model is used to optimize and express the joint probability model of network features between nodes, and then the known node attribute features are integrated into the above model. The basic principle is: if two nodes have similar contexts, they are judged to be similar. For power graph data, if two nodes have common or similar neighbor nodes, they are judged to have similar low-dimensional representations. The node attribute features are generally known, so the learned low-dimensional representation of the node can explain the node attribute features of its neighbors. The fusion formula is expressed as follows:
[0115]
[0116] Among them, v i 、v j 、v k represents the i, j, and kth nodes in the generated original graph G, v i , v j , v k ∈V (V represents the node set of graph G); Φ(v i ) represents the representation vector of node i, Φ(v i )∈R d ;f j 、f k represents the prior node attribute feature vector of nodes j and k, f j , f k ∈R d (d represents the dimension of the prior node attribute feature vector).
[0117] Since the normalization term in formula (1) has a very high time complexity, the negative sampling method is used for optimization, and the formula is replaced by learning the representation vector of the nodes in the graph by maximizing formula (2):
[0118]
[0119] Among them, σ(x) represents the sigmoid function; E represents the edge set of graph G; Indicates that according to P n (v) Extract node v i Negative samples v t .
[0120] Using the definition in the DeepWalk algorithm, the negative sample v t The degree is expressed as deg(v t ), and P n (v)∝deg(v) 3 / 4 Therefore, the objective function of integrating node network information and node attribute feature information is expressed as follows:
[0121]
[0122] Among them, C i Represents node v i The set of neighbor nodes of
[0123] After model simplification, the final objective function is expressed as follows:
[0124]
[0125] Where D represents the set of all positive and negative samples, and the meaning of each element is expressed by γ: γ = 1 means v j Yes i Positive samples, i.e., neighbor nodes; γ=-1 means v j Yes i Negative samples, that is, v j Indicates that through P n (v) The obtained sampling nodes.
[0126] This model shares all parameters with DeepWalk, so the model parameter settings are consistent with DeepWalk. The typical parameter settings for the graph representation of nodes and edges within 10,000 and 1 million levels are shown in Table 1.
[0127] Table 1. Typical parameter settings for graph representation of nodes and edges within 10,000 and 1,000,000 levels
[0128]
[0129]
[0130] When the graph data is expanded to other power business areas, resulting in an increase in scale, α1~α4 are reduced according to the model test results, and d is selected from (64, 128, 256) according to the maximum scale of node attribute feature information.
[0131] In the graph fusion of the present invention, knowledge representation learning is used to classify and predict graph data, and the corresponding nodes and their attribute feature information can be constructed or updated. The graph data generated by structured data is compared, and the nodes and node attributes in the above-mentioned merged graph are further adjusted respectively, thereby improving the accuracy of entity linking and knowledge merging of classified entities, relationships and attributes.
[0132] Furthermore, in terms of the model running environment, graph data is mainly based on mainstream technologies such as Neo4J to provide storage capabilities, and the maximum amount of data stored in a node does not exceed 2 35 Bytes, so they have to rely on third-party distributed storage (such as HBase) to provide distributed collaboration capabilities. There is a lack of balanced subgraph partitioning strategies for very large graphs. When super nodes (with hundreds of thousands or even millions of edges) exist in the large graphs built with massive data, it will become a fatal bottleneck for graph query and calculation.
[0133] See also Figure 3 , the method of the embodiment of the present invention also includes: graph balancing; specifically, for the new graph formed after the graph fusion is completed, the degree of each node and the number of edge relations in the graph are counted by using the power graph modeling tool to form a statistical list of nodes and edge relations corresponding to the entity, and for the super points in the list whose node degree or edge relation number exceeds the threshold (the default value is 100,000), a hybrid optimization segmentation method is used to balance the graph, specifically including:
[0134] (5.1) When the node degree exceeds the threshold, classify the neighbor nodes of the super node and count the number of edges and edge relationships, select the largest classification for segmentation, and determine whether the node degree is lower than the threshold. If not, repeat the above operation until it is lower than the threshold;
[0135] (5.2) When the number of edge relations exceeds the threshold, classify and count the edge relation attributes, separate the largest classification, establish a new node edge relation, and determine whether the number of edge relations is lower than the threshold. If not, repeat the above operation until it is lower than the threshold.
[0136] (5.3) When both the node degree and the edge relationship number exceed the threshold, execute (5.1) and (5.2) in sequence.
[0137] The embodiment of the present invention provides a graph generation, representation and fusion method for power data knowledge, forming a graph generation, representation and fusion process for structured and unstructured data in the selected business field, and improving the accuracy of graph data construction and graph representation learning in the power field. The system's graph fusion storage module provides a fully distributed and decentralized storage architecture, and uses native graph storage to effectively solve the problem of the upper limit of unit node storage in current graph data technology, which leads to performance problems in large-scale power graph generation and application.
[0138] The key innovation of the method of the embodiment of the present invention is:
[0139] (1) A word representation learning algorithm based on the DeepWalk algorithm is proposed to construct a graph representation learning model that integrates graph node network information and node attribute feature information. The known node attribute feature information is used as prior knowledge to transform the graph representation learning process into a word representation learning process. The model is continuously optimized through deep learning to obtain a low-dimensional node representation vector that integrates graph node network information and node attribute feature information, which has better content expression capabilities.
[0140] (2) The nested method of "BIES" and BiLSTM algorithm is used to annotate entity and relationship vectors in text, documents and other data, which integrates the features of entity vector representation and word vector representation, and effectively improves the accuracy of triple generation.
[0141] (3) With the graph representation learning algorithm as the core, the graph data generation, graph fusion, and graph balancing processes in the power field are self-contained and can achieve continuous improvement of the field graph data information and continuous improvement of accuracy.
[0142] The method disclosed in the embodiment of the present invention is applicable to the graph generation, knowledge representation and fusion method of massive high-dimensional data in multiple business fields such as power operation and inspection, dispatching, marketing, customer service, etc. Through data acquisition and processing, original graph merging generation, knowledge representation learning, graph fusion, and graph balancing, the high-dimensional, large-scale sparse graph data of the power grid can be converted into a low-dimensional graph feature vector that integrates business attributes of multiple professional fields, thereby better meeting the data requirements of model training in the power field, effectively solving the performance bottlenecks of power graph data analysis, display and model application, and significantly improving the level of integrated sharing and value mining of all business data of the power grid.
[0143] In the embodiment of the present invention, knowledge representation refers to associating knowledge factors in knowledge objects with knowledge to facilitate people to identify and understand knowledge. Knowledge representation is the premise and foundation of knowledge organization. Any knowledge organization method must be based on knowledge representation; it is generally divided into subjective knowledge representation and objective knowledge representation. Knowledge fusion refers to the process of merging descriptive information about the same entity or concept from multiple knowledge graph sources after equivalent instances, equivalent classes / subclasses, and equivalent attributes / subattributes are determined. Deep learning is the most important research direction for realizing artificial intelligence. It is a type of machine learning. It learns the inherent laws and representation levels of sample data through a multi-layer neural network algorithm, and interprets data by imitating the mechanism of the human brain.
[0144] The following are device embodiments of the present invention, which can be used to perform method embodiments of the present invention. For details not disclosed in the device embodiments, please refer to the method embodiments of the present invention.
[0145] See also Figure 4In view of the above-mentioned graph generation and representation method for power data knowledge fusion, the present invention also realizes a graph generation, representation and fusion system for power data, which specifically includes a data acquisition and processing module, a graph modeling module, a knowledge extraction module, a graph merging module, a knowledge representation module, a graph fusion storage module, a graph adaptation module, and a graph visualization module.
[0146] Taking the construction of marketing and distribution data and comprehensive energy graph data as an example, the following describes the working process of graph generation, knowledge representation and graph fusion in this system.
[0147] (1) Data acquisition and processing module, which is used to acquire relational, text, document and other data stored in the power big data platform for selected distribution and integrated energy businesses, and convert the data into standard formats followed by each data type; this module provides a unified structured and unstructured data call interface and supports batch data acquisition;
[0148] (2) Graph modeling module, which is used to construct graph models from existing structured data models of distribution and integrated energy business, extract entities, relationships and attributes from unstructured data, and load corresponding data;
[0149] (3) The knowledge extraction module is used to perform ontology recognition, entity, relationship, and attribute recognition and extraction on text, documents and other data within the scope of marketing and integrated energy business, and pass the extraction results to the graph modeling module. This module converts text, documents and other data into text, annotates them in a semi-supervised manner using the above-mentioned "BIES" method, and extracts "entity-relationship-entity" triples. Taking the text "Electricity customer A opened an account through marketing account manager Li Ming" as an example, the "Marketing Account Manager Li Ming" entity is represented as "S-CM-2" and combined with the nearest entity "Electricity Customer A" to generate a triple;
[0150] (4) An original graph merging module, which is used to merge multiple subgraphs formed by the structured data and unstructured data of the distribution and integrated energy into one graph based on the node, relationship similarity and aggregation degree analysis algorithm;
[0151] (5) Knowledge representation module, which is used to process the network relationships and attribute features of each node in the marketing graph data into a low-dimensional feature vector for storage, providing sample data for graph knowledge fusion and graph neural network learning;
[0152] (6) Graph fusion storage module, used to adjust the node and relationship structure in the original marketing graph data to improve the accuracy of the fusion graph. The low layer of this module provides a native (V, E) storage format. The storage architecture is completely distributed and decentralized, and does not rely on any third-party storage architecture. A stable message queue and snapshot mechanism is built between storage nodes, so that any node and process can assume a virtual stable intermediate information interaction platform to ensure the global consistency, sorting, and maximum one-time delivery of messages. There is no upper limit on the storage scale of a single node graph.
[0153] (7) A graph adaptive module, which is used to adaptively segment super nodes whose node degrees or edge relationships exceed a threshold in the graph, optimize computing and resource coordination, and prevent super nodes from becoming a bottleneck for graph analysis and computing.
[0154] (8) Graph visualization module, which is used to integrate multiple graph layout algorithms and provide a visualization library including static, dynamic, hybrid graphs, multi-dimensional graph layouts, and morphological rendering.
[0155] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0156] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0157] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0158] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0159] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for generating a power data knowledge graph, characterized in that: The following steps are involved: Obtain the business data and data models of each business system of the pre-selected power industry; For each business system, the business data is converted into sub-graph data based on the acquired data model and the data processing rules of the business system; Obtain the low-dimensional graph representation vector of each graph node in each subgraph data; Based on the low-dimensional graph representation vector of each graph node in each subgraph data, the probability of the existence of connection between each graph node in each subgraph data is obtained by using the pre-trained node connection prediction model; For each graph node in each subgraph data, based on the classification of the graph nodes and the probability of connection, the relationship between the graph nodes within the subgraph data and the relationship between the graph nodes between the subgraph data are updated to obtain the power data knowledge graph; in, The step of obtaining the low-dimensional graph representation vector of each graph node in each subgraph data specifically includes: For each graph node in each subgraph data, obtain a positive sample set and a negative sample set and merge them to obtain a merged sample set; Randomly initialize the representation vector parameters of the graph nodes in the objective function; Divide the combined sample set into several batches of disjoint sets; Based on the plurality of mutually disjoint sets of batches, a batch gradient descent method is used to optimize the objective function until the objective function converges to obtain an optimized objective function; The representation vector parameters of the optimized objective function are concatenated with the prior feature vectors of the graph nodes to obtain the low-dimensional graph representation vectors of the graph nodes. The expression of the objective function is: In the formula, D represents the set of all positive and negative samples, and the meaning of each element is expressed by γ: γ = 1 means v j Yes i The positive sample is a neighbor node; γ=-1 means v j Yes i Negative samples, v j Indicates that P n (v) The obtained sampling node; σ(x) represents the sigmoid function; v i 、v j represents the i-th and j-th nodes in the generated original graph; Φ(v i ) represents the representation vector of node i; f j Represents the prior node attribute feature vector of node j; The structure of the node connection prediction model is a GCN deep neural network including one input layer, multiple hidden layers and one output layer; wherein the input layer is used to input a low-dimensional graph representation vector of two graph nodes, and the output layer is used to output the probability that two graph nodes are connected; The steps of obtaining the pre-trained node connection prediction model specifically include: randomly dividing the low-dimensional graph representation vector generated by all sub-graph data into two parts to obtain a training set and a test set; using the GCN algorithm to train the training set in a full-set manner to obtain a trained node connection prediction model; testing the trained node connection prediction model in the test set, and after the test passes, obtaining the pre-trained node connection prediction model.
2. A method for generating a power data knowledge graph according to claim 1, characterized in that: For each business system, based on the acquired data model and the data processing rules of the business system, the step of converting the business data into subgraph data specifically includes: When the business data is structured data, the conversion processing rules and processes include: If the primary keys of any two tables in the structured data are the same and the attribute sets are disjoint, only one graph node is constructed to merge the attribute sets; If the primary keys of any two tables in the structured data are the same and their attribute sets intersect, two graph nodes are constructed in the graph, and the attribute intersection of the two graph nodes is added to the relationship between the graph nodes; If the primary keys of any two tables in the structured data are the same and there is a containment relationship between the attribute sets, two graph nodes are constructed in the graph, and the relationship between the graph nodes is increased by the containment relationship.
3. The method for generating a power data knowledge graph according to claim 1, characterized in that: For each business system, based on the acquired data model and the data processing rules of the business system, the step of converting the business data into subgraph data specifically includes: When the business data is unstructured data, the conversion processing rules and processes include: Convert unstructured data into text format; Based on the data in the text format, the extracted graph nodes and relationship data are directly represented by triples (Entity1, RelationType, Entity2); wherein Entity1 and Entity2 are graph nodes in the extracted text, and RelationType is a predefined Entity1 and Entity2 relationship; The label of the graph node object is defined as word position, relationship type and role. The data outside the graph node and relationship are represented as non-extracted objects to obtain the labeled corpus. Among them, the word position is used to represent the position of the word in the graph node; the relationship type is selected from the relationship set predefined in the business field; the role is used to represent the position of the graph node in the triple. The annotated corpus is merged into triples based on the proximity principle of the annotation sequence.
4. The method for generating a power data knowledge graph according to claim 1, characterized in that: For each business system, based on the acquired data model and the data processing rules of the business system, the business data is converted into subgraph data, and further includes: (1) Based on the same name or attribute value, the graph nodes contained in each generated subgraph data are roughly clustered; (2) Using text similarity features, basic feature extraction algorithms, and mutually exclusive feature analysis to jointly calculate the similarity of graph nodes, the graph nodes whose similarity meets the preset requirements are merged; (3) Based on the results of steps (1) and (2), a hierarchical clustering algorithm is used to align the graph nodes to form the Base version of the fusion data. A fixed ID value and current timestamp are encoded for each fused graph node.
5. The method for generating a power data knowledge graph according to claim 1, characterized in that: After obtaining the power data knowledge graph, it also includes: Count the degree of each node and the number of edge relationships in the graph to form a statistical list of nodes and edge relationships corresponding to the graph nodes. For super points in the list whose node degree or edge relationship number exceeds the threshold, use a hybrid optimization segmentation method to balance the graph. When the node degree exceeds the threshold, the number of edges and edge relationships of the neighboring nodes of the super point are classified and counted, and the largest classification is selected for segmentation; it is determined whether the node degree is lower than the threshold. If it is not satisfied, the above operation is repeated until it is lower than the threshold; When the number of edge relationships exceeds the threshold, the edge relationship attributes are classified and counted, the largest classification is split out, and a new node edge relationship is established; it is determined whether the number of edge relationships is lower than the threshold. If not, the above operation is repeated until it is lower than the threshold.
6. A power data knowledge graph generation system, characterized in that: include: The first acquisition module is used to acquire business data and data models of various business systems of the pre-selected power major; A subgraph data acquisition module is used to convert business data into subgraph data for each business system based on the acquired data model and data processing rules of the business system; A low-dimensional graph representation vector acquisition module is used to obtain a low-dimensional graph representation vector of each graph node in each subgraph data; A probability acquisition module is used to obtain the probability of connection between each graph node in each subgraph data based on the low-dimensional graph representation vector of each graph node in each subgraph data and using a pre-trained node connection prediction model; The knowledge graph acquisition module is used to update the relationship between graph nodes in the subgraph data and the relationship between graph nodes between subgraph data for each graph node in each subgraph data based on the classification of the graph nodes and the probability of connection, so as to obtain the power data knowledge graph; in, The step of obtaining the low-dimensional graph representation vector of each graph node in each subgraph data specifically includes: For each graph node in each subgraph data, obtain a positive sample set and a negative sample set and merge them to obtain a merged sample set; Randomly initialize the representation vector parameters of the graph nodes in the objective function; Divide the combined sample set into several batches of disjoint sets; Based on the plurality of mutually disjoint sets of batches, a batch gradient descent method is used to optimize the objective function until the objective function converges to obtain an optimized objective function; The representation vector parameters of the optimized objective function are concatenated with the prior feature vectors of the graph nodes to obtain the low-dimensional graph representation vectors of the graph nodes. The expression of the objective function is: In the formula, D represents the set of all positive and negative samples, and the meaning of each element is expressed by γ: γ = 1 means v j Yes i The positive sample is a neighbor node; γ=-1 means v j Yes i Negative samples, v j Indicates that through P n (v) The obtained sampling node; σ(x) represents the sigmoid function; v i 、v j represents the i-th and j-th nodes in the generated original graph; Φ(v i ) represents the representation vector of node i; f j Represents the prior node attribute feature vector of node j; The structure of the node connection prediction model is a GCN deep neural network including one input layer, multiple hidden layers and one output layer; wherein the input layer is used to input a low-dimensional graph representation vector of two graph nodes, and the output layer is used to output the probability that two graph nodes are connected; The steps of obtaining the pre-trained node connection prediction model specifically include: randomly dividing the low-dimensional graph representation vector generated by all sub-graph data into two parts to obtain a training set and a test set; using the GCN algorithm to train the training set in a full-set manner to obtain a trained node connection prediction model; testing the trained node connection prediction model in the test set, and after the test passes, obtaining the pre-trained node connection prediction model.
