Power grid service-oriented knowledge graph generation method and device, equipment, storage medium and program product

CN122905040APending Publication Date: 2026-10-13SHENZHEN POWER SUPPLY BUREAU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611133979.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0004]然而,由于目前的对齐方式依赖词汇匹配和简单规则,对齐精度有限

Benefits of technology

[0042]上述面向电网业务的知识图谱生成方法、装置、计算机设备、计算机可读存储介质和计算机程序产品,首先获取电网业务的标准语义文件,并从多源业务文档中提取候选三元组;基于标准语义文件对每个候选三元组执行语义对齐操作,生成每个候选三元组对应的对齐置信度值;将不同文档中同义异形的词汇(候选三元组)统一映射至电网业务的同一标准概念,消除语义歧义,且通过专用的电网业务的标准语义文件,从而提高对齐的精度以及映射准确率。其次若对齐置信度值大于第一阈值,将候选三元组存入主存储区;若对齐置信度值大于等于第二阈值,且小于第一阈值,将候选三元组存入次存储区;其中,第一阈值大于第二阈值;实现知识按可信度物理隔离,避免低置信度知识干扰高精度推理,最后基于存入主存储区与次存储区中所有的三元组,确定电网业务的知识图谱,减少了知识图谱中错误三元组数量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122905040A_ABST
    Figure CN122905040A_ABST
Patent Text Reader

Abstract

The application relates to a power grid service-oriented knowledge graph generation method and device, equipment, a storage medium and a program product. The method comprises the following steps: acquiring a standard semantic file of a power grid service, and extracting candidate triplets from multi-source service documents; performing a semantic alignment operation on each candidate triplet based on the standard semantic file to generate an alignment confidence value corresponding to each candidate triplet; if the alignment confidence value is greater than a first threshold value, storing the candidate triplet in a main storage area; if the alignment confidence value is greater than or equal to a second threshold value and less than or equal to the first threshold value, storing the candidate triplet in a secondary storage area; wherein the first threshold value is greater than the second threshold value; and determining a knowledge graph of the power grid service based on all triplets stored in the main storage area and the secondary storage area. The method can improve alignment accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power grid digital application technology, and in particular to a knowledge graph generation method, apparatus, computer equipment, computer-readable storage medium, and computer program product for power grid business. Background Technology

[0002] With the deepening of the digital transformation of the power grid, massive amounts of business data have been accumulated in all aspects of power generation, transmission, transformation, distribution and consumption, forming a complex business system covering multiple fields such as production, marketing, materials, projects and dispatch. The business entities are numerous, the data table structure is complex and hierarchical, and the industry professional terminology system is highly specialized.

[0003] In traditional techniques, a general semantic model is constructed, and natural language processing techniques are used to align the extraction results with the general semantic model.

[0004] However, the current alignment methods rely on word matching and simple rules, resulting in limited alignment accuracy. Summary of the Invention

[0005] Therefore, it is necessary to provide a knowledge graph generation method, apparatus, computer equipment, computer-readable storage medium, and computer program product for power grid services that can improve alignment accuracy in response to the above-mentioned technical problems.

[0006] Firstly, this application provides a method for generating a knowledge graph for power grid operations, the method comprising:

[0007] Obtain the standard semantic file of power grid business and extract candidate triples from multi-source business documents;

[0008] Based on the standard semantic file, a semantic alignment operation is performed on each candidate triple to generate an alignment confidence value for each candidate triple.

[0009] If the alignment confidence value is greater than the first threshold, the candidate triplet is stored in the main storage area; if the alignment confidence value is greater than or equal to the second threshold and less than or equal to the first threshold, the candidate triplet is stored in the secondary storage area; wherein, the first threshold is greater than the second threshold.

[0010] Based on all the triples stored in the main storage area and the secondary storage area, the knowledge graph of the power grid business is determined.

[0011] In one embodiment, the standard semantic file includes a set of entity types and a set of relation types; the set of entity types includes standard entity types, and the set of relation types includes standard relations, with each standard entity type and each standard relation corresponding to a standard semantic vector;

[0012] The step of performing semantic alignment operation on each candidate triple based on the standard semantic file to generate an alignment confidence value corresponding to each candidate triple includes:

[0013] The candidate triples are encoded to obtain a candidate semantic vector corresponding to each element in the candidate triples. Based on the candidate semantic vectors and each of the standard semantic vectors, a target similarity score is determined for each candidate triple. The elements include candidate head entities, candidate relations, and candidate tail entities.

[0014] For each candidate triplet, obtain the context word sequence of each element in the candidate triplet in the multi-source business document, and determine the context consistency score of the candidate triplet based on the context word sequence; wherein, the context word sequence includes at least one of context entities, context relations and context attributes;

[0015] For each candidate triple, the path constraint score of the candidate triple is determined based on the candidate relation in the triple and the standard relation in the relation type set.

[0016] Based on the target similarity score, the context consistency score, and the path constraint score of the same candidate triple, the alignment confidence value of each candidate triple is determined.

[0017] In one embodiment, the standard semantic file includes a set of relation path templates; determining the path constraint score of the candidate triples based on the candidate relations in the triples and the standard relations in the set of relation types includes:

[0018] When the candidate relation in the candidate triple does not exist in the relation type set, the search is performed in the relation path template set to determine if a target relation path template exists. The target search conditions include using the first entity type to which the candidate head entity belongs as the starting point and the second entity type to which the candidate tail entity belongs as the ending point. The target relation path template is a relation path template connecting the first entity type and the second entity type. The relation path template is an ordered relation chain from the starting entity type to the target entity type.

[0019] If the target relation path template exists, the candidate relation is modified to the standard relation corresponding to the target relation path template, and the path constraint score of the candidate triple is generated based on the semantic similarity between the standard relation and the candidate relation.

[0020] In one embodiment, the candidate semantic vector includes a first candidate semantic vector, a second candidate semantic vector, and a third candidate semantic vector; the first candidate semantic vector corresponds to the candidate head entity; the second candidate semantic vector corresponds to the tail entity; and the third candidate semantic vector corresponds to the candidate relation.

[0021] The step of determining the target similarity score for each candidate triplet based on the candidate semantic vectors and each of the standard semantic vectors includes:

[0022] The first candidate semantic vector and the second candidate semantic vector are respectively compared with the standard semantic vector of each standard entity type in the entity type set by calculating cosine similarity, and the first set of similarity values ​​and the second set of similarity values ​​corresponding to each standard entity type are determined.

[0023] The cosine similarity between the third candidate semantic vector and the standard semantic vector of each standard relation in the relation type set is calculated to obtain the third set of similarity values ​​corresponding to each standard relation.

[0024] The maximum value from the first set of similarity values ​​is taken as the head entity similarity score; the maximum value from the second set of similarity values ​​is taken as the tail entity similarity score; and the maximum value from the third set of similarity values ​​is taken as the relation similarity score.

[0025] The minimum value among the head entity similarity score, the relation similarity score, and the tail entity similarity score is taken as the target similarity score of the candidate triple.

[0026] In one embodiment, the method further includes:

[0027] Receive a user's natural language query, parse the natural language query, and obtain the query entity and query intent;

[0028] According to the query intent, a multi-hop graph traversal search is performed in the main storage area starting from the query entity to determine the first triplet that is hit.

[0029] If the first triplet satisfies the answer requirement of the query intent, then the first natural language answer is determined and output based on the first triplet;

[0030] If the first triplet does not meet the answer requirements of the query intent, the natural language query is encoded into a query vector, and semantic similarity is retrieved in the secondary storage area to obtain the second triplet; the first triplet and the second triplet are used to determine the second natural language answer and output it.

[0031] In one embodiment, the method further includes:

[0032] When a first triplet is hit from the primary storage area and / or a second triplet is hit from the secondary storage area, the hit first triplet and / or the second triplet are used as new candidate triplets, and the new version of the standard semantic file is obtained according to the version change log; wherein, the version change log is a log recorded when the standard semantic file undergoes a version change;

[0033] Re-execute the semantic alignment operation for each candidate triple based on the standard semantic file to generate an alignment confidence value for each candidate triple; if the alignment confidence value is greater than a first threshold, store the candidate triple in the main storage area; if the alignment confidence value is greater than or equal to a second threshold and less than or equal to the first threshold, store the candidate triple in the secondary storage area.

[0034] Secondly, this application also provides a knowledge graph generation device for power grid services, the device comprising:

[0035] The acquisition module is used to acquire standard semantic files of power grid business and extract candidate triples from multi-source business documents;

[0036] The alignment module is used to perform semantic alignment operations on each candidate triple based on the standard semantic file and generate an alignment confidence value for each candidate triple.

[0037] The storage module is configured to store the candidate triplet in the main storage area if the alignment confidence value is greater than a first threshold; and to store the candidate triplet in the secondary storage area if the alignment confidence value is greater than or equal to a second threshold and less than or equal to the first threshold; wherein the first threshold is greater than the second threshold.

[0038] The determination module is used to determine the knowledge graph of the power grid business based on all the triples stored in the main storage area and the secondary storage area.

[0039] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.

[0040] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.

[0041] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.

[0042] The aforementioned knowledge graph generation method, apparatus, computer equipment, computer-readable storage medium, and computer program product for power grid business first acquire a standard semantic file for power grid business and extract candidate triples from multi-source business documents. Based on the standard semantic file, a semantic alignment operation is performed on each candidate triple to generate an alignment confidence value corresponding to each candidate triple. Synonymous but heterogeneous terms (candidate triples) in different documents are uniformly mapped to the same standard concept in power grid business, eliminating semantic ambiguity. Furthermore, the use of a dedicated standard semantic file for power grid business improves alignment accuracy and mapping precision. Secondly, if the alignment confidence value is greater than a first threshold, the candidate triple is stored in the main storage area; if the alignment confidence value is greater than or equal to a second threshold but less than the first threshold, the candidate triple is stored in the secondary storage area. The first threshold is greater than the second threshold. This achieves physical isolation of knowledge according to confidence level, avoiding interference from low-confidence knowledge with high-precision reasoning. Finally, based on all the triples stored in the main and secondary storage areas, the knowledge graph of power grid business is determined, reducing the number of erroneous triples in the knowledge graph. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a flowchart illustrating a knowledge graph generation method for power grid services in one embodiment;

[0045] Figure 2 This is a flowchart illustrating the process of performing semantic alignment operations on each candidate triple based on a standard semantic file in one embodiment.

[0046] Figure 3 This is a flowchart illustrating the process of determining the path constraint score of a candidate triplet in one embodiment.

[0047] Figure 4 This is a flowchart illustrating the process of determining the target similarity score for each candidate triplet in one embodiment.

[0048] Figure 5 This is a flowchart illustrating the application of knowledge graphs in one embodiment;

[0049] Figure 6 This is a structural block diagram of a knowledge graph generation device for power grid services in one embodiment.

[0050] Figure 7This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0052] In one embodiment, such as Figure 1 As shown, a knowledge graph generation method for power grid business is provided. This embodiment illustrates the method applied to a terminal, but it is understood that the method can also be applied to a server, or to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps S102 to S108. Wherein:

[0053] Step S102: Obtain the standard semantic file of the power grid business and extract candidate triples from the multi-source business documents.

[0054] Among them, the standard semantic document for power grid business is a formalized specification description of the domain concepts, conceptual attributes, relationships and constraints between concepts in power grid business. Multi-source business documents refer to business documents generated from different business systems such as power grid production, marketing, materials, projects, and dispatch, and in various formats including PDF, Word, Excel, and scanned images.

[0055] Optionally, before obtaining the standard semantic file for power grid services, the terminal pre-constructs the standard semantic file for power grid services. The standard semantic file includes a set of entity types, a set of relation types, a set of business rules, and a set of relation path templates. An entity type is a class of objects with common characteristics, such as "substation" or "regulatory document." A relation type refers to the semantic connection between two entities, such as "standard" or "reference." Relation path templates are predefined, ordered sequences of relation types. The set is the dataset corresponding to the above content. The terminal then obtains the constructed standard semantic file for power grid services.

[0056] First, define the set of entity types. For example, in power grid maintenance operations, entity types include: "substation", "voltage level", "equipment" (further divided into "circuit breaker", "disconnect switch", "transformer", etc.), "maintenance procedures", "maintenance tasks", "work orders", "system documents", "departments", "personnel", "time", etc.

[0057] Secondly, define the set of relationship types. Relationship types include: "belonging to" (the substation belongs to a certain voltage level), "includes" (the procedure includes the task), "based on" (the task is based on a certain system), "execution" (personnel execute the task), "associated" (work order is associated with equipment), "release time", etc.

[0058] Then, define the set of business rules. For example:

[0059] Rule 1: If the maintenance task involves a voltage level ≥110kV, a "Type 1 work order" must be generated.

[0060] Rule 2: An "isolation" operation must be performed before circuit breaker maintenance. These rules can be expressed using SWRL (Semantic Web Rule Language) or a custom scripting language.

[0061] Finally, define the set of relation path templates. Each relation path template is an ordered chain of relations from the starting entity type to the target entity type. For example:

[0062] Relationship path template T1: Department—(Issued)—System—(Standard)—Maintenance Task, indicating that a system issued by a certain department regulates a certain maintenance task.

[0063] Relationship path template T2: Maintenance task — (involved) — equipment — (located) — substation, indicating the substation where the equipment involved in the maintenance task is located. These templates are pre-stored in the relationship path template library for path constraint verification in subsequent steps.

[0064] Optionally, the terminal extracts candidate knowledge units from multi-source business documents. These candidate knowledge units include candidate entities, candidate relationships, and candidate attribute values. The terminal first uses OCR and text parsing tools to convert the multi-source business documents into plain text, and then performs structured segmentation by chapters, paragraphs, and tables. Then, it extracts entities, relationships, and attribute values ​​from the segmented documents to obtain candidate entities, candidate relationships, and the attribute values ​​of the candidate entities. The candidate entities include candidate header entities and candidate footer entities.

[0065] Furthermore, the terminal performs entity extraction, including using a BERT-based named entity recognition model for the power sector to label entity words and their type candidates in the document. For example, from the sentence "According to the 'State Grid Corporation Substation Maintenance Regulations' (2023 Edition), maintenance personnel Zhang San should conduct a preventive test on the #2 main transformer of the 110kV Changling Substation on March 15, 2024," candidate entities are extracted as follows: "State Grid Corporation Substation Maintenance Regulations" (type: regulations), "Zhang San" (type: personnel), "March 15, 2024" (type: time), "110kV Changling Substation" (type: substation), "#2 main transformer" (type: equipment), and "preventive test" (type: maintenance task).

[0066] The terminal performs relation extraction, including classifying entity pairs in a sentence using a pre-trained relation classification model (such as a BERT-based relation extraction model). For example, the relation candidate for entity pair ("procedure", "maintenance task") is "specification"; the relation candidate for entity pair ("personnel", "maintenance task") is "execution"; and the relation candidate for entity pair ("substation", "equipment") is "containment". Each entity pair includes a head entity and a tail entity.

[0067] The terminal performs attribute value extraction, including: the terminal extracts attribute information of entities, such as the "version number" of the procedure, the "rated voltage" of the device, and the "planned duration" of the task.

[0068] Step S104: Perform semantic alignment operation on each candidate triple based on the standard semantic file to generate an alignment confidence value corresponding to each candidate triple.

[0069] Optionally, the terminal performs semantic alignment operations on each candidate triple based on the standard concepts included in the standard semantic file using a semantic alignment engine to generate an alignment confidence value for each candidate triple.

[0070] Step S106: If the alignment confidence value is greater than the first threshold, store the candidate triplet in the main storage area; if the alignment confidence value is greater than or equal to the second threshold and less than or equal to the first threshold, store the candidate triplet in the secondary storage area.

[0071] Among them, the first threshold Greater than the second threshold ,and The primary storage area stores high-confidence candidate triples and can be implemented using a graph database; the secondary storage area stores candidate triples to be verified or other than high-confidence triples and can be stored using a hybrid vector database and graph database.

[0072] Optionally, the terminal uses formula (1) to determine the size of the alignment confidence value and the first threshold and the second threshold, and determines the storage method of the candidate triplet based on the comparison result.

[0073] Formula (1)

[0074] In the formula, store represents the judgment function, and Q represents the alignment confidence value. Represents the main storage area, Representing the secondary jurisdiction, It means to discard.

[0075] If the alignment confidence value is greater than the first threshold, the candidate triplet is stored in the main storage area; if the alignment confidence value is less than the second threshold, the candidate triplet is discarded; if the alignment confidence value is greater than or equal to the second threshold and less than or equal to the first threshold, the candidate triplet is stored in the secondary storage area.

[0076] Step S108: Based on all the triples stored in the main storage area and the secondary storage area, determine the knowledge graph of the power grid business.

[0077] Optionally, the terminal constructs a knowledge graph based on triples in the main storage area and the secondary storage area, and integrates standard semantic files, structured data models of power grid business and knowledge graph into a three-in-one framework for performing multi-hop reasoning and cross-modal retrieval.

[0078] Furthermore, the terminal constructs a complete knowledge graph based on triples in the primary and secondary storage areas. Simultaneously, it integrates quasi-semantic files (OWL files), structured data models (such as relational database schemas for power grid equipment ledgers), and this knowledge graph to form a unified "ontology-data-knowledge" framework. The quasi-semantic files provide semantic constraints for entities and relationships in the graph. Tables and fields in the structured data model are mapped to classes and attributes in the quasi-semantic files using mapping languages ​​(such as R2RML), allowing records in the relational database to virtually become part of the knowledge graph. Entity nodes in the knowledge graph establish external links with primary keys in the structured data, enabling cross-modal retrieval. For example, a user queries "Who was in charge of the most recent maintenance at the 110kV Changling Substation?": Multi-hop reasoning: First, find the "maintenance task" associated with "Changling Substation" in the knowledge graph, then find the "responsible person" entity from the task. Cross-modal retrieval: If the name of the person in charge is not directly stored in the knowledge graph, but the "maintenance record table" of the structured data model contains the field, the framework will automatically generate an SQL query and merge the results.

[0079] The aforementioned knowledge graph generation method for power grid business first obtains a standard semantic file for power grid business and extracts candidate triples from multi-source business documents. Based on the standard semantic file, a semantic alignment operation is performed on each candidate triple to generate an alignment confidence value for each candidate triple. Synonymous but heterogeneous terms (candidate triples) in different documents are uniformly mapped to the same standard concept in power grid business, eliminating semantic ambiguity. Furthermore, the use of a dedicated standard semantic file for power grid business improves alignment accuracy and mapping precision. Secondly, if the alignment confidence value is greater than a first threshold, the candidate triple is stored in the main storage area; if the alignment confidence value is greater than or equal to a second threshold but less than the first threshold, the candidate triple is stored in the secondary storage area. The first threshold is greater than or equal to the second threshold. This achieves physical isolation of knowledge based on confidence level, preventing low-confidence knowledge from interfering with high-precision reasoning. Finally, based on all the triples stored in the main and secondary storage areas, the knowledge graph for power grid business is determined, reducing the number of erroneous triples in the knowledge graph.

[0080] In one exemplary embodiment, such as Figure 2 As shown, the standard semantic file includes a set of entity types and a set of relation types; the set of entity types includes standard entity types, and the set of relation types includes standard relations. Each standard entity type and each standard relation corresponds to a standard semantic vector. Based on the standard semantic file, a semantic alignment operation is performed on each candidate triple to generate an alignment confidence value corresponding to each candidate triple, including the following steps S202 to S208. Wherein:

[0081] Step S202: Encode the candidate triples to obtain the candidate semantic vector corresponding to each element in the candidate triples. Based on the candidate semantic vectors and each standard semantic vector, determine the target similarity score of each candidate triple.

[0082] The elements include candidate head entities, candidate relations, and candidate tail entities.

[0083] Optionally, the terminal inputs the candidate triples into a Sentence-BERT model fine-tuned for the power domain to obtain multi-dimensional candidate semantic vectors. After vectorization, all candidate triples and their vectors are stored in a temporary cache.

[0084] Furthermore, the terminal uses cosine similarity as shown in formula (2) based on the candidate semantic vector V. c Given the standard semantic vectors Vt, determine the similarity score for each candidate triplet.

[0085] Formula (2)

[0086] In the formula, sim vec (c,t) represents the candidate semantic vector Vc The similarity score between the vector and the standard semantic vector Vt. || || represents the magnitude of the vector.

[0087] For each candidate triplet, the maximum similarity score across all standard concepts is taken as the target similarity score.

[0088] For the candidate entity "110kV Changling Substation", its semantic vector is compared with the standard vector of the "substation" entity type in the ontology (which is the mean of all instance vectors in the ontology or the pre-trained center vector) to obtain a similarity score, for example, 0.92. For the candidate relation "norm", the similarity is calculated with the standard vectors of relation types such as "based on", "contains", and "norm" in the ontology, and the maximum value is taken as the target similarity score.

[0089] Step S204: For each candidate triplet, obtain the context word sequence of each element in the candidate triplet in the multi-source business document, and determine the context consistency score of the candidate triplet based on the context word sequence.

[0090] The context word sequence includes at least one of context entities, context relations, and context attributes.

[0091] Optionally, for each candidate triple, the context word sequence of each element in the candidate triple in the multi-source business document is obtained. The position of the candidate triple in a certain source business document is... Taking it as the center, take it before and after. The context word sequence consisting of 1 word is The terminal determines the context consistency score of candidate triples based on the context word sequence according to formula (3).

[0092] Formula (3)

[0093] In the formula, S ctx (c) represents the context consistency score. For each word in the context word sequence, the word embedding vector is... It is a bidirectional long short-term memory network that outputs a context representation vector. It is a multilayer perceptron, outputting a scalar value. The Sigmoid function compresses the output to... Interval.

[0094] Alternatively, the terminal may also use a simplified method of calculating context consistency scores based on rules or language model probabilities, as shown in formula (4).

[0095] Formula (4)

[0096] In the formula, The conditional probabilities given for the language model.

[0097] The context word sequence is defined as a word window consisting of N words before and after the candidate triplet's position in the source document; in this embodiment, N=5. For example, the context window for the candidate entity "Changling Substation" is: "...to perform..." on the #2 main transformer of [Changling Substation]. The word sequence in this window is input into a pre-trained context scoring model (such as an LSTM-based language model) to calculate the reasonableness score of the triplet's appearance in this context. If the candidate relation "norm" appears in the context of "procedure...norm...task", a high consistency score (e.g., 0.85) is obtained; if it appears in unreasonable contexts such as "time...norm...location", the score is lower.

[0098] Step S206: For each candidate triple, determine the path constraint score of the candidate triple based on the candidate relations in the triple and the standard relations in the relation type set.

[0099] Optionally, for each candidate triple, the terminal determines the path constraint score of the candidate triple based on the candidate relations in the triple and the standard relations in the relation type set, denoted as S. path (h,r,t).

[0100] Step S208: Based on the target similarity score, context consistency score, and path constraint score of the same candidate triple, determine the alignment confidence value of each candidate triple.

[0101] Optionally, the terminal calculates the alignment confidence value Q of each candidate triple by weighted summing of the target similarity score, context consistency score and path constraint score of the same candidate triple, as shown in formula (5).

[0102] Formula (5)

[0103] In the formula, These represent the weighting coefficients, where, .

[0104] Furthermore, , , For example, if the target similarity score is 0.92, the context consistency score is 0.85, and the path constraint score is 0.3 (if it exists) or 0 (if it does not exist), then the confidence score when a path exists is 0.5 × 0.92 + 0.3 × 0.85 + 0.2 × 0.3 = 0.775; and the confidence score when a path does not exist is 0.46 + 0.255 + 0 = 0.715.

[0105] In this embodiment, by introducing target similarity score, context consistency score and relation path constraint verification, the mapping accuracy between candidate triples and standard concepts in standard semantic files is greatly improved, directly reducing the number of erroneous triples in the knowledge graph.

[0106] In one exemplary embodiment, such as Figure 3 As shown, the standard semantic file includes a set of relation path templates; based on the candidate relations in the triples and the standard relations in the relation type set, the path constraint scores of the candidate triples are determined, including steps S302 to S306. Wherein:

[0107] Step S302: When the candidate relation in the candidate triple does not exist in the relation type set, then search for the existence of the target relation path template in the relation path template set based on the target search conditions.

[0108] The target search conditions include taking the first entity type to which the candidate head entity belongs as the search starting point and the second entity type to which the candidate tail entity belongs as the search ending point; the target relationship path template is a relationship path template that connects the first entity type and the second entity type; the relationship path template is an ordered relationship chain from the starting entity type to the target entity type.

[0109] Optionally, when the candidate relation in the candidate triple does not exist in the relation type set, that is, the candidate relation cannot directly match any standard relation in the relation type set, the terminal searches for the existence of a corresponding target relation path template in the relation path template set, with the first entity type to which the candidate head entity belongs as the starting point of the search and the second entity type to which the candidate tail entity belongs as the end point of the search.

[0110] Step S304: If a target relationship path template exists, the candidate relationship is modified to the standard relationship corresponding to the target relationship path template.

[0111] Step S306: Based on the semantic similarity between the standard relation and the candidate relation, generate the path constraint score of the candidate triple.

[0112] Optionally, if a target relation path template exists in the relation path template set, the terminal corrects the candidate relation to the standard relation corresponding to the target relation path template, and then generates the path constraint score of the candidate triple based on the semantic similarity between the standard relation and the candidate relation according to formula (6).

[0113] Formula (6)

[0114] In the formula, Spath(h,r,t) represents the path constraint score of the candidate triple. For a predefined set of relational path templates, each relational path template is denoted as . , For entity type, For relation types, If and only if there exists a path in the relational path template set starting from the initial entity Type to target entity The type matches the actual path of the target relation path template, which is the target relation path template. For the set of relation types in the standard semantic file, Standard relations (e.g., template end relations or dominant relations on the path) inferred from the target relation path template. Candidate relationship Relationship with the inferred standard Semantic similarity between (values) ), The preset path constraint gain coefficient (in this embodiment, it is taken as...) ), This is an indicator function; it takes the value 1 when the condition is true and 0 when it is false.

[0115] Optionally, if there is no target relation path template in the relation path template set, the preset value is determined as the path constraint score of the candidate triple. According to formula (6), the preset value is 0.

[0116] Furthermore, when a candidate relation cannot directly match any relation type in the standard semantic file (e.g., the extracted relation term is "reference," but "reference" is not found in the relation type set of the standard semantic file), path constraint verification is triggered. In this case, focusing on the head and tail entity candidates of the candidate triple, a search is conducted in the relation path template set to determine if a relation path template connects them. Assume the candidate triple is (《Inspection Procedure》, "reference", "Work Permit System"). The search reveals a target relation path template: System → (Basis) → Regulations → (Reference) → System or Template System → (Association) → Work Permit Type. If a target relation path template is found, the candidate relation "reference" is corrected to the standard relation "association" in the closest target relation path template, and the path constraint score is increased (e.g., +0.3). If no target relation path template is found, the path constraint score is 0.

[0117] In another optional embodiment, when the candidate relation in the candidate triple exists in the relation type set, the preset value is determined as the path constraint score of the candidate triple, and the path constraint score of the candidate triple is 0.

[0118] In this embodiment, when a candidate relationship cannot be precisely matched, the path constraint verification does not directly determine it as invalid. Instead, it checks whether there is a target relationship path template connection between the candidate head entity and the candidate tail entity. If there is a connection, it proves that the candidate relationship is logically reasonable. The similarity score is compensated by the path constraint score, allowing the candidate triple to have a chance to cross the second threshold and be stored in the secondary storage area. This is a fault-tolerant mechanism that degenerates from precise matching to structural verification, significantly reducing the knowledge loss rate caused by lexical diversity. It also effectively avoids misalignment that may be caused by relying solely on lexical similarity.

[0119] In one exemplary embodiment, such as Figure 4 As shown, the candidate semantic vectors include a first candidate semantic vector, a second candidate semantic vector, and a third candidate semantic vector; the first candidate semantic vector corresponds to the candidate head entity; the second candidate semantic vector corresponds to the tail entity; and the third candidate semantic vector corresponds to the candidate relation. Based on the candidate semantic vectors and each standard semantic vector, the target similarity score of each candidate triplet is determined, including steps S402 to S408. Wherein:

[0120] Step S402: Perform cosine similarity calculations between the first candidate semantic vector and the candidate second semantic vector and the standard semantic vector of each standard entity type in the entity type set, respectively, to determine the first set of similarity values ​​and the second set of similarity values ​​corresponding to each standard entity type.

[0121] The standard semantic vectors include the semantic vectors corresponding to the head entity, the semantic vectors corresponding to the tail entity, and the semantic vectors corresponding to the relations.

[0122] Optionally, the terminal iterates through the standard semantic vectors of each standard entity type in the entity type set based on the first candidate semantic vector, and calculates the cosine similarity with the standard semantic vector of each standard entity type to determine the first set of similarity values ​​corresponding to each standard entity type; the second semantic vector is processed similarly. The candidate second semantic vector is then used to calculate the cosine similarity with the standard semantic vector of each standard entity type in the entity type set to determine the second set of similarity values ​​corresponding to each standard entity type.

[0123] Step S404: Calculate the cosine similarity between the third candidate semantic vector and the standard semantic vector of each standard relation in the relation type set to obtain the third set of similarity values ​​corresponding to each standard relation.

[0124] Optionally, the terminal traverses the standard semantic vector of each standard relation in the relation type set based on the third candidate semantic vector, and performs cosine similarity calculation with the standard semantic vector of each standard relation to obtain the third set of similarity values ​​corresponding to each standard relation.

[0125] Step S406: Take the maximum value from the first set of similarity values ​​as the head entity similarity score; take the maximum value from the second set of similarity values ​​as the tail entity similarity score; take the maximum value from the third set of similarity values ​​as the relation similarity score.

[0126] Step S408: The minimum value among the head entity similarity score, relation similarity score, and tail entity similarity score is taken as the target similarity score of the candidate triplet.

[0127] Optionally, the terminal selects the maximum value from the first set of similarity scores as the head entity similarity score; the maximum value from the second set of similarity scores as the tail entity similarity score; and the maximum value from the third set of similarity scores as the relation similarity score. Then, the minimum value among these three is selected as the target similarity score for the candidate triple. The minimum value among the head entity similarity score, relation similarity score, and tail entity similarity score is taken as the overall target similarity score for the triple. Its overall semantic alignment quality is limited by the matching degree of its weakest link, effectively avoiding the problem of a single element's accidental good match masking the insufficient matching of other elements, ensuring that the target similarity score truly reflects the overall alignment quality of the candidate triple.

[0128] In this embodiment, by performing independent semantic vector encoding traversal matching on the head entity, relation, and tail entity in the candidate triplet, an optimal single-item matching score is determined for each of the three constituent elements, enabling refined and independent evaluation of each element within the candidate triplet. Since the candidate head entity, candidate relation, and candidate tail entity belong to different semantic categories in the semantic space (the vector space distribution of entities and relations is different), matching them separately with the standard vectors of the corresponding types in the ontology avoids semantic bias caused by cross-type comparisons, ensuring that the matching score of each element is the optimal result obtained by comparing within the same type of standard concept.

[0129] In one exemplary embodiment, such as Figure 5 As shown, the generated knowledge graph is applied, including steps S502 to S508. Wherein:

[0130] Step S502: Receive the user's natural language query, parse the natural language query, and obtain the query entity and query intent.

[0131] Optionally, the terminal receives natural language queries input by the user, such as "When a cooler failure occurs at the #3 main transformer of the 500kV X substation, what are the emergency isolation procedures according to the regulations? What type of work order is required?" The terminal parses and processes the natural language query to obtain the query entities, such as equipment: "#3 main transformer", fault: "cooler failure", station: "X substation", target: "operation procedures, work order", and query intent, such as "fault handling procedure query" or "operation procedure retrieval".

[0132] Step S504: Perform a multi-hop graph traversal search in the main storage area based on the query intent, starting from the query entity, to determine the first hit triplet.

[0133] Step S506: If the first triplet satisfies the answer requirements of the query intent, then determine the first natural language answer based on the first triplet and output it.

[0134] Optionally, the terminal performs a multi-hop graph traversal search in the main storage area based on the query intent, starting from the query entity, to determine the first matched triplet. For example, the first hop: starting from "#3 main transformer", following the "occurrence" relationship, finds the fault node "cooler all stopped". The second hop: starting from "cooler all stopped", following the "basis" relationship, finds the procedure node "2024 version procedure". The third hop: starting from "2024 version procedure", following the "guidance" relationship, finds the work order node. The terminal successfully finds the triplet where "2024 version procedure" is the head or tail entity.

[0135] If the "2024 version of the procedure" is linked to the "work order" relationship, and the "2024 version of the procedure" also has the text attribute "specific operating steps," then the first triplet satisfies the query intent's answer requirements. The main memory returns the results: "procedure name," "work order," and "specific operating steps." The terminal then determines the first natural language answer based on the first triplet returned by the main memory and outputs it.

[0136] Step S508: If the first triplet does not meet the answer requirements of the query intent, the natural language query is encoded into a query vector, and semantic similarity is retrieved in the secondary storage area to obtain the second triplet; the first triplet and the second triplet are used to determine the second natural language answer and output it.

[0137] If the "2024 version of the procedure" does not connect to any "work order" relationship (assuming that when building the knowledge graph, this triple was stored in the secondary storage area due to low confidence, and is missing from the primary storage area), and the "2024 version of the procedure" does not have a "specific operation steps" text attribute attached (assuming the operation steps are in the relational database), then the first triple does not meet the answer requirements of the query intent, and the terminal needs to perform a cross-modal retrieval.

[0138] Optionally, the terminal encodes the natural language query into a query vector and performs semantic similarity retrieval in the secondary storage area to obtain the second triplet. The second triplet is "cooler all stopped, suggestion, emergency repair work order". The terminal obtains the supplementary answer "emergency repair work order".

[0139] Furthermore, the terminal can also query the relational database for the "specific operating steps" of the cooler based on the natural language query, and include the "specific operating steps" as a supplementary answer. The terminal will determine the second natural language answer based on the first triplet, the second triplet, and the results returned by the relational database, and then output it.

[0140] In addition, if the first and second triples can already satisfy the answer requirements of the query intent, the terminal will determine the second natural language answer by combining the first and second triples and output it.

[0141] In this embodiment, multi-hop inference can accurately acquire deeply related business knowledge, meeting the query needs of complex power grids. Cross-modal retrieval integrates high-confidence graph matching in the main storage area and vector similarity retrieval in the secondary storage area. While ensuring accurate results, it does not omit any knowledge to be verified and adds uncertainty markers to improve the system's robustness and interpretability. The two work together to achieve high recall and low false positive rate, significantly enhancing the completeness of question answering in complex business scenarios.

[0142] In an exemplary embodiment, the method further includes: when a first triplet is hit from the main storage area and / or a second triplet is hit from the secondary storage area, taking the hit first triplet and / or the second triplet as new candidate triplets, obtaining the new version's standard semantic file according to the version change log; re-performing the semantic alignment operation based on the standard semantic file for each candidate triplet to generate an alignment confidence value corresponding to each candidate triplet; if the alignment confidence value is greater than a first threshold, storing the candidate triplet in the main storage area; and if the alignment confidence value is greater than or equal to a second threshold and less than or equal to the first threshold, storing the candidate triplet in the secondary storage area.

[0143] The version change log is a log that records changes to standard semantic files.

[0144] Optionally, when the standard semantic file undergoes a version change and a first triplet is found in the main storage area and / or a second triplet is found in the secondary storage area, the first triplet and / or the second triplet need to be realigned. In this case, the new version of the standard semantic file needs to be obtained from the version change log. Then, the terminal uses the first triplet and / or the second triplet as new candidate triplets and re-executes the semantic alignment operation based on the standard semantic file for each candidate triplet, generating an alignment confidence value for each candidate triplet. If the alignment confidence value is greater than a first threshold, the candidate triplet is stored in the main storage area; if the alignment confidence value is greater than or equal to a second threshold and less than or equal to a first threshold, the candidate triplet is stored in the secondary storage area. This achieves the migration of triples recorded between the main storage area and the secondary storage area.

[0145] In another optional embodiment, on-demand realignment further includes: when the realigned confidence value is lower than a third threshold, marking the triple as pending review and pushing it to a manual verification interface; using the manually verified correct triples and their alignment results as training samples to update the semantic vector generation model. The third threshold is less than the second threshold. When the recalculated confidence value is lower than the third threshold, indicating a severe drift, manual intervention is triggered to ensure the accuracy of the knowledge.

[0146] In this embodiment, the knowledge graph update time after the standard semantic file upgrade is reduced by using an on-demand realignment strategy instead of full realignment.

[0147] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0148] Based on the same inventive concept, this application also provides a knowledge graph generation apparatus for power grid services, which implements the aforementioned knowledge graph generation method for power grid services. The solution provided by this apparatus is similar to the implementation described in the above method. Therefore, the specific limitations in one or more embodiments of the knowledge graph generation apparatus for power grid services provided below can be found in the limitations of the knowledge graph generation method for power grid services described above, and will not be repeated here.

[0149] In one exemplary embodiment, such as Figure 6 As shown, a knowledge graph generation device for power grid services is provided, comprising: an acquisition module 601, an alignment module 602, a storage module 603, and a determination module 604, wherein:

[0150] The acquisition module 601 is used to acquire the standard semantic file of power grid business and extract candidate triples from multi-source business documents.

[0151] Alignment module 602 is used to perform semantic alignment operation on each candidate triple based on the standard semantic file and generate an alignment confidence value corresponding to each candidate triple.

[0152] Storage module 603 is used to store candidate triples in the main storage area if the alignment confidence value is greater than a first threshold; and to store candidate triples in the secondary storage area if the alignment confidence value is greater than or equal to a second threshold and less than or equal to the first threshold; wherein the first threshold is greater than the second threshold.

[0153] The determination module 604 is used to determine the knowledge graph of power grid business based on all triples stored in the main storage area and the secondary storage area.

[0154] In an exemplary embodiment, the standard semantic file includes an entity type set and a relation type set; the entity type set includes standard entity types, and the relation type set includes standard relations, with each standard entity type and each standard relation corresponding to a standard semantic vector; the alignment module 602 is further configured to encode the candidate triples to obtain a candidate semantic vector corresponding to each element in the candidate triples, and to determine the target similarity score of each candidate triple based on the candidate semantic vector and each standard semantic vector; wherein, the elements include candidate head entities, candidate relations, and candidate tail entities; for each candidate triple, the context word sequence of each element in the candidate triple in the multi-source business document is obtained, and the context consistency score of the candidate triple is determined based on the context word sequence; wherein, the context word sequence includes at least one of context entities, context relations, and context attributes; for each candidate triple, the path constraint score of the candidate triple is determined based on the candidate relations in the triple and the standard relations in the relation type set; and the alignment confidence value of each candidate triple is determined based on the target similarity score, context consistency score, and path constraint score of the same candidate triple.

[0155] In an exemplary embodiment, the standard semantic file includes a set of relation path templates; the alignment module 602 is further configured to search for the existence of a target relation path template in the set of relation path templates using the target search conditions when the candidate relation in the candidate triple does not exist in the set of relation types; wherein, the target search conditions include taking the first entity type to which the candidate head entity belongs as the search starting point and the second entity type to which the candidate tail entity belongs as the search ending point; the target relation path template is a relation path template connecting the first entity type and the second entity type; the relation path template is an ordered relation chain from the starting entity type to the target entity type; if a target relation path template exists, the candidate relation is modified to the standard relation corresponding to the target relation path template, and a path constraint score for the candidate triple is generated based on the semantic similarity between the standard relation and the candidate relation.

[0156] In an exemplary embodiment, the candidate semantic vectors include a first candidate semantic vector, a second candidate semantic vector, and a third candidate semantic vector; the first candidate semantic vector corresponds to a candidate head entity; the second candidate semantic vector corresponds to a tail entity; and the third candidate semantic vector corresponds to a candidate relation. The alignment module 602 is further configured to perform cosine similarity calculations on the first and second candidate semantic vectors with the standard semantic vectors of each standard entity type in the entity type set, respectively, to determine a first set of similarity values ​​and a second set of similarity values ​​corresponding to each standard entity type; perform cosine similarity calculations on the third candidate semantic vector with the standard semantic vectors of each standard relation in the relation type set, to obtain a third set of similarity values ​​corresponding to each standard relation; take the maximum value from the first set of similarity values ​​as the head entity similarity score; take the maximum value from the second set of similarity values ​​as the tail entity similarity score; take the maximum value from the third set of similarity values ​​as the relation similarity score; and take the minimum value among the head entity similarity score, relation similarity score, and tail entity similarity score as the target similarity score of the candidate triple.

[0157] In an exemplary embodiment, the knowledge graph generation device for power grid business further includes a reasoning module, which receives a user's natural language query, parses the natural language query to obtain the query entity and query intent; performs a multi-hop graph traversal search in the main storage area starting from the query entity according to the query intent to determine the first triplet; if the first triplet satisfies the answer requirements of the query intent, then determines the first natural language answer based on the first triplet and outputs it; if the first triplet does not satisfy the answer requirements of the query intent, then encodes the natural language query into a query vector and performs semantic similarity search in the secondary storage area to obtain the second triplet; and determines the second natural language answer based on the first triplet and the second triplet and outputs it.

[0158] In an exemplary embodiment, the knowledge graph generation apparatus for power grid services further includes an update module, configured to, when a first triplet is hit from the main storage area and / or a second triplet is hit from the secondary storage area, use the hit first triplet and / or the second triplet as new candidate triplets, and obtain a new version of the standard semantic file according to the version change log; wherein, the version change log is a log recorded when the standard semantic file undergoes a version change; re-execute the semantic alignment operation based on the standard semantic file for each candidate triplet to generate an alignment confidence value corresponding to each candidate triplet; if the alignment confidence value is greater than a first threshold, store the candidate triplet in the main storage area; if the alignment confidence value is greater than or equal to a second threshold and less than or equal to the first threshold, store the candidate triplet in the secondary storage area.

[0159] The modules in the aforementioned knowledge graph generation device for power grid business can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0160] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores a knowledge graph. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a knowledge graph generation method for power grid operations.

[0161] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0162] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0163] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0164] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0165] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0166] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0167] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for generating knowledge graphs for power grid business, characterized in that, The method includes: Obtain the standard semantic file of power grid business and extract candidate triples from multi-source business documents; Based on the standard semantic file, a semantic alignment operation is performed on each candidate triple to generate an alignment confidence value for each candidate triple. If the alignment confidence value is greater than the first threshold, the candidate triplet is stored in the main storage area; if the alignment confidence value is greater than or equal to the second threshold and less than or equal to the first threshold, the candidate triplet is stored in the secondary storage area; wherein, the first threshold is greater than the second threshold. Based on all the triples stored in the main storage area and the secondary storage area, the knowledge graph of the power grid business is determined.

2. The method according to claim 1, characterized in that, The standard semantic file includes a set of entity types and a set of relation types; the set of entity types includes standard entity types, and the set of relation types includes standard relations, with each standard entity type and each standard relation corresponding to a standard semantic vector; The step of performing semantic alignment operation on each candidate triple based on the standard semantic file to generate an alignment confidence value corresponding to each candidate triple includes: The candidate triples are encoded to obtain a candidate semantic vector corresponding to each element in the candidate triples. Based on the candidate semantic vectors and each of the standard semantic vectors, a target similarity score is determined for each candidate triple. The elements include candidate head entities, candidate relations, and candidate tail entities. For each candidate triplet, obtain the context word sequence of each element in the candidate triplet in the multi-source business document, and determine the context consistency score of the candidate triplet based on the context word sequence; wherein, the context word sequence includes at least one of context entities, context relations and context attributes; For each candidate triple, the path constraint score of the candidate triple is determined based on the candidate relation in the triple and the standard relation in the relation type set. Based on the target similarity score, the context consistency score, and the path constraint score of the same candidate triple, the alignment confidence value of each candidate triple is determined.

3. The method according to claim 2, characterized in that, The standard semantic file includes a set of relation path templates; determining the path constraint score of the candidate triples based on the candidate relations in the triples and the standard relations in the set of relation types includes: When the candidate relation in the candidate triple does not exist in the relation type set, the search is performed in the relation path template set to determine if a target relation path template exists. The target search conditions include using the first entity type to which the candidate head entity belongs as the starting point and the second entity type to which the candidate tail entity belongs as the ending point. The target relation path template is a relation path template connecting the first entity type and the second entity type. The relation path template is an ordered relation chain from the starting entity type to the target entity type. If the target relation path template exists, the candidate relation is modified to the standard relation corresponding to the target relation path template, and the path constraint score of the candidate triple is generated based on the semantic similarity between the standard relation and the candidate relation.

4. The method according to claim 2, characterized in that, The candidate semantic vectors include a first candidate semantic vector, a second candidate semantic vector, and a third candidate semantic vector; the first candidate semantic vector corresponds to the candidate head entity; the second candidate semantic vector corresponds to the tail entity; and the third candidate semantic vector corresponds to the candidate relation. The step of determining the target similarity score for each candidate triplet based on the candidate semantic vectors and each of the standard semantic vectors includes: The first candidate semantic vector and the second candidate semantic vector are respectively compared with the standard semantic vector of each standard entity type in the entity type set by calculating cosine similarity, and the first set of similarity values ​​and the second set of similarity values ​​corresponding to each standard entity type are determined. The cosine similarity between the third candidate semantic vector and the standard semantic vector of each standard relation in the relation type set is calculated to obtain the third set of similarity values ​​corresponding to each standard relation. The maximum value from the first set of similarity values ​​is taken as the head entity similarity score; the maximum value from the second set of similarity values ​​is taken as the tail entity similarity score; and the maximum value from the third set of similarity values ​​is taken as the relation similarity score. The minimum value among the head entity similarity score, the relation similarity score, and the tail entity similarity score is taken as the target similarity score of the candidate triple.

5. The method according to any one of claims 1-4, characterized in that, The method further includes: Receive a user's natural language query, parse the natural language query, and obtain the query entity and query intent; According to the query intent, a multi-hop graph traversal search is performed in the main storage area starting from the query entity to determine the first triplet that is hit. If the first triplet satisfies the answer requirement of the query intent, then the first natural language answer is determined and output based on the first triplet; If the first triplet does not meet the answer requirements of the query intent, the natural language query is encoded into a query vector, and semantic similarity is retrieved in the secondary storage area to obtain the second triplet; the first triplet and the second triplet are used to determine the second natural language answer and output it.

6. The method according to claim 5, characterized in that, The method further includes: When a first triplet is hit from the primary storage area and / or a second triplet is hit from the secondary storage area, the hit first triplet and / or the second triplet are used as new candidate triplets, and the new version of the standard semantic file is obtained according to the version change log; wherein, the version change log is a log recorded when the standard semantic file undergoes a version change; Re-execute the semantic alignment operation for each candidate triple based on the standard semantic file to generate an alignment confidence value for each candidate triple; if the alignment confidence value is greater than a first threshold, store the candidate triple in the main storage area; if the alignment confidence value is greater than or equal to a second threshold and less than or equal to the first threshold, store the candidate triple in the secondary storage area.

7. A knowledge graph generation device for power grid business, characterized in that, The device includes: The acquisition module is used to acquire standard semantic files of power grid business and extract candidate triples from multi-source business documents; The alignment module is used to perform semantic alignment operations on each candidate triple based on the standard semantic file and generate an alignment confidence value for each candidate triple. The storage module is configured to store the candidate triplet in the main storage area if the alignment confidence value is greater than a first threshold; and to store the candidate triplet in the secondary storage area if the alignment confidence value is greater than or equal to a second threshold and less than or equal to the first threshold; wherein the first threshold is greater than the second threshold. The determination module is used to determine the knowledge graph of the power grid business based on all the triples stored in the main storage area and the secondary storage area.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.