Intelligent operation and maintenance decision-making assistance method, equipment and medium based on large language model
By adopting a method based on a large language model in intelligent operation and maintenance assisted decision-making, a professional knowledge base and knowledge graph are built, and large-model assisted decision-making is solved, and the problems of high data requirements, difficulty in algorithm selection, and poor system interaction in intelligent operation and maintenance assisted decision-making are achieved, and operation and maintenance decision-making with high accuracy and reliability are achieved.
Patent Information
- Application Number
- CN202510247549.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2045-03-04
AI Technical Summary
In the field of intelligent operation and maintenance assisted decision-making, it is difficult for the existing technology to effectively combine large language models to solve the problems of high data requirements, difficulty in selecting algorithms, and poor system interaction, resulting in insufficient accuracy and reliability of operation and maintenance decisions.
Using intelligent operation and maintenance assisted decision-making methods based on large language models, we use offline to build a professional knowledge base and knowledge graph, and conduct large-model assisted decision-making online, including text knowledge retrieval, rule query and prompt template modules to ensure the accuracy and interpretability of the decision-making process.
It improves the accuracy and reliability of Q&A in professional fields, enhances the interpretability and human-computer interaction of operation and maintenance decisions, reduces the cost of model application, and does not require a large amount of hardware equipment support.
Smart Images

Figure CN119739797B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of operation and maintenance technology, and in particular to an intelligent operation and maintenance auxiliary decision-making method, device and storage medium based on a large language model. Background Art
[0002] Large Language Model (LLM) is an important technology in the field of artificial intelligence. It is based on deep learning algorithms and understands and generates natural language text by training large-scale massive data sets. Large language models usually contain billions or even hundreds of billions of parameters, which can capture the complexity and diversity of language, and thus perform very well in various natural language processing tasks. The core advantage of large language models lies in their powerful semantic understanding and text generation capabilities. They can generate coherent and logical texts, and can even simulate human conversations to achieve tasks such as question answering, translation, and summarization. In addition, they can understand complex language structures and semantic relationships, and perform sentiment analysis and entity recognition on texts. In general, the logical thinking and reasoning capabilities demonstrated by large language models make them a particularly prominent technology in the current field of artificial intelligence, and they have broad application prospects and huge development potential.
[0003] Intelligent operation and maintenance decision-making assistance is an innovative application in the field of operation and maintenance. It uses artificial intelligence technology to realize the intelligence and efficiency of operation and maintenance work. Through real-time monitoring, fault prediction, intelligent alarm, automated deployment and other means, intelligent operation and maintenance decision-making assistance can quickly identify and solve system problems, reduce failure rates, and improve system performance. At the same time, it can also liberate manpower, allowing operation and maintenance personnel to have more time and energy to deal with complex problems and carry out innovative work. The application of intelligent operation and maintenance decision-making assistance will bring higher operation and maintenance efficiency and better business continuity to enterprises, and is an important development direction in the field of operation and maintenance.
[0004] With the rapid development of computing and storage technologies, large language model technology in artificial intelligence has also made great progress. Despite the great progress in technology, there are still huge challenges in combining large language model technology with intelligent operation and maintenance decision-making assistance. In actual situations, large language model technology will have the following three significant problems in the field of intelligent operation and maintenance decision-making assistance:
[0005] From the perspective of data, intelligent operation and maintenance decision-making has extremely high requirements for data. The accuracy of data will directly affect the success of inspection and maintenance tasks. The instability of data is likely to lead to wrong decisions, causing misunderstandings among operation and maintenance personnel at work, making it difficult to carry out operation and maintenance tasks;
[0006] From the perspective of algorithm selection, operation and maintenance decision-making assistance has high requirements for algorithm selection. In operation and maintenance decision-making assistance, there is a large amount of data in different modes. Data in different modes need to be processed by models in different modes. At the same time, the model must be extremely accurate and must not have an adverse impact on the decision.
[0007] From the perspective of system interactivity, the operation and maintenance decision-making support system requires good human-computer interaction and compatibility across multiple platforms. In the process of intelligent operation and maintenance decision-making support, the interaction between the operation and maintenance personnel and the operation and maintenance system needs to be real-time, and the model processing and response are coordinated operations between multiple platforms.
[0008] Based on the above reasons, applying large language models in intelligent operation and maintenance decision-making assistance will further implement operation and maintenance decisions and make the operation and maintenance decision-making system more usable. Summary of the invention
[0009] The present invention proposes an intelligent operation and maintenance auxiliary decision-making method, device and storage medium based on a large language model, which can solve at least one of the technical problems in the background technology.
[0010] To achieve the above object, the present invention adopts the following technical solutions:
[0011] An intelligent operation and maintenance decision-making assistance method based on a large language model includes the following steps:
[0012] This includes offline professional knowledge base and knowledge graph construction process, as well as online large model-assisted decision-making process;
[0013] The offline professional knowledge base and knowledge graph construction process includes three core sub-modules, namely, the local knowledge base generation module, the knowledge graph construction module and the generation logic rule module. The local knowledge base generation module and the knowledge graph construction module are used to process the input text data, while the generation logic rule module directly processes the result of the knowledge graph construction module, and the two are in a serial relationship.
[0014] The online large model assisted decision-making process includes three core sub-modules, namely, text knowledge retrieval module, rule query module and prompt template module. The prompt template module is used to process the results of the text knowledge retrieval module and the rule query module, and has a serial relationship with the two. The text knowledge retrieval module and the rule query module are in a parallel relationship, and are used to process the local knowledge base and knowledge graph data respectively. The processing logic of the three sub-modules is different, and together they constitute the assisted decision-making process.
[0015] Furthermore, the local knowledge base generation module applies text preprocessing methods to process the collected text knowledge data in related professional fields and obtains a usable high-quality dataset; based on the available high-quality dataset, the text embedding model is fine-tuned. , where f represents the text embedding model, θ represents the model parameters before fine-tuning, Represents the fine-tuned model parameters; Apply the fine-tuned text embedding model to vectorize and embed text knowledge in professional fields , where V represents the embedding vector and T represents the text knowledge; the clustering algorithm and the fast vector library are combined to realize the index construction and knowledge preservation of the vectorized text data, forming the final local knowledge base as follows:
[0016]
[0017] Among them, I represents the constructed index, IndexCosine represents the index construction method based on cosine distance, Kmeans represents the clustering algorithm, represents the L2 norm.
[0018] Furthermore, the knowledge graph construction module uses the prior knowledge of related fields and the natural language model to realize the conversion of text data into graph data. , where KGs represents the generated knowledge graph data and LLM represents the natural language big model; based on the prior knowledge of related fields, the available ontology layer and entity layer framework are constructed. The natural language big model extracts the triple information in the text data under the set ontology layer and entity layer framework. , where h, r, t represent the head entity, relationship and tail entity of the triple respectively, and H, R, T represent the head entity set, relationship set and tail entity set of the triple respectively, and are saved in the graph database to form the corresponding knowledge graph data KGs.
[0019] Furthermore, the logic rule generation module uses the semantic and structural information in the knowledge graph data to allow the natural language model to apply the thought chain method to extract logic rules from the triple data of the knowledge graph, as follows:
[0020]
[0021] Among them, ρ represents the set of logical rules, H and L represent the final and initial states of the rules, X, Y, Z represent the entity data in the graph data, and l represents the relationship between two entities; the rule ranker is used to score and sort the logical rules, and the natural language big model is used to verify the logical rules, and reliable logical rules are extracted for query, as follows:
[0022]
[0023] in, , represents a set of facts satisfying body(ρ) in KGs, Represents the head rule that satisfies the fact in KGs.
[0024] Furthermore, the text knowledge retrieval module applies the above text embedding model to embed the input question into a vector, and then applies the clustering algorithm and the semantic similarity algorithm to search in the fast vector library, as follows:
[0025]
[0026] Among them, A and B represent text vector representation, and θ represents the angle between vectors. Get similar vector text data ; According to the set maximum retrieval threshold, retain the first few vector text data that are most similar to the input question, as follows:
[0027]
[0028] in, , k represents the set maximum retrieval threshold, and uses the text embedding model to de-encode the similar vector data and output the final text data ,in, Represents the inverse encoding of a text embedding model.
[0029] Furthermore, the rule query module uses the natural language model to call the corresponding logical rules in the knowledge graph data, queries the subgraph related to the input question, and applies the graph database query statement to find the most relevant target triple data. , where triplet represents the target triplet data, input represents the user input, ρ represents the rule query, and LLM represents the application of the large model to extract entities.
[0030] Furthermore, the prompt template module organically combines the input question, similar text data and target triple data, expressed as:
[0031]
[0032] Among them, prompt represents the designed prompt enhancement method, SEP represents the connection operation, text represents similar text, triplet represents the target triplet data, and input represents the question input by the user, thereby realizing input enhancement of the natural language large model, so that the reasoning of the natural language large model is explainable and accurate.
[0033] Furthermore, we use the natural language big model to generate semantic similarity datasets in related fields, and apply different types of natural language big models to screen the datasets to ensure the availability of the datasets. Then, we apply the big model training framework and fine-tune the text embedding model suitable for the current field based on the contrastive learning method, as follows:
[0034]
[0035] Among them, f represents the text embedding model, x represents the original sample, and K represents the number of negative samples. represents a positive sample, represents negative samples, α is a hyperparameter, which represents the minimum distance difference between positive and negative sample pairs, and its value is 1.0;
[0036] Based on the regularization method, a clustering algorithm with anomaly recognition capability is constructed to avoid the influence of data with poor embedding effect, and it is embedded into the fast vector library to realize the index construction function, as follows:
[0037]
[0038] Where x represents a data point, represents the L2 norm, d represents the dimension of the data, represents the i-th cluster center, and Represent x and The value in the j dimension; The update method is ,in, represents the set of data points of the i-th cluster, Indicates the amount of data in this collection.
[0039] Furthermore, it also includes applying the thought chain method to construct a step-by-step prompt template; at the same time, it integrates roles, goals, and execution requirements, inputs the input content, search information, and target triples as background information into the natural language big model, guides the chain reasoning and output of the big model, and realizes the interpretability of the results, as follows:
[0040]
[0041] Among them, input represents the user's input, X represents the intermediate output of reasoning, and output represents the final output of the large model.
[0042] On the other hand, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the above method.
[0043] On the other hand, the present invention further discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.
[0044] It can be seen from the above technical scheme that the intelligent operation and maintenance decision-making support method based on a large language model of the present invention can effectively improve the accuracy and reliability of questions and answers in professional fields by combining knowledge graph technology, local knowledge base retrieval technology and large model question and answer technology; using knowledge graph technology, the entire question and answer reasoning process can be well displayed in a visual way, so that the results of the question and answer are based on evidence and more reliable; and the local knowledge base retrieval technology can enable the local library knowledge to be updated at any time, keep up with the latest news in the current field, so that the question and answer results are accurate and timely.
[0045] The intelligent operation and maintenance decision-making assistance method based on a large language model of the present invention includes collecting text knowledge data in related professional fields, applying open source methods to process to obtain high-quality data sets, and then using text embedding methods to convert text data sets into vectors for local storage; using a large model in combination with a set ontology framework to construct knowledge graph data in professional fields and save them in a database; using a large model to process the semantics and structural information of the generated knowledge graph to derive usable logical rules; performing information retrieval and graph rule matching on questions input by users to obtain local text information and target triple data related thereto; using prompt engineering technology to enhance the results of the retrieval and the input questions, and using the large model to perform question and answer, and visualize the target triple data. The present invention combines the large model with the local knowledge base, and can greatly improve the effect of the model without fine-tuning the large model, greatly reducing the application cost of the model.
[0046] Specifically, compared with the prior art, the present invention has the following beneficial effects:
[0047] Using expertise in a specific field as reference material, and combining knowledge graphs with local knowledge bases, further improves input content and improves the reliability of input knowledge to ensure that the output of the large language model is more in line with user expectations and closer to the real answer;
[0048] Using the template technology of the prompt project to limit the output of the large language model, the solution to the hallucination problem of the large model has been greatly improved, ensuring that its output is legal and compliant, and also in line with ethical constraints;
[0049] The application of knowledge graphs greatly improves the interpretability of large models and enables intelligent operation and maintenance systems to reason from faults to causes, making fault repairs more thorough and improving economic benefits.
[0050] The application of visualization further enhances the human-computer interaction of the intelligent operation and maintenance decision-making support system. It is not limited to the form of question and answer, but shows the chain relationship of the decision-making process, so that users can learn knowledge and gain reliable operation and maintenance experience during use.
[0051] Combining the large model with the local knowledge base can greatly improve the model effect without fine-tuning the model, greatly reducing the application cost of the model and eliminating the need for a large amount of hardware support.
[0052] Use a large model combined with the semantic and structural information in the knowledge graph to generate corresponding logical rules. This ensures that even if the input question cannot directly find the corresponding node, the corresponding subgraph can be matched according to the logical rules to ensure the accuracy of the final question and answer. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The drawings constituting a part of the present application are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0054] Figure 1 The overall structure of the embodiment of the present invention;
[0055] Figure 2 Flow chart for implementing the present invention;
[0056] Figure 3 This is an implementation flow chart of step 3 and step 4 of an embodiment of the present invention. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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.
[0058] like Figure 1 and Figure 2 As shown, the intelligent operation and maintenance auxiliary decision-making method based on a large language model described in this embodiment is to solve the problems existing in the prior art. The present invention adopts the following technical solutions:
[0059] The following steps are involved:
[0060] Offline professional knowledge base and knowledge graph construction process, as well as online large model assisted decision-making process;
[0061] The offline professional knowledge base and knowledge graph construction process includes three core sub-modules, namely, a local knowledge base generation module, a knowledge graph construction module, and a logic rule generation module. The local knowledge base generation module and the knowledge graph construction module are used to process input text data, while the logic rule generation module directly processes the results of the knowledge graph construction module, and the two are in a serial relationship.
[0062] The online large model assisted decision-making process includes three core sub-modules, namely, a text knowledge retrieval module, a rule query module and a prompt template module. The prompt template module is used to process the results of the text knowledge retrieval module and the rule query module, and has a serial relationship with the two. The text knowledge retrieval module and the rule query module are in a parallel relationship, and are used to process the local knowledge base and knowledge graph data respectively.
[0063] The following are specific instructions:
[0064] Step 1:
[0065] The knowledge vector library of the specified professional field is constructed to obtain the knowledge vector library of the specified professional field that can perform fast and accurate intelligent question and answer in the specified professional field.
[0066] Step 1.1:
[0067] According to the designated field direction of professional questions and answers as needed, all relevant professional materials in the designated field are collected and used as the original data set of the knowledge vector library of the designated professional field.
[0068] Step 1.2:
[0069] Clean, convert and organize the original data set of the knowledge vector library in the specified professional field, analyze the authenticity of the data in the text and the identification of the differences between the data, and convert the original data set into a high-quality machine-recognizable and learnable data set.
[0070] Step 1.3:
[0071] Recursively segment the generated high-quality dataset , where t represents small text and T represents large text. The large text is divided into small texts to achieve paragraphization and usability of high-quality data sets.
[0072] Step 1.4:
[0073] Input the paragraph-based small text dataset into the fine-tuned text embedding model, and use unsupervised and zero-shot learning to achieve the transformation of text data vectorization. , where V represents the embedding vector, T represents the text data, and f represents the text embedding model.
[0074] Step 1.5:
[0075] Use the clustering algorithm as follows:
[0076]
[0077] Where x represents a data point, represents the L2 norm, d represents the dimension of the data, represents the i-th cluster center, and Represent x and The value in the j dimension; The update method is ,in, represents the set of data points of the i-th cluster, Indicates the amount of data in the set, groups the vectorized text data, classifies similar texts into the same question-answer group, and achieves the purpose of dimensionality reduction of high-dimensional vector data, as follows:
[0078]
[0079] Among them, v represents the sample, c represents the group after v is clustered, represents the L2 norm.
[0080] Step 1.6:
[0081] Based on the fast query vector library, a query index is constructed for the processed text vectorized data as follows:
[0082]
[0083] Among them, I represents the constructed index, IndexCosine represents the index construction method based on cosine distance, Kmeans represents the clustering algorithm, Represents the L2 norm and is represented by a key-value pair The query index and vectorized text data are stored in the fast query vector library in a certain way, so as to build a knowledge vector library in a specified professional field.
[0084] Step 2:
[0085] The construction of knowledge graphs in designated professional fields and the generation of logical rules based on the big model convert existing specific knowledge texts into graph data that is easier to visualize, providing a reasonable and credible explanation for the conclusions of intelligent question and answer. After the knowledge graph is generated, the big model can use the semantic and structural information contained in it to build logical rules for graph queries. The logical rules are conducive to the rapid matching of information for subsequent intelligent question and answer, ensuring the timeliness and accuracy of the answers.
[0086] Step 2.1:
[0087] Abstract and refine the knowledge in the specified professional field, build the corresponding hierarchical architecture, and define the required target entities and target relationships.
[0088] Step 2.2:
[0089] Use natural language large model technology to extract knowledge from small text data sets in designated professional fields , where E and R represent the target entity set and target relationship set respectively, T represents the input text data, and LLM represents the application of the large model to identify entity and relationship triples, obtain the target entity E and target relationship R that meet the requirements and save them in the graph database, so as to realize the construction of the knowledge graph in the specified professional field.
[0090] Step 2.3:
[0091] Use the natural language big model rule generator to generate usable logical rules based on the semantics and structural information of the constructed professional knowledge graph , where ρ represents the generated rules, LLM represents the application of large models to generate rules, and KGs represents the constructed knowledge graph. Specifically, the rule generator generates candidate rules for each relationship as follows:
[0092]
[0093] Among them, ρ represents the logical rule set, H and L represent the final and initial states of the rules, X, Y, Z represent the entity data in the graph data, and l represents the relationship between two entities.
[0094] Step 2.4:
[0095] The quality of the generated logical rules is evaluated based on the rule sorting module. The quality of the rules is estimated by combining the facts in the existing knowledge graph and the rules are sorted accordingly. This step helps to filter out meaningless rules and reduce the burden of subsequent verification, as follows:
[0096]
[0097] in, , represents a set of facts satisfying body(ρ) in KGs, Represents the head rule that satisfies the fact in KGs.
[0098] Step 2.5:
[0099] LLM’s reasoning ability is used to verify the logical correctness of ranking rules through chain reasoning. Chain reasoning is a step-by-step derivation process that helps the validator determine whether a rule is logically valid. This step helps eliminate false rules, i.e. rules that are supported in the graph but are logically incorrect.
[0100] Step 3:
[0101] Rapid retrieval of professional knowledge and matching of specific target entities and target relationships can provide a reliable question-answering background for large-model question-answering and ensure the reliability of intelligent question-answering.
[0102] Step 3.1:
[0103] The user inputs relevant questions in the specified professional field, and the relevant questions entered by the user are converted into vectorized representations based on the fine-tuned text embedding model used. ,in, Represents the input text data, represents the vector representation of the problem, and f represents the semantic embedding model. The fine-tuning method is as follows:
[0104]
[0105] Among them, f represents the text embedding model, x represents the original sample, and K represents the number of negative samples. represents a positive sample, represents negative samples, α is a hyperparameter, which represents the minimum distance difference between positive and negative sample pairs, and its value is 1.0.
[0106] Step 3.2:
[0107] Use the vectorized question data to match the text vectors in the specified professional domain knowledge vector library for semantic similarity, and find the top K text data that are most similar to it, as follows:
[0108]
[0109] in, , k represents the set maximum retrieval threshold, and V represents the text vector set.
[0110] Step 3.3:
[0111] Use natural language big model technology to identify key search entities and key search relationships in the user input text to determine the purpose of the user's question , where input represents input and LLM represents the application of large model for target recognition.
[0112] Step 3.4:
[0113] Based on the logical rules generated by the big model, query matching is performed to match the subgraph consisting of N-hop key target entities and key target relationships that are closest to the key search entity and key search relationship from the knowledge graph of the specified professional field. , where triplet represents the target triplet data, input represents the user input, ρ represents the rule query, and LLM represents the application of the large model to extract entities and visualize the matching results.
[0114] Step 4:
[0115] Combining the text information retrieved from the specified professional field knowledge vector library and the key target triple data retrieved from the specified professional field knowledge graph rules, a dedicated natural language large model is used to provide professional answers to user questions.
[0116] Step 4.1:
[0117] According to the input and output requirements of the big model and the characteristics of question and answer in the specified professional field, a set of effective prompt templates are designed to assist the big model in accurate question and answer.
[0118] Step 4.2:
[0119] Construct a business rule that combines text information and key target triple data so that the two can be organically combined as reliable background information for large-model question answering, as follows:
[0120]
[0121] Among them, SEP represents the connection operation, text represents text information, and triplet represents the key target triplet data.
[0122] Step 4.3:
[0123] With the semantic understanding, logical thinking and text generation capabilities of the dedicated natural language model, professional responses can be given to professional questions input by users, realizing intelligent question and answer in the entire designated professional field. , where input represents input, output represents output, and X represents intermediate output content.
[0124] Specifically, an intelligent operation and maintenance decision-making support system based on a large language model in an embodiment of the present invention is provided with two modules, namely: offline professional knowledge base and graph construction and online large model decision-making support. The offline process establishes relevant professional knowledge base and knowledge graph data set to ensure the timeliness of subsequent applications; the online process is the interaction process between the large model and the user.
[0125] The following is a detailed description with reference to the accompanying drawings:
[0126] Offline professional knowledge base and graph construction module:
[0127] According to the professional field that needs to be answered, collect relevant text data in the field and build a raw data set based on the relevant field. The collection methods include: using python to implant crawlers into relevant open source websites or platforms to collect data; collecting relevant text documents and using PaddleOCR developed based on python to extract text; collecting electronic manuscripts of relevant text files and using python-docx and other software packages to parse and obtain text data;
[0128] The collected raw data in related fields are preprocessed, redundant data are cleaned, wrong data sets are cleaned, various types of data are converted and organized, etc. Through such related operations, the authenticity of the collected raw data can be determined, the differences between various types of data can be eliminated, and the formats of various types of data can be converted to ensure the cleanliness and consistency of the data, and the conversion of the collected raw data sets into high-quality usable data sets can be realized;
[0129] Use the langchain toolkit to split the text of the collected high-quality data set. The method used is to split according to special characters. Use a recursive method to split according to the selected special characters (such as period, exclamation mark, and question mark, etc.) to ensure that the length of each sentence after segmentation is basically similar, and will not be too long or too short. In addition, it is also necessary to ensure the coherence of the previous and next sentences, so that there is an overlap between the previous and next sentences;
[0130] Use the transformers toolkit to call the open source text semantic embedding model BGE (any related text semantic embedding model can be used, this example uses the BGE model) to embed the segmented text into vectors. Set the embedding dimension to 768, and use the GPU graphics card to quickly convert the text into a vector representation. The text embedding process mainly converts the original text into a vector representation. , where d is the set 768 and t represents a certain text in the article.
[0131] Based on the faiss vector library, we build an index for the text vector representation embedded in BGE to prepare for later knowledge retrieval. Due to the high data dimension and large data volume, we use the K-Means clustering algorithm provided by faiss to cluster the text vector representation after adding L2 regularization and save it as a local file to speed up the later query speed;
[0132] Based on the high-quality data set established in step 3 and the prior knowledge in related fields, build the relevant ontology layer and entity layer. Use Python to crawl the construction framework of this type of knowledge in related fields, and combine the existing knowledge to build the ontology layer and entity layer required in practice;
[0133] Use Python to call the Wenxin Yiyan big model API (any related language big model API is acceptable, this embodiment uses Wenxin Yiyan), and use the defined ontology layer and entity layer as prior knowledge, and then input high-quality data sets into the input of Wenxin Yiyan in batches, use the text extraction and summarization capabilities of the big model, convert the input high-quality data set into a corresponding knowledge graph data set, and save it in the Neo4j database for subsequent calls.
[0134] The semantic and structural information in the generated professional knowledge graph data is used to call the Wenxin Yiyanda model API using Python to build corresponding logical rules based on the triple information in the knowledge graph; then the existing graph data is used to sort the logical rules for accuracy, and finally the available logical rules are screened out as subsequent graph query rules.
[0135] Online large model auxiliary decision module:
[0136] 1. The user inputs the professional field questions that need to be answered online, and then uses the transformer toolkit to call the text semantic embedding model BGE to implement its semantic embedding and obtain the final semantic vector representation of the question. Before processing the text embedding, the input question is first checked to ensure the relevance of the input question to the specific field;
[0137] 2. Use Python programming tools to develop a semantic similarity retrieval model and embed it into the Faiss toolkit. Then use Faiss to call the developed semantic similarity retrieval model and use the embedded question vector as a matching vector to search the local vector database. Set the K of TopK to 3, and then extract the three text vectors with the closest similarity based on the search results. The semantic similarity calculation method used is:
[0138]
[0139] Among them, A and B represent the text vector representation, and θ represents the angle between the vectors.
[0140] 3. Use the de-coding capability of the text semantic embedding model BGE to de-code the three retrieved text vector representations into normal text representations. Then, use Python to call the API of Wenxinyiyan, combine the input question and the three retrieved texts as input, and identify the triple data in the knowledge graph that is closest to the above knowledge;
[0141] 4. Use Neo4j query statements combined with the logical rules generated in the early stage to find the existing target triple data in the prepared knowledge graph dataset, and use its two-hop results as the visualization results, visualize them in the user interface, and assist the user's decision-making process.
[0142] The implementation flow chart of step 3 and step 4 is as follows: Figure 3 As shown;
[0143] 5. Then, based on the result of step 3, design a prompt engineering template, organically combine the three texts, the recognized triple data and the question input by the user, and ensure the richness of the input sentence. According to the prompt engineering template design method of the ICIO and CRISPE frameworks, the prompt word template of this embodiment is designed as:
[0144] '''You are an AI question-and-answer intelligent operation and maintenance expert specializing in intelligent operation and maintenance decision-making assistance.
[0145] You need to combine the background information provided with the output requirements to answer the user's operation and maintenance questions.
[0146] Background information: {background information}
[0147] Operation and maintenance issues: {Operation and maintenance issues}
[0148] Output requirements: {output requirements}
[0149] Based on {background information}, answer {operation and maintenance questions} and ensure {output requirements}. '''
[0150] Define the role of the big model and combine the corresponding requirements and background knowledge into the user input. And repeatedly input important information and requirements into the big model, so that the big model can strengthen its understanding of the user's output requirements and ensure the reliability and accuracy of the output. The bracketed content in the template is the actual search information and input questions;
[0151] 6. Based on the PyTorch toolkit and transformers toolkit, call the open source ChatGLM3-6B large language model (any relevant open source natural language large model can be used, ChatGLM3-6B is just one of them, and this embodiment uses this model), then input the prepared input text into the model, and the model will reply. In addition, the model's reply is designed to be in a streaming output state to ensure the smoothness of the output and the interactivity of the question and answer.
[0152] The structural parameters of the ChatGLM3-6B large language model are as follows:
[0153] Table 1 ChatGLM3-6B network structure
[0154]
[0155] The core part of the structure of the ChatGLM3-6B large language model is the encoder (the encoder has been optimized in this embodiment). The network structure parameters of the encoder are as follows:
[0156] Table 2 Encoder network structure in ChatGLM3-6B
[0157]
[0158] Inside the entire ChatGLM3-6B large language model encoder, all operations are repeated 28 times according to the above structure to ensure the large capacity of the large model.
[0159] To sum up, the intelligent operation and maintenance decision-making support method based on a large language model in an embodiment of the present invention can effectively improve the accuracy and reliability of questions and answers in professional fields by combining knowledge graph technology, local knowledge base retrieval technology and large model question and answer technology; using knowledge graph technology, the entire question and answer reasoning process can be well displayed in a visual way, so that the results of question and answer are based on evidence and more reliable; and local knowledge base retrieval technology can enable local library knowledge to be updated at any time, keep up with the latest news in the current field, so that the question and answer results are accurate and timely.
[0160] On the other hand, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the above method.
[0161] On the other hand, the present invention further discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.
[0162] In another embodiment provided in the present application, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute any of the intelligent operation and maintenance decision-making assistance methods based on a large language model in the above-mentioned embodiments.
[0163] It is understandable that the system, device and storage medium provided in the embodiments of the present invention correspond to the method provided in the embodiments of the present invention, and the explanation, examples and beneficial effects of the relevant contents can refer to the corresponding parts in the above methods.
[0164] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0165] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0166] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An intelligent operation and maintenance decision-making assistance method based on a large language model, characterized in that: The following steps are involved: Offline professional knowledge base and knowledge graph construction process, as well as online large model assisted decision-making process; The offline professional knowledge base and knowledge graph construction process includes three core sub-modules, namely, a local knowledge base generation module, a knowledge graph construction module, and a logic rule generation module. The local knowledge base generation module and the knowledge graph construction module are used to process input text data, while the logic rule generation module directly processes the results of the knowledge graph construction module, and the two are in a serial relationship. The online large model auxiliary decision-making process includes three core sub-modules, namely, text knowledge retrieval module, rule query module and prompt template module. The prompt template module is used to process the results of the text knowledge retrieval module and the rule query module, and has a serial relationship with the two. The text knowledge retrieval module and the rule query module are in a parallel relationship, and are used to process the local knowledge base and knowledge graph data respectively. The knowledge graph construction module uses prior knowledge in related fields and a large natural language model to convert text data into graph data. , where KGs represents the generated knowledge graph data, and LLM represents the application of large models for data transformation; The logic rule generation module uses the semantic and structural information in the knowledge graph data to allow the natural language model to apply the thought chain method to extract logic rules from the triple data of the knowledge graph, as follows: Among them, ρ represents the logical rule set, H and L represent the final and initial states of the rule, X, Y, Z represent the entity data in the graph data, and l represents the relationship between two entities; The rule query module uses the natural language model to call the corresponding logical rules in the knowledge graph data, queries the subgraph related to the input question, and applies the graph database query statement to find the most relevant target triple data. , where triplet represents the target triple data, input represents the user input, ρ represents the rule query, and LLM represents the application of a large model to extract entities and relations; The prompt template module organically combines the input question, similar text data, and target triple data, expressed as: Among them, prompt represents the designed prompt enhancement method, SEP represents the connection operation, text represents similar text, triplet represents the target triplet data, and input represents the question input by the user, thereby realizing input enhancement of the natural language large model, so that the reasoning of the natural language large model is explainable and accurate.
2. The intelligent operation and maintenance decision-making assistance method based on a large language model according to claim 1 is characterized in that: The local knowledge base generation module applies a text preprocessing method to process the collected text knowledge data in the relevant professional field and obtains a usable high-quality data set; Fine-tune the text embedding model based on available high-quality datasets , where f represents the text embedding model, θ represents the model parameters before fine-tuning, Represents the fine-tuned model parameters; Apply the fine-tuned text embedding model to vectorize and embed text knowledge in professional fields , where V represents the embedding vector and T represents the text knowledge; clustering algorithm and open source fast vector library are combined to realize the index construction and knowledge preservation of vectorized text data, forming the final local knowledge base as follows: Among them, I represents the constructed index, IndexCosine represents the index construction method based on cosine distance, Kmeans represents the clustering algorithm, represents the L2 norm.
3. The intelligent operation and maintenance decision-making assistance method based on a large language model according to claim 1 is characterized in that: Based on the prior knowledge of related fields, a usable ontology layer and entity layer framework are constructed. The natural language model extracts triple information from text data under the set ontology layer and entity layer framework. , where h, r, t represent the head entity, relationship and tail entity of the triple respectively, and H, R, T represent the head entity set, relationship set and tail entity set of the triple respectively, and are saved in the graph database to form the corresponding knowledge graph data KGs.
4. The intelligent operation and maintenance decision-making assistance method based on a large language model according to claim 1 is characterized in that: The rule ranker is used to score and sort the logic rules, and the natural language big model is used to verify the logic rules, and reliable logic rules are extracted for query, as follows: in, , represents a set of facts satisfying body(ρ) in KGs, Represents the head rule that satisfies the fact in KGs.
5. The intelligent operation and maintenance decision-making assistance method based on a large language model according to claim 2 is characterized in that: After the text knowledge retrieval module uses the text embedding model to embed the input question into a vector, it uses the clustering algorithm and the semantic similarity algorithm to search in the fast vector library as follows: Among them, A and B represent text vector representation, θ represents the angle between vectors, and similar vector text data is obtained ; According to the set maximum retrieval threshold, retain the first few vector text data that are most similar to the input question, as follows: in, , k represents the set maximum retrieval threshold, and uses the text embedding model to de-encode the similar vector data and output the final text data ,in, Represents the inverse encoding of a text embedding model.
6. The intelligent operation and maintenance decision-making assistance method based on a large language model according to claim 2 is characterized in that: Use the natural language big model to generate a semantic similarity dataset in the relevant field, and apply different types of natural language big models to screen the dataset to ensure the availability of the dataset; then apply the big model training framework and fine-tune the text embedding model suitable for the current field based on the contrastive learning method, as follows: Among them, f represents the text embedding model, x represents the original sample, and K represents the number of negative samples. represents a positive sample, represents negative samples, α is a hyperparameter, which represents the minimum distance difference between positive and negative sample pairs, and its value is 1.0; Based on the regularization method, a clustering algorithm with anomaly recognition capability is constructed to avoid the influence of data with poor embedding effect, and it is embedded into the fast vector library to realize the index construction function, as follows: Where x represents a data point, represents the L2 norm, d represents the dimension of the data, represents the i-th cluster center, and Represent x and The value in the j dimension; The update method is ,in, represents the set of data points of the i-th cluster, Indicates the amount of data in this collection.
7. The intelligent operation and maintenance decision-making assistance method based on a large language model according to claim 6 is characterized in that: Apply the thought chain method to build a step-by-step prompt template; integrate roles, goals, and execution requirements at the same time, input content, search information, and target triples as background information into the natural language model, guide the chain reasoning and output of the model, and achieve interpretability of the results, as follows: Among them, input represents the user's input, X represents the intermediate output of reasoning, and output represents the final output of the large model.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the computer program is executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.