Fault knowledge graph construction method, fault diagnosis method, intelligent agent and system

By optimizing the fault graph construction strategy through tasks and feedback mechanisms that search for matching historical graphs in a pre-defined vector database, the problem of low efficiency in traditional manual processing is solved, and efficient and accurate automated construction of fault knowledge graphs is achieved.

CN121638397AActive Publication Date: 2026-03-10SUNGROW (SHANGHAI) CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Traditional methods for constructing fault knowledge graphs rely on manual processing, which is inefficient, difficult to handle complex or ambiguous fault information, and prone to introducing errors and biases.

Method used

By searching for historical graph construction tasks that match the original file data in a preset vector database, and combining them with a preset feedback mechanism, the optimal knowledge graph construction strategy is determined. The knowledge graph construction tool is then called to automate the construction process, and the construction process of the fault graph is dynamically optimized.

Benefits of technology

It improves the efficiency and accuracy of fault knowledge graph construction, reduces errors and omissions, and enhances the practicality and automation level of fault graphs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121638397A_ABST
    Figure CN121638397A_ABST
Patent Text Reader

Abstract

The invention discloses a fault knowledge graph construction method, a fault diagnosis method, an intelligent agent and a system. The system comprises the steps of obtaining original file data of a to-be-constructed fault knowledge graph, searching a historical graph construction task matched with knowledge graph construction of the original file data from a preset vector database, and determining an optimal knowledge graph construction strategy based on the historical graph construction task and a preset feedback mechanism, and calling a knowledge graph construction tool based on the optimal knowledge graph construction strategy so as to construct the knowledge graph. According to the technical scheme, the historical graph construction task matched with the knowledge graph construction of the original file data is searched from the preset vector database, and the optimal knowledge graph construction strategy is determined based on the historical graph construction task and the preset feedback mechanism; and calling a knowledge graph construction tool to construct the knowledge graph based on the optimal knowledge graph construction strategy, so that the efficiency and the quality of fault knowledge graph construction can be remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to a fault knowledge graph construction method, a fault diagnosis method, an agent and a system. BACKGROUND

[0002] In order to improve the reliability and fault diagnosis efficiency of products such as new energy equipment, it is an important means to effectively organize and utilize a large amount of data such as fault case analysis reports. However, in the face of massive multi-source heterogeneous data, the traditional fault knowledge graph construction method for fault diagnosis usually inputs and processes data manually. This method is prone to errors and biases, especially when dealing with complex or ambiguous fault information. As the amount of data increases, the efficiency of pure manual processing will be greatly reduced, and it is difficult to cope with the rapid growth of information. SUMMARY

[0003] Therefore, the present application provides a fault knowledge graph construction method, a fault diagnosis method, an agent and a system, which can significantly improve the efficiency of fault knowledge graph construction.

[0004] According to an aspect of the present application, the present application embodiment provides a fault knowledge graph construction method, which comprises:

[0005] Obtaining original file data of a fault knowledge graph to be constructed;

[0006] In response to a fault graph construction instruction, searching for a historical graph construction task matched with the knowledge graph construction of the original file data from a preset vector database;

[0007] Determining an optimal knowledge graph construction strategy corresponding to the original file data based on the historical graph construction task and a preset feedback mechanism;

[0008] Calling a knowledge graph construction tool based on the optimal knowledge graph construction strategy to perform knowledge graph construction to obtain a constructed fault knowledge graph.

[0009] According to another aspect of the present application, the present application embodiment further provides a fault diagnosis method, which comprises:

[0010] Obtaining fault file data to be fault diagnosed;

[0011] Determining a fault diagnosis reason corresponding to the fault file data to be fault diagnosed based on a pre-constructed fault knowledge graph, wherein the pre-constructed fault knowledge graph is obtained by using the aforementioned fault knowledge graph construction method.

[0012] According to another aspect of the present application, the present application embodiment further provides an agent, which comprises:

[0013] An information acquisition module is configured to acquire original file data to be used for constructing a fault knowledge graph.

[0014] A searching module is configured to search, in response to a fault graph construction instruction, a historical graph construction task matched with knowledge graph construction of the original file data from a preset vector database.

[0015] A strategy determination module is configured to determine an optimal knowledge graph construction strategy corresponding to the original file data based on the historical graph construction task and a preset feedback mechanism.

[0016] A graph construction module is configured to invoke a knowledge graph construction tool from a tool invocation module based on the optimal knowledge graph construction strategy, so as to construct a knowledge graph and obtain a constructed fault knowledge graph.

[0017] According to another aspect of the present application, the embodiments of the present application further provide a fault diagnosis system, which comprises:

[0018] An information acquisition module is configured to acquire fault file data to be diagnosed.

[0019] A diagnosis module is configured to determine a fault diagnosis cause corresponding to the fault file data to be diagnosed based on a pre-constructed fault knowledge graph, wherein the pre-constructed fault knowledge graph is acquired by using the fault knowledge graph construction method.

[0020] The technical solution of the embodiments of the present application can refer to historical successful experience knowledge, continuously optimize construction of a fault graph, and improve accuracy of fault graph construction and practicability of the graph, by searching, from a preset vector database, a historical graph construction task matched with knowledge graph construction of original file data. The optimal knowledge graph construction strategy is determined based on the historical graph construction task and a preset feedback mechanism, and the optimal knowledge graph construction strategy is transmitted to an intelligent agent module. The dynamic optimization mechanism of feedback makes each fault graph construction more accurate and effective, reduces errors and omissions, and improves overall performance. The knowledge graph construction tool is invoked from the tool invocation module based on the optimal knowledge graph construction strategy, so as to construct a knowledge graph for the original file data. Various graph construction tools can be intelligently selected and invoked according to specific requirements, which significantly improves efficiency and quality of fault knowledge graph construction.

[0021] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0023] Figure 1 A flow chart of a fault knowledge graph construction method provided by an embodiment of the present application is shown in FIG. 1.

[0024] Figure 2 A framework schematic diagram of data preprocessing provided by an embodiment of the present application is shown in FIG. 2.

[0025] Figure 3 A flow chart of another fault knowledge graph construction method provided by an embodiment of the present application is shown in FIG. 3.

[0026] Figure 4 A flow chart of a fault diagnosis method provided by an embodiment of the present application is shown in FIG. 4.

[0027] Figure 5 A structural block diagram of an agent provided by an embodiment of the present application is shown in FIG. 5.

[0028] Figure 6 A schematic diagram of a fault diagnosis system provided by an embodiment of the present application is shown in FIG. 6.

[0029] Figure 7 A structural schematic diagram of an electronic device provided by an embodiment of the present application is shown in FIG. 7. DETAILED DESCRIPTION

[0030] In order to make the person skilled in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.

[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0032] In one embodiment, Figure 1 This is a flowchart of a fault knowledge graph construction method provided in one embodiment of the present application. This embodiment is applicable to the construction of fault knowledge graphs. The method can be executed by an intelligent agent, which can be implemented in hardware and / or software and can be configured in an electronic device.

[0033] like Figure 1 As shown, the method for constructing a fault knowledge graph in this embodiment includes the following specific steps:

[0034] S110. Obtain the original file data of the fault knowledge graph to be constructed.

[0035] The original file data can be understood as files related to various new energy equipment failures. New energy equipment may include, but is not limited to, power conversion equipment, energy storage equipment, vehicle charging equipment, electrolytic hydrogen production equipment, wind power generation equipment, photovoltaic power generation equipment, etc. The failure-related files may include, but are not limited to, failure case analysis reports, product operation manuals, performance index documents, monitoring and maintenance manuals, etc. The file types of the original file data support multiple formats such as Excel, Word, PPT, PDF, TXT, and images.

[0036] In this embodiment, acquiring the original file data for constructing the fault knowledge graph involves collecting various types of fault files related to the faulty product. Specifically, the acquisition of original file data can take many forms, such as user-inputted original file data for constructing the fault knowledge graph, and / or original file data transmitted by a third-party organization. It should be noted that the original file data can undergo preprocessing. This preprocessing can include, but is not limited to, data cleaning, data normalization, automatic file type identification and parsing, document content extraction, removal of stop words and other useless information, processing of synonyms and proper nouns, and standardization of data formats. These preprocessing methods unify data specifications for subsequent processing, improve the efficiency of subsequent data processing, and ensure data quality, providing a solid foundation for the accuracy and reliability of the fault graph.

[0037] S120. In response to the fault graph construction instruction, search the preset vector database for historical graph construction tasks that match the knowledge graph construction of the original file data.

[0038] In this embodiment, the fault graph construction instruction can be understood as the graph construction instruction when constructing a fault knowledge graph from raw file data. This instruction can be in the form of a prompt project, also known as a contextual prompt. The fault graph construction instruction can refine the prompt words through structured text and other methods to guide the Large Language Model (LLM) to output the desired result. The prompt can be understood as the initial text input received by the LLM to generate a response or complete a task. This input can be a question, a description, a set of keywords, or any other form of text used to guide the model to generate a response with specific content. For example, a fault knowledge graph can be constructed based on user input data and a graph schema, where the graph schema is a pre-constructed graph ontology, equivalent to imposing a constraint.

[0039] In this embodiment, the preset vector database includes vectorized data obtained by vectorizing the historical construction process data of each successful construction. This vectorized data is stored in the vector database. The historical construction process data includes: historical input text data, historical knowledge graph construction requirements, various subtasks decomposed from the historical input text data, the knowledge graph construction tools called by each subtask, and the successfully constructed historical knowledge graphs. In this embodiment, the specific implementation method for vectorizing the historical construction process data is not limited. For example, it can be vectorized using an embedding model, one-hot encoding, word embedding, etc.

[0040] In this embodiment, in response to the fault graph construction instruction of the original file data, a historical graph construction task matching the knowledge graph construction of the original file data is searched from a preset vector database according to a preset retrieval algorithm. The preset retrieval algorithm includes, but is not limited to, the approximate nearest neighbor search algorithm. In this embodiment, the matching historical graph construction task is the relevant experience knowledge of historical knowledge graph construction, which can be understood as the historical graph construction process data stored in the preset vector database. The historical graph construction structure corresponding to the historical graph construction task may include: historical input text data, historical knowledge graph construction requirements, various sub-tasks decomposed from the historical input text data, the knowledge graph construction tools called by each sub-task, and the successfully constructed historical knowledge graph.

[0041] S130. Determine the optimal knowledge graph construction strategy corresponding to the original file data based on the historical graph construction task and the preset feedback mechanism.

[0042] Among them, the pre-set feedback mechanism may include, but is not limited to, action reflection mechanism and self-reflection mechanism.

[0043] In this embodiment, the determination of the optimal knowledge graph construction strategy requires dynamic optimization using a preset feedback mechanism. This preset feedback mechanism can include, but is not limited to, reflection mechanisms such as ReAct and Reflexion for long-term planning in complex tasks. This reflection mechanism allows the agent to repeatedly consider and refine its execution plan based on past actions and observations. The goal of using the preset reflection mechanism in this embodiment is to correct and improve past errors, thereby enhancing the quality of the final result. In some embodiments, the historical knowledge graph construction task can be first decomposed into at least two sub-tasks. Task feedback for each sub-task is collected, and reflection is performed based on this feedback. The reflection is then analyzed to obtain analysis results, and the knowledge graph construction strategy is adjusted based on these results until the optimal knowledge graph construction strategy is obtained.

[0044] S140. Based on the optimal knowledge graph construction strategy, call the knowledge graph construction tool to construct the knowledge graph and obtain the constructed fault knowledge graph.

[0045] In one embodiment, the knowledge graph construction tool includes at least one of the following: a natural language to graph query language tool, a graph database tool, and a graph ontology tool; wherein, the natural language to graph query language tool is constructed through a large language model and in-context learning (ICL), and is a tool for generating a graph database query language with an initial security level based on natural language text. The content of the ICL includes: a graph construction task description, a fault entity type ontology, a small number of sample examples, and output format requirements; the graph database tool is a graph-based database tool used to connect to the graph database, execute graph database query statements, and store the parameter information contained in the graph database query statements into the graph database. The parameter information includes at least: entities, relations, and attributes; the graph ontology tool is used to obtain a pre-configured graph pattern layer to modify the fault knowledge graph to be constructed according to preset requirements. In this embodiment, in addition to the tools mentioned above, the knowledge graph construction tool supports iterative evolution of tools, which can be understood as adding tools as needed in the future. In addition, the knowledge graph construction tool also supports version updates of existing tools, that is: existing tools can be updated or tools can be added as needed in the future.

[0046] In this embodiment, the optimal knowledge graph construction strategy corresponding to the original file data is determined based on historical knowledge graph construction tasks and a preset feedback mechanism. Based on this optimal strategy, a knowledge graph construction tool is invoked to construct a knowledge graph from the original file data, resulting in a constructed fault knowledge graph. Specifically, the optimal fault graph construction process is dynamically planned based on relevant data from historical knowledge graph construction. Initially, preliminary planning involves retrieving experiential knowledge related to the original file data of the fault knowledge graph to be constructed from a preset vector library. The system then uses this retrieved experiential knowledge to generate a preliminary fault graph construction plan, decomposing the graph construction task into sub-tasks such as obtaining the graph schema, generating a graph construction cypher, optimizing security levels, and storing the graph. Then, the initial knowledge graph construction plan is executed, task feedback for each subtask is collected, and reflection is conducted based on the task feedback. The reflection is analyzed to obtain the analysis results, and the knowledge graph construction strategy is adjusted based on the analysis results until the optimal knowledge graph construction strategy is obtained. This can be understood as observing, thinking, correcting and improving the errors based on the preset feedback mechanism and the execution of subtasks, dynamically adjusting the knowledge graph construction plan, repeating the feedback and adjustment process, and finally obtaining the optimal knowledge graph construction strategy.

[0047] The technical solution of this application embodiment, by searching for historical knowledge graph construction tasks that match the knowledge graph construction of the original file data from a preset vector database, can refer to historical successful experience knowledge, continuously learn and improve its performance, and significantly improve the efficiency and accuracy of fault handling. The strategy generation module determines the optimal knowledge graph construction strategy based on historical knowledge graph construction tasks and a preset feedback mechanism, and transmits the optimal knowledge graph construction strategy to the intelligent agent module. The dynamic optimization mechanism based on feedback makes each fault graph construction more accurate and effective, reduces errors and omissions, and improves the overall performance. Finally, the intelligent agent module calls the knowledge graph construction tool from the tool calling module based on the optimal knowledge graph construction strategy to construct the knowledge graph on the original file data. It can intelligently select and call various graph construction tools according to specific needs, significantly improving the efficiency and quality of fault knowledge graph construction, as well as the automation and intelligence level of fault knowledge graphs, and has broad practical application potential and value.

[0048] In one embodiment, the fault knowledge graph construction method of this application further includes: identifying the file security level in the original file data to obtain the file security level identification result;

[0049] The query statement of the Cypher graph with the initial security level generated by the knowledge graph construction tool is used as the preliminary Cypher result. The security level of each entity node and relation edge in the preliminary Cypher result is optimized according to the file security level identification result to obtain the target security level. The target security level is then integrated into the fault knowledge graph to obtain the target knowledge graph.

[0050] The classification results can include various forms such as public, level 1, level 3, etc. If the document shows that it is not classified, then the document is public; if the document shows that it is classified, then the corresponding classification level is directly identified.

[0051] In this embodiment, the graph database query Text2Cypher tool generates an executable Cypher graph query statement and hands it over to the agent. The agent then determines whether the statement is executable. It should be noted that the graph database query Text2Cypher tool can also identify security levels. However, since incorrect identification may occur when identifying security levels, the use of the graph database query Text2Cypher tool to identify security levels is added to improve the accuracy and precision of security level identification.

[0052] In one embodiment, the fault knowledge graph construction method of this application further includes:

[0053] Obtain the graph query statement returned by the knowledge graph construction tool, match the graph query statement with the preset knowledge graph requirements to obtain the matching result, and if the matching result is a match, call the graph database tool in the knowledge graph construction tool to connect to the graph database and execute the graph query statement to generate the fault knowledge graph;

[0054] If the matching result is not a match, when returning the fault graph construction instruction in response to the original file data, the steps of searching the preset vector database for historical graph construction tasks that match the knowledge graph construction of the original file data continue until the Cypher graph query statement matches the preset knowledge graph requirement.

[0055] The preset knowledge graph requirements can be understood as the relevant requirements for building a knowledge graph. Cypher graph queries contain graph information, which can be matched with the preset knowledge graph requirements to determine whether the requirements are currently met.

[0056] In this embodiment, the graph information in the generated Cypher graph query statement is matched with the preset knowledge graph requirements to obtain a matching result. If the matching result is a match, the GraphDB tool in the knowledge graph construction tool is invoked to connect to the graph database and execute the Cypher graph query statement to generate a fault knowledge graph. If the matching result is a mismatch, the process returns to the step of the history memory module responding to the fault graph construction instruction of the original file data and searching for historical graph construction tasks that match the knowledge graph construction of the original file data from the preset vector database, until the knowledge graph matches the preset knowledge graph requirements. This can be understood as determining whether the constructed fault graph is sufficient to match the task requirements. If it matches, the graph database storage is completed; if it does not match, the process returns to the step of searching for historical graph construction tasks that match the knowledge graph construction of the original file data from the preset vector database to construct the final graph, thus achieving intelligent construction and storage of the fault graph.

[0057] In one embodiment, the fault knowledge graph construction method of this application further includes:

[0058] Perform data preprocessing on the original file data;

[0059] The data preprocessing includes: parsing the original file data according to a preset text parser; and normalizing the parsed original file data.

[0060] In this embodiment, the original file data is parsed using a preset text parser. This preset text parser may include, but is not limited to, parsing methods such as Word parser, Excel parser, PDF parser, TXT parser, PPT parser, and image parser. Data normalization processing of the parsed original file data can include, but is not limited to, missing value handling, synonym handling, Chinese-English word segmentation, stop word removal, proper noun handling, and data format processing. In this embodiment, through the data parsing unit and data cleaning unit, a fully automated operation from data reading to preprocessing is achieved. It supports accurate identification of multiple file types, automatically performs data cleaning and standardization, greatly improving the efficiency and quality of data processing. The automated data reading and processing in this embodiment avoids manual operation, reduces the possibility of human error, and ensures the accuracy and reliability of the data processing process.

[0061] For example, to facilitate a better understanding of data preprocessing, Figure 2 This is a schematic diagram of a data preprocessing framework provided in an embodiment of this application, as shown below. Figure 2 As shown, the data parsing includes a Word parser, an Excel parser, a PDF parser, a TXT parser, a PPT parser, and an image parser; the data cleaning includes missing value handling, synonym handling, Chinese and English word segmentation, stop word removal, proper noun handling, and data format processing.

[0062] In one embodiment, Figure 3 This is a flowchart of another fault knowledge graph construction method provided in an embodiment of this application. Based on the above embodiments, this embodiment further refines the following steps: when responding to a fault knowledge graph construction command, searching for historical knowledge graph construction tasks that match the knowledge graph construction of the original file data from a preset vector database; determining the optimal knowledge graph construction strategy corresponding to the original file data based on the historical knowledge graph construction tasks and a preset feedback mechanism; and calling a knowledge graph construction tool based on the optimal knowledge graph construction strategy to construct the knowledge graph and obtain the constructed fault knowledge graph.

[0063] like Figure 3 As shown, the fault knowledge graph construction method in this embodiment may specifically include the following steps:

[0064] S310. Obtain the original file data of the fault knowledge graph to be constructed.

[0065] S320. The historical map construction task in the historical memory module is vectorized by a preset embedding model and stored in a preset vector database.

[0066] The preset embedding model can be understood as a pre-configured embedding model, which may include, but is not limited to, the jina-embeddings model; the preset retrieval algorithm may include, but is not limited to, the approximate nearest neighbor search algorithm, which can be understood as a method of retrieval in the mapped space by constructing a vector index of the entire high-dimensional vector space through a specific index structure and mapping it to a low-dimensional or small-range vector space.

[0067] In this embodiment, the historical map construction task is transformed into vectors through the Embedding model, and then the vectors are stored in a vector database for long-term preservation. Each time the map construction task is executed, relevant content can be retrieved from the vector database using a preset retrieval algorithm to assist in the current map construction.

[0068] S330. Based on the preset retrieval algorithm, retrieve the historical graph construction task from the preset vector database that matches the knowledge graph construction of the original file data.

[0069] The historical knowledge graph construction task includes at least: historical input text data, historical knowledge graph construction requirements, various sub-tasks decomposed from the historical input text data, knowledge graph construction tools called by each sub-task, and the successfully constructed historical knowledge graph.

[0070] In this embodiment, a historical graph construction task matching the knowledge graph construction of the original file data is retrieved from a preset vector database according to a preset retrieval algorithm. This can be understood as follows: for each historical graph construction task recorded in long-term memory, the historical data of each successful construction is vectorized using an embedding model (including but not limited to Jina-embeddings) and then stored in a vector database (including but not limited to Faiss). Then, an approximate nearest neighbor search algorithm is used to quickly retrieve experiential knowledge related to the current fault graph construction task from the vector database, improving the consistency and stability of fault graph construction. By retrieving historical experience through the approximate nearest neighbor search algorithm, its performance can be continuously learned and improved, significantly enhancing the efficiency and accuracy of fault handling.

[0071] S340. The historical map construction task is decomposed into at least two sub-tasks.

[0072] In this embodiment, the historical graph construction task is decomposed into two or more sub-tasks. Each sub-task includes at least the graph ontology, generating a graph construction query language statement, optimizing security levels, and storing the graph.

[0073] S350. Take at least two of the decomposed subtasks as the initial planning graph construction plan and execute each subtask.

[0074] In this embodiment, for each subtask obtained from the decomposition of the historical map construction task, each subtask is used as the initial map construction plan and each subtask is executed, and the task feedback corresponding to each subtask is collected.

[0075] S360. Collect task feedback for each subtask and reflect on the feedback.

[0076] In this embodiment, task feedback corresponding to each decomposed subtask is collected, and reflection is carried out based on the task feedback. This can be understood as repeatedly thinking about, correcting and improving past errors based on past task execution (such as tool calls in historical tasks) and observations to improve the quality of fault map construction.

[0077] S370. Analyze the reflection to obtain the analysis results, and adjust the knowledge graph construction strategy according to the analysis results until the optimal knowledge graph construction strategy is obtained.

[0078] In this embodiment, the historical knowledge graph construction task is decomposed into at least two subtasks. These subtasks include at least obtaining the knowledge graph schema, generating a knowledge graph construction cypher, optimizing security levels, and storing the knowledge graph. These at least two subtasks are used as the initial knowledge graph construction plan, and each subtask is executed. Task feedback for each subtask is collected, and reflection is conducted based on this feedback. The reflection is analyzed to obtain analysis results, and the knowledge graph construction strategy is adjusted based on these results until the optimal knowledge graph construction strategy is obtained. This can be understood as decomposing the knowledge graph construction task into subtasks, such as obtaining the knowledge graph schema, generating a knowledge graph construction cypher, optimizing security levels, and storing the knowledge graph. Then, the initially planned knowledge graph construction plan is executed. Based on the feedback mechanism, the execution status of the subtasks is assessed, such as whether the execution was successful. Errors are observed, corrected, and improved, and the knowledge graph construction plan is dynamically adjusted. This feedback and adjustment process is repeated. In this embodiment, the dynamic optimization mechanism based on feedback makes each faulty knowledge graph construction more accurate and effective, reducing errors and omissions, and improving overall performance.

[0079] In this embodiment, by referring to historical successful experience and knowledge, the construction process and content of the fault map are continuously optimized to improve the accuracy and practicality of the fault map construction. The dynamic planning and feedback mechanism further enhances the flexibility and effectiveness of the map construction. By collecting feedback information in real time during the construction process, the construction strategy is dynamically adjusted and deviations are corrected in a timely manner to ensure the high quality and high adaptability of the fault map. This adaptive adjustment mechanism ensures that each construction is the optimal solution for the actual situation.

[0080] S380. Decompose the original file data into tasks according to the optimal knowledge graph construction strategy, and determine the knowledge graph construction tool called by each subtask after task decomposition.

[0081] In this embodiment, the agent repeatedly thinks about, corrects and improves the errors in the past based on past task execution and observations in order to obtain the optimal knowledge graph construction strategy. Then, according to the optimal knowledge graph construction strategy, the original file data is decomposed into tasks, and the knowledge graph construction tool called by each sub-task after task decomposition is determined.

[0082] S390. Call the Natural Language to Graph Query Language tool to generate graph database query statements with initial security classifications from the original file data.

[0083] Among them, the Natural Language to Graph Query Language tool can be understood as the Text2Cypher tool, which is a tool for generating graph database query languages ​​based on natural language text.

[0084] In this embodiment, the agent invokes a natural language to graph query language tool to generate graph database query statements with initial security classifications from the original file data.

[0085] S3100: Call the graph database tool to execute the graph database query statement, and store the parameter information contained in the graph database query statement into the graph database to obtain the constructed fault knowledge graph.

[0086] The parameter information includes at least entities, relationships, and attributes.

[0087] In this embodiment, intelligent graph construction tools, including but not limited to Text2Cypher, GraphDB, and Schema tools, are selected and used to construct a fault knowledge graph. The fault knowledge graph includes fault entity nodes, relation edges, attributes, labels, and relationships. Specifically, the original file data is decomposed into tasks according to the optimal knowledge graph construction strategy, and the tools invoked for each subtask are determined. The Text2Cypher tool is invoked to generate Cypher graph query statements with initial security levels from the original file data. The GraphDB tool is invoked to execute the Cypher graph query statements and store them in the graph database to obtain the knowledge graph of the original file data. In this embodiment, the intelligent agent can intelligently select and invoke various graph construction tools, such as Text2Cypher, GraphDB, and Schema tools, according to specific needs, exhibiting flexibility and efficiency, greatly improving resource utilization and the automation and intelligence of the workflow.

[0088] In this embodiment, since the knowledge graph ontology changes continuously throughout the project, requiring complete code modifications each time and involving a large amount of data, this ontology is extracted and placed separately in this tool library. The schema ontology can be directly modified using the schema tool, and only the tool needs to be maintained subsequently. For example, a knowledge graph related to inverter faults can be constructed; another example is the construction of a knowledge graph related to energy storage faults, which can be directly modified by modifying the schema ontology.

[0089] In this embodiment, to facilitate a better understanding of the context learning ICL content in the Text2Cypher tool for graph database querying, the following are provided: graph construction task description, fault entity type ontology, a small number of sample examples and output format requirements; the following are corresponding examples for related explanations. 1) The graph construction task is described as follows: Create a Cypher MERGE statement to model all entities and relationships found in the text according to these criteria; before creating new nodes, attributes or relationships, please refer to the provided schema and use existing or similar nodes, attributes or relationships; use generic categories for node and relationship labels, please refer to the small number of demonstrations provided. 2) The schema contains the following: node labels and attributes: Equip, Param, etc.; relationship labels and attributes: hasParam; relationship: Equip-hasParam->parameter; parameters can include but are not limited to design parameters such as voltage and current. (3) A few-shot example is as follows:

[0090] Input: One of the important parameters of product A is its operating voltage;

[0091] Reasoning: The generated statement has an entity "Product A", which can be represented as an Equip node. The "One of the parameters is working voltage" part represents the relationship between the product and its parameters. For this, a "hasParam" relationship can be used. The parameters themselves are not explicitly named, so a generic Param node can be used with an attribute 'name' whose value is 'work voltage'. Confidentiality level attributes also need to be considered. Therefore, confidentiality level attributes are added to both the node and the relationship, and they are set to "public".

[0092] Output: MERGE(A:Equip{name:'Product A'})

[0093] ON CREATE SET A.secretLevel='public'

[0094] MERGE(P:Param{name:'Operating Voltage'})

[0095] ON CREATE SET P.secretLevel='public'

[0096] MERGE(A)-[r:hasParam]->(P)

[0097] ON CREATE SET r.secretLevel='public'.

[0098] In this embodiment, the most suitable tools, such as Text2Cypher Tool, GraphDB Tool, and Schema Tool, are intelligently selected and invoked according to the needs of the construction plan to carry out the specific construction of the graph. This not only improves the flexibility and efficiency of tool use, but also allows for adjustment of tool configuration according to specific needs, optimizing resource utilization and realizing the intelligent and automatic construction of product fault graphs. It can be widely applied to the fault diagnosis of various types of products (including but not limited to inverters, energy storage, etc.), and has broad applicability, high practical value and benefits.

[0099] In one embodiment, Figure 4 This is a flowchart of a fault diagnosis method provided in an embodiment of this application.

[0100] S410. Obtain the fault file data to be diagnosed.

[0101] S420. Based on the pre-built fault knowledge graph, determine the fault diagnosis cause corresponding to the fault file data to be diagnosed.

[0102] In this embodiment, the pre-constructed fault knowledge graph is obtained by using the fault knowledge graph construction method described above in this application, and will not be described further in this embodiment.

[0103] In this embodiment, the cause of the fault diagnosis can be determined by using a pre-constructed fault knowledge graph.

[0104] In one embodiment, Figure 5 This is a structural block diagram of an intelligent agent provided in one embodiment of this application. This intelligent agent is suitable for constructing a fault knowledge graph and can be implemented in hardware or software. It can be configured in an electronic device to implement a fault knowledge graph construction method according to this embodiment of the application.

[0105] like Figure 5 As shown, the intelligent agent includes: an information acquisition module 510, a historical construction task search module 520, a strategy determination module 530, and a graph construction module 540;

[0106] Among them, the information acquisition module 510 is used to acquire the original file data of the fault knowledge graph to be constructed;

[0107] The lookup module 520 is used to search for historical graph construction tasks that match the knowledge graph construction of the original file data from a preset vector database when responding to a fault graph construction instruction.

[0108] The strategy determination module 530 is used to determine the optimal knowledge graph construction strategy corresponding to the original file data based on the historical graph construction task and the preset feedback mechanism.

[0109] The graph construction module 540 is used to call the knowledge graph construction tool based on the optimal knowledge graph construction strategy to construct a knowledge graph and obtain a constructed fault knowledge graph.

[0110] The technical solution of this application includes a historical construction task search module, which searches a preset vector database for historical graph construction tasks that match the knowledge graph construction of the original file data. This allows for continuous optimization of the fault graph construction by referencing successful historical experiences, improving the accuracy and usability of the fault graph. A strategy determination module determines the optimal knowledge graph construction strategy based on historical graph construction tasks and a preset feedback mechanism. This dynamic optimization mechanism ensures that each fault graph construction is more accurate and effective, reducing errors and omissions and improving overall performance. The graph construction module invokes knowledge graph construction tools from the tool invocation module based on the optimal knowledge graph construction strategy to construct a knowledge graph from the original file data. This allows for intelligent selection and invocation of various graph construction tools according to specific needs, significantly improving the efficiency and quality of fault knowledge graph construction.

[0111] In one embodiment, the knowledge graph construction tool includes at least one of the following: a natural language to graph query language tool, a graph database tool, and a graph ontology tool;

[0112] Among them, the Natural Language to Graph Query Language Tool is built through a large language model and Context Learning ICL. It is a tool for generating a graph database query language with an initial security level based on natural language text. The content of Context Learning ICL includes: graph construction task description, fault entity type ontology, a small number of sample examples and output format requirements.

[0113] Graph database tools are graph-based database tools used to connect to graph databases, execute graph database queries, and store the parameter information contained in the graph database queries into the graph database; wherein, the parameter information includes at least: entities, relations, and attributes;

[0114] The graph ontology tool is used to obtain pre-configured graph pattern layers to modify the fault knowledge graph to be built according to preset requirements.

[0115] In one embodiment, the intelligent agent further includes:

[0116] The matching module is used to obtain the graph query statement returned by the knowledge graph building tool, and match the graph query statement with the preset knowledge graph requirements to obtain the matching result. If the matching result is a match, the graph database tool in the knowledge graph building tool is called to connect to the graph database and execute the graph query statement to generate the fault knowledge graph.

[0117] The loop module is used to return the steps of searching the preset vector database for historical graph construction tasks that match the knowledge graph construction of the original file data when the matching result is not a match, in response to the fault graph construction instruction of the original file data, until the graph query statement and the preset knowledge graph requirement are matched.

[0118] In one embodiment, the intelligent agent further includes:

[0119] The data preprocessing module is used to preprocess the raw file data;

[0120] Data preprocessing includes:

[0121] The original file data is parsed based on a preset text parser.

[0122] Perform data normalization on the original file data after data parsing.

[0123] In one embodiment, the lookup module 520 includes:

[0124] The vectorization processing unit is used to vectorize the historical map construction task in the historical memory module through a preset embedding model and store it in a preset vector database.

[0125] The search unit is used to retrieve historical knowledge graph construction tasks that match the knowledge graph construction of the original file data from a preset vector database according to a preset retrieval algorithm. The historical knowledge graph construction tasks include at least: historical input text data, historical knowledge graph construction requirements, various sub-tasks decomposed from the historical input text data, knowledge graph construction tools called by each sub-task, and successfully constructed historical knowledge graphs.

[0126] In one embodiment, the strategy determination module 530 includes:

[0127] The task decomposition unit is used to decompose the historical graph construction task into at least two sub-tasks; wherein, the sub-tasks include at least the graph ontology, generating graph construction query language statements, optimizing security level, and storing graph;

[0128] An execution unit is used to construct a graph from at least two decomposed subtasks as the initial plan and execute each subtask.

[0129] The reflection unit is used to collect task feedback for each subtask and to reflect on the task feedback.

[0130] The adjustment unit is used to analyze the reflections to obtain analysis results, and adjust the knowledge graph construction strategy based on the analysis results until the optimal knowledge graph construction strategy is obtained.

[0131] In one embodiment, the map construction module 540 includes:

[0132] The tool determination unit is used to decompose the original file data into tasks according to the optimal knowledge graph construction strategy, and to determine the knowledge graph construction tools called by each subtask after task decomposition.

[0133] The first calling unit is used to call the natural language to graph query language tool to generate graph database query statements with initial security classification levels from the original file data;

[0134] The second calling unit is used to call the graph database tool to execute the graph database query statement and store the parameter information contained in the graph database query statement into the graph database to obtain the constructed fault knowledge graph. The parameter information includes at least entities, relations and attributes.

[0135] In one embodiment, Figure 6 This is a schematic diagram of a fault diagnosis system provided in an embodiment of this application, as shown below. Figure 6 As shown, the fault diagnosis system specifically includes the following steps:

[0136] The information acquisition module is used to acquire fault file data to be diagnosed.

[0137] The diagnostic module is used to determine the cause of the fault diagnosis corresponding to the fault file data to be diagnosed based on a pre-built fault knowledge graph.

[0138] In this embodiment, the pre-constructed fault knowledge graph is obtained by using the fault knowledge graph construction method described above in this application, and will not be described further in this embodiment.

[0139] In one embodiment, Figure 7This is a schematic diagram of an electronic device provided for an embodiment of this application. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present application described and / or claimed herein.

[0140] like Figure 7 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0141] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0142] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as fault knowledge graph construction methods.

[0143] In some embodiments, the fault knowledge graph construction method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the fault knowledge graph construction method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the fault knowledge graph construction method by any other suitable means (e.g., by means of firmware).

[0144] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0145] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable fault knowledge graph construction apparatus, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0146] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0147] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0148] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0149] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0150] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.

[0151] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for constructing a failure knowledge graph, characterized in that, The fault knowledge graph construction method comprises: acquiring original file data of a fault knowledge graph to be constructed; in response to a fault graph construction instruction, searching a preset vector database for a historical graph construction task matching knowledge graph construction of the original file data; determining an optimal knowledge graph construction strategy corresponding to the original file data based on the historical graph construction task and a preset feedback mechanism; calling a knowledge graph construction tool based on the optimal knowledge graph construction strategy to perform knowledge graph construction to obtain a constructed fault knowledge graph. 2.The failure knowledge graph construction method of claim 1, wherein, The knowledge graph construction tool comprises at least one of the following: a natural language to graph query language tool, a graph database tool, and a graph ontology tool; The natural language to graph query language tool is constructed by a large language model and a context learning ICL, and is a tool for generating a graph database query language with an initial security level based on natural language text. The content of the context learning ICL includes: graph construction task description, fault entity type ontology, a small amount of sample examples, and output format requirements. The graph database tool is a graph-based database tool, which is used to connect a graph database, execute a graph database query statement, and store parameter information contained in the graph database query statement into the graph database. The parameter information at least includes: entities, relationships, and attributes. The graph ontology tool is used to obtain a pre-configured graph schema layer to modify the fault knowledge graph to be constructed according to preset requirements. 3.The failure knowledge graph construction method of claim 1, wherein, The fault knowledge graph construction method further comprises: acquiring a graph query statement fed back by the knowledge graph construction tool, and matching the graph query statement with a preset knowledge graph requirement to obtain a matching result. In a case where the matching result is matched, a graph database tool in the knowledge graph construction tool is called to connect a graph database and execute a graph query statement to generate a fault knowledge graph; in a case where the matching result is not matched, returning to the step of searching a preset vector database for a historical graph construction task matching knowledge graph construction of the original file data in response to the fault graph construction instruction of the original file data until the graph query statement and the preset knowledge graph requirement are matched. 4.The failure knowledge graph construction method of claim 1, wherein, The fault knowledge graph construction method further comprises: performing data preprocessing on the original file data; The data preprocessing comprises: performing data analysis on the original file data according to a preset text parser; performing data normalization processing on the original file data after data analysis. 5.The failure knowledge graph construction method of claim 1, wherein, The step of searching a preset vector database for a historical graph construction task matching knowledge graph construction of the original file data in response to the fault graph construction instruction of the original file data comprises: performing vectorization processing on the historical graph construction task in the historical memory module by a preset embedding model, and storing the historical graph construction task in the preset vector database. retrieving, according to a preset retrieval algorithm, a historical graph construction task matched with the knowledge graph construction of the original file data from the preset vector database; wherein the historical graph construction task at least includes: historical input text data, historical knowledge graph construction requirements, each subtask decomposed from the historical input text data, a knowledge graph construction tool respectively called by each subtask, and a historical knowledge graph constructed successfully. 6.The failure knowledge graph construction method of claim 1, wherein, determining an optimal knowledge graph construction strategy corresponding to the original file data based on the historical graph construction task and a preset feedback mechanism, including: task decomposition of the historical graph construction task to obtain at least two subtasks; wherein the subtasks at least include a graph ontology, a generated graph construction graph query language sentence, an optimized security level, and a stored graph; decomposing the at least two subtasks as an initial planned graph construction plan and executing each subtask; collecting task feedback corresponding to each subtask and reflecting according to the task feedback; analyzing the reflection to obtain an analysis result, and adjusting the graph construction strategy according to the analysis result until an optimal knowledge graph construction strategy is obtained. 7.The failure knowledge graph construction method of claim 1, wherein, calling a knowledge graph construction tool based on the optimal knowledge graph construction strategy to construct a good fault knowledge graph from the original file data, including: task decomposition of the original file data according to the optimal knowledge graph construction strategy, and determining the knowledge graph construction tool respectively called by each subtask after the task decomposition; calling a natural language to graph query language tool to generate a graph database query sentence with an initial security level from the original file data; calling a graph database tool to execute the graph database query sentence, and storing parameter information contained in the graph database query sentence into a graph database to obtain a constructed fault knowledge graph, wherein the parameter information at least includes entities, relationships and attributes.

8. A failure diagnosis method characterized by comprising: The fault diagnosis method comprises: obtaining fault file data to be diagnosed; determining a fault diagnosis reason corresponding to the fault file data to be diagnosed based on a pre-constructed fault knowledge graph; wherein the pre-constructed fault knowledge graph is obtained by using the fault knowledge graph construction method of any one of claims 1-7.

9. An agent, characterized in that The intelligent agent comprises: an information acquisition module for acquiring original file data to be constructed into a fault knowledge graph; a historical construction task finding module for finding a historical graph construction task matched with the knowledge graph construction of the original file data from a preset vector database in response to a fault graph construction instruction; a strategy determination module for determining an optimal knowledge graph construction strategy corresponding to the original file data based on the historical graph construction task and a preset feedback mechanism; a graph construction module for calling a knowledge graph construction tool based on the optimal knowledge graph construction strategy to construct a good fault knowledge graph.

10. A failure diagnosis system characterized by comprising: The system comprises: an information acquisition module for acquiring fault file data to be diagnosed; A diagnosis module is configured to determine a fault diagnosis cause corresponding to the fault file data to be diagnosed based on a pre-constructed fault knowledge graph, wherein the pre-constructed fault knowledge graph is obtained by using the fault knowledge graph construction method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Multi-modal cultural relic knowledge graph construction method, device and system and storage medium

    CN115391547A

  • Machine instruction generation method and device, electronic equipment and storage medium

    CN117270832A

  • Information interaction method and device based on large language model and electronic equipment

    CN118093801A

  • Intelligent agent method, device and system

    CN118426874A

  • Workflow generation method based on large language model, agent, medium and terminal

    CN118551022A