Triple completion method for power grid operation situation knowledge graph

By using the triplet distinction model in the power grid operating situation knowledge graph, we obtain embedded representations of entities and relationships and perform question-and-answer connection predictions, which solves the problem of missing triplet information and difficulty in completing the power grid situation knowledge graph, and improves It improves the completion efficiency and accuracy, adapts to the specific needs of the electric power field, and reduces the consumption of computing resources and the risk of sensitive data leakage.

CN118674022AInactive Publication Date: 2024-09-20INFORMATION & COMMNUNICATION BRANCH STATE GRID JIANGXI ELECTRIC POWER CO
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411155207.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-09-20
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When constructing a power grid operating situation knowledge graph, the existing technology has the problem of missing triplet information and difficulty in completing it. The general large-scale language model has many parameters, large memory usage, long training time, slow prediction speed, and lacks specificity in the power field. knowledge, resulting in poor results, the risk of sensitive data leakage, and high consumption of computing resources.

Method used

Using the triplet differentiation model based on the knowledge graph, through the embedding layer, dropout layer and output layer, we obtain the embedded representation of entities and relationships, build a question-and-answer connection prediction, and determine whether the initial triplet is established, thereby realizing the completion of the triplet. Complete, improve completion efficiency and accuracy.

Benefits of technology

By obtaining rich semantic information, the association of entities and relationships in a low-dimensional vector space improves the efficiency and accuracy of triple completion, reduces computing resource consumption, avoids the risk of sensitive data leakage, and adapts to specific knowledge in the power field. Map completion requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118674022A
    Figure CN118674022A
Patent Text Reader

Abstract

The invention provides a triple completion method for a power grid operation situation knowledge graph, and the method comprises the steps: training a triple distinguishing model according to triads in the knowledge graph, and obtaining the embedded representation of entities and relationships in the knowledge graph through the triple distinguishing model; the method comprises the following steps: extracting a missing triple from a knowledge graph, performing completion to obtain an initial triple, constructing a question and answer mode connection according to embedded representation of entities and relationships in the knowledge graph, predicting and judging whether the initial triple is established or not to obtain a completion result of the missing triple, and realizing triple completion of the knowledge graph. According to the method, the embedded representation of the entity and the relationship of the triple in the power grid operation situation knowledge graph is obtained through the power grid operation situation knowledge graph, and the embedded representation contains rich semantic information, so that the entity and the relationship can be reasonably associated in a low-dimensional vector space; and triple completion of the knowledge graph is carried out by applying association of the entities and the relationships in the low-dimensional vector space, so that the triple completion efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power grid knowledge graph completion, and in particular to a triple completion method for a power grid operation status knowledge graph. Background Art

[0002] The texts in the power field have the following characteristics: they are highly professional and usually contain a large number of professional terms and concepts; structured and unstructured data coexist, including not only structured tabular data, but also unstructured text reports, fault descriptions, operation logs, etc.; multi-source data fusion, data comes from different sources, such as equipment monitoring data, maintenance records, accident reports, etc. These data types are diverse and require comprehensive analysis.

[0003] With the in-depth application of knowledge graph research, methods of constructing power grid operation status knowledge graphs for power grid operation status detection and other situations have emerged in the power field.

[0004] In the existing technology, a general large language model is usually used to construct a knowledge graph of the power grid operation status. However, based on the characteristics of the text in the power field, the direct use of general large language models (LLMs) for text understanding in the power field has the following problems: many parameters, large memory usage, long training time, and slow prediction speed; directly using a general large language model to train actual power production data poses the risk of sensitive data being leaked when uploaded to the cloud; the general large language model lacks specific knowledge in the power field and has poor results; the general large language model requires large computing resources and is costly.

[0005] The knowledge graph of power grid operation status constructed by existing technologies usually has the problem of missing triple information and great difficulty in completing it.

[0006] Therefore, it is necessary to provide a method that can process the characteristics of text in the power field and accurately complete the knowledge graph of power grid operation status. Summary of the invention

[0007] The purpose of the present invention is to provide a triple completion method for a power grid operation status knowledge graph, so as to improve the problem that the existing technology is difficult to process power field text to complete the power grid status knowledge graph.

[0008] In the first aspect, the triple completion method of the power grid operation status knowledge graph provided by the present invention includes: training a triple distinction model according to the triples in the knowledge graph, and obtaining the embedded representation of entities and relationships in the knowledge graph through the triple distinction model; extracting missing triples from the knowledge graph, completing the missing triples to obtain initial triples, and constructing a question-and-answer connection prediction based on the embedded representation of entities and relationships in the knowledge graph to determine whether the initial triples are valid, so as to obtain the completion result of the missing triples, thereby realizing triple completion of the knowledge graph.

[0009] The beneficial effect of the triple completion method of the power grid operation status knowledge graph provided by the present invention is that: the embedded representation of the entities and relationships of the triples in the power grid operation status knowledge graph is obtained, and the embedded representation contains rich semantic information so that the entities and relationships can be reasonably associated in the low-dimensional vector space, and the association between the entities and relationships in the low-dimensional vector space is used to complete the triples of the knowledge graph, thereby improving the efficiency and accuracy of triple completion.

[0010] In a possible embodiment, the triple distinction model includes an embedding layer, a Dropout layer and an output layer; wherein the embedding layer is used to transform the triples of the knowledge graph to obtain the representation vectors of the corresponding triples; the Dropout layer is used to obtain the embedded representation of the triples according to the representation vectors of the triples; the output layer is used to construct the question vector and the answer vector of the initial triples according to the embedded representation of the triples, and calculate the similarity between the question vector and the answer vector.

[0011] In another possible embodiment, a triple discrimination model is trained according to triples in a knowledge graph, including: obtaining triples in the knowledge graph as positive samples, generating negative samples according to the positive samples; inputting the positive samples and the negative samples as training sets into the triple discrimination model to be trained for iterative training, and obtaining a trained triple discrimination model after minimizing the loss function of the training, and the loss function satisfies the following formula: ,in, represents the head entity vector in the positive sample, represents the head entity vector in the negative sample, represents the tail entity vector in the positive sample, represents the tail entity vector in the negative sample, represents the relationship vector, represents a sample set, represents the loss value, Represents a hyperparameter.

[0012] In other possible embodiments, missing triples are extracted from the knowledge graph, and the missing triples are completed to obtain initial triples, including: extracting missing triples from the knowledge graph, and determining the type of the missing triples; when the missing triple is a triple that is missing a tail entity, randomly extracting an entity from the knowledge graph as the tail entity of the missing triple to complete the completion to obtain the initial triple; when the missing triple is a triple that is missing a head entity, randomly extracting an entity from the knowledge graph as the head entity of the missing triple to complete the completion to obtain the initial triple.

[0013] Whether the initial triple is established is judged through question-answer connection prediction, including: when the missing triple is a triple that lacks a tail entity, the embedded representation of the head entity of the initial triple and the embedded representation of the relationship are added to obtain a question vector, and the embedded representation of the tail entity of the initial triple is used as the answer vector; when the missing triple is a triple that lacks a head entity, the embedded representation of the tail entity of the initial triple and the embedded representation of the relationship are subtracted to obtain the question vector, and the embedded representation of the head entity of the initial triple is used as the answer vector; the similarity between the question vector and the answer vector is calculated, and whether the similarity is greater than a set similarity threshold; when the similarity is greater than or equal to the similarity threshold, it is judged that the initial triple is established, and when the similarity is less than the similarity threshold, it is judged that the initial triple is not established.

[0014] The knowledge graph includes x groups of missing triples, x>1; extracting missing triples from the knowledge graph, completing the missing triples to obtain initial triples, and constructing question-answering connection predictions based on the embedded representations of entities and relationships in the knowledge graph to determine whether the initial triples are valid to obtain the missing triples completion results, including: extracting a group of missing triples from the knowledge graph, completing the missing triples to obtain initial triples, and determining whether the initial triples are valid through question-answering connection predictions. When the initial triples are not valid, the initial triples are discarded, and the missing triples are re-completed to obtain new initial triples. Triples and determine whether the initial triples are established through question-answer connection prediction, until the initial triples are established, the established initial triples are added to the knowledge graph to replace the corresponding missing triples to complete the completion of a group of missing triples; repeatedly extract a group of missing triples from the knowledge graph to obtain the next group of missing triples, complete the missing triples to obtain the initial triples, and determine whether the initial triples are established through question-answer connection prediction to obtain the completion results of the missing triples, until x groups of missing triples are extracted and the completion of the missing triples is completed, thereby realizing the triple completion of the knowledge graph.

[0015] In the second aspect, the present invention also provides a triple completion device for a power grid operation status knowledge graph, the device comprising: a training unit for training a triple discrimination model based on the triples in the knowledge graph, and obtaining embedded representations of entities and relationships in the knowledge graph through the triple discrimination model.

[0016] The completion unit is used to extract missing triples from the knowledge graph, complete the missing triples to obtain the initial triples, and construct a question-answering connection prediction based on the embedded representation of entities and relationships in the knowledge graph to determine whether the initial triples are valid to obtain the completion results of the missing triples, thereby realizing triple completion of the knowledge graph.

[0017] In a third aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the triple completion method of the above-mentioned power grid operation status knowledge graph is implemented.

[0018] In a fourth aspect, the present invention also provides an electronic device, comprising: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory, so that the electronic device executes the triple completion method of the above-mentioned power grid operation status knowledge graph.

[0019] For the beneficial effects of the second to fourth aspects, reference may be made to the description of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A schematic flow chart of a method for completing triples of a knowledge graph of power grid operation status provided by an embodiment of the present invention; Figure 2 A schematic diagram of the structure of a triplet differentiation model provided in an embodiment of the present invention; Figure 3 A schematic diagram of a triple completion device for a power grid operation status knowledge graph provided by an embodiment of the present invention; Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than 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 are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be understood by people with general skills in the field to which the present invention belongs. "Including" and similar words used in this article mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.

[0022] In view of the problems existing in the prior art, an embodiment of the present invention provides a triple completion method for a power grid operation status knowledge graph.

[0023] This embodiment provides a knowledge graph completion method based on meta-relation learning. Figure 1 , the method comprising: S101: Train a triple discrimination model based on the triples in the knowledge graph, and obtain the embedded representation of entities and relationships in the knowledge graph through the triple discrimination model.

[0024] In S101, in a possible embodiment, the triplet distinguishing model includes an embedding layer, a Dropout layer, and an output layer.

[0025] Among them, the embedding layer is used to transform the triples of the knowledge graph to obtain the representation vectors of the corresponding triples.

[0026] The Dropout layer is used to obtain the embedded representation of the triplet based on its representation vector.

[0027] The output layer is used to construct the question vector and answer vector of the initial triplet based on the embedded representation of the triplet and calculate the similarity between the question vector and the answer vector.

[0028] In the triple distinguishing model, after the conversion of the embedding layer, the head entity, relationship, tail entity and negative sample entity of the triple already have their corresponding basic representation vectors in the low-dimensional vector space. It is worth noting that in the knowledge graph data of the power operation status, the number of one-to-one relationships has a large proportion, so the training result of the first model will be more inclined to make the distributed representation of entities and relationships conform to the expression of one-to-one relationship types. Therefore, the triple distinguishing model proposed in the present invention adds a Dropout layer after the embedding layer with many network parameters to make the learned vector expression as diverse as possible. For the same batch of data, the triple distinguishing model proposed in the present invention learns more data distribution possibilities, so that the model has a stronger modeling ability for complex relationship types such as one-to-many or many-to-one. After the Dropout layer, the final embedded representation of the head entity, relationship, tail entity and negative sample entity can be obtained.

[0029] Specifically, in a distributed low-dimensional semantic space, if a triple is established, then the head entity A distributed representation of The distributed representation of the tail entity The distributed representation of is similar.

[0030] For use with most models or The norm is different from the distance metric. In the triple distinction model proposed in the present invention, cosine similarity is used as the distance judgment. Specifically, it transforms the link prediction process into a question-answering model. When predicting whether the triple with missing tail entity is correct after completion, the The expression problem part, The answer part is expressed; when predicting whether the triplet missing from the head entity is completed correctly, The expression problem part, Therefore, taking the tail entity prediction as an example, the model hopes that when the triple When established, , which is equivalent to The distance should be in the knowledge graph embedded representation space Keep as far away from the target location as possible.

[0031] In a possible embodiment, a triple discrimination model is trained based on triples in a knowledge graph, including: obtaining triples in the knowledge graph as positive samples, and generating negative samples based on the positive samples. The positive samples and negative samples are input as training sets into the triple discrimination model to be trained for iterative training, and a trained triple discrimination model is obtained when the training loss function is minimized, and the loss function satisfies the following formula: ,in, represents the head entity vector in the positive sample, represents the head entity vector in the negative sample, represents the tail entity vector in the positive sample, represents the tail entity vector in the negative sample, represents the relationship vector, represents a sample set, represents the loss value, Represents a hyperparameter.

[0032] In a specific embodiment, a complete triple (correct triple) is extracted from the knowledge graph as a positive sample, and the composition structure of the triple includes a head entity, a relationship, and a tail entity. An incorrect triple is generated as a negative sample by randomly replacing the head entity or the tail entity in the triple extracted from the knowledge graph, and the positive sample and the negative sample are used as a pre-prepared training set for training a triple distinction model. The training of the triple distinction model using a training set including positive samples and negative samples is to enable the model to effectively distinguish positive samples from negative samples.

[0033] The training set is input into the triple discrimination model to be trained for training. Specifically, the triplets of positive and negative samples are input into the embedding layer in the form of initial embedding, and the representation vector of the corresponding triples is obtained through the embedding layer. The representation vector of the triple output by the embedding layer is input into the Dropout layer, and the embedded representation of the triple is obtained through the Dropout layer, which specifically includes the vector representation of the head entity of the triple, the vector representation of the relationship of the triple, and the vector representation of the tail entity of the triple. According to the embedded representation of the triple and the type of missing triples in the knowledge graph (missing head entity or missing tail entity), the question vector and the answer vector are constructed for question-answering link prediction. The question-answering link preset is performed through the output layer to obtain the similarity value of the question vector and the answer vector.

[0034] When training the triplet discrimination model, the model compares the scores of the positive and negative triples and adjusts the parameters to make the positive score as high as possible and the negative score as low as possible. Specifically, if , indicating that the current model has successfully distinguished positive samples from negative samples, the loss is 0, and no further adjustment is required. , the model needs to adjust parameters to increase the score of positive samples or reduce the score of negative samples, so that the difference between the two is greater than or equal to In this way, the hyperparameters The minimum distinction between positive and negative samples is controlled to ensure that the model can better distinguish between positive and negative samples, thereby improving prediction accuracy and model robustness.

[0035] In the triplet discrimination model proposed in this invention, in order to learn effective entity and relationship vector representations under the first model architecture proposed in this work, all samples in the training set are used to minimize the following loss function: ,in, represents the head entity vector in the positive sample, represents the head entity vector in the negative sample, represents the tail entity vector in the positive sample, represents the tail entity vector in the negative sample, represents the relationship vector, represents a sample set, represents the loss value, represents a hyperparameter. For a given entity, whether it appears in the head entity or the tail entity, its distributed representation will be the same. The meaning expressed by the above loss function is consistent with the expectations of the triplet representation learning triplet discrimination model, that is, the score of the positive sample triplet needs to be higher than the score of the negative sample triplet, so that the loss value approaches 0.

[0036] See the instruction manual Figure 2 , the triplet distinguishing model structure proposed in the present invention does not need to learn a large number of network parameters. All knowledge graph triple data composed of , and All from the entity collection ,and All come from the relationship set The triple distinguishing model will encode the entities or relations in their respective sets in sequence, so that each entity and relationship has its unique ID representation, thereby forming its corresponding one-hot vector expression, which will also serve as the input of the embedding layer in the model to facilitate the vectorization operation of entities and relations.

[0037] In a possible embodiment, the initial embedding method adopted by the triple input embedding layer is specifically one-hot encoding or a general learning embedding (word2vec) method. The embedding layer adopts MLP or LSTM or RNN or GNN.

[0038] Exemplarily, the triplet distinguishing model of the present invention is iteratively trained using mini-batch based stochastic gradient descent, as follows: , It should be noted that "Dropout (dropout probability - p)" refers to the Dropout regularization technique, which is an effective method to prevent overfitting of the first model.

[0039] Overfitting refers to the phenomenon that the first model performs well on the training data, but performs poorly on new data that has not been seen. This is usually because the first model excessively learns the details and noise of the training data during training, resulting in a decrease in its generalization ability.

[0040] Dropout solves the overfitting problem by randomly discarding some neurons (and their connections) during training. Each time training, a portion of neurons are randomly selected not to participate in the calculation, as if these neurons are temporarily "inactivated". The dropout probability -p refers to the probability of each neuron being discarded in each training iteration. For example, if p=0.5, then each neuron has a 50% probability of being discarded in a training iteration.

[0041] How Dropout works: Reduce the dependencies between neurons. Since only a portion of neurons participate in the calculations during each training, each neuron cannot rely on the existence of other specific neurons. This forces the model to learn more robust feature representations that are not overly dependent on any single neuron. Similar to model integration, each training can be viewed as a sub-network randomly sampled from the entire network. Dropout can be viewed as training multiple such sub-networks at the same time and averaging their predictions during testing. This model integration effect can improve the generalization ability of the model.

[0042] In the power grid operation status knowledge graph completion solution of the present invention, the role of Dropout is: since the one-to-one relationship accounts for a large proportion in the power operation status knowledge graph, the model is prone to over-learning this simple relationship pattern, resulting in insufficient generalization ability for more complex relationship types. Dropout increases the randomness of model training by randomly discarding neurons, forcing the model to learn entity and relationship representations with more generalization capabilities, thereby improving the model's modeling capabilities for complex relationship types such as one-to-many and many-to-one.

[0043] In knowledge graph representation learning, the goal of the model is to learn effective vector representations of entities and relations, so that positive triples (i.e., real knowledge) have higher scores, while negative triples (i.e., wrong knowledge) have lower scores. Negative sample entities are the key elements used to construct negative triples. By learning to distinguish between positive and negative examples, the model can better understand the real connection between entities and relations, and improve its ability to predict new triples and complete the knowledge graph.

[0044] The characteristic of the knowledge graph of power grid operation status is that the links (relationships) are directional. For example, for the triple (control center C, responsible area, East China), the relationship "responsible area" can be said to be the path from the head entity node "control center C" to the tail entity node "East China", but it cannot be said to be the path from "East China" to "control center C".

[0045] The constructed negative sample entities are usually randomly replaced with the head entity or tail entity in the positive example triple, and have a non-existent or unreasonable relationship in the real world. For example, let's take an example: assuming there is a positive example triple (control center A, responsible area, East China), the negative sample entity can be constructed in the following ways: Randomly replace the head entity: replace "control center A" with other control centers, such as (control center B, responsible area, East China). In fact, control center B is not responsible for the East China region, so this is a negative sample triple. Randomly replace the tail entity: replace "East China" with other regions, such as (control center A, responsible area, Southwest region). In fact, control center A is not responsible for the Southwest region, so this is a negative sample triple. It should be noted that the selection of negative sample entities needs to be cautious, and try to ensure that they have a certain similarity with the positive example triple, but do not constitute a real relationship. In addition to the random replacement method mentioned in the above example, common negative sample selection strategies also include selection based on type constraints.

[0046] S102: Extract missing triples from the knowledge graph, complete the missing triples to obtain initial triples, construct question-answering connection predictions based on the embedded representations of entities and relationships in the knowledge graph to determine whether the initial triples are valid, and obtain the completion results of the missing triples, thereby completing the triples of the knowledge graph.

[0047] In S102, in a possible embodiment, missing triples are extracted from the knowledge graph, and the missing triples are completed to obtain initial triples, including: extracting missing triples from the knowledge graph, and determining the type of the missing triples; when the missing triple is a triple that is missing a tail entity, randomly extracting an entity from the knowledge graph as the tail entity of the missing triple to complete the completion and obtain the initial triple; when the missing triple is a triple that is missing a head entity, randomly extracting an entity from the knowledge graph as the head entity of the missing triple to complete the completion and obtain the initial triple.

[0048] In a possible embodiment, whether the initial triple is established is determined through question-answer connection prediction, including: when the missing triple is a triple that lacks a tail entity, adding the embedding representation of the head entity of the initial triple and the embedding representation of the relationship to obtain a question vector, and using the embedding representation of the tail entity of the initial triple as the answer vector; when the missing triple is a triple that lacks a head entity, subtracting the embedding representation of the tail entity of the initial triple from the embedding representation of the relationship to obtain the question vector, and using the embedding representation of the head entity of the initial triple as the answer vector; calculating the similarity between the question vector and the answer vector, and determining whether the similarity is greater than a set similarity threshold; when the similarity is greater than or equal to the similarity threshold, determining that the initial triple is established, and when the similarity is less than the similarity threshold, determining that the initial triple is not established.

[0049] In a possible embodiment, the similarity calculation between the question vector and the answer vector satisfies the following formula: ,in, represents the similarity between the question vector and the answer vector, The vector representation of the head entity representing the triple, A vector representation of the relationship between triples, The vector representation of the tail entity of the triple, Representation vector The norm of Representation vector Specifically, the norm is the length of the vector.

[0050] In a possible embodiment, the knowledge graph includes x groups of missing triples, x>1. Missing triples are extracted from the knowledge graph, the missing triples are completed to obtain initial triples, and question-answer connection predictions are constructed based on the embedded representations of entities and relationships in the knowledge graph to determine whether the initial triples are established to obtain the completion results of the missing triples, including: extracting a group of missing triples from the knowledge graph, completing the missing triples to obtain initial triples, and determining whether the initial triples are established through question-answer connection predictions. When the initial triples are not established, the initial triples are discarded, the missing triples are completed again to obtain new initial triples, and the initial triples are determined through question-answer connection predictions until the initial triples are established, and the established initial triples are added to the knowledge graph to replace the corresponding missing triples to complete the completion of a group of missing triples.

[0051] Repeat the process of extracting a group of missing triples from the knowledge graph to obtain the next group of missing triples, completing the missing triples to obtain the initial triples, and judging whether the initial triples are valid through question-answer connection prediction to obtain the completion results of the missing triples, until x groups of missing triples are extracted and the completion of the missing triples is completed, thereby realizing the triple completion of the knowledge graph.

[0052] In a specific embodiment, the knowledge graph includes x groups of missing triples, where x> 1. A group of missing triples is extracted from the knowledge graph, and the type of the missing triples is determined to be a triple of a missing tail entity or a triple of a missing head entity.

[0053] When the missing triple is a triple that is missing a tail entity, an entity is randomly extracted from the knowledge graph as the tail entity of the missing triple to complete the completion and obtain the initial triple. The embedded representation of the head entity of the initial triple and the embedded representation of the relationship are added to obtain the question vector, and the embedded representation of the tail entity of the initial triple is used as the answer vector. The similarity between the question vector and the answer vector is calculated according to the set similarity calculation formula, and it is determined whether the similarity is greater than the set similarity threshold. When the calculated similarity is greater than or equal to the similarity threshold, the initial triple is judged to be established, and the established initial triple is added to the knowledge graph to replace the corresponding missing triple to complete the completion of the missing triple. When the similarity is less than the similarity threshold, it is judged that the initial triple is not established and the initial triple is discarded. Repeatedly randomly extract entities from the knowledge graph as the tail entities of the missing triples to obtain a new initial triplet, and calculate the similarity between the question vector and the answer vector constructed based on the new initial triplet, and judge whether the initial triplet is valid based on the calculation result, until a valid initial triplet is obtained to complete the completion of the corresponding missing triplet.

[0054] When the missing triple is a triple that is missing a head entity, an entity is randomly extracted from the knowledge graph as the head entity of the missing triple to complete the completion and obtain the initial triple. The embedded representation of the tail entity of the initial triple is subtracted from the embedded representation of the relationship to obtain the question vector, and the embedded representation of the head entity of the initial triple is used as the answer vector. The similarity between the question vector and the answer vector is calculated according to the set similarity calculation formula, and it is determined whether the similarity is greater than the set similarity threshold. When the calculated similarity is greater than or equal to the similarity threshold, the initial triple is judged to be established, and the established initial triple is added to the knowledge graph to replace the corresponding missing triple to complete the completion of the missing triple. When the similarity is less than the similarity threshold, it is judged that the initial triple is not established and the initial triple is discarded. Repeatedly randomly extract entities from the knowledge graph as the tail entities of the missing triples to obtain a new initial triplet, and calculate the similarity between the question vector and the answer vector constructed based on the new initial triplet, and judge whether the initial triplet is valid based on the calculation result, until a valid initial triplet is obtained to complete the completion of the corresponding missing triplet.

[0055] The above operation completes the completion of a group of missing triples. Then, a group of missing triples is repeatedly extracted from the knowledge graph to obtain the next group of missing triples, the newly obtained missing triples are completed to obtain the initial triples, and the initial triples are judged through question-answer connection prediction to obtain the completion result of the missing triples to complete the operation of completing the newly obtained missing triples, until x groups of missing triples are extracted from the knowledge graph and the missing triples are completed, thereby completing the triples of the knowledge graph.

[0056] The triple completion method of the power grid operation status knowledge graph provided by the present invention effectively models the triples in the power grid operation status knowledge graph according to the characteristics of the triples in the power grid operation status knowledge graph, so that the obtained entity and relationship vectors can contain rich semantic information, so that the entities and relationships can be reasonably associated in the low-dimensional vector space, and the association between entities and relationships in the low-dimensional vector space is used to complete the triples of the knowledge graph, thereby effectively improving the efficiency and accuracy of triple completion.

[0057] The triplet distinguishing model provided by the present invention distinguishes positive and negative samples in the training stage, provides comparative information, and helps the model learn, so that the trained triplet distinguishing model has generalization ability and can apply the knowledge learned from the training data to new and unseen data. When the triplet distinguishing model is used to predict whether the initial triple is established, it can determine whether the triple itself is reasonable.

[0058] In addition, the present invention defines the formation process of triples in the power operation status knowledge graph as the process of transferring the head entity to the tail entity in the distributed representation space, and the relationship is the only way to achieve this transfer process, organically linking the head entity and the tail entity. Relationships are regarded as the core of such a transfer process to characterize various relationships in the knowledge graph, so that various effective vector calculations can be performed, which can also meet the needs of deeper reasoning in the future.

[0059] In a possible embodiment, the completed power grid operation status knowledge graph obtained by the triple completion method of the power grid operation status knowledge graph provided by the present invention can be used for power grid operation status detection. Specifically, the process of performing power grid operation status detection includes: mapping real-time operation data to the corresponding entity in the knowledge graph, updating the attribute value of the entity, such as updating the load rate of the line, the overload rate of the equipment, etc. Then, the abnormal operation state is identified according to the attribute value of the entity using the preset rules and reasoning mechanism in the knowledge graph. For example: based on the threshold judgment, if the line load rate exceeds the preset threshold, it is judged that the line has an overload risk. Based on historical data analysis, if the operating temperature of the equipment is significantly higher than the historical level of the same period, it is judged that the equipment may be abnormal. Based on association analysis, if multiple devices in a certain area have a temperature rise phenomenon at the same time, it is judged that there may be potential risks in the area. Situation assessment, based on the detected abnormal state, combined with the association relationship and impact range analysis in the knowledge graph, evaluate the severity and development trend of the current power grid operation situation. Situation warning, according to the situation assessment results, timely issue warning information to remind operators to pay attention to potential risks and provide corresponding decision support.

[0060] For example, it can be set to identify the following situations as abnormal situations through knowledge graph analysis: The load rate of line L1 reaches 95%, exceeding the warning threshold of 90%. The temperature of the main transformer of substation S1 is 10 degrees higher than the historical same period. There is a direct connection between line L1 and substation S1.

[0061] Based on the above information, the system can infer the following conclusions: There is an overload risk on line L1, which may cause the line to trip. The main transformer of substation S1 may have problems such as overload or poor heat dissipation, which need further investigation. Due to the connection between line L1 and substation S1, the overload risk of line L1 may further increase the burden on the main transformer of substation S1 and increase the risk of failure.

[0062] See the instruction manual Figure 3 This embodiment also provides a triple completion device for a power grid operation status knowledge graph, which is used to implement the above method embodiment. The device includes: The training unit 301 is used to train a triple discrimination model based on the triples in the knowledge graph, and obtain the embedded representation of entities and relationships in the knowledge graph through the triple discrimination model.

[0063] The completion unit 302 is used to extract missing triples from the knowledge graph, complete the missing triples to obtain initial triples, construct a question-answering connection prediction based on the embedded representation of entities and relationships in the knowledge graph to determine whether the initial triples are valid, and obtain the completion results of the missing triples, thereby realizing triple completion of the knowledge graph.

[0064] All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.

[0065] In other embodiments of the present application, the present application discloses an electronic device, such as Figure 4 As shown, the electronic device 400 may include: one or more processors 401; a memory 402; a display 403; one or more applications (not shown); and one or more computer programs 404. The above components may be connected via one or more communication buses 405. The one or more computer programs 404 are stored in the above memory and configured to be executed by the one or more processors 401. The one or more computer programs 404 include instructions, which may be used to execute the following: Figure 1 , Figure 3 And each step in the corresponding embodiment.

[0066] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0067] Each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0068] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk.

[0069] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.

Claims

1. A triple completion method for power grid operation status knowledge graph, It is characterized in that include: Training a triple distinguishing model according to the triples in the knowledge graph, and obtaining embedded representations of entities and relationships in the knowledge graph through the triple distinguishing model; Missing triples are extracted from the knowledge graph, the missing triples are completed to obtain initial triples, and question-answering connection predictions are constructed based on the embedded representations of entities and relationships in the knowledge graph to determine whether the initial triples are valid, thereby obtaining the completion results of the missing triples and realizing triple completion of the knowledge graph.

2. The method according to claim 1, It is characterized in that The triplet discrimination model includes an embedding layer, a dropout layer and an output layer; The embedding layer is used to transform the triples of the knowledge graph to obtain the representation vectors of the corresponding triples; The Dropout layer is used to obtain an embedded representation of the triplet according to the representation vector of the triplet; The output layer is used to construct the question vector and the answer vector of the initial triplet according to the embedded representation of the triplet, and calculate the similarity between the question vector and the answer vector.

3. The method according to claim 1, It is characterized in that The triplet discrimination model is trained based on the triples in the knowledge graph, including: Acquire triples in the knowledge graph as positive samples, and generate negative samples based on the positive samples; The positive samples and the negative samples are input as training sets into the triplet discrimination model to be trained for iterative training. When the training loss function is minimized, a trained triplet discrimination model is obtained. The loss function satisfies the following formula: ,in, represents the head entity vector in the positive sample, represents the head entity vector in the negative sample, represents the tail entity vector in the positive sample, represents the tail entity vector in the negative sample, represents the relationship vector, represents a sample set, represents the loss value, Represents a hyperparameter.

4. The method according to claim 1, It is characterized in that Extracting missing triples from the knowledge graph and completing the missing triples to obtain initial triples includes: Extracting missing triples from the knowledge graph and determining the type of the missing triples; When the missing triple is a triple that is missing a tail entity, randomly extracting an entity from the knowledge graph as the tail entity of the missing triple to complete the completion and obtain an initial triple; When the missing triple is a triple that is missing a head entity, an entity is randomly extracted from the knowledge graph as the head entity of the missing triple to complete the completion and obtain an initial triple.

5. The method according to claim 1, It is characterized in that Judging whether the initial triple is established by question-answer connection prediction includes: When the missing triple is a triple that lacks a tail entity, the embedded representation of the head entity of the initial triple and the embedded representation of the relationship are added to obtain a question vector, and the embedded representation of the tail entity of the initial triple is used as the answer vector; When the missing triple is a triple that lacks a head entity, subtract the embedding representation of the tail entity of the initial triple from the embedding representation of the relationship to obtain a question vector, and use the embedding representation of the head entity of the initial triple as the answer vector; Calculating the similarity between the question vector and the answer vector, and determining whether the similarity is greater than a set similarity threshold; When the similarity is greater than or equal to the similarity threshold, it is determined that the initial triple is established; when the similarity is less than the similarity threshold, it is determined that the initial triple is not established.

6. The method according to claim 1, It is characterized in that The knowledge graph includes x groups of missing triplets, x>1; Extracting missing triples from the knowledge graph, completing the missing triples to obtain initial triples, constructing a question-answering connection prediction based on the embedded representation of entities and relationships in the knowledge graph to determine whether the initial triples are valid to obtain the completion result of the missing triples, including: A group of missing triples are extracted from the knowledge graph, the missing triples are completed to obtain initial triples, and whether the initial triples are established is determined by question-answer connection prediction. When the initial triples are not established, the initial triples are discarded, the missing triples are completed again to obtain new initial triples, and whether the initial triples are established is determined by question-answer connection prediction until the initial triples are established, and the established initial triples are added to the knowledge graph to replace the corresponding missing triples to complete the completion of a group of missing triples; Repeat the process of extracting a group of missing triples from the knowledge graph to obtain the next group of missing triples, completing the missing triples to obtain initial triples, and judging whether the initial triples are valid through question-answer connection prediction to obtain the completion results of the missing triples, until x groups of missing triples are extracted and the completion of the missing triples is completed, thereby realizing the triple completion of the knowledge graph.

7. A triplet completion device for a knowledge graph of power grid operation status, It is characterized in that The device comprises: A training unit, used for training a triple distinguishing model according to the triples in the knowledge graph, and obtaining embedded representations of entities and relations in the knowledge graph through the triple distinguishing model; A completion unit is used to extract missing triples from the knowledge graph, complete the missing triples to obtain initial triples, construct a question-answer connection prediction based on the embedded representation of entities and relationships in the knowledge graph to determine whether the initial triples are valid, and obtain the completion results of the missing triples, thereby realizing triple completion of the knowledge graph.

8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the triple completion method of the power grid operation status knowledge graph described in any one of claims 1 to 6 is implemented.

9. An electronic device, It is characterized in that include: Processor and memory; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory so that the electronic device executes the triple completion method of the power grid operation status knowledge graph described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Knowledge complementing method and device for knowledge graph

    CN110147450A

  • Knowledge graph completion method and system

    CN113569062A

  • Knowledge graph completion method and device, equipment, storage medium and program product

    CN117909517A