A method and device for fusion of heterogeneous power knowledge
By automating the processing of language models and prompts, the problem of human dependence in existing technologies is solved, achieving efficient and accurate knowledge graph fusion, reducing redundancy, and improving the quality of the knowledge base.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STATE GRID FUJIAN ELECTRIC POWER CO LTD
- Filing Date
- 2023-12-05
- Publication Date
- 2026-05-26
AI Technical Summary
Existing knowledge fusion methods rely heavily on human intervention and have low levels of automation, resulting in insufficient efficiency and accuracy in knowledge fusion.
The system employs language models and prompts for automated processing such as aggregation, alignment, expansion, and quality inspection. It integrates entities, entity attributes, entity relationships, and relationship attributes from multiple graphs and performs quality inspection on the fusion results, reducing the workload of manual labor.
It improves the efficiency and accuracy of knowledge fusion, reduces the redundancy of knowledge graphs, and enhances the accuracy and reliability of knowledge bases.
Smart Images

Figure CN117708345B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method and device for fusion of heterogeneous knowledge in the power industry, belonging to the field of knowledge fusion. Background Technology
[0002] A knowledge graph is a graph database used to store and represent knowledge. It is a network structure composed of entities and relationships between entities. Although a large number of knowledge graphs already exist, they typically come from different sources and domains, thus exhibiting heterogeneity and inconsistency. Knowledge fusion is an important task aimed at addressing the heterogeneity and inconsistency issues in knowledge graphs. By fusing information from different knowledge graphs, a more comprehensive knowledge base can be built, improving the accuracy and reliability of knowledge. However, existing knowledge fusion methods are highly dependent on human intervention, and their level of automation needs improvement.
[0003] Patent CN108268581A, "A Method and Apparatus for Constructing a Knowledge Graph," discloses: acquiring structured data, the structured data including a first entity name of a first entity and attribute information corresponding to the first entity name, the attribute information including a first attribute and a first attribute value; performing entity alignment processing on the first entity based on a similarity measure between the first entity and a second entity in the knowledge graph, the similarity measure type including at least one of the following: character similarity measurement, structural similarity measurement of the classification tree in which the entity is located, and attribute similarity measurement; and importing the structured data into the knowledge graph according to the entity alignment processing result. Summary of the Invention
[0004] To overcome the problems existing in the prior art, this invention designs a method for fusion of heterogeneous knowledge in the power industry. It uses language models and prompts to perform automated processing such as aggregation, alignment, expansion, and quality inspection. It fuses entities, entity attributes, entity relationships, and relationship attributes of multiple knowledge graphs, obtains missing values, and performs quality inspection on the fusion results. It can effectively fuse a large amount of knowledge graph data, reduce the manual burden, and improve the efficiency and accuracy of knowledge fusion.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] Technical Solution 1
[0007] A method for fusing heterogeneous power knowledge includes the following steps:
[0008] A method for fusing heterogeneous power knowledge includes the following steps:
[0009] The first triplet is obtained from the ontology layers of at least two knowledge graphs. The first triplet contains entity relations. The first task text is constructed, which includes several first triplets and relation aggregation hints. The language model classifies the entity relations in the first triplets into synonym relations and inclusion relations according to the relation aggregation hints. Entity relations belonging to synonym relations are merged.
[0010] Obtain second triples from the ontology layers of at least two knowledge graphs. Each second triple contains entity attributes or relation attributes. Construct the second task text, which includes second triples belonging to the same entity or several second triples belonging to the same relation, and attribute aggregation hints. The language model categorizes the attributes in the second triples into synonymous attributes and non-synonymous attributes according to the attribute aggregation hints. Merge the entity attributes or relation attributes that belong to the synonymous attributes.
[0011] Entities are obtained from the instance layers of at least two knowledge graphs and divided into several data blocks; a third task text is constructed, which includes several entities belonging to the same data block and entity alignment hints; the language model determines whether there are duplicate entities based on the entity alignment hints; and duplicate entities are merged.
[0012] Furthermore, it also includes: entities having a data source field to identify the data source document; and entities with the same data source field being grouped into the same data block.
[0013] Furthermore, it also includes: entities having a data source field to identify the data source document; for entities with the same data source field, calculating the similarity between entities pairwise, and grouping entity pairs with similarity higher than a threshold into the same data block.
[0014] Furthermore, it also includes: selecting some attributes in the ontology layer as target attributes; and grouping entities with the same or similar target attributes into the same data block.
[0015] Furthermore, it also includes: calculating the embedding value of the entity's description information, and grouping entities whose cosine value of the embedding value is greater than a threshold into the same data block.
[0016] Furthermore, it also includes: traversing each data block; selecting an entity as a reference entity in each data block; traversing other nodes in the data block, comparing the entity attributes, relationships, and relationship attributes of the current entity and the reference entity, and obtaining the missing entity attributes, relationships, and relationship attributes of the current entity and adding them to the graph database.
[0017] Furthermore, it also includes: obtaining all data source texts containing the current entity; constructing a fourth task text, which includes the data source text and knowledge acquisition prompts; and the language model obtaining the missing entity attributes, relationships, and relationship attributes of the current entity from the data source text according to the knowledge acquisition prompts.
[0018] Furthermore, it also includes: if the number of entities in a data block exceeds a threshold, the data block is processed in layers; a fifth task text is constructed, which includes entities and related knowledge in the same layer, as well as entity alignment hints; the language model determines whether there are duplicate entities in the layer based on the entity alignment hints.
[0019] Furthermore, it also includes: extracting several entities from the merged instance layer; constructing a sixth task text, which includes the entity to be inspected, the data source document, and the inspection prompts; the language model judges the entity to be inspected based on the data source document and the inspection prompts, and if it is true, it passes the inspection; if it is false, it is transferred to manual correction or directly deleted.
[0020] Technical Solution Two
[0021] An electronic device includes a memory and a processor, the memory storing instructions adapted to be loaded by the processor and executed as described in technical solution one.
[0022] Compared with the prior art, the present invention has the following features and beneficial effects:
[0023] This invention utilizes language models and prompts for automated processing such as aggregation, alignment, expansion, and quality inspection. It integrates entities, entity attributes, entity relationships, and relationship attributes from multiple knowledge graphs, retrieves missing values, and performs quality inspection on the fusion results. This effectively integrates large amounts of knowledge graph data, reduces manual workload, and improves the efficiency and accuracy of knowledge fusion.
[0024] This invention aligns similar entities by grouping them into the same data block based on factors such as data source, entity similarity, and target attributes. This reduces redundancy in the knowledge graph and improves its accuracy. Furthermore, by layering the data blocks, entities with similar numbers of relationships and attributes are grouped into the same layer, further aggregating similar entities and reducing the number of entities and knowledge processed by the language model per iteration, thus improving the accuracy of the output. Attached Figure Description
[0025] Figure 1 This is a flowchart of the present invention. Detailed Implementation
[0026] The present invention will now be described in more detail with reference to the embodiments.
[0027] like Figure 1 As shown, a method for fusing heterogeneous power knowledge includes the following steps:
[0028] S1. Construct the first and second power knowledge graphs respectively:
[0029] The process involves acquiring several data source documents; extracting triples from these documents; each triple includes an electricity entity, relationships between electricity entities, and attributes of the electricity entity. These triples are then stored in a graph database to obtain an electricity knowledge graph. Graph databases can directly store nodes and the relationships between them, also known as "edges." The entities in a triple are the nodes in the graph database, while the relationships and attributes between entities constitute the "edges." Multiple triples stored in the graph database as nodes and edges form the knowledge graph. Graph databases can intuitively and visually display the relationships and attributes between entities in a triple. Examples of graph databases include Neo4j, DGraph, OrientDB, and ArangoDB.
[0030] S2, Schema Integration;
[0031] S21. Merging Entities: In vertical domains where the number of entities is small and their impact on the quality of the knowledge graph is significant, duplicate entities from different power knowledge graph ontology layers are merged through manual judgment. For example, if entities are completely identical or one entity completely contains another type of entity, then the two entities and all their attributes and relationships are merged.
[0032] S22, Merging Entity Relationships:
[0033] Traverse each entity in the ontology layer of each power knowledge graph to obtain several first triples. Each first triple contains entity relations, such as (entity A, relation C, entity B).
[0034] The first task text is constructed, which includes several first triples and relation aggregation prompts. The language model obtains synonym and inclusion relations from the several first triples according to the relation aggregation prompts. The language model is not limited to a specific language model. Generally, GPT3.5 / GPT4 developed by OpenAI can be used as the language model in this embodiment of the application. Alternatively, ERNIE3.0 developed by Baidu, PanGu-Σ developed by Huawei, ChatGLM developed by Tsinghua University, Luotuo developed by SenseTime and Huazhong University of Science and Technology, or any future language model can be used.
[0035] Examples are given below:
[0036] Relation aggregation hint: Based on the given abstraction level knowledge (entity, relation name, entity), aggregate all relation categories. The aggregation results are divided into synonym relations and containment relations. Output according to the output structure of the given example.
[0037] First ternary group: (Equipment, Belonging to, Main body layer plant), (Equipment, Located in, Plant), (Equipment, Connected to, Equipment), (Equipment, Upstream, Equipment), (Equipment, Protection, Equipment)
[0038] Language model outputs: synonym relations (belonging to, located at), containment relations (upstream, connected).
[0039] Furthermore, if the entity relationship includes descriptive information, this information is also written into the first task text to improve the output accuracy of the language model. For example, the entity relationship "Job Responsibility" could be defined as follows: {Description: Represents a job relationship; start time; end time}.
[0040] Merge synonym relationships: From the synonym relationships, select one relationship as the default standard relationship, and map the remaining relationships to the standard relationship. For example, unify the relationship "person's employer" and "person's employing institution" as the former, and merge the attribute values of the relationships; in addition, establish a mapping relationship between the two relation terms.
[0041] The determination of whether to merge inclusion relationships is made manually. For example, the relationship between "upstream" and "link" cannot be merged in some scenarios and needs to be determined manually.
[0042] S23, Merge entity attributes:
[0043] Traverse all entities in the ontology layer to obtain second triples containing entity attributes or relation attributes: (entity A, attribute, attribute name) and (entity relation B, attribute, attribute name). For example, (launch, attribute, start time), (launch, attribute, start date), (launch, attribute, description information).
[0044] Construct the second task text, which includes: several second triples containing entity attributes belonging to the same entity, and attribute aggregation hints; the language model classifies the entity attributes in the second triples into synonymous attributes and non-synonymous attributes according to the attribute aggregation hints.
[0045] Alternatively, construct a second task text, which includes: several second triples containing relational attributes belonging to the same relation, and attribute aggregation hints; the language model classifies the relational attributes in the second triples into synonymous attributes and non-synonymous attributes according to the attribute aggregation hints.
[0046] Examples are given below:
[0047] Attribute aggregation hint: Based on the given abstraction level knowledge (entity, attribute, attribute name), aggregate all attributes with the same meaning. Output according to the output structure of the given example.
[0048] The second ternary pair: (device, attribute, manufacturing date), (device, attribute, nameplate date, (device, attribute, operating time), (device, attribute, commissioning time), (device, attribute, manufacturer), (device, attribute, supplier).
[0049] Language model output: Synonymous attributes: (manufacture date, nameplate date), (manufacturer, supplier).
[0050] Furthermore, if the attribute has descriptive information, it is also written into the second task text to improve the output accuracy of the language model.
[0051] Merge entity attributes or relational attributes that are synonymous: Select one of the synonymous attributes as the default standard attribute description. For example, (device, attribute, manufacturing date) and (device, attribute, nameplate date) mentioned above can be unified into the former.
[0052] S3, Instance Fusion:
[0053] Obtain several entities from instance layers of at least two knowledge graphs, divide these entities into multiple entity blocks; construct a third task text, which includes several entities belonging to the same data block and entity alignment hints; use the language model to determine whether there are duplicate entities based on the entity alignment hints; and merge duplicate entities.
[0054] In one implementation, an entity has a data source field to identify its data source document; entities with the same data source field are grouped into the same data block.
[0055] In one implementation, for entities with the same data source field, the similarity between entities is calculated pairwise, such as the Jaccard coefficient and edit distance; entity pairs with similarity higher than a threshold are grouped into the same data block.
[0056] In one implementation, certain attributes are selected as target attributes in the ontology layer, such as date of birth and gender; entities with consistent or similar target attributes are grouped into the same data block. For example, people with the same date of birth and the same gender are likely to be the same person.
[0057] In one implementation, the embedding value of the entity's description information is calculated, and entities with a cosine value greater than 0.9 are grouped into the same data block.
[0058] In one implementation, the instance layer is further extended: each data block is traversed; the entity with the most attributes or the most associated knowledge in each data block is selected as the reference entity; other nodes in the data block are traversed, and the entity attributes, relationships, and relationship attributes of the current entity and the reference entity are compared, and the missing entity attributes, relationships, and relationship attributes of the current entity are obtained and added to the graph database.
[0059] In one implementation, knowledge acquisition prompts are input into a language model, and the language model outputs the missing entity attributes, relations, and relation attributes of the current entity; or the missing entity attributes, relations, and relation attributes of the current entity are directly obtained using a search engine.
[0060] In one implementation, all data source texts containing the current entity are obtained; a fourth task text is constructed, which includes the data source text and knowledge acquisition prompts; the language model obtains the missing entity attributes, relationships, and relationship attributes of the current entity from the data source text according to the knowledge acquisition prompts.
[0061] Examples are given below:
[0062] Knowledge Acquisition Hint: Based on the following scenario for entity A, write a brief description of entity A that incorporates the scenario. Scenario: {Text blocks in all data source texts containing entity A}. Description: The description attributes for each entity will be completed based on the above steps.
[0063] In one implementation, if the number of entities in a data block exceeds a threshold (30), the data block is further layered. Layering is based on the number of entity attributes, relationships, or relationship attributes; the closer the numbers are, the higher the probability of duplicate entities. The data is divided into three layers, each representing 1 / 3 to 2 / 3 of the maximum value of (attribute count + relationship count). A fifth task text is constructed, including entities and related knowledge within the same layer, and entity alignment hints. The language model aligns entities according to the alignment hints, i.e., it determines whether duplicate entities exist in that layer. Duplicate entities are then merged.
[0064] Examples are given below:
[0065] Entities and related knowledge at the same level: Entity A {Entity Name: 10kV Transformer}, attributes {Date of manufacture: 2022.1.1, Operating time: 7200h, Commissioning time: 7212h, Manufacturer: A certain transformer company, Description: The 10kV transformer produced by this transformer company adopts the latest technology, has the best performance, and the lowest historical failure rate}, Relationship: {(Commissioning time, 2022.1.5), (Substation, a certain 10kV transformer)}}; Entity B: {Entity Name: 10kV Transformer}, attributes: {Date of manufacture: 2022.1.1, Operating time: 5000h, Commissioning time: 5222h, Manufacturer: A certain Transformer Co., Ltd., Description: The 10kV transformer produced by a certain transformer company is developed using the latest technology, with the best performance and the lowest failure rate in history}, Relationship {(Scrap Time, 2031.12.31), (Voltage Level, 10kV)}}; Entity C: {Entity Name: 10kV Transformer}, Attributes: {Date of Manufacture: 2022.1.1, Operating Duration: 7200h, Commissioning Duration: 7212h, Manufacturer: a certain transformer company, Description: The 10kV transformer produced by a certain transformer company is developed using the latest technology, with the best performance and the lowest failure rate in history}, Relationship {(Commissioning Time, 2022.1.5)}}.
[0066] Entity alignment hint: Based on the entity list above, the output will most likely be a list of entities that are the same entity (i.e., a list of duplicate entities).
[0067] Language model output: Same entity: [Entity A, Entity C]
[0068] In one implementation, for the knowledge graph that has completed the fusion of the ontology layer and the instance layer, several entities are extracted from the instance layer for quality inspection. The selected strategy is as follows:
[0069] Based on factors such as the number of entity attributes, the number of relationships, and the number of alignments, a number of entities and their associated knowledge are extracted for quality inspection. The higher the number of entity attributes, relationships, and alignments, the greater the probability of selection. The data source document for the extracted entities is obtained.
[0070] Construct the sixth task text, which includes the entity to be inspected, the data source document, and the inspection prompts. The language model judges the entity to be inspected based on the data source document and the inspection prompts. If it is true, the entity passes the inspection; if it is false, it is transferred to manual correction or directly deleted.
[0071] Quality control prompt: For entity A, determine whether the entity A mentioned in the following text descriptions refers to the same entity. (Text blocks 1, 2, and 3 are all data sources containing entity A.)
[0072] Data Source Document: Text Block 1: A 10kV transformer is a common power device used to convert high-voltage electricity to low-voltage electricity to meet the power needs of various electrical appliances. It typically consists of a primary winding and a secondary winding; the primary winding is connected to high-voltage electricity, and the secondary winding is connected to low-voltage electricity. The turns ratio of a 10kV transformer is 10000:100, meaning it can convert 10000 volts of high-voltage electricity to 100 volts of low-voltage electricity. This type of transformer is widely used in industrial, commercial, and residential power supply sectors and is an indispensable part of the power system. Text Block 2: A 10kV transformer is a highly efficient and reliable power device with many advantages. First, it can convert high-voltage electricity to low-voltage electricity to meet the power needs of various electrical appliances. Second, the 10kV transformer has high conversion efficiency, which can reduce energy loss and improve the operating efficiency of the power system. Furthermore, this transformer has a small size and weight, making it convenient for installation and maintenance. Finally, the 10kV transformer has high reliability, ensuring the stable operation of the power system and reducing the failure rate. Therefore, it is widely used in industrial, commercial, and residential power supply sectors. Text Block 3: In power systems, 10kV transformers play a crucial role. They convert high-voltage electricity into low-voltage electricity to meet the power demands of various electrical devices. Since different electrical devices require different voltages and currents, 10kV transformers can be adjusted as needed to meet the power requirements of different devices. Furthermore, these transformers also have overload protection and short-circuit protection functions, ensuring the safe operation of the power system. Therefore, 10kV transformers are an indispensable part of the power system, playing a vital role in ensuring the stable operation of the power system and protecting the safety of people's lives and property.
[0073] Language model output: Yes / No
[0074] It should be noted that the aforementioned power heterogeneous knowledge fusion device is also used to achieve the above-mentioned... Figure 1 The method steps corresponding to each embodiment of the power heterogeneous knowledge fusion method shown are not repeated here.
[0075] It should be noted that the functional units / modules in the various embodiments of the present invention can be integrated into one processing unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated into one unit / module. The integrated unit / module described above can be implemented in hardware or in the form of software functional units / modules.
[0076] From the above description of the embodiments, those skilled in the art will clearly understand that the embodiments described herein can be implemented in hardware, software, firmware, middleware, code, or any suitable combination thereof. For hardware implementation, the processor can be implemented in one or more of the following units: Application-Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field-Programmable Gate Array (FPGA), processor, controller, microcontroller, microprocessor, other electronic units designed to implement the functions described herein, or combinations thereof. For software implementation, some or all of the processes of the embodiments can be implemented by a computer program instructing the associated hardware. During implementation, the program can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of a computer program from one place to another. Storage media can be any available medium accessible to a computer. Computer-readable media can include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code having the form of instructions or data structures and accessible to a computer.
[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit the scope of protection of the present invention. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should be able to analyze that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the essence and scope of the technical solutions of the present invention.
Claims
1. A method for fusing heterogeneous knowledge in the power industry, characterized in that, Includes the following steps: The first triplet is obtained from the ontology layers of at least two knowledge graphs. The first triplet contains entity relations. The first task text is constructed, which includes several first triplets and relation aggregation hints. The language model classifies the entity relations in the first triplets into synonym relations and inclusion relations according to the relation aggregation hints. Entity relations belonging to synonym relations are merged. Obtain second triples from the ontology layers of at least two knowledge graphs. Each second triple contains entity attributes or relation attributes. Construct the second task text, which includes second triples belonging to the same entity or several second triples belonging to the same relation, and attribute aggregation hints. The language model categorizes the attributes in the second triples into synonymous attributes and non-synonymous attributes according to the attribute aggregation hints. Merge the entity attributes or relation attributes that belong to the synonymous attributes. Entities are obtained from the instance layers of at least two knowledge graphs and divided into several data blocks; Construct the third task text, which includes several entities belonging to the same data block and entity alignment hints; the language model determines whether there are duplicate entities based on the entity alignment hints; and merges duplicate entities.
2. The method for fusing heterogeneous power knowledge according to claim 1, characterized in that, Also includes: The entity has a data source field to identify the data source document; Entities with the same data source fields are grouped into the same data block.
3. The method for fusing heterogeneous power knowledge according to claim 1, characterized in that, Also includes: The entity has a data source field to identify the data source document; For entities with the same data source field, calculate the similarity between each pair of entities, and group entity pairs with similarity higher than the threshold into the same data block.
4. The method for fusing heterogeneous power knowledge according to claim 1, characterized in that, Also includes: Select a subset of attributes from the ontology layer as target attributes; Entities with the same or similar target attributes are grouped into the same data block.
5. The method for fusing heterogeneous power knowledge according to claim 1, characterized in that, Also includes: Calculate the embedding value of the entity's description information, and group entities whose cosine value of the embedding value is greater than a threshold into the same data block.
6. The method for fusing heterogeneous power knowledge according to claim 1, characterized in that, Also includes: Iterate through each data block; Select one entity from each data block as the reference entity; Traverse other nodes in the data block, compare the entity attributes, relationships, and relationship attributes of the current entity and the reference entity, and add the missing entity attributes, relationships, and relationship attributes of the current entity to the graph database.
7. The method for fusing heterogeneous power knowledge according to claim 6, characterized in that, Also includes: Retrieve all data source texts containing the current entity; Construct the fourth task text, which includes the data source text and knowledge acquisition prompts; the language model retrieves the missing entity attributes, relations, and relation attributes of the current entity from the data source text according to the knowledge acquisition prompts.
8. The method for fusion of heterogeneous power knowledge according to claim 1, characterized in that, Also includes: If the number of entities in a data block exceeds the threshold, the data block will be processed in layers. Construct the fifth task text, which includes entities and related knowledge in the same layer, and entity alignment hints; the language model determines whether there are duplicate entities in this layer based on the entity alignment hints.
9. The method for fusion of heterogeneous power knowledge according to claim 1, characterized in that, Also includes: Several entities are extracted from the merged instance layer; the sixth task text is constructed, which includes the entity to be inspected, the data source document, and the inspection prompts; the language model judges the entity to be inspected based on the data source document and the inspection prompts. If it is true, the inspection is passed; if it is false, it is transferred to manual correction or directly deleted.
10. An electronic device, characterized in that, include: Memory, used to store executable instructions; A processor for executing executable instructions stored in the memory to implement the method as described in any one of claims 1 to 9.