Intelligent maintenance reasoning method based on knowledge graph and large language model

By constructing a fault entity relationship in aviation equipment fault diagnosis and maintenance, and jointly extracting the model and complex equipment fault knowledge graph, and combining the ability to generate large language models, the problem that knowledge graph construction methods in the existing technology are difficult to capture complex relationships and lack professional knowledge of large language models, and efficient and accurate intelligent maintenance reasoning is achieved.

CN119886334APending Publication Date: 2025-04-25CHENGDU AIRCRAFT DESIGN INST OF AVIATION IND CORP OF CHINA
View PDF 0 Cites 19 Cited by

Patent Information

Application Number
CN202411913541.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In aviation equipment fault diagnosis and maintenance, existing knowledge graph construction methods are difficult to fully capture the complex relationships between entities, and large language models lack in-depth knowledge support in professional fields, resulting in limited professionalism and accuracy of inference results.

Method used

By constructing a joint extraction model of faulty entity relationships, combining multi-dimensional vector enhancement retrieval of knowledge graph and enhanced generation technology of large language models, intelligent maintenance inference of complex equipment is realized. This method includes building a data set extracted from faulty entity relationships, training a joint extraction model of entity relationships, building a complex equipment fault knowledge graph, and performing intelligent maintenance inference through the combination of knowledge graphs and large language models.

Benefits of technology

It improves the accuracy and efficiency of joint extraction of fault entity relationships, realizes retrieval and enhanced inference combining knowledge graphs with large language models, breaks through the professional knowledge limitations of traditional inference models, and significantly improves the efficiency and accuracy of fault processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119886334A_ABST
    Figure CN119886334A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of virtual reality and simulation, and relates to an intelligent maintenance reasoning method based on a knowledge graph and a large language model, which comprises the following steps of: 1, constructing a data set extracted by a fault entity relationship; 2, constructing a fault entity relation joint extraction model; 3, training and evaluating an entity relationship joint extraction model; 4, constructing a complex equipment fault knowledge graph; 5, based on the knowledge graph and the large language model, intelligent maintenance reasoning is carried out; 6, verifying and optimizing the intelligent maintenance reasoning scheme; the invention provides an intelligent maintenance reasoning method aiming at the field of complex equipment maintenance and aims to better meet intelligent maintenance reasoning requirements under multiple scenes by combining an entity relation joint extraction model and fusing a knowledge graph multi-dimensional vector enhanced retrieval and large language model enhanced generation technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of virtual reality and simulation technology, and specifically to an intelligent maintenance reasoning method based on knowledge graph and large language model. Background Art

[0002] In recent years, the development of knowledge graphs and large language models has provided new ideas for intelligent maintenance reasoning. Through machine learning and natural language processing technology, effective fault information can be extracted from massive maintenance manuals, equipment logs and other data to assist maintenance decisions. Knowledge graphs can effectively integrate multi-source heterogeneous data and express them in the form of graphics to form a logically clear and easy-to-query knowledge system, providing comprehensive knowledge support for fault diagnosis and maintenance. At the same time, large language models perform well in text analysis, information extraction, and knowledge reasoning. Through pre-training on large amounts of text data, they have strong context understanding and reasoning capabilities. In actual scenarios, they can generate targeted maintenance suggestions and optimization decisions to achieve intelligent maintenance reasoning.

[0003] Existing research has applied knowledge graphs and large language models to intelligent reasoning systems in different fields, but the combination of the two has not been fully developed and applied in aviation equipment fault diagnosis and maintenance. On the one hand, the existing fault knowledge graph construction methods mainly rely on simple entity extraction and rule matching, which makes it difficult to fully capture the complex relationships between entities, and there are still challenges in the automatic entity relationship extraction and knowledge updating of multi-source heterogeneous data; on the other hand, although large language models have powerful text generation and reasoning capabilities, the professionalism and accuracy of their reasoning results may be limited when they lack deep knowledge support in professional fields. Therefore, how to organically combine knowledge graphs and large language models and use the advantages of both to realize intelligent maintenance reasoning of aviation equipment with domain expertise has become an urgent problem to be solved. Summary of the invention

[0004] The purpose of the present invention is to provide an intelligent maintenance reasoning method for complex equipment based on knowledge graph and large language model. By means of entity relationship joint extraction model, the multi-dimensional vector enhanced retrieval of knowledge graph and the enhanced generation technology of large language model are integrated to provide an intelligent maintenance reasoning method for the field of complex equipment maintenance, so as to better meet the needs of intelligent maintenance reasoning in multiple scenarios.

[0005] The technical solution of the present invention:

[0006] An intelligent maintenance reasoning method based on knowledge graph and large language model includes the following steps:

[0007] Step 1: Construct a dataset for fault entity relationship extraction;

[0008] Step 2: Construct a fault entity relationship joint extraction model;

[0009] Step 3: Train and evaluate the entity relationship joint extraction model;

[0010] Step 4: Construct a knowledge graph of complex equipment failures;

[0011] Step 5: Perform intelligent maintenance reasoning based on the knowledge graph and large language model;

[0012] Step 6: Verify and optimize the intelligent maintenance reasoning solution.

[0013] Furthermore, in step 1, fault-related content is extracted from multi-source heterogeneous data to construct a dataset, which is used for classification prediction of different entity types and different relationship types.

[0014] Further, step 1 specifically includes the following steps:

[0015] 1.1. Data cleaning and noise removal: Clean multi-source heterogeneous data, remove noise, redundant information and invalid records, ensure data consistency and integrity, and ensure data quality;

[0016] 1.2 Structuring the processed multi-source heterogeneous data: semantically parse the multi-source heterogeneous data and convert the unstructured data into structured data; in the structured multi-source heterogeneous data set, the entity types include model equipment, system, system components, fault phenomenon, fault cause, inspection item, and maintenance method, and the relationship types include component inclusion relationship, fault cause relationship, and maintenance suggestion relationship; the basic format of the structured multi-source heterogeneous data set includes the original sentence text and a set of triples, where the triple T includes the head entity h, the relationship type r, and the tail entity t, and the triple form is shown in Formula 1:

[0017] T=<h,r,t> (1);

[0018] 1.3 Extraction of text vector feature information: For a sequence text X = {x1, x2, ..., x n}, convert the structured data into feature vectors, extract keywords and context information, and map each keyword to a high-dimensional vector space. The processing formula for converting structured data into feature vectors is shown in Formula 2:

[0019] h i =Embedding(x i |{x1,…,x n}) (2)

[0020] Among them, x i is the ith keyword in the original text, h i Represents the 768-dimensional word embedding of the i-th keyword;

[0021] The dataset for fault entity relationship extraction is constructed.

[0022] Furthermore, step 2 specifically constructs a CasRel entity relationship joint extraction model by introducing self-attention mechanism optimization; the input of the CasRel entity relationship joint extraction model is text information of a certain length, and the output is a triple of entity and relationship. By introducing the self-attention mechanism, the contextual information features of the faulty entity are mined, and the accurate and efficient identification of the potential relationship between faulty entities in multi-source heterogeneous data is achieved.

[0023] Further, the step 2 specifically includes:

[0024] 2.1 Constructing entity relationship extraction pointer network:

[0025] The CasRel entity-relationship joint extraction model includes an entity pointer network and a relationship pointer network. The entity pointer network is used to predict the head and tail position labels of all entities in the text, and the relationship pointer network is used to predict the multi-dimensional mapping of the relationship between different entities in the text.

[0026] (1) Entity Pointer Network

[0027] Given an input text sequence X = {x1, x2, ..., x n}, after converting the structured data into the feature vector H, the goal of the CasRel entity relationship joint extraction model is to predict the starting and ending positions of each entity. For the i-th keyword, the hidden layer of the starting and ending positions is output through the pointer network, and the calculation is shown in Equation 3-Equation 4:

[0028]

[0029] Among them, h i is the multidimensional embedding vector of the i-th keyword in the input text, W s and W e are the weight matrices for predicting the start and end positions, respectively, and b s and b e is the bias term, is the hidden layer weight of the starting position pointer of the i-th keyword output, is the hidden layer weight of the end position pointer of the i-th keyword output, and Softmax is the activation function;

[0030] (2) Relationship Pointer Network

[0031] After the entity pointer network predicts the location of the entity, the relationship pointer network is responsible for predicting the relationship between the entities predicted by the entity pointer network. Given the locations of two entities, the relationship between them is calculated through the relationship pointer network. The calculation formula is shown in Formula 5:

[0032]

[0033] in, is the predicted relationship vector of the ith keyword, is the i-th word embedding of the sentence word embedding of the head entity position to be predicted, h i is the word embedding of the i-th keyword in the sentence, W r is the weight matrix of the predicted relationship, b r is the bias term; Determined by the rule of formula 6:

[0034]

[0035] Among them, start and end are the starting position and ending position of the entity respectively;

[0036] 2.2 Self-attention mechanism optimization: By introducing the self-attention mechanism, the context information weight configuration adjustment is added between the output layers of the pointer network to mine the context information features of the fault entity, and to achieve accurate and efficient identification of the potential relationship between fault entities in multi-source heterogeneous data;

[0037] In order to enhance the ability of CasRel entity relationship joint extraction model to capture contextual information, the self-attention mechanism is introduced. The self-attention mechanism is used to measure the text sequence X = {x1, x2, …, x n}, and dynamically adjust its weight in the prediction process, which specifically includes the following steps:

[0038] First, the input feature F is transformed into a learnable weight matrix W. Q , W K , W V The query matrix Q, key matrix K, and value matrix V are obtained, as shown in Formula 7:

[0039]

[0040] Secondly, the self-attention mechanism is calculated as shown in Equation 8:

[0041]

[0042] Among them, d k Represents the dimension of the key;

[0043] Again, through the self-attention mechanism calculation, the CasRel entity relationship joint extraction model can calculate the relevance weight of each word with other words, and then weighted sum to obtain a new representation; the calculation formulas for the final input of the entity pointer network and the relationship pointer network are shown in Equations 9-11:

[0044] P start =Attention(E s ) (9)

[0045] P end =Attention(E e ) (10)

[0046] P r (r,t|h)=Attention(E r (r,t|h)) (11)

[0047] Among them, P start and P end Output score matrix for entity pointer network, P r (r,t|h) is the output score of the relation pointer network, E s 、E e 、E r (r, t|h) are the entity start position matrix hidden layer, entity end position matrix hidden layer, and relationship matrix hidden layer respectively;

[0048] 2.3 Decoding the entity relationship of the pointer network: Decode the entity head and tail position label encoding and multidimensional relationship mapping encoding in the pointer network output by the CasRel entity relationship joint extraction model, extract triples in the form of "head entity, relationship, tail entity", and realize the extraction of triple structured data from the original sentence text; the starting position and ending position of the entity are finally divided into 0 or 1 by the set score threshold of 0.5, and the calculation formula is shown in Formula 12:

[0049]

[0050] Among them, P i is the original score of the ith position in the sentence, is the final output score of the i-th position in the sentence.

[0051] Furthermore, step 3 specifically uses the constructed dataset to train, verify and test the CasRel entity-relationship joint extraction model, and comprehensively evaluates the model's classification and prediction performance for entities and relationships.

[0052] Further, the step 3 specifically includes:

[0053] 3.1 Dataset division and model training: The constructed dataset is divided into training set and test set according to the ratio of 80% and 20% respectively. The CasRel entity relationship joint extraction model is optimized through the cross entropy function. At the same time, the ratio parameter is set to balance the total training loss of entities and relationships, and the training results are optimized. The calculation formula is shown in Formula 13:

[0054] L=L e +λL r (13)

[0055] Among them, L e is the cross loss of the entity pointer network, L r is the cross loss of the relation pointer network, λ is the adjustment parameter, and L is the total training loss;

[0056] 3.2 Selecting the performance evaluation indicators of the CasRel entity relationship joint extraction model: In order to quantitatively evaluate the prediction performance of the constructed entity relationship joint extraction model, the accuracy, recall rate, and F1 score are introduced as indicators to measure the difference between the model predicted triples and the actual triples; the calculation formulas of accuracy, recall, and F1 score are shown in Equations 14 to 16:

[0057]

[0058] Among them, TP is a true positive example, FP is a false positive example, and FN is a false negative example;

[0059] 3.3 Evaluation and comparison of the performance of the CasRel entity relationship joint extraction model: Use the test set obtained after division to evaluate the performance of the CasRel entity relationship joint extraction model, and compare the performance with the CasRel entity relationship joint extraction model in step 2 through the comparative benchmark method to evaluate the prediction and classification accuracy of the CasRel entity relationship joint extraction model after target optimization of the cross entropy function.

[0060] Furthermore, step 4 is to store and manage the extracted fault entities and relationship types based on the Neo4j tool to form a complex equipment fault knowledge graph. The specific steps are as follows:

[0061] (1) Fault knowledge structuring: The extracted fault entities and relationship types are stored in a table in the form of triples;

[0062] (2) Import fault knowledge: Import structured triples into the Neo4j tool using Cypher statements;

[0063] (3) Deduplication of fault knowledge graph: Duplicate entities in the knowledge graph are deduplicated using Cypher statements, and then high-similar nodes are further deduplicated based on the OpenAI similarity matching mechanism.

[0064] (4) Dynamic update and maintenance of the fault knowledge graph: When new fault entities and relationship types are added, the fault knowledge graph is updated in real time, and the new nodes are matched with the old nodes for similarity, and the new nodes with extremely high similarity are merged with the old nodes.

[0065] Further, step 5: Based on the knowledge graph and the large language model, intelligent maintenance reasoning is performed, specifically:

[0066] Combine the constructed complex equipment fault knowledge graph with the large language model, enhance the generation capability of the large language model through the retrieval query results of the knowledge graph, and generate intelligent fault diagnosis and maintenance reasoning results. That is, based on the deep query of nodes and relationships in the knowledge graph, the fault information is obtained and combined with the large language model to improve the reasoning accuracy and pertinence of the large language model, and automatically generate maintenance plans, fault prediction suggestions and optimization decisions;

[0067] Step 5 specifically includes:

[0068] (1) Constructing a large language model input template: Introduce a large language model and set an input template, including the question and prompt word parts;

[0069] (2) Construct node word embeddings: Based on the fault knowledge graph, the node name is converted into word embeddings through the OpenAIEmbeddings method, and the FAISS vector index is constructed;

[0070] (3) Node vector retrieval: similarity matching is performed through FAISS vector index, and the number of matching nodes is set to 10;

[0071] (4) Relationship retrieval: retrieve matching nodes through node vectors, use Cypher statements to retrieve adjacent nodes in the knowledge graph, reconstruct sentences based on the retrieved nodes, and sort the reconstructed sentences based on the original similarity matching order;

[0072] (5) Importing prompt words: Generate prompt words based on the sentences sorted in (4) and import them into the large language model input template. The large language model automatically generates maintenance reasoning results based on the prompts, including maintenance plans, fault prediction suggestions, and optimization decisions;

[0073] (6) Relationship classification retrieval: The Cypher statements used for relationship retrieval are further refined according to the question type to reduce the interference of large language model input prompts. Question types include querying related fault names, querying maintenance plans, querying inspection items, and querying involved models or parts.

[0074] Furthermore, step 6 specifically verifies and optimizes the generated maintenance reasoning results, including: comparing and verifying with actual data; continuously optimizing the reasoning model and knowledge graph based on the feedback results;

[0075] The step 6 specifically includes:

[0076] (1) Intelligent question answering with a large language model: OpenAI’s large language model infers the optimal maintenance solution based on the input prompt words;

[0077] (2) Extracting entity relations: Using the CasRel entity relation joint extraction model obtained in step 3, we extract structured triples from the conversation results of the large language model.

[0078] (3) Update the knowledge graph: Dynamically add new maintenance results and fault information to the fault knowledge graph to ensure the real-time and effectiveness of the fault knowledge graph, as shown in Equation 17:

[0079] G new =G old ∪ΔG (17)

[0080] Among them, G old is the set of existing triples in the fault knowledge graph, ΔG is the set of newly identified triples, G new It is the triple set after the fault knowledge graph is updated.

[0081] Beneficial effects of the present invention:

[0082] 1. Improved the accuracy and efficiency of joint extraction of fault entity relationships. Compared with traditional models, the joint extraction model of fault entity relationships established by the present invention can more accurately predict and classify entity relationships for multi-source heterogeneous data sources. This greatly improves the efficiency of knowledge extraction and provides an efficient and reliable knowledge base tool for subsequent retrieval and query of fault maintenance reasoning.

[0083] 2. Retrieval-enhanced reasoning combining knowledge graph and large language model is realized. The retrieval-enhanced reasoning framework proposed in the present invention can automatically generate maintenance plans, fault prediction suggestions and optimization decisions based on user questions through rapid retrieval of knowledge graph combined with enhanced generation of large language model. This method of combining knowledge graph with large language model breaks through the limitation of traditional reasoning model that lacks professional domain knowledge, greatly improves the efficiency and accuracy of fault handling, and provides a novel and efficient solution for intelligent maintenance reasoning of complex equipment. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] In order to more clearly explain the specific implementation of the present invention, the following briefly describes the related drawings involved. It should be pointed out that the drawings mentioned below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be derived based on these drawings without creative work.

[0085] Figure 1 is a flow chart of the method of the present invention;

[0086] Figure 2 Schematic diagram of the fault entity relationship joint extraction model of the present invention;

[0087] Figure 3 A schematic diagram of the aviation equipment failure knowledge graph constructed by the present invention;

[0088] Figure 4 This is a schematic diagram of intelligent maintenance reasoning based on knowledge graph and large language model of the present invention. DETAILED DESCRIPTION

[0089] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0090] One embodiment of the present invention is to provide a complex equipment intelligent maintenance reasoning method based on a knowledge graph and a large language model, comprising the following steps:

[0091] Step 1: Construct a dataset for fault entity relationship extraction. Extract fault-related content from multi-source heterogeneous data sources (including but not limited to aviation maintenance manuals, equipment logs, sensor data, etc.) to construct a dataset. This dataset is used for classification prediction of different entity types and different relationship types. Its fault entity types include fault phenomenon, fault cause, system components, etc., and relationship types include fault cause relationship, maintenance suggestion relationship, etc.;

[0092] Step 2: Construction of fault entity-relationship joint extraction model. By introducing the self-attention mechanism optimization, the CasRel entity-relationship joint extraction model is constructed. The input of the model is text information of a certain length, and the output of the model is a triple of entities and relations in the text. By introducing the self-attention mechanism to mine the contextual information features of the fault entity, accurate and efficient identification of the potential relationship between fault entities in multi-source heterogeneous data can be achieved.

[0093] Step 3: Training and evaluation of the entity-relationship joint extraction model. Use the constructed dataset to train, verify, and test the entity-relationship joint extraction model, and comprehensively evaluate the model's classification and prediction performance for entities and relationships;

[0094] Step 4: Construction of aviation equipment fault knowledge graph. Based on the Neo4j tool, the extracted fault entities and their relationships are stored and managed to form an aviation equipment fault knowledge graph. The fault entities are mapped as nodes in the graph, and the relationships between the fault entities are mapped as edges in the graph. A knowledge graph with a logical structure is constructed to achieve efficient query and maintenance of the knowledge graph.

[0095] Step 5: Intelligent maintenance reasoning based on knowledge graph and large language model. Combine the constructed aviation equipment fault knowledge graph with the large language model, enhance the generation capability of the large language model through the retrieval query results of the knowledge graph, and generate intelligent fault diagnosis and maintenance reasoning results. Obtain fault information based on deep query of nodes and relationships in the knowledge graph and combine it with the large language model to improve the reasoning accuracy and pertinence of the large language model, and automatically generate maintenance plans, fault prediction suggestions, and optimization decisions;

[0096] Step 6: Verification and optimization of intelligent maintenance reasoning scheme. Verify and optimize the generated maintenance reasoning results, including: comparing and verifying with historical maintenance records, expert opinions and other actual data; and continuously optimizing the reasoning model and knowledge graph based on the feedback results.

[0097] The second embodiment of the present invention is to provide a complex equipment intelligent maintenance reasoning method based on knowledge graph and large language model, the flow chart is as follows Figure 1 As shown, specifically including:

[0098] 1. Construct a dataset for fault entity relationship extraction. Extract fault-related content from multi-source heterogeneous data sources (including but not limited to aviation maintenance manuals, equipment logs, sensor data, etc.) to construct a dataset, which is used for classification prediction of different entity types and different relationship types.

[0099] The step 1 specifically includes:

[0100] 1.1 Structuring of multi-source heterogeneous data. Perform semantic analysis on multi-source heterogeneous data and use annotation tools to convert unstructured data into structured data. Data sources include maintenance record manuals, log files, etc., and annotate fault entities and the relationships between these entities.

[0101] In the multi-source heterogeneous dataset, entity types include model, system, system component, fault phenomenon, fault cause, inspection item, maintenance method, etc., and relationship types include component inclusion relationship, fault cause relationship, maintenance suggestion relationship, etc. The basic format of the dataset includes the original sentence text and a set of triples, where the triple T includes the head entity h, the relationship type r, and the tail entity t. The triple form is shown in Formula 1:

[0102] T=<h,r,t> (1)

[0103] 1.2. Data cleaning and noise removal. Clean the original data to remove noise, redundant information and invalid records, ensure data consistency and integrity, and ensure data quality. Remove irrelevant and duplicate data, and slice the text content according to length and punctuation.

[0104] 1.3 Extraction of text vector feature information. For a sequence of text X = {x1, x2, ..., x n}, use BERT's Embedding strategy to convert the data set text into feature vectors, extract keywords and context information, and map each word to a high-dimensional vector space so that the model can process it. The calculation formula is shown in Formula 2:

[0105] h i =Embedding(x i |{x1,…,x n}) (2)

[0106] Among them, x i is the i-th word in the original text, h i Represents the 768-dimensional word embedding of the i-th word.

[0107] 1.4 Construction of a dataset of fault entity relationship extraction containing about 2,000 samples. There are 8 entity types, namely: model, system, fault name, fault phenomenon, fault impact, fault location, inspection method, and maintenance method, and 8 relationship types, namely: contains, generates faults, generates phenomena, generates impacts, specific locations, requires inspection, and requires maintenance.

[0108] 2. Construction of fault entity-relationship joint extraction model. By introducing the self-attention mechanism optimization, the CasRel entity-relationship joint extraction model is constructed. The input of the model is text information of a certain length, and the output of the model is a triple of entities and relationships in the text. By introducing the self-attention mechanism to mine the contextual information features of the fault entity, accurate and efficient identification of the potential relationship between fault entities in multi-source heterogeneous data can be achieved.

[0109] The step 2 specifically includes:

[0110] 2.1 Pointer network construction for entity relationship extraction. The entity relationship joint extraction model CasRel constructed by the present invention is a pointer network prediction architecture such as Figure 2 As shown in Figure 1, it includes an entity pointer network and a relationship pointer network. The entity pointer network is used to predict the head and tail position labels of all entities in the text, and the relationship pointer network is used to predict the multi-dimensional mapping of the relationship between different entities in the text.

[0111] (1) Entity Pointer Network

[0112] Given an input text sequence X = {x1, x2, ..., x n}, after using BERT's Embedding strategy to convert the dataset text into a feature vector H, the model's goal is to predict the start and end positions of each entity. For the i-th word, the hidden layer calculation of the start and end positions output by the pointer network is as follows:

[0113] As shown in formula 3-formula 4:

[0114]

[0115] Among them, h i is the multidimensional embedding vector of the i-th word in the input text, W s and W e are the weight matrices for predicting the start and end positions, respectively, and b s and b e is the bias term, is the starting position pointer hidden layer weight of the output word i, is the hidden layer weight of the end position pointer of the i-th word output, and Softmax is the activation function.

[0116] (2) Relationship Pointer Network

[0117] After the entity pointer network predicts the location of the entity, the relationship pointer network is responsible for predicting the relationship between these entities. Given the locations of two entities, the relationship between them is calculated through the relationship pointer network. The calculation formula is shown in Equation 5:

[0118]

[0119] in, is the predicted relationship vector of the i-th word, with a dimension of M×2, the number of relationship types, that is, including the start position and the end position. is the i-th word embedding of the sentence word embedding of the head entity position to be predicted, h i is the word embedding of the i-th word in the sentence, W r is the weight matrix of the predicted relationship, b r is the bias term. It can be determined by the rule of formula 6:

[0120]

[0121] Among them, start and end are the starting position and ending position of the entity respectively.

[0122] 2.2 Self-attention mechanism optimization: By introducing the self-attention mechanism, the context information weight configuration adjustment is added between the output layers of the pointer network to mine the context information features of the fault entity, and to achieve accurate and efficient identification of the potential relationship between fault entities in multi-source heterogeneous data.

[0123] In order to enhance the model's ability to capture contextual information, the present invention introduces a self-attention mechanism. The self-attention mechanism can be used to measure the relevance of each word in the sequence to other words, thereby dynamically adjusting its weight in the prediction process. First, the input feature F is processed by the learnable weight matrix W Q , W K , W V The query matrix Q, key matrix K, and value matrix V are obtained, as shown in Formula 7:

[0124]

[0125] Then calculate through the self-attention mechanism, as shown in Formula 8:

[0126]

[0127] Among them, Q, K, and V represent the query matrix, key matrix, and value matrix after the input sequence is transformed into different linear matrices, respectively. k Indicates the dimension of the key.

[0128] Through the self-attention mechanism calculation, the model can calculate the relevance weight of each word with other words, and then weighted sum to obtain a new representation. The calculation formulas for the final input of the entity pointer network and the relationship pointer network after the self-attention mechanism layer are shown in Equations 9-11:

[0129] P start =Attention(E s ) (9)

[0130] P end =Attention(E e ) (10)

[0131] P r (r,t|h)=Attention(E r (r,t|h)) (11)

[0132] Among them, P startand P end Output score matrix for entity pointer network, the size is 1×N, N is the sentence length, P r (r, t|h) is the output score of the relation pointer network, and its size is (M×2)×N, where M is the number of relation types, and E s 、E e 、E r (r, t|h) are the entity start position matrix hidden layer, entity end position matrix hidden layer, and relationship matrix hidden layer respectively.

[0133] 2.3 Entity relationship decoding of pointer network. Decode the entity head and tail position label encoding and multidimensional relationship mapping encoding in the pointer network output by the entity relationship joint extraction model, and extract triples in the form of <head entity, relationship, tail entity> to achieve the extraction of triple structured data from raw text.

[0134] The starting position and ending position of the entity are finally divided into 0 or 1 by the set score threshold of 0.5. The calculation formula is shown in Formula 12:

[0135]

[0136] Among them, P i is the original score of the ith position in the sentence, is the final output score of the i-th position in the sentence.

[0137] 3. Training and evaluation of the entity-relationship joint extraction model: Use the constructed dataset to train and test the entity-relationship joint extraction model, and comprehensively evaluate the model's classification and prediction performance for entities and relationships.

[0138] The step 3 specifically includes:

[0139] 3.1 Dataset division and model training. The constructed dataset is divided into training set and test set in the ratio of 80% and 20%. The model optimizes the target through the cross entropy function, and sets the ratio parameter to balance the training loss of entities and relationships to optimize the training results. The calculation formula is shown in Formula 13:

[0140] L=L e +λL r (13)

[0141] Among them, L e is the cross loss of the entity pointer network, L r is the cross loss of the relation pointer network, λ is the adjustment parameter, and L is the total training loss.

[0142] 3.2 Model performance evaluation indicator selection. In order to quantitatively evaluate the prediction performance of the constructed entity relationship joint extraction model, accuracy, recall, and F1 score are introduced as indicators to measure the difference between the model predicted triples and the actual triples. The calculation formulas of accuracy, recall, and F1 score are shown in Equations 14 to 16:

[0143]

[0144] Among them, TP is a true positive, FP is a false positive, and FN is a false negative.

[0145] 3.3 Model performance evaluation and comparison. The performance of the model is evaluated using the test set obtained after partitioning, and the performance is compared with the benchmark method (i.e., the original CasRel model) to evaluate the prediction classification accuracy and calculation speed of the entity relationship joint extraction model.

[0146] The comparison of the prediction result indicators of the method of the present invention and the benchmark method is as follows.

[0147] How to use Accuracy Recall F1 score Benchmark Methodology 0.843 0.871 0.857 Method of the present invention 0.944 0.957 0.950

[0148] It can be seen from the accuracy, recall rate and F1 score indicators of the results that the method of the present invention is better than the benchmark method, with an improvement of nearly 10%, achieving relatively good results.

[0149] 4. Construction of aviation equipment fault knowledge graph. Based on the Neo4j tool, the extracted fault entities and their relationships are stored and managed to form an aviation equipment fault knowledge graph. The fault entities are mapped as nodes in the graph, and the relationships between fault entities are mapped as edges in the graph. A knowledge graph with a logical structure is constructed to achieve efficient query and maintenance of the knowledge graph.

[0150] The present invention constructs an aviation equipment fault knowledge graph based on the Neo4j tool, and the specific steps are as follows:

[0151] (1) Fault knowledge structuring: The extracted fault entities and their relations are stored in a table in the form of triples, including the head entity name, relation type, and tail entity name.

[0152] (2) Importing fault knowledge. The structured triples are imported into the Neo4j database through Cypher statements to form a directed graph. Each fault entity is mapped as a node in the graph, and the relationship between entities is mapped as an edge in the graph. The results of the knowledge graph after import are as follows: Figure 3 shown.

[0153] (3) Knowledge fusion: Duplicate entities in the knowledge graph are fused and removed through Cypher statements, and nodes with extremely high similarity are further fused and removed based on OpenAI’s similarity matching.

[0154] (4) Dynamic update and maintenance. When new fault entities and relationships are added, the knowledge graph is updated in real time, the new nodes are matched with the old nodes for similarity, and the new nodes with extremely high similarity are merged with the old nodes.

[0155] 5. Intelligent maintenance reasoning based on knowledge graph and large language model. Combine the constructed aviation equipment fault knowledge graph with the large language model, enhance the generation capability of the large language model through the retrieval query results of the knowledge graph, and generate intelligent fault diagnosis and maintenance reasoning results. Obtain fault information based on deep query of nodes and relationships in the knowledge graph and combine it with the large language model to improve the reasoning accuracy and pertinence of the large language model, automatically generate maintenance plans, fault prediction suggestions and optimize decisions, and the intelligent maintenance reasoning process is as follows: Figure 4 shown.

[0156] The step 5 specifically includes:

[0157] (1) Construct a large language model input template. Introduce a large language model and set an input template that includes questions and prompt words.

[0158] (2) Construct node word embeddings. Based on the knowledge graph constructed above, the node names are converted into word embeddings through the OpenAIEmbeddings method, and the FAISS vector index is constructed based on this.

[0159] (3) Node vector retrieval: The question is converted into word embeddings according to OpenAIEmbeddings, and similarity matching is performed through FAISS vector indexing. The number of matching nodes is set to 10.

[0160] (4) Relationship retrieval. Through the above node vector retrieval, matching nodes are obtained, and adjacent nodes are further retrieved in the knowledge graph according to the Cypher statement. Sentences are reorganized according to the retrieved node names, and the sentences are sorted according to the original similarity matching ranking.

[0161] (5) Importing prompts. The sentences obtained by retrieval ranking are used as prompt words in order of ranking and imported into the large language model input template. The large language model automatically generates maintenance plans, fault prediction suggestions, and optimization decisions based on the prompts.

[0162] (6) Relationship classification retrieval. Furthermore, the original question is first input into the large language model to obtain the relationship classification result. The question types include querying the name of the associated fault, querying the maintenance plan, querying the inspection items, querying the models or parts involved, etc. The Cypher statement used will be further refined according to the question type to perform the above relationship retrieval to reduce the interference items of the large language model input prompts.

[0163] 6. Verification and optimization of intelligent maintenance reasoning solutions. Verify and optimize the generated maintenance reasoning results, including: comparing and verifying with actual data such as historical maintenance records and expert opinions; and continuously optimizing the reasoning model and knowledge graph based on feedback results.

[0164] The step 6 specifically includes:

[0165] (1) Intelligent question answering with a large language model. The original question and the hint words retrieved in the above steps are input into the OpenAI large language model, which then obtains the optimal maintenance plan based on reasoning.

[0166] (2) Entity relationship extraction. Figure 2 The trained entity relation joint extraction model shown extracts structured triples from the conversation results of a large language model.

[0167] (3) Update of knowledge graph. New maintenance results and fault information are dynamically added to the knowledge graph to ensure the real-time and effectiveness of the knowledge graph, as shown in Equation 17:

[0168] G new =G old ∪ΔG (17)

[0169] Among them, G old is the set of triples already in the knowledge graph, ΔG is the set of newly identified triples, G new It is the triple set after the knowledge graph is updated.

[0170] The above is only a specific embodiment of the present invention, and the present invention is described in detail. The unexplained part is a conventional technology. However, the protection scope of the present invention is not limited to this. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. The protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. An intelligent maintenance reasoning method based on knowledge graph and large language model, characterized in that: The following steps are involved: Step 1: Construct a dataset for fault entity relationship extraction; Step 2: Construct a fault entity relationship joint extraction model; Step 3: Train and evaluate the entity relationship joint extraction model; Step 4: Construct a knowledge graph of complex equipment failures; Step 5: Perform intelligent maintenance reasoning based on the knowledge graph and large language model; Step 6: Verify and optimize the intelligent maintenance reasoning solution.

2. The intelligent maintenance reasoning method based on knowledge graph and large language model according to claim 1 is characterized in that: Step 1: Extract fault-related content from multi-source heterogeneous data to build a dataset, which is used for classification prediction of different entity types and different relationship types.

3. The intelligent maintenance reasoning method based on knowledge graph and large language model according to claim 2 is characterized in that: Step 1 specifically includes the following steps: 1.

1. Data cleaning and noise removal: Clean multi-source heterogeneous data, remove noise, redundant information and invalid records, ensure data consistency and integrity, and ensure data quality; 1.2 Structuring the processed multi-source heterogeneous data: semantically parse the multi-source heterogeneous data and convert the unstructured data into structured data; in the structured multi-source heterogeneous data set, the entity types include model equipment, system, system components, fault phenomenon, fault cause, inspection item, and maintenance method, and the relationship types include component inclusion relationship, fault cause relationship, and maintenance suggestion relationship; the basic format of the structured multi-source heterogeneous data set includes the original sentence text and a set of triples, where the triple T includes the head entity h, the relationship type r, and the tail entity t, and the triple form is shown in Formula 1: T=<h,r,t> (1); 1.3 Extraction of text vector feature information: For a sequence text X = {x1, x2, ..., x n }, convert the structured data into feature vectors, extract keywords and context information, and map each keyword to a high-dimensional vector space. The processing formula for converting structured data into feature vectors is shown in Formula 2: h i =Embedding(x i ∣{x1,…,x n }) (2) Among them, x i is the i-th keyword in the original text, h i Represents the 768-dimensional word embedding of the i-th keyword; The dataset for fault entity relationship extraction is constructed.

4. The intelligent maintenance reasoning method based on knowledge graph and large language model according to claim 1 is characterized in that: Step 2 specifically introduces the self-attention mechanism to optimize and construct the CasRel entity relationship joint extraction model; the input of the CasRel entity relationship joint extraction model is text information of a certain length, and the output is a triple of entity and relationship. By introducing the self-attention mechanism, the contextual information features of the fault entity are mined to achieve accurate and efficient identification of the potential relationship between fault entities in multi-source heterogeneous data.

5. The intelligent maintenance reasoning method based on knowledge graph and large language model according to claim 4 is characterized in that: The step 2 specifically includes: 2.1 Constructing entity relationship extraction pointer network: The CasRel entity-relationship joint extraction model includes an entity pointer network and a relationship pointer network. The entity pointer network is used to predict the head and tail position labels of all entities in the text, and the relationship pointer network is used to predict the multi-dimensional mapping of the relationship between different entities in the text. (1) Entity Pointer Network Given an input text sequence X = {x1, x2, ..., x n }, after converting the structured data into the feature vector H, the goal of the CasRel entity relationship joint extraction model is to predict the starting and ending positions of each entity. For the i-th keyword, the hidden layer of the starting and ending positions is output through the pointer network, and the calculation is shown in Equation 3-Equation 4: Among them, h i is the multidimensional embedding vector of the i-th keyword in the input text, W s and W e are the weight matrices for predicting the start and end positions, respectively, and b s and b e is the bias term, is the hidden layer weight of the starting position pointer of the i-th keyword output, is the hidden layer weight of the end position pointer of the i-th keyword output, and Softmax is the activation function; (2) Relationship Pointer Network After the entity pointer network predicts the location of the entity, the relationship pointer network is responsible for predicting the relationship between the entities predicted by the entity pointer network. Given the locations of two entities, the relationship between them is calculated through the relationship pointer network. The calculation formula is shown in Formula 5: in, is the predicted relationship vector of the ith keyword, is the i-th word embedding of the sentence word embedding of the head entity position to be predicted, h i is the word embedding of the i-th keyword in the sentence, W r is the weight matrix of the predicted relationship, b r is the bias term; Determined by the rule of formula 6: Among them, start and end are the starting position and ending position of the entity respectively; 2.2 Self-attention mechanism optimization: By introducing the self-attention mechanism, the context information weight configuration adjustment is added between the output layers of the pointer network to mine the context information features of the fault entity, and to achieve accurate and efficient identification of the potential relationship between fault entities in multi-source heterogeneous data; In order to enhance the ability of CasRel entity relationship joint extraction model to capture contextual information, the self-attention mechanism is introduced. The self-attention mechanism is used to measure the text sequence X = {x1, x2, ..., x n }, and dynamically adjust its weight in the prediction process, which specifically includes the following steps: First, the input feature F is transformed into a learnable weight matrix W. Q , W K , W V The query matrix Q, key matrix K, and value matrix V are obtained, as shown in Formula 7: Secondly, the self-attention mechanism is calculated as shown in Equation 8: Among them, d k Represents the dimension of the key; Again, through the self-attention mechanism calculation, the CasRel entity relationship joint extraction model can calculate the relevance weight of each word with other words, and then weighted sum to obtain a new representation; the calculation formulas for the final input of the entity pointer network and the relationship pointer network are shown in Equations 9-11: P start =Attention(E s ) (9) P end =Attention(E e ) (10) P r (r,t∣h)=Attention(E r (r,t∣h)) (11) Among them, P start and P end Output score matrix for entity pointer network, P r (r,t|h) is the output score of the relation pointer network, E s 、E e 、E r (r, t|h) are the entity start position matrix hidden layer, entity end position matrix hidden layer, and relationship matrix hidden layer respectively; 2.3 Decoding the entity relationship of the pointer network: Decode the entity head and tail position label encoding and multidimensional relationship mapping encoding in the pointer network output by the CasRel entity relationship joint extraction model, extract triples in the form of "head entity, relationship, tail entity", and realize the extraction from the original sentence text to triple structured data; the starting position and ending position of the entity are finally divided into 0 or 1 by the set score threshold of 0.5, and the calculation formula is shown in Formula 12: Among them, P i is the original score of the ith position in the sentence, is the final output score of the i-th position in the sentence.

6. The intelligent maintenance reasoning method based on knowledge graph and large language model according to claim 1 is characterized in that: Step 3 specifically uses the constructed dataset to train, verify and test the CasRel entity-relationship joint extraction model, and comprehensively evaluates the model's classification and prediction performance for entities and relationships.

7. The intelligent maintenance reasoning method based on knowledge graph and large language model according to claim 6 is characterized in that: The step 3 specifically includes: 3.1 Dataset division and model training: The constructed dataset is divided into training set and test set according to the ratio of 80% and 20% respectively. The CasRel entity relationship joint extraction model is optimized through the cross entropy function. At the same time, the ratio parameter is set to balance the total training loss of entities and relationships, and the training results are optimized. The calculation formula is shown in Formula 13: L=L e +λL r (13) Among them, L e is the cross loss of the entity pointer network, L r is the cross loss of the relation pointer network, λ is the adjustment parameter, and L is the total training loss; 3.2 Selecting the performance evaluation indicators of the CasRel entity relationship joint extraction model: In order to quantitatively evaluate the prediction performance of the constructed entity relationship joint extraction model, the accuracy, recall rate, and F1 score are introduced as indicators to measure the difference between the model predicted triples and the actual triples; the calculation formulas of accuracy, recall, and F1 score are shown in Equations 14 to 16: Among them, TP is a true positive example, FP is a false positive example, and FN is a false negative example; 3.3 Evaluation and comparison of the performance of the CasRel entity relationship joint extraction model: Use the test set obtained after division to evaluate the performance of the CasRel entity relationship joint extraction model, and compare the performance with the CasRel entity relationship joint extraction model in step 2 through the comparative benchmark method to evaluate the prediction and classification accuracy of the CasRel entity relationship joint extraction model after target optimization of the cross entropy function.

8. The intelligent maintenance reasoning method based on knowledge graph and large language model according to claim 7 is characterized in that: The step 4 is to store and manage the extracted fault entities and relationship types based on the Neo4j tool to form a complex equipment fault knowledge graph. The specific steps are as follows: (1) Fault knowledge structuring: The extracted fault entities and relationship types are stored in a table in the form of triples; (2) Import fault knowledge: Import structured triples into the Neo4j tool using Cypher statements; (3) Deduplication of fault knowledge graph: Duplicate entities in the knowledge graph are deduplicated using Cypher statements, and then high-similar nodes are further deduplicated based on the OpenAI similarity matching mechanism. (4) Dynamic update and maintenance of the fault knowledge graph: When new fault entities and relationship types are added, the fault knowledge graph is updated in real time, and the new nodes are matched with the old nodes for similarity, and the new nodes with extremely high similarity are merged with the old nodes.

9. The intelligent maintenance reasoning method based on knowledge graph and large language model according to claim 8 is characterized in that: Step 5: Based on the knowledge graph and large language model, intelligent maintenance reasoning is performed, specifically: Combine the constructed complex equipment fault knowledge graph with the large language model, enhance the generation capability of the large language model through the retrieval query results of the knowledge graph, and generate intelligent fault diagnosis and maintenance reasoning results. That is, based on the deep query of nodes and relationships in the knowledge graph, the fault information is obtained and combined with the large language model to improve the reasoning accuracy and pertinence of the large language model, and automatically generate maintenance plans, fault prediction suggestions and optimization decisions; Step 5 specifically includes: (1) Constructing a large language model input template: Introduce a large language model and set an input template, including the question and prompt word parts; (2) Construct node word embeddings: Based on the fault knowledge graph, the node name is converted into word embeddings through the OpenAIEmbeddings method, and the FAISS vector index is constructed; (3) Node vector retrieval: similarity matching is performed through FAISS vector index, and the number of matching nodes is set to 10; (4) Relationship retrieval: retrieve matching nodes through node vectors, use Cypher statements to retrieve adjacent nodes in the knowledge graph, reconstruct sentences based on the retrieved nodes, and sort the reconstructed sentences based on the original similarity matching order; (5) Importing prompt words: Generate prompt words based on the sentences sorted in (4) and import them into the large language model input template. The large language model automatically generates maintenance reasoning results based on the prompts, including maintenance plans, fault prediction suggestions, and optimization decisions; (6) Relationship classification retrieval: The Cypher statements used for relationship retrieval are further refined according to the question type to reduce the interference of large language model input prompts. Question types include querying related fault names, querying maintenance plans, querying inspection items, and querying involved models or parts.

10. The intelligent maintenance reasoning method based on knowledge graph and large language model according to claim 9 is characterized in that: Step 6 specifically verifies and optimizes the generated maintenance reasoning results, including: comparing and verifying with actual data; continuously optimizing the reasoning model and knowledge graph based on the feedback results; The step 6 specifically includes: (1) Intelligent question answering with a large language model: OpenAI’s large language model infers the optimal maintenance solution based on the input prompt words; (2) Extracting entity relations: Using the CasRel entity relation joint extraction model obtained in step 3, we extract structured triples from the conversation results of the large language model. (3) Update the knowledge graph: Dynamically add new maintenance results and fault information to the fault knowledge graph to ensure the real-time and effectiveness of the fault knowledge graph, as shown in Equation 17: G new =G old ∪ΔG (17) Among them, G old is the set of existing triples in the fault knowledge graph, ΔG is the set of newly identified triples, G new It is the triple set after the fault knowledge graph is updated.

Citation Information

Cited By

  • Multi-modal agent RAG-ReAct double-engine cooperative training method

    CN120256971A

  • A dual-engine collaborative training method for multimodal intelligent agents RAG-ReAct

    CN120256971B

  • Execution method of large model graph retrieval enhancement system oriented to software and hardware monitoring operation and maintenance

    CN120386898A

  • Implementation method of large model graph retrieval enhancement system for software and hardware monitoring and operation

    CN120386898B

  • Helicopter transmission system fault information extraction method based on RL-GPNet

    CN120541691A