A power fault knowledge graph reasoning method and system
By generating and optimizing the logical rules and joint embedding of the power fault knowledge graph through a large language model, the problem of insufficient semantic information understanding and cross-domain reasoning capabilities of the power knowledge graph is solved, and more efficient and accurate fault diagnosis is achieved.
Patent Information
- Application Number
- CN202510205663.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-02-25
AI Technical Summary
Existing power knowledge graph reasoning methods are insufficient in semantic information understanding and cross-domain reasoning capabilities, making it difficult to effectively handle complex power equipment fault diagnosis and monitoring tasks.
A large language model is used to generate logical rules. Existing rules and external knowledge are combined to generate high-confidence rules through depth-first search and rule sorter. Joint embedding and iterative updates are performed to optimize entity and relationship embedding.
It significantly improves the accuracy and reliability of knowledge graph reasoning, solves the problems of data sparsity and weak cross-domain reasoning, and improves the efficiency and accuracy of fault diagnosis.
Smart Images

Figure CN119692485B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of knowledge graph reasoning, and in particular relates to a power fault knowledge graph reasoning method and system. Background Art
[0002] With the continuous advancement of automation technology in modern industry, the complexity of power equipment systems is also increasing. Prolonged operation and incorrect operation can cause power equipment failures, leading to serious safety incidents. Reliability is crucial in power equipment systems. Reliability requires that equipment must be able to perform its required functions without failure under specific conditions and at specific times. Fault diagnosis is one way to ensure reliability, and therefore equipment fault diagnosis and detection have become a hot technology in the power industry.
[0003] Existing technologies employ knowledge-driven fault diagnosis methods. Using a given knowledge base and inference engine, they apply reasoning methods to known facts in the knowledge base to infer new facts. Since only established facts collected from the knowledge base are used, no expert-designed logic or rules are required. Knowledge Graph Embedding (KGE) technology has been widely used in knowledge graph reasoning and has gradually become a mainstream approach. These methods map entities and relationships into a low-dimensional vector space and leverage the geometric relationships in the embedded space for reasoning. However, a limitation of embedded methods is that they primarily reason based on structural information, with limited understanding of semantic information and multi-relationship modeling.
[0004] Power knowledge graphs are primarily used in areas such as equipment management, fault diagnosis, and production monitoring, providing data-driven intelligent support for industrial systems. Reasoning in power knowledge graphs often faces challenges such as data noise, incomplete data, and complex spatiotemporal dependencies. Existing technologies for knowledge graph reasoning in the power sector have significant shortcomings, limiting their application in large-scale power knowledge graphs. These shortcomings include:
[0005] 1. Weak understanding of semantic information: Current mainstream knowledge graph embedding methods (such as TransE and TransH) primarily reason based on structural information, mapping entities and relationships into a low-dimensional vector space and performing reasoning through geometric calculations. This approach has good processing capabilities for the topological structure of knowledge graphs, but struggles to capture the deep connections between complex semantics.
[0006] 2. Insufficient cross-domain reasoning capabilities: Reasoning tasks in power knowledge graphs often involve multiple heterogeneous data sources, such as sensor data, historical fault records, and maintenance logs. However, existing embedding models can typically only process explicit information within the graph and have limited ability to capture implicit relationships between cross-domain data. Summary of the Invention
[0007] In order to address the deficiencies in the prior art, the present invention provides a power fault knowledge graph reasoning method and system, which utilizes a large language model to realize fault reasoning in the power field, and solves the problems of data sparsity and weak cross-domain reasoning in the power fault knowledge graph.
[0008] In order to solve the above technical problems, the present invention adopts the following technical solutions.
[0009] The present invention first discloses a power fault knowledge graph reasoning method, which includes the following steps:
[0010] Obtain the industrial fault knowledge graph, build a rule generator based on the big model, combine existing rules and prompt templates to generate fault information logic rules, and pre-process the generated rules based on rule quality assessment indicators;
[0011] Entities in the industrial fault knowledge graph are subjected to open-world knowledge guidance to obtain entity description embeddings, and the entity description embeddings are concatenated with the original entity embeddings in the industrial fault knowledge graph to obtain a joint embedding;
[0012] The pre-processed fault information logic rules are iteratively injected into the joint embedding, and the learning entities and relationships in the joint embedding are embedded and updated to obtain the inference result of the fault device.
[0013] The present invention further includes the following preferred embodiments:
[0014] The obtaining of the industrial field fault knowledge graph further includes:
[0015] Use depth-first search to sample multiple paths from the knowledge graph, which are instantiated logical rules;
[0016] Given a triple , define the closed path p as connecting the knowledge graph and Relationship sequence ;
[0017] Given relationship , first select the anchor triple set { }, and use the depth-first search algorithm to sample a set of paths {p} with length less than m from these anchor triples, and construct a set of rules ; Use variables to replace entities and relations in rule p to obtain rule samples ; Input the rule sample into LLM, according to the target relationship The relationships discovered , representing special symbols in relation names as natural statements.
[0018] The rule-based quality assessment indicator pre-processes the generated rules, further comprising:
[0019] The rule sorter is used to evaluate and sort the quality evaluation indicators of the generated rules, and the rules with quality evaluation indicators higher than the preset values are screened out for use in reasoning tasks.
[0020] The quality assessment indicators include support, coverage, confidence and PCA confidence.
[0021] The step of concatenating the entity description embedding with the original entity embedding in the industrial fault knowledge graph to obtain a joint embedding further includes:
[0022] Extract the text embeddings of all entities in the knowledge graph, obtain relevant knowledge supplements in the open world by querying the large model, and integrate the knowledge within the graph and the open world layer by layer to achieve semantically unified expression of multi-source knowledge.
[0023] The step of concatenating the entity description embedding with the original entity embedding in the industrial fault knowledge graph to obtain a joint embedding further includes:
[0024] Get the entity set in the knowledge graph , for each entity in the collection , in Euclidean space Get the entity embedding inside the knowledge graph , relation embedding , and large models embedding open-world natural descriptions of entities , concatenate the embeddings of the open world and the knowledge graph to obtain the joint entity embedding :
[0025] .
[0026] The iterative injection of the pre-processed fault information logic rules into the joint embedding, embedding and updating the learned entities and relationships in the joint embedding to obtain the inference result of the fault device further includes:
[0027] Use t-norm fuzzy logic to model rules. Through specific logical connectives, the truth value of a complex formula is defined as the truth value combination of its components. Given a logical rule and basic rules , the true value is calculated as:
[0028] ,
[0029] The scoring function of the fault knowledge graph reasoning on the triple corresponds to the truth value calculation of the triple. The scoring function is based on the TransE model and is used to calculate the truth value of the triple, as shown in the following formula:
[0030] ,
[0031] Where d is the vector dimension of the embedding space, For the joint embedding in open world and knowledge graph, 、 、 Under the conditions, ;
[0032] Minimize the global loss of the fault knowledge graph representation to learn and update entity and relation embeddings;
[0033] Construct a training set P containing all positive logic rule instances, that is, the rule instances consisting of the generated rules and the real triples of the knowledge graph, and then use the ranking loss that minimizes the margin to make the positive logic rule instances have a larger truth value than the negative logic rule instances. The objective function is:
[0034] ,
[0035] in, represents a positive logic rule instance, Represents a negative logic rule instance, which is constructed by randomly replacing the relations in P; is a hyperparameter partition that separates positive and negative regular instances, express .
[0036] The present invention also discloses a power fault knowledge graph reasoning system using the aforementioned power fault knowledge graph reasoning method, comprising:
[0037] The rule generation module is used to obtain the industrial fault knowledge graph, build a rule generator based on the large model, combine existing rules and prompt templates to generate fault information logic rules, and pre-process the generated rules based on the rule quality evaluation indicators;
[0038] A joint embedding module is used to embed entity descriptions of entities in the industrial fault knowledge graph through open-world knowledge guidance, and then concatenate the entity description embeddings with the original entity embeddings in the industrial fault knowledge graph to obtain a joint embedding.
[0039] The inference module is used to iteratively inject the pre-processed fault information logic rules into the joint embedding, embed and update the learning entities and relationships in the joint embedding, and obtain the inference result of the faulty device.
[0040] The present invention further includes the following preferred embodiments:
[0041] The obtaining of the industrial field fault knowledge graph further includes:
[0042] Use depth-first search to sample multiple paths from the knowledge graph, which are instantiated logical rules;
[0043] Given a triple , define the closed path p as connecting the knowledge graph and Relationship sequence ;
[0044] Given relationship , first select the anchor triple set { }, and use the depth-first search algorithm to sample a set of paths {p} with length less than m from these anchor triples, and construct a set of rules ; Use variables to replace entities and relations in rule p to obtain rule samples ; Input the rule sample into LLM, according to the target relationship The relationships discovered , representing special symbols in relation names as natural statements.
[0045] The rule-based quality assessment indicator pre-processes the generated rules, further comprising:
[0046] The rule sorter is used to evaluate and sort the quality evaluation indicators of the generated rules, and the rules with quality evaluation indicators higher than the preset values are screened out for use in reasoning tasks.
[0047] The quality assessment indicators include support, coverage, confidence and PCA confidence.
[0048] The step of concatenating the entity description embedding with the original entity embedding in the industrial fault knowledge graph to obtain a joint embedding further includes:
[0049] Extract the text embeddings of all entities in the knowledge graph, obtain relevant knowledge supplements in the open world by querying the large model, and integrate the knowledge within the graph and the open world layer by layer to achieve semantically unified expression of multi-source knowledge.
[0050] The step of concatenating the entity description embedding with the original entity embedding in the industrial fault knowledge graph to obtain a joint embedding further includes:
[0051] Get the entity set in the knowledge graph , for each entity in the collection , in Euclidean space Get the entity embedding inside the knowledge graph , relation embedding , and large models embedding open-world natural descriptions of entities , concatenate the embeddings of the open world and the knowledge graph to obtain the joint entity embedding :
[0052] .
[0053] The iterative injection of the pre-processed fault information logic rules into the joint embedding, embedding and updating the learned entities and relationships in the joint embedding to obtain the inference result of the fault device further includes:
[0054] Use t-norm fuzzy logic to model rules. Through specific logical connectives, the truth value of a complex formula is defined as the truth value combination of its components. Given a logical rule and basic rules , the true value is calculated as:
[0055] ,
[0056] The scoring function of the fault knowledge graph reasoning on the triple corresponds to the truth value calculation of the triple. The scoring function is based on the TransE model and is used to calculate the truth value of the triple, as shown in the following formula:
[0057] ,
[0058] Where d is the vector dimension of the embedding space, For the joint embedding in open world and knowledge graph, 、 、 Under the conditions, ;
[0059] Minimize the global loss of the fault knowledge graph representation to learn and update entity and relation embeddings;
[0060] Construct a training set P containing all positive logic rule instances, that is, the rule instances consisting of the generated rules and the real triples of the knowledge graph, and then use the ranking loss that minimizes the margin to make the positive logic rule instances have a larger truth value than the negative logic rule instances. The objective function is:
[0061] ,
[0062] in, represents a positive logic rule instance, Represents a negative logic rule instance, which is constructed by randomly replacing the relations in P; is a hyperparameter partition that separates positive and negative regular instances, express .
[0063] Accordingly, the present application also discloses a terminal, including a processor and a storage medium;
[0064] The storage medium is used to store instructions;
[0065] The processor is used to operate according to the instructions to execute the steps of the aforementioned power fault knowledge graph reasoning method.
[0066] Correspondingly, the present application also discloses a computer-readable storage medium on which a computer program is stored, which, when executed by a processor, implements the steps of the aforementioned power fault knowledge graph reasoning method.
[0067] The beneficial effect of the present invention is that, compared with the existing technology, the present invention provides a power fault knowledge graph reasoning method and system, which significantly enhances the accuracy of knowledge graph reasoning by utilizing a large language model to generate new rules with higher confidence and optimize existing rules; combining existing rules and external knowledge generation mechanisms, it effectively fills the information gaps in the knowledge graph caused by data scarcity or incomplete collection, making the reasoning results in sparse data scenarios more reliable, and solving the problems of reasoning accuracy, insufficient data sparsity and so on in the existing technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 It is an overall framework diagram of the present invention based on the ChatFD model. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solutions and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0070] The embodiments described in this application are only part of the embodiments of the present invention, not all of the embodiments. Based on the spirit of the present invention, other embodiments obtained by ordinary technicians in this field without making creative work are all within the scope of protection of the present invention.
[0071] In response to the shortcomings of the existing technology, the present invention proposes a power fault knowledge graph reasoning method and system, including the steps of ChatFD model construction and rule generation, external knowledge prompt template design, rule and joint embedding integration and iterative training. New rules are generated by combining existing rules and prompt templates, and the confidence is calculated to optimize the generated rules; external knowledge prompt templates are designed to generate joint embeddings to enhance the expression ability of multi-source heterogeneous data. The new rules and joint embeddings are injected into the model for multiple rounds of optimization to achieve efficient reasoning and fault diagnosis of power equipment. By introducing a large language model and utilizing its powerful understanding and generation capabilities of natural language, the defects of traditional embedding models in the semantic dimension are effectively supplemented. By combining the large language model to generate new rules, the knowledge gaps in the data graph are filled, and the problems of data sparsity and weak spatiotemporal dependency modeling in the power knowledge graph are solved, thereby improving the reasoning efficiency, accuracy and interpretability.
[0072] The overall architecture of ChatFD, an industrial fault graph reasoning framework based on a large language model, is as follows: Figure 1 As shown. Specifically, in module (1), the entire industrial fault knowledge graph is input and the large model is used to generate logical rules. In module (2), the entity description is embedded through the open world knowledge guidance and jointly embedded with the original entity embedding. In module (3), the logical rules are iteratively injected into the joint embedding to update the entity and relationship embedding. The external knowledge and rule generation bottom layer of modules (1) and (2) are represented as the ChatFD decoding layer. The decoding layer structure of ChatFD adopts the decoder design based on Transformer, which can generate text.
[0073] The power fault knowledge graph reasoning method disclosed in the present invention includes the following steps:
[0074] Step 1: Obtain the industrial fault knowledge graph, build a rule generator based on the big model, combine existing rules and prompt templates to generate fault information logic rules, and preprocess the generated rules based on the rule quality evaluation indicators.
[0075] The rule generator of the present invention fully utilizes the semantic and structural information of a large amount of training knowledge in a large model to generate rules for reasoning fault information.
[0076] In order to enable the large model to fully understand the structure of the knowledge graph (KG) for logical rule mining, this paper adopts depth-first search (DFS) to sample multiple paths from the KG, which are instantiated logical rules. , define the closed path p as connecting the knowledge graph and Relationship sequence .
[0077] Given relationship , first select the anchor triple set { }, and use the DFS algorithm to sample a set of paths {p} with a length less than m from these anchor triples to form a rule instance , for example, the rule instance shown below.
[0078] ,
[0079] The above formula indicates that the type of grounding cable is power supply equipment. If the power supply equipment fails, the fault level is level 4. Therefore, the fault level of the grounding cable failure is also level 4. Next, use variables to replace the rule instance. The entities and relationships in the rule sample When rule samples are input into LLM, the structural information therein can promote the generation of new rules. The relationships discovered , special symbols in relation names are expressed as natural statements. The inverse relation of the original relation is expressed by adding "inv".
[0080] In order to generate more logical rules about target relations, this paper puts the processed rule samples into the prompt template, thereby using the large language model (LLM) to generate rich potential logical rules. Specifically, the prompt template is designed based on the existing entities and relations in the knowledge graph, aiming to guide the LLM to generate inference rules that meet the needs of the industrial field in the semantic context of the open world. Given an anchor relationship , prompt template q and ChatFD decoding layer CD_DL, the specific boot process is:
[0081] ,
[0082] in is used Generated rule samples and rule-generated questions and template-generated questions. These are the rules ultimately generated by the LLM. LLMs can experience hallucinations when generating rules, manifesting as rules that may not conform to actual logic or background knowledge. To address this hallucination problem in large language model rule generation, this paper proposes a rule ranker, which evaluates and ranks the quality of generated rules, thereby selecting rules with quality assessment indicators exceeding preset values for use in inference tasks. The rule ranker's design incorporates multiple quality assessment metrics, including support, coverage, confidence, and PCA confidence.
[0083] Step 2: The entities in the industrial fault knowledge graph are subjected to open-world knowledge guidance to obtain entity description embeddings, and the entity description embeddings are spliced with the original entity embeddings in the industrial fault knowledge graph to obtain a joint embedding.
[0084] Specifically, we first extract the text embeddings of all entities in the KG, and then query the LLM to obtain relevant knowledge supplements in the open world. On this basis, this paper proposes a joint embedding method based on a hierarchical clustering structure, which integrates the knowledge inside the graph and the open world layer by layer, thereby achieving a unified semantic expression of multi-source knowledge. The entity set in the fault knowledge graph is , for each entity in the collection , the present invention is in Euclidean space Get the entity embedding inside the KG , relation embedding , and LLM's open-world natural description of entity generation Embed Specifically, given an anchor entity , prompt template qe and ChatFD decoding layer CD_DL proposed by the present invention, the specific entity natural description process is shown in the following formula:
[0085] ,
[0086] in is through the use of and rule-generated questions and template-generated questions. The natural description of the entity finally generated by LLM. Finally, the embeddings of the open world and the knowledge graph are spliced to obtain the joint entity embedding , as shown below:
[0087] ,
[0088] Step 3: Iteratively inject the pre-processed fault information logic rules into the joint embedding, embed and update the learned entities and relationships in the joint embedding, and obtain the inference result of the faulty device.
[0089] In order to better iteratively inject the generated logical rules into entity and relationship embedding, it is necessary to model the rules and convert the abstract rules into positive values corresponding to the rules. This paper uses t-norm fuzzy logic to model the rules. Through specific logical connectives, the truth value of a complex formula is defined as the truth value combination of its components. Given a logical rule and basic rules , the true value is calculated as follows:
[0090] ,
[0091] In the above formula, the larger the truth value is, the more the basic rule satisfies the requirements. The scoring function of the fault knowledge graph reasoning on the triple corresponds to the truth value calculation of the triple. The scoring function is based on the TransE model and is used to calculate the truth value of the triple, as shown in the following formula:
[0092] ,
[0093] Where d is the vector dimension of the embedding space, For the joint embedding in open world and knowledge graph, 、 、 Under the conditions, ,and The larger the value, the more likely the triple is to be true. The present invention minimizes the global loss of fault knowledge graph representation to learn and update entity and relation embeddings.
[0094] The present invention first constructs a training set P containing all positive logic rule instances, i.e., rule instances consisting of generative rules and real triples in the knowledge graph. A ranking loss that minimizes margins is then used to ensure that positive logic rule instances have greater truth values than negative logic rule instances. The final objective function is:
[0095] ,
[0096] in, represents a positive logic rule instance, Represents a negative logic rule instance, which is constructed by randomly replacing relations in P. is a hyperparameter partition that separates positive and negative regular instances, express .
[0097] The specific experimental example includes two steps: preprocessing of the original dataset and knowledge graph reasoning using the ChatFD model, as shown below.
[0098] 1. Preprocessing of original dataset
[0099] Since there are currently no publicly available knowledge graph fault diagnosis datasets in the industrial sector, this paper constructed a rail transit knowledge graph fault diagnosis dataset, RailTransitKG, based on data from a rail transit company's daily equipment usage records. Furthermore, to test the ChatFD model's performance on general knowledge graphs, this paper also evaluated the ChatFD model on the FB15k-237 dataset.
[0100] The entity-relationship ontology in RailTransitKG includes 25 relationships and 20 entity types. These include entity types such as "fault cause," "fault type," "equipment name," "equipment type," and "location," as well as relationships between entities such as "superior location," "superior specialty," and "fault symptom." Table 1 lists some of these entity-relationship ontology structures. Considering the high cost of inference on large models, we randomly sampled 100 data points from the test set for testing.
[0101] 2. ChatFD model for knowledge graph reasoning
[0102] The model structure diagram is as follows Figure 1 As shown. Since Alitong Yiqianwen performs well in domestic large models, this paper uses the API of Alitong Yiqianwen large model to implement ChatFD. The compared models include three types of methods:
[0103] (1) Methods based on traditional deep learning: including RGCN, ConvE and RotatE models.
[0104] (2) Methods based on neural-symbolic reasoning, which effectively combine the rules existing in the knowledge graph with deep learning methods. Including IterE and RPJE models.
[0105] (3) The ChatFD model based on other large models, including the Alitong Qianwen, LLaMA, iFlytek Xinghuo and Tsinghua ChatGLM models.
[0106] Table 1 shows the results of comparative experiments on fault diagnosis based on knowledge graphs. First, ChatFD achieved the best results when compared with traditional deep learning methods (RGCN, ConvE, and RotatE). This is primarily due to the fact that traditional deep learning methods only utilize triple knowledge within the knowledge graph, while ChatFD fully leverages the rich semantics of entities in the external world, improving fault diagnosis effectiveness. Furthermore, these methods fail to consider the logical rules within the knowledge graph, which contain rich contextual information that facilitates knowledge acquisition and reasoning. This prevents these embedding models from achieving more accurate entity and relationship embedding representations, and their performance is significantly inferior to the ChatFD model proposed in this paper.
[0107] Secondly, on both datasets, ChatFD outperformed neural-symbolic reasoning methods (IterE and RPJE). While these methods leverage contextual information from the knowledge graph's internal logical rules, ChatFD enriches the embedding of entities within the knowledge graph using entity descriptions obtained from the external world by a large model. This ultimately led to ChatFD's superiority over these neural-symbolic reasoning methods, demonstrating that incorporating external knowledge into knowledge graphs can improve fault diagnosis.
[0108] Table 1
[0109]
[0110] The beneficial effect of the present invention is that, compared with the existing technology, the present invention provides a power fault knowledge graph reasoning method and system, which significantly enhances the accuracy of knowledge graph reasoning by utilizing a large language model to generate new rules with higher confidence and optimize existing rules; combining existing rules and external knowledge generation mechanisms, it effectively fills the information gaps in the knowledge graph caused by data scarcity or incomplete collection, making the reasoning results in sparse data scenarios more reliable, and solving the problems of reasoning accuracy, insufficient data sparsity and so on in the existing technology.
[0111] The present invention may be a system, method and / or computer program product. The present invention also discloses a power fault knowledge graph reasoning system based on the aforementioned power fault knowledge graph reasoning method, comprising:
[0112] The rule generation module is used to obtain the industrial fault knowledge graph, build a rule generator based on the large model, combine existing rules and prompt templates to generate fault information logic rules, and pre-process the generated rules based on the rule quality evaluation indicators;
[0113] A joint embedding module is used to embed entity descriptions of entities in the industrial fault knowledge graph through open-world knowledge guidance, and then concatenate the entity description embeddings with the original entity embeddings in the industrial fault knowledge graph to obtain a joint embedding.
[0114] The inference module is used to iteratively inject the pre-processed fault information logic rules into the joint embedding, embed and update the learning entities and relationships in the joint embedding, and obtain the inference result of the faulty device.
[0115] Based on the spirit of the present invention, those skilled in the art can easily conceive of a computer program product based on the aforementioned power failure knowledge graph reasoning method. This computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure. Specifically, the present application also includes a terminal comprising a processor and a storage medium; the storage medium is configured to store instructions; and the processor is configured to operate according to the instructions to execute the steps of the aforementioned power failure knowledge graph reasoning method.
[0116] A computer-readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof. The computer-readable storage medium used herein is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0117] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.
[0118] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, the state information of the computer-readable program instructions is used to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), so that the electronic circuit can execute the computer-readable program instructions, thereby implementing various aspects of the present disclosure.
[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.
Claims
1. A power fault knowledge graph reasoning method, characterized in that: The following steps are involved: Obtain the industrial fault knowledge graph, build a rule generator based on the big model, combine existing rules and prompt templates to generate fault information logic rules, and pre-process the generated rules based on rule quality assessment indicators; The processed rule samples are placed into the prompt template to generate latent logic rules using the large language model (LLM). The prompt template is designed based on the entities and relationships in the knowledge graph, guiding the LLM to generate inference rules that meet industrial needs in the semantic context of the open world. Given an anchor relationship x, a prompt template q, and a ChatFD decoding layer CD_DL, the specific guidance process is as follows: p(r|x,q,CD_DL)=p(r|x,q1) where q1 is a regular sample R generated using x rm and rule-generated questions and template-generated questions; r is the rule finally generated by LLM; Entities in the industrial fault knowledge graph are subjected to open-world knowledge guidance to obtain entity description embeddings, and the entity description embeddings are concatenated with the original entity embeddings in the industrial fault knowledge graph to obtain a joint embedding; Iteratively injecting the pre-processed fault information logic rules into the joint embedding, embedding and updating the learned entities and relations in the joint embedding to obtain the inference result of the faulty device; The iterative injection of the pre-processed fault information logic rules into the joint embedding, embedding and updating the learned entities and relationships in the joint embedding to obtain the inference result of the fault device further includes: Use t-norm fuzzy logic to model rules. Through specific logical connectives, the truth value of a complex formula is defined as the truth value combination of its components. Given a logical rule and basic rules The true value is calculated as: I(p)=I(e s ,r q1 ,e te ).I(e te ,r q2 ,e o ).I(e s ,r h ,e o )-I(e s ,r q1 ,e te ).I(e te ,r q2 ,e o )+1 I(.) represents the scoring function of the fault knowledge graph reasoning on the triple, which corresponds to the truth value calculation of the triple. The scoring function is based on the TransE model and is used to calculate the truth value of the triple, as shown in the following formula: Where d is the vector dimension of the embedding space, e s ,r,e o For the joint embedding in the open world and knowledge graph, in ||e s ||≤1, ||e o Under the conditions of ||≤1, ||r||≤1, I(e s ,r,e o )∈(0,1); Minimize the global loss of the fault knowledge graph representation to learn and update entity and relation embeddings; Construct a training set P containing all positive logic rule instances, that is, the rule instances consisting of the generated rules and the real triples of the knowledge graph, and then use the ranking loss that minimizes the margin to make the positive logic rule instances have a larger truth value than the negative logic rule instances. The objective function is: Among them, p + ∈P represents a positive logic rule instance, p - ∈P - represents a negative logic rule instance, which is constructed by randomly replacing the relations in P; η is a hyperparameter partition that separates positive and negative rule instances, [x] + represents max(0,x); The step of concatenating the entity description embedding with the original entity embedding in the industrial fault knowledge graph to obtain a joint embedding further includes: Get the entity set E in the knowledge graph = {e1,...,e |E| }, for each entity e in the set i , in Euclidean space Get the entity embedding inside the KG Relation Embedding and LLM's open-world natural description of entity generation i Embed Given the anchor entity y, the hint template qe, and the ChatFD decoding layer CD_DL, the entity natural description process is: p(d|y,qe,CD_DL)=p(d|y,q2) Where q2 is the question generated by using y and the question template generated by the rules; d is the natural description of the entity finally generated by LLM; Concatenate the embeddings of the open world and the knowledge graph to obtain the joint entity embedding v i :
2. The power fault knowledge graph reasoning method according to claim 1 is characterized in that: The obtaining of the industrial field fault knowledge graph further includes: Use depth-first search to sample multiple paths from the knowledge graph, which are instantiated logical rules; Given a triple (e1,r m ,e n ), define the closed path p as connecting e1 and e in the knowledge graph n The relationship sequence (r1, r2...r n ); Given a relation r m First, select the anchor triple set {(e,r m ,e')}, and use the depth-first search algorithm to sample a set of paths {p} with a length less than m from these anchor triples, and construct a rule set {ψ}; use variables to replace the entities and relations in the rule p to obtain the rule sample R rm ; Input the rule sample into LLM, according to the target relationship r m The mined relationship R rm , representing special symbols in relation names as natural statements.
3. The power fault knowledge graph reasoning method according to claim 2 is characterized in that: The rule-based quality assessment indicator pre-processes the generated rules, further comprising: The rule sorter is used to evaluate and sort the quality evaluation indicators of the generated rules, and the rules with quality evaluation indicators higher than the preset values are screened out for use in reasoning tasks.
4. The power fault knowledge graph reasoning method according to claim 3 is characterized in that: The quality assessment indicators include support, coverage, confidence and PCA confidence.
5. The power fault knowledge graph reasoning method according to claim 4 is characterized in that: The step of concatenating the entity description embedding with the original entity embedding in the industrial fault knowledge graph to obtain a joint embedding further includes: Extract the text embeddings of all entities in the knowledge graph, obtain relevant knowledge supplements in the open world by querying the large model, and integrate the knowledge within the graph and the open world layer by layer to achieve semantically unified expression of multi-source knowledge.
6. A power fault knowledge graph reasoning system, characterized by: include: The rule generation module is used to obtain the industrial fault knowledge graph, build a large model-based rule generator, combine existing rules and prompt templates to generate fault information logical rules, and preprocess the generated rules based on rule quality assessment indicators. The processed rule samples are placed in the prompt template, thereby using the large language model (LLM) to generate potential logical rules. The prompt template is designed based on the entities and relationships in the knowledge graph, guiding the LLM to generate inference rules that meet industrial needs in the semantic context of the open world. Given an anchor relationship x, a prompt template q, and a ChatFD decoding layer CD_DL, the specific guidance process is as follows: p(r|x,q,CD_DL)=p(r|x,q1) where q1 is a regular sample R generated using x rm and rule-generated questions and template-generated questions; r The rules finally generated for LLM; A joint embedding module is used to embed entity descriptions of entities in the industrial fault knowledge graph through open-world knowledge guidance, and then concatenate the entity description embeddings with the original entity embeddings in the industrial fault knowledge graph to obtain a joint embedding. An inference module, configured to iteratively inject the pre-processed fault information logic rules into the joint embedding, embed and update the learned entities and relations in the joint embedding, and obtain an inference result of the faulty device; The iterative injection of the pre-processed fault information logic rules into the joint embedding, embedding and updating the learned entities and relationships in the joint embedding to obtain the inference result of the fault device further includes: Use t-norm fuzzy logic to model rules. Through specific logical connectives, the truth value of a complex formula is defined as the truth value combination of its components. Given a logical rule and basic rules The true value is calculated as: I(p)=I(e s ,r q1 ,e te ).I(e te ,r q2 ,e o ).I(e s ,r h ,e o )-I(e s ,r q1 ,e te ).I(e te ,r q2 ,e o )+1 I(.) represents the scoring function of the fault knowledge graph reasoning on the triple, which corresponds to the truth value calculation of the triple. The scoring function is based on the TransE model and is used to calculate the truth value of the triple, as shown in the following formula: Where d is the vector dimension of the embedding space, e s ,r,e o For the joint embedding in the open world and knowledge graph, in ||e s ||≤1, ||e o Under the conditions of ||≤1, ||r||≤1, I(e s ,r,e o )∈(0,1); Minimize the global loss of the fault knowledge graph representation to learn and update entity and relation embeddings; Construct a training set P containing all positive logic rule instances, that is, the rule instances consisting of the generated rules and the real triples of the knowledge graph, and then use the ranking loss that minimizes the margin to make the positive logic rule instances have a larger truth value than the negative logic rule instances. The objective function is: Among them, p + ∈P represents a positive logic rule instance, p - ∈P - represents a negative logic rule instance, which is constructed by randomly replacing the relations in P; η is a hyperparameter partition that separates positive and negative rule instances, [x] + represents max(0,x); The step of concatenating the entity description embedding with the original entity embedding in the industrial fault knowledge graph to obtain a joint embedding further includes: Get the entity set E in the knowledge graph = {e1,...,e |E| }, for each entity e in the set i , in Euclidean space Get the entity embedding inside the KG Relation Embedding and LLM's open-world natural description of entity generation i Embed Given the anchor entity y, the hint template qe, and the ChatFD decoding layer CD_DL, the entity natural description process is: p(d|y,qe,CD_DL)=p(d|y,q2) Where q2 is the question generated by using y and the question template generated by the rules; d is the natural description of the entity finally generated by LLM; Concatenate the embeddings of the open world and the knowledge graph to obtain the joint entity embedding v i :
7. The power fault knowledge graph reasoning system according to claim 6 is characterized in that: The obtaining of the industrial field fault knowledge graph further includes: Use depth-first search to sample multiple paths from the knowledge graph, which are instantiated logical rules; Given a triple (e1,r m ,e n ), define the closed path p as connecting e1 and e in the knowledge graph n The relationship sequence (r1, r2...r n ); Given a relation r m First, select the anchor triple set {(e,r m ,e')}, and use the depth-first search algorithm to sample a set of paths {p} with a length less than m from these anchor triples, and construct a rule set {ψ}; use variables to replace the entities and relations in the rule p to obtain the rule sample R rm ; Input the rule sample into LLM, according to the target relationship r m The mined relationship R rm , representing special symbols in relation names as natural statements.
8. The power fault knowledge graph reasoning system according to claim 7 is characterized in that: The rule-based quality assessment indicator pre-processes the generated rules, further comprising: The rule sorter is used to evaluate and sort the quality evaluation indicators of the generated rules, and the rules with quality evaluation indicators higher than the preset values are screened out for use in reasoning tasks.
9. The power fault knowledge graph reasoning system according to claim 8, characterized in that: The quality assessment indicators include support, coverage, confidence and PCA confidence.
10. The power fault knowledge graph reasoning system according to claim 9 is characterized in that: The step of concatenating the entity description embedding with the original entity embedding in the industrial fault knowledge graph to obtain a joint embedding further includes: Extract the text embeddings of all entities in the knowledge graph, obtain relevant knowledge supplements in the open world by querying the large model, and integrate the knowledge within the graph and the open world layer by layer to achieve semantically unified expression of multi-source knowledge.
11. A terminal comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is used to operate according to the instructions to execute the steps of the power fault knowledge graph reasoning method according to any one of claims 1-5.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the power fault knowledge graph reasoning method described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Low-voltage governance aid decision-making method fusing large language model and knowledge graph
CN118863057A
Knowledge graph relation prediction method and device, equipment and storage medium
CN119025685A
Large model and knowledge graph fusion method, application method and system
CN119226529A