A dcs intelligent decision-making method and system fusing a large language model and a knowledge graph

By combining knowledge graphs with large language models in nuclear power DCS systems, the problems of data dispersion and insufficient professional knowledge are solved, efficient intelligent decision-making and accurate question-and-answer are achieved, and operation and maintenance efficiency and decision-making quality are improved.

CN118820778BActive Publication Date: 2025-10-24CHINA NUCLEAR POWER OPERATION TECH CORP +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410784771.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-18
Publication Date
2025-10-24
Estimated Expiration
2044-06-18

AI Technical Summary

Technical Problem

In existing technologies, the data of nuclear power DCS systems is scattered and professional domain knowledge is limited. Large language models provide inaccurate answers in professional fields and are prone to hallucinations. Traditional methods make it difficult to effectively integrate and utilize nuclear power DCS operation and maintenance data, resulting in inefficient intelligent decision-making.

Method used

By constructing a nuclear power DCS operation and maintenance knowledge graph, combined with a large language model, and adopting a data-driven and knowledge-driven approach, data preprocessing, knowledge extraction and fusion are carried out. The knowledge graph is used to provide structured knowledge, enhance the professional knowledge background of the large language model, and realize intelligent decision-making through prompt strategies and cross-validation.

Benefits of technology

It improves the accuracy and reliability of question-and-answer services in the nuclear power DCS field, optimizes knowledge extraction and application, realizes localized knowledge base enhancement and automated intelligent decision-making, and improves the work efficiency and decision-making quality of operation and maintenance personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118820778B_ABST
    Figure CN118820778B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of nuclear power DCS systems, and provides a DCS intelligent decision-making method and system fusing a large language model and a knowledge graph, which aims to solve the problems that the large language model is insufficient in answering professional fields, is prone to hallucinated facts and catastrophic forgetting, and is insufficient in explainability, and the like, the application inputs a question into the large language model, simultaneously imports the prompt prompt strategy, analyzes the question by using the large language model, cross-verifyes the question with the knowledge graph, and finally outputs an intelligent decision-making result, by fusing the text knowledge in the knowledge base, the structured knowledge of the knowledge graph and the parameterized knowledge in the large language model, the application realizes the nuclear power DCS field application of the large language model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of nuclear power DCS system, and particularly relates to a DCS intelligent decision-making method and system fusing a large language model and a knowledge graph. BACKGROUND

[0002] Nuclear power DCS (Distributed Control System) operation and maintenance data contains rich expert experience and DCS health management knowledge. These data cover device-related knowledge, abnormal reasons and corrective measures, and other operation and maintenance content. However, these data have not been fully integrated, and there is a serious data island phenomenon between documents. By converting expert experience and practical knowledge into computer-understandable knowledge and applying it to actual operations, it can effectively help operation and maintenance personnel to quickly respond to alarms, thereby obtaining standardized and high-quality response results. Currently, large language models (LLM) have achieved remarkable success in various natural language processing tasks in general fields. However, for professional problems, due to the limited professional domain knowledge, LLM will produce fact hallucinations, affecting the reliability of the answers, which brings potential risks to the application of LLM in the industrial field with higher rigor.

[0003] The knowledge graph captures key entities and relationships in nuclear power DCS operation and maintenance data, forming a structured knowledge base, providing accurate and comprehensive background knowledge for large language models, thereby improving their accuracy and reliability in professional fields. Combine large language models with knowledge graphs, use structured knowledge as the domain knowledge of large models, use knowledge graphs as knowledge-driven, and use large models as data-driven. Both of them combine to meet the higher requirements of serious applications.

[0004] In actual engineering applications, the mining and use efficiency of nuclear power DCS data and technical documents is not high, mainly affected by the following three aspects:

[0005] (1) Data sources are extensive and data volume is huge

[0006] Nuclear power DCS involves a wide variety of data, including log data, operation and maintenance data, work order data, etc. These data are scattered in different systems and are difficult to obtain in bulk. At the same time, the huge data volume also increases the difficulty of data analysis.

[0007] (2) Limitations of professional domain knowledge

[0008] Document management personnel and information technology personnel mainly manage nuclear power technical documents from the aspects of cataloging, format and structure, and are unable to extract key content and logically reorganize it from the content perspective. This results in low secondary utilization rate of data and difficulty in fully realizing its value.

[0009] (3) Limitations of relational databases

[0010] Traditional relational databases have the problems of rule redundancy and information island when storing log data and work order data, and it is difficult to associate different data or to represent different attributes that data may have. This limits the comprehensive understanding and scientific management of nuclear power DCS operation and maintenance data, and also affects the rapid response to DCS alarm abnormalities.

[0011] Currently, there is no intelligent decision-making method and related research on the fusion of large language models and knowledge graphs for nuclear power DCS in the prior art. The intelligent decision-making methods for other directions of nuclear power and other fields have the following inherent problems:

[0012] (1) Domain knowledge graph based on public data

[0013] Existing nuclear power domain knowledge graphs based on public data sets are mainly derived from literature, online communities or various open databases on the Internet. Although such data is easy to obtain, there is less factual knowledge related to nuclear power operation and maintenance, and it cannot be directly applied to nuclear power operation and maintenance.

[0014] (2) Knowledge graph based on traditional methods

[0015] Traditional rule-based methods require prior knowledge to set rules, and the recognition effect is not good for complex unstructured data. Statistical-based methods require a large amount of domain knowledge as research support, which requires higher requirements for researchers.

[0016] (3) Machine learning / deep learning-based methods

[0017] Although this type of method can effectively extract contextual text features, it requires a large amount of data annotation work. Facing the huge multi-source heterogeneous data in the nuclear power field, it is very difficult to meet the annotation requirements, resulting in unsatisfactory knowledge extraction effect.

[0018] (4) Large language models and knowledge graphs are not combined enough

[0019] The combination of large language models and knowledge graphs is more to use knowledge graphs as domain knowledge to enhance the domain understanding of large language models. However, for fields such as nuclear power plants that require high accuracy of intelligent question answering and have very clear business logic, using large language models as text extraction tools and knowledge graphs as query tools, related development is still lacking. SUMMARY

[0020] The application aims to provide a DCS intelligent decision-making method and system fusing a large language model and a knowledge graph, solve problems such as insufficient professional field answers, easy hallucination facts and catastrophic forgetting, and insufficient explainability of the large language model, and realize the nuclear power DCS field application of the large language model by combining the knowledge graph and adopting a data driving + knowledge driving mode.

[0021] To achieve the above-mentioned purpose, the application provides the following technical scheme.

[0022] In one aspect, the application provides a DCS intelligent decision-making method fusing a large language model and a knowledge graph, comprising:

[0023] Step 1: Collecting nuclear power DCS multi-source heterogeneous operation and maintenance data, and pre-processing the data;

[0024] Step 2: Constructing a nuclear power DCS operation and maintenance knowledge graph ontology library, and completing the knowledge graph ontology and concept layer framework design;

[0025] Step 3: Carrying out knowledge extraction on the pre-processed operation and maintenance data, obtaining knowledge graph data layer information, and constructing a graph;

[0026] Step 4: Forming a step-by-step prompt large language model prompt strategy in combination with the constructed knowledge graph concept layer framework;

[0027] Step 5: Carrying out information extraction on user question text, matching with the constructed knowledge graph, extracting existing knowledge graph triple information and user intention recognition information in the text as the problem input of the large language model;

[0028] Step 6: Taking the nuclear power DCS case library and the above-mentioned knowledge graph as a knowledge base, and locally deploying the large language model and the knowledge base;

[0029] Step 7: Inputting the problem into the large language model, simultaneously importing the above-mentioned prompt strategy, analyzing the problem by the large language model, cross-verifying with the knowledge graph, and finally outputting an intelligent decision-making result.

[0030] In some embodiments, on the basis of the domain ontology library and the concept layer framework, data information corresponding to the concept layer entities and entity attributes is extracted from the DCS multi-source heterogeneous data, and is stored in the knowledge graph database in the form of triplets, and is expressed as:

[0031] G={E,R,F};

[0032] In the formula, E represents an entity set {e1, e2, …, e E}, the entity e is the most basic component element in the knowledge graph, R represents a relationship set {r1, r2, …, rR}, the relationship r is an edge in the knowledge graph, and F represents a fact set {f1, f2,..., f F}.

[0033] In some embodiments, the extracted same-category entities are vectorized and encoded, and text similarity calculation is performed. The cosine similarity calculation formula is:

[0034]

[0035] In the formula, A·B is the dot product of vector A and vector B, and ||A|| and ||B|| are the Euclidean norms of the vectors;

[0036] The Euclidean distance calculation formula is:

[0037]

[0038] In some embodiments, step 4 includes:

[0039] Step 4.1: Extract the concept layer framework of the constructed knowledge graph;

[0040] Step 4.2: Generate a requirement prompt in combination with the knowledge graph concept layer framework;

[0041] Step 4.3: Generate a few-shot case prompt in combination with an existing case question and answer.

[0042] In some embodiments, user intent information in user questions is extracted from the question, and an intent classification model using a TF-IDF feature extractor is used, as follows:

[0043]

[0044] TF_IDF i =TF i,j ×IDF i ;

[0045] Where n i,j represents the number of times that word i appears in question j, ∑ k n k,j represents the total number of words in question j; D is the total number of questions, and |j:t i ∈d j | represents the number of questions containing word i; and TF_IDF represents the importance of word i in question j.

[0046] In some embodiments, a normal distribution or a uniform distribution is used to initialize vector representation of all entities and relationships in the knowledge graph, and a TransE model is used for training to form a knowledge graph vector knowledge base:

[0047]

[0048] wherein E and R represent the number of entities and relations in the knowledge graph respectively, and d is the dimension of each vector;

[0049] The TransE model assumes that the relation is a vector translation from the head entity to the tail entity, as follows:

[0050] h + r = t;

[0051] wherein h, r, and t are the vector representations of the head entity, the relation, and the tail entity in the knowledge graph triplets, respectively;

[0052] Through TransE model training, the distance of correct triplets is minimized, and the triplet minimum distance is represented as:

[0053]

[0054] wherein (h, r, t) represents a correct triplet, (h', r', t') represents an incorrect triplet, γ represents the distance between positive and negative samples, which is a constant, similar to the margin in the support vector machine, []+ represents max(0, x), distance(x, y) represents the distance between x and y vectors, which is represented by the 2-norm, as follows:

[0055]

[0056] After TransE model embedding, all entities in the knowledge graph are represented by vectors.

[0057] In some embodiments, the prompt strategy is used to obtain the question and answer dependency information of the intermediate output of the large language model, and the Transformer model is used to perform deep semantic coding on the question and answer dependency information, and then similarity matching is performed with the structured semantic coding in the knowledge graph;

[0058] The question and answer dependency information generated by the large model and the existing structured information in the knowledge graph are subjected to word embedding, and the words in the sentences are mapped to corresponding word vectors through the word embedding layer, and after conversion, S1=(a1, a2,...a l ), S2=(b1, b2,...b l ) are obtained respectively;

[0059] wherein a i represents the word vector of the i-th word in sentence 1, and b i represents the word vector of the i-th word in sentence 2;

[0060] The Transformer layer encodes global semantic features t1, t2 of the input sentences, the interaction attention layer extracts local similar features s1, s2 in each sentence, the feature fusion vector m is obtained by fusing s1, s2, and the feature fusion vector m is input into the full connection layer for semantic similarity calculation, and the feature fusion vector m is as follows:

[0061] m=[t1;t2;t1-t2;s1;s2;s1-s2];

[0062] Wherein, t1 represents the semantic feature of sentence 1, t2 represents the semantic feature of sentence 2, s1 represents the similar feature of sentence 1, and s2 represents the similar feature of sentence 2.

[0063] The output layer adopts a full connection network to adjust the weight of the feature and a softmax function to predict the classification result The input is the fused feature fusion vector m, and the predicted classification result is The calculation formula is as follows:

[0064]

[0065] The loss function of the model adopts a cross-entropy loss function as follows:

[0066]

[0067] Wherein, theta is a parameter, k represents the number of categories, r i is a real label, y i is a predicted value, and lambda||theta|| 2 is a regularization term.

[0068] On the other hand, the application also provides a DCS intelligent decision-making system fusing a large language model and a knowledge graph, comprising:

[0069] A nuclear power DCS abnormal alarm intelligent decision-making data collection and preprocessing module is used for collecting and storing operation and maintenance related data in the field of nuclear power DCS, and performing data preprocessing on the collected multi-source heterogeneous data in the field of nuclear power DCS to form a data sample set.

[0070] A nuclear power DCS abnormal alarm intelligent decision-making knowledge graph concept layer design module is used for combining the actual operation and maintenance requirements of nuclear power DCS to construct a nuclear power DCS knowledge graph ontology and concept layer design meeting the nuclear power application;

[0071] A nuclear power DCS abnormal alarm intelligent decision-making data layer acquisition and graph construction module is used for extracting entities and attributes from the data sample set, combining the concept layer framework, and constructing a nuclear power DCS operation and maintenance knowledge graph.

[0072] The nuclear power DCS abnormal alarm intelligent decision-making knowledge graph strategy enhancement module combines the constructed knowledge graph concept layer framework to form a large language model prompt learning strategy;

[0073] The nuclear power DCS abnormal alarm intelligent decision-making user question and answer text intention recognition and key information extraction module is used to extract the existing knowledge graph triple information and user intention recognition information in the question and answer input.

[0074] The nuclear power DCS abnormal alarm intelligent decision-making knowledge enhancement module is used to take the nuclear power DCS case library and the knowledge graph as a local knowledge base to carry out knowledge question and answer.

[0075] The nuclear power DCS abnormal alarm intelligent decision-making intelligent question and answer module is used to input the problem text into the large language model, import the prompt learning strategy mentioned above, analyze and troubleshoot the problem, and cross-verify with the knowledge graph to output the intelligent decision-making result.

[0076] On the other hand, the present application also provides a computer device comprising a memory and a processor, wherein the memory stores computer readable instructions, and wherein the processor implements the steps of the DCS intelligent decision-making method of fusing a large language model and a knowledge graph when executing the computer readable instructions.

[0077] On the other hand, the present application also provides a computer readable storage medium, wherein the computer readable storage medium stores computer readable instructions, and wherein the computer readable instructions implement the steps of the DCS intelligent decision-making method of fusing a large language model and a knowledge graph when being executed.

[0078] Compared with the prior art, the DCS intelligent decision-making method and system of fusing a large language model and a knowledge graph provided by the present application have the following beneficial effects:

[0079] The present application carries out intelligent decision-making research based on DCS operation and maintenance data, and develops a professional field method and system of nuclear power DCS intelligent decision-making by deeply fusing the advantages of a large language model and a knowledge graph. The present application fuses the text knowledge in the knowledge base, the structured knowledge of the knowledge graph, and the parameterized knowledge in the large language model to realize the application of the large language model in the field of nuclear power DCS.

[0080] The present application has the following advantages:

[0081] First, the data integration and preprocessing capability is enhanced. The present application collects and preprocesses multi-source heterogeneous data in the field of nuclear power DCS to form a unified data sample set, solves the problem of scattered data and difficulty in batch acquisition in the prior art, and improves the data integration and analysis efficiency.

[0082] Second, constructing an efficient knowledge graph. The application proposes a top-down knowledge graph ontology and concept layer design method, and combines with a bottom-up data layer knowledge extraction to realize the systematic construction of the nuclear power DCS operation and maintenance knowledge graph, overcoming the defects of low construction efficiency and insufficient coverage of the prior art.

[0083] Third, fusion of large language model and knowledge graph. The application combines knowledge graph with large language model, provides structured domain knowledge through knowledge graph, enhances the professional knowledge background of large language model, improves the accuracy and reliability of the model in the field of nuclear power DCS, and solves the problem of limited professional domain knowledge of large language model in the prior art.

[0084] Fourth, improve the reliability of intelligent question answering system. By designing a distributed prompt large language model prompt strategy, the application effectively reduces the fact illusion phenomenon of large language model in the professional field, enhances the reliability and accuracy of the model, and is particularly suitable for the nuclear power field which has high requirements for the accuracy of intelligent question answering.

[0085] Fifth, optimize knowledge extraction and application. The application introduces a user question and answer intention and key information extraction module, which is matched with the constructed knowledge graph to ensure accurate understanding and efficient processing of user input information, overcoming the problem of inaccurate semantic understanding in the prior art.

[0086] Sixth, realize the enhancement of local knowledge base. The application constructs a local knowledge base combining the nuclear power DCS operation and maintenance related case base with the knowledge graph, enhances the localization deployment and application ability of domain knowledge, and improves the timeliness of knowledge update and the speed of system response.

[0087] Seventh, automatic intelligent decision-making. The application realizes automatic analysis and decision support for nuclear power DCS alarm and fault problems, provides standardized and high-quality response results, and significantly improves the work efficiency and decision-making quality of operation and maintenance personnel. BRIEF DESCRIPTION OF DRAWINGS

[0088] In order to more clearly illustrate the technical solutions of the application, the following will briefly introduce the drawings needed to be used in the technical description.

[0089] Figure 1 The flow chart of the DCS intelligent decision-making method provided by the application fusing large language model and knowledge graph;

[0090] Figure 2 The information extraction flowchart of the large language model based on the distribution prompt strategy provided by the application;

[0091] Figure 3 The cross-validation diagram of the knowledge graph and the large language model provided by the application;

[0092] Figure 4 A secondary intention classification and knowledge question answering framework schematic diagram provided by the present application;

[0093] Figure 5 A block diagram of a nuclear power DCS abnormal alarm intelligent decision system provided by the present application. DETAILED DESCRIPTION

[0094] The following is further described in detail through specific embodiments.

[0095] As Figures 1 to 4 shown, the present application provides a DCS intelligent decision method fusing a large language model and a knowledge graph, comprising the following steps:

[0096] Step 1: Collection and preprocessing of nuclear power DCS multi-source heterogeneous operation and maintenance data. The nuclear power DCS multi-source heterogeneous operation and maintenance data includes but is not limited to alarm logs, fault manuals, alarm procedures, risk analysis, maintenance schemes, repair reports and other data as the original data set; and data secondary collection, data cleaning and other data preprocessing work are carried out on the collected data to establish a data sample set.

[0097] Based on the experience of nuclear power operation and maintenance, the present application collects multi-source heterogeneous data generated by DCS operation and maintenance, including structured data such as lists and tables, semi-structured and unstructured data such as reports, manuals and procedures, and specifically including alarm logs, fault manuals, alarm procedures, risk analysis, maintenance schemes and repair report data files. These data serve as the original data set and provide a rich source of information for the construction of a knowledge graph. Due to the diversity of data sources and the variety of formats, the data needs to be preprocessed. First, the text information in the data is extracted and identified. Subsequently, the JIEBA word segmentation tool is used to segment Chinese text into meaningful words or phrases, and common stop words such as "of", "is", "in" and the like are deleted, as well as data deduplication, word segmentation and the like, in order to improve the efficiency and accuracy of subsequent processing.

[0098] As an embodiment, data preprocessing includes:

[0099] Data secondary collection: Extract more related data from different systems to make up for the deficiencies or defects of the initial data collection.

[0100] Data cleaning: to remove or correct errors, noise and redundant information in the data, and unify the data format.

[0101] Step 2: Top-down knowledge graph ontology and concept layer design. Based on nuclear power operation experience, the key data categories required for operation are analyzed, and the nuclear power DCS operation knowledge graph ontology library (such as alarm log, alarm procedure, etc.) is constructed; the relationship between different ontologies is defined based on business logic, and the knowledge graph ontology and concept layer framework design is completed. The ontology includes all entity categories in the knowledge graph and the attribute categories used by the entity, such as the entity "alarm log" has "time, device name, device information, fault description, alarm code, running state" entity attributes; the concept layer framework includes all entities, entity attributes and entity relationships.

[0102] The ontology and concept layer design of the application is a clear, formalized and standardized description of the concepts in the field of nuclear power DCS operation and their mutual relationships. The ontology design provides a theoretical framework for the elements and attributes in the data layer, ensuring the rigor and logic of the knowledge graph structure.

[0103] The design content of the concept layer includes the data structure of knowledge, mainly around entity (Entity), relation (Relation) and attribute (Attribute). These elements constitute the basic unit of the knowledge graph, and the specific knowledge form of the data layer is constrained through hierarchical structure and hierarchical relationship definition.

[0104] Following the three-element principle of knowledge graph construction, the three-element relationship of entity-relationship-entity attribute or entity-relationship-entity is clarified. Combined with expert experience and nuclear power DCS alarm response procedures, seven types of ontology elements such as alarm log, fault manual, alarm procedure, risk analysis, maintenance scheme, and emergency repair report are constructed, as well as the relationships between entities and between entities and attributes.

[0105] Step 3: Bottom-up knowledge graph data layer acquisition and graph construction. For the data sample set, nuclear power DCS data layer knowledge extraction is carried out; relying on the constructed knowledge graph concept layer framework, the acquired nuclear power feature data is imported, the correspondence of the knowledge graph "entity-attribute-relation" triplets is realized, and Neo4j is used to complete the knowledge graph database construction.

[0106] The knowledge graph data layer is a unit of fact triplets, which stores specific data information. The data layer of the knowledge graph stores specific data information in the form of fact triplets. Data layer knowledge extraction is based on the field ontology library and concept layer framework, and extracts data information corresponding to the concept layer entities and entity attributes from DCS multi-source heterogeneous data, and stores it in the knowledge graph database in the form of triplets. Generally represented as:

[0107] G={E,R,F}

[0108] Where, E represents the entity set {e1, e2, …, eE} and entity e is the most basic element in the knowledge graph, represented by a node in the graph, R represents a set of relations {r1, r2, …, r R} and relation r is the edge in the knowledge graph, representing some kind of connection between different entities. F represents a set of facts {f1, f2, …, f F} and each fact f is defined as a triple (h, r, t) ∈ f. Where h represents the head entity, r represents the relationship, and t represents the tail entity.

[0109] Data layer knowledge extraction refers to extracting data information corresponding to the concept layer entities and entity attributes from the DCS multi-source heterogeneous data based on the domain ontology library and the concept layer framework, and storing it in the form of triples in the knowledge graph database. In the nuclear power DCS alarm response, it mainly involves alarm log data, fault manual, alarm procedure and other guide specification data, risk analysis table, operation and maintenance work order, experience feedback and other behavior data. Among the above information sources, there are structured data such as lists and tables, as well as semi-structured and unstructured data such as reports, manuals and procedures. For various forms of data sources, the invention uses a multi-strategy method for knowledge extraction.

[0110] For structured and semi-structured data extraction. For risk analysis table, work order data (including repair report and maintenance report) and other structured data with clear field definitions, export the data corresponding to the knowledge graph concept layer entities and attributes from the DCS system, and integrate it as knowledge graph data layer information after data preprocessing. For semi-structured data such as alarm logs, regular expression matching, dictionary matching, template matching and other rule-based methods are used to extract entity and attribute information such as "time, equipment name, equipment information, system display, alarm code, running state information" in the log data.

[0111] For unstructured data extraction. For unstructured data such as fault manuals, the invention builds a knowledge extraction model based on large language models, using large language models based on prompt learning (Prompt) and few-shot learning for entity extraction. Prompt allows users to guide and extract rules in an instructional manner. Use LLM to extract multiple times, while collecting human feedback data to train and optimize Prompt. Through repeated iteration of this process, until the extraction effect reaches the expected performance level.

[0112] Knowledge fusion and knowledge processing. Knowledge fusion refers to the process of integrating new knowledge when it is obtained during knowledge graph construction, in order to eliminate contradictions and ambiguities. The same type of entities extracted are vectorized and encoded, and text similarity is calculated, generally using cosine similarity or Euclidean distance. And replace the words with semantic errors or synonymous descriptions with standard semantics to complete the knowledge fusion.

[0113] The cosine similarity calculation formula is:

[0114]

[0115] Where A·B is the dot product of vector A and vector B, and ||A|| and ||B|| are the Euclidean norms (lengths) of the vectors.

[0116] The Euclidean distance calculation formula is:

[0117]

[0118] In the knowledge processing process, the text matching technology is used to further process and integrate the text information in the knowledge base; the text matching is used for knowledge processing to ensure that all knowledge elements are consistent in semantics. Knowledge processing is a continuous process, and the knowledge system needs to be iteratively updated according to newly obtained knowledge to form a large-scale knowledge system.

[0119] Relying on the constructed knowledge graph concept layer framework, the obtained nuclear power feature data is imported, the correspondence of the knowledge graph "entity-attribute-relation" triplets is realized, and Neo4j is used to complete the knowledge graph database construction. Since the knowledge graph concept layer is constructed in a top-down manner, all relationship types are defined in advance and exist in the concept layer. Relying on the knowledge graph concept layer structure, the entity and entity attribute data after knowledge fusion are matched with the entities and entity attributes in the concept layer one by one, the entity and attribute matching is completed, and finally the complete knowledge graph is formed.

[0120] Step 4: Combine the constructed knowledge graph concept layer framework to form a distributed prompt large language model prompt strategy. Step 4 specifically includes:

[0121] Step 4.1: Extract the concept layer framework of the constructed knowledge graph. Combine the extracted entity relationship to collect related entities, relationships and concepts. The knowledge graph concept layer constructed by the present application includes 7 types of ontology elements such as alarm logs, fault manuals, alarm procedures, risk analysis, maintenance schemes, and repair reports, as well as the relationships between entities and between entities and attributes.

[0122] Step 4.2: Generate a demand prompt combined with the knowledge graph concept layer framework. According to the target design prompt template, provide context information using entities and relationships in the knowledge graph. When the large language model receives input, it will respond to questions according to the matching demand prompt. In order to make the large language model input meet the user's demand, that is, to analyze the problem according to the user's requirements.

[0123] Step 4.3: Generate few-shot case prompts based on existing case Q&A. The core principle of few-shot learning is to use the extensive knowledge and pattern recognition ability accumulated during the pre-training of large language models to guide the model to perform specific tasks through a small number of examples. Case prompts are used to help the large language model understand the user's thought process and output the required process and results, i.e., output structured Q&A dependency information before the final result output, so as to facilitate cross-validation with the knowledge graph.

[0124] Step 5: Information extraction is performed on the user question text, and the constructed knowledge graph is matched to extract existing knowledge graph triple information and user intent recognition information in the text as the input of the large language model.

[0125] In step 5, the user intent information and key entity information in the user's question are extracted from the question.

[0126] For user intent, an intent classification model using a TF-IDF (Term Frequency-Inverse Document Frequency) feature extractor is used. TF-IDF is a technique commonly used for text feature extraction, which is used to measure the importance of a word to a document. For this invention, the document is the DCS common question. TF is the term frequency, which represents the frequency of a word appearing in a question, and IDF is the inverse document frequency, which represents the rarity of a word in the entire corpus. The TF-IDF feature extractor converts text data into vector representation, where each element represents the TF-IDF value of the corresponding word.

[0127]

[0128] TF_IDF i =TF i,j ×IDF i

[0129] where n i,j represents the number of times word i appears in question j, ∑ k n k,j represents the total number of words in question j; D is the total number of questions, |j:t i ∈d j | represents the number of questions containing word i; TF_IDF represents the importance of word i in question j, considering the global importance in all question sets D.

[0130] The method for extracting key entity information from user questions uses the same entity extraction method as the knowledge graph data layer in the knowledge graph process.

[0131] The extracted entity is matched with the constructed knowledge graph to obtain relevant triple information of the user input; the user question and answer intention and the triple information are input into a large language model as a new question.

[0132] Step 6: The nuclear power DCS case library and the above knowledge graph are used as a local knowledge base, and the retrieval-augmented generation (RAG) technology is combined with the large language model to realize the use of information in the external knowledge base to enhance the domain response capability of the large language model.

[0133] The nuclear power DCS operation and maintenance related case library and the above knowledge graph are used as a local knowledge base for domain knowledge enhancement and local deployment.

[0134] The constructed knowledge graph is vectorized and stored as a vector knowledge base. The essence of converting a knowledge graph database into a vector knowledge base is an embedding model, and common methods include TransE, TransH, TransR, TransD, and ComplEx. Taking TransE as an example, first, initialize the vector representation of all entities and relationships, generally using normal distribution or uniform distribution to initialize all entity and relationship vectors:

[0135]

[0136] E and R represent the number of entities and relationships in the knowledge graph, respectively, and d is the dimension of each vector.

[0137] The TransE model assumes that the relationship is a vector translation from the head entity to the tail entity:

[0138] h+r≈t

[0139] Where h, r, and t are the vector representations of the head entity, relationship, and tail entity in the knowledge graph triple. Then, a distance-based scoring function is used to score the relationship. For a triple, the closer the sum of the head entity vector and the relationship vector to the tail entity vector, the closer the triple is to a correct triple, and the greater the difference, the more abnormal the triple. Therefore, the goal of knowledge graph embedding is to make the distance of correct triples as small as possible, and the distance of incorrect triples as large as possible, that is, the reciprocal as small as possible. Through TransE model training, the distance of correct triples is minimized, and the minimum distance of triples is represented as:

[0140]

[0141] where (h, r, t) denotes a correct triple, (h', r', t') denotes an incorrect triple, γ denotes the margin between positive and negative samples, is a constant, similar to the margin in support vector machines, []+ denotes max(0, x), that is, when x is greater than 0, the value of x is taken, when x is less than 0, 0 is taken. distance(x, y) denotes the distance between x and y vectors, which is generally represented by 2-norm.

[0142]

[0143] After embedding by the TransE model, all entities in the knowledge graph are represented by vectors.

[0144] Step 7: Intelligent decision-making. Input the question into the large language model, import the prompt strategy described above, analyze the question using the large language model, and cross-verify with the knowledge graph, and finally output the intelligent decision-making result.

[0145] First, a combination of dynamic programming, Levenstein distance and regular matching is adopted to match the table names and field names in the knowledge base from the word level, secondly, for some unmatched data, the semantic vector method is used to match from the semantic point of view, so that the large model can more efficiently call and process data, and thus guarantee the accuracy of the table name and field name recall data.

[0146] In some embodiments, the present application provides a method for entity extraction of unstructured data based on prompt learning (Prompt) and few-shot learning of a large language model.

[0147] Specifically, LangChain+ChatGLM3-6B is used as the base model, the fault manual is used as the local knowledge base, and the nuclear DCS domain vocabulary is used as additional vocabulary for encoding (Embedding) to improve the accuracy of model extraction. The word embedding formula is expressed as:

[0148] E: V→R d

[0149]

[0150] where E is the embedding function, V is the vocabulary, d is the dimension of the embedding, and v is the word in the vocabulary.

[0151] For the abnormal information in the alarm log, first locate the document and the content in the local knowledge base, and then use Prompt to extract the key entity attributes (System, Error Code, Message, Description, Action) and translate them into Chinese.

[0152] In terms of Prompt, it is driven by conditions and tasks, and uses a "three-step method" (demand prompt, domain knowledge prompt, case prompt) to extract, aiming to guide the model better understand and execute the task through step-by-step guidance. In the "three-step method" prompt strategy, large language models improve the generalization ability of the model by continuously learning and accumulating knowledge. Compared with deep learning methods, through prompt learning and few-shot learning, large language models can significantly reduce the dependence on large amounts of labeled data; at the same time, they can also combine domain vocabulary and general knowledge for Chinese-English translation, greatly improving the extraction efficiency of the model.

[0153] In some embodiments, the present application provides a knowledge graph and large language model cross-validation method.

[0154] The prompt strategy is used to obtain the question and answer dependent information of the intermediate output of the large language model, and the Transformer model is used to encode the deep semantic of the question and answer dependent information of the intermediate output of the large model, and then the similarity is matched with the structured semantic encoding in the knowledge graph. The semantic similarity model based on the Transformer encoder mainly includes the following five parts: word vector embedding representation, Transformer coding layer, interactive attention layer, feature fusion layer, and output layer. The question and answer dependent information generated by the large model and the existing structured information in the knowledge graph are word embedded, and the words in the sentence are mapped to corresponding word vectors through the word embedding layer. After conversion, S1=(a1,a2,...a l ), S2=(b1,b2,...b l );

[0155] wherein a i represents the word vector of the i-th word in sentence 1, b i represents the word vector of the i-th word in sentence 2, the Transformer layer encodes the global semantic features t1, t2 of the input sentence, wherein t1 represents the semantic feature of sentence 1, t2 represents the semantic feature of sentence 2, the interactive attention layer extracts the local similarity features s1, s2 in each sentence, wherein s1 represents the similarity feature of sentence 1, s2 represents the similarity feature of sentence 2, the s1, s2 two features are fused to obtain the feature fusion vector m, and input to the fully connected layer for semantic similarity calculation. The feature fusion vector m is as follows:

[0156] m=[t1;t2;t1-t2;s1;s2;s1-s2]

[0157] Wherein, t1-t2, s1-s2 are the subtraction operation of vectors, the purpose is to obtain the difference feature, finally through the way of vector splicing, the final feature fusion vector m is obtained.

[0158] The output layer adopts a full connection network to adjust the weight of the feature and a softmax function to predict the classification result The input is the fused feature fusion vector m, and the classification result is predicted The calculation formula is as follows:

[0159]

[0160] The loss function of the model adopts a cross-entropy loss function as follows:

[0161]

[0162] Wherein, theta is a parameter, k represents the number of categories, ri is a real label, yi is a predicted value, and lambda theta 2 Is a regularization term.

[0163] By searching the most similar knowledge graph triple structure information in the domain knowledge graph and the question and answer dependency information generated by the large model, cross verification with the intermediate result generated by the large model is realized.

[0164] The application constructs a nuclear power DCS operation and maintenance knowledge graph, and provides strong support for the operation and maintenance of the nuclear power DCS through the visualization and query function of the knowledge graph. The knowledge graph not only improves the operation and maintenance efficiency, but also helps to improve the operation and maintenance quality, and ensures the safe and stable operation of the nuclear power plant.

[0165] The above only describes the specific implementation of the application, but the protection scope of the application is not limited to this, any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the application, which should be covered within the protection scope of the application. Therefore, the protection scope of the application should be subject to the protection scope of the claims.

Claims

1. A DCS intelligent decision-making method fusing a large language model and a knowledge graph, characterized in that, Comprise: Step 1: Collect nuclear power DCS multi-source heterogeneous operation and maintenance data, and preprocess the data; Step 2: Construct a nuclear power DCS operation and maintenance knowledge graph ontology library, complete the knowledge graph ontology and concept layer framework design; Step 3: Knowledge extraction is performed on the preprocessed operation and maintenance data to obtain knowledge graph data layer information, and the graph is constructed; Step 4: Combine the constructed knowledge graph concept layer framework to form a step-by-step prompt large language model prompt strategy; Step 5: Information extraction is performed on the user question text, and the existing knowledge graph triple information and user intent recognition information in the text are extracted as the input of the large language model; Step 6: The nuclear power DCS case library and the above knowledge graph are used as the knowledge base, and the large language model and the knowledge base are locally deployed; Step 7: Input the question into the large language model, and import the prompt strategy above, use the large language model to analyze the question, and cross-verify with the knowledge graph to output the intelligent decision result; In step 7, the prompt strategy is used to obtain the intermediate output of the large language model, and the Transformer model is used to encode the deep semantic of the question and answer dependency information, and then the similarity is matched with the structured semantic encoding in the knowledge graph; The question-answer dependency information generated by the large model and the existing structural information in the knowledge graph are word-embedded. The words in the sentence are mapped to corresponding word vectors through the word embedding layer. After conversion, S1=(a1, a2, ...a l ), S2=(b1,b2,...b l ); where a l denotes the word vector of the l-th word in sentence 1, b l denotes the word vector of the l-th word in sentence 2; The Transformer layer encodes the global semantic features t1, t2 of the input sentence, and the interaction attention layer extracts the local similarity features s1, s2 in each sentence. The two features s1, s2 are fused to obtain a feature fusion vector m, which is input into the full connection layer for semantic similarity calculation. The feature fusion vector m is as follows: m = [t1; t2; t1-t2; s1; s2; s1-s2]; Wherein, t1 represents the semantic feature of sentence 1, t2 represents the semantic feature of sentence 2, s1 represents the similarity feature of sentence 1, and s2 represents the similarity feature of sentence 2; The output layer adopts a full connection network to adjust the weight of the features and a softmax function to predict the classification result The input is the fused feature fusion vector m, and the predicted classification result is The calculation formula is as follows: The loss function of the model uses the cross-entropy loss function as follows: where θ is the parameter, c denotes the class number, R z is the true label, y z is the predicted value, λ||θ|| 2 is the regularization term.

2. The DCS intelligent decision-making method of fusing a large language model and a knowledge graph according to claim 1, characterized in that, In step 3, based on the domain ontology library and the concept layer framework, the data information corresponding to the concept layer entity and entity attribute is extracted from the DCS multi-source heterogeneous data, and is stored in the knowledge graph database in the form of triple, which is represented as: G = {E, R, F}; In the formula, E represents an entity set {e1, e2,..., e i}, the entity e is the most basic component element in the knowledge graph, R represents a relation set {r1, r2,..., r j}, the relation r is an edge in the knowledge graph, and F represents a fact set {f1, f2,..., f k}.

3. The DCS intelligent decision-making method of fusing a large language model and a knowledge graph according to claim 1, characterized in that, In step 3, the extracted entities of the same category are vectorized and encoded, and the text similarity is calculated. The cosine similarity calculation formula is as follows: In the formula, A·B is the dot product of vector A and vector B, and ||A|| and ||B|| are the Euclidean norms of the vectors; The Euclidean distance calculation formula is as follows:

4. The DCS intelligent decision-making method of fusing a large language model and a knowledge graph according to claim 1, characterized in that, Step 4 includes: Step 4.1: Extract the concept layer framework of the constructed knowledge graph; Step 4.2: Generate demand prompts combined with the knowledge graph concept layer framework; Step 4.3: Generate few-shot case prompts combined with existing case question and answer.

5. The DCS intelligent decision-making method of fusing a large language model and a knowledge graph according to claim 1, characterized in that, In step 5, the user intent information in the user's question is extracted, and the intent classification model of the TF-IDF feature extractor is used, as follows: TF_IDF i = TF i,j x IDF i ; where n i,j represents the number of times the word i appears in the question j,∑ k n k,j represents the total number of words in the question j; D is the total number of questions, |j:t i ∈d j | represents the number of questions containing the word i; TF_IDF represents the importance of the word i in the question j.

6. The DCS intelligent decision-making method fusing a large language model and a knowledge graph according to claim 1, characterized in that, In step 6, normal distribution or uniform distribution is used to initialize vector representation of all entities and relationships in the knowledge graph, and then TransE model is used for training to form a knowledge graph vector knowledge base: Wherein, E and R represent the number of entities and relationships in the knowledge graph respectively, and d is the dimension of each vector. TransE model assumes that the relationship is a vector translation from the head entity to the tail entity, as follows: h+r≈t; Wherein, h, r, t are the vector representations of the head entity, relationship and tail entity in the knowledge graph triple, respectively, and the distance of the correct triple is minimized through TransE model training, and the minimum distance of the triple is represented as: Wherein, (h, r, t) represents the correct triple, (h', r', t') represents the incorrect triple, γ represents the distance between positive and negative samples, which is a constant, []+ represents max(0, x), distance(x, y) represents the distance between x and y vectors, which is represented by 2 norm, as follows: After TransE model embedding, all entities in the knowledge graph are represented by vectors.

7. A DCS intelligent decision system fusing a large language model and a knowledge graph, characterized in that, The DCS intelligent decision-making method of fusing large language model and knowledge graph according to any one of claims 1-6 comprises: A nuclear power DCS abnormal alarm intelligent decision-making data collection and preprocessing module for collecting and storing nuclear power DCS operation and maintenance related data, and preprocessing the collected multi-source heterogeneous data of the nuclear power DCS field to form a data sample set; A nuclear power DCS abnormal alarm intelligent decision-making knowledge graph concept layer design module for constructing a nuclear power DCS knowledge graph ontology and concept layer design that meets the nuclear power application requirements in combination with the actual operation and maintenance requirements of the nuclear power DCS; A nuclear power DCS abnormal alarm intelligent decision-making data layer acquisition and graph construction module for extracting entities and attributes from the data sample set and constructing a nuclear power DCS operation and maintenance knowledge graph in combination with the concept layer framework; A nuclear power DCS abnormal alarm intelligent decision-making knowledge graph strategy enhancement module for forming a large language model prompt learning strategy in combination with the constructed knowledge graph concept layer framework; A nuclear power DCS abnormal alarm intelligent decision-making user question and answer text intent recognition and key information extraction module for extracting existing knowledge graph triple information and user intent recognition information from the question and answer input; A nuclear power DCS abnormal alarm intelligent decision-making knowledge enhancement module for using the nuclear power DCS case library and the knowledge graph as a local knowledge base to carry out knowledge question and answer; A nuclear power DCS abnormal alarm intelligent decision-making intelligent question and answer module for inputting the problem text into the large language model, importing the prompt learning strategy mentioned above, analyzing the problem and fault tracing, and cross verifying with the knowledge graph to output the intelligent decision-making result.

8. A computer device comprising a memory and a processor, the memory having stored thereon computer readable instructions, characterized in that, The processor executes the computer readable instructions to implement the steps of the DCS intelligent decision-making method of fusing large language model and knowledge graph according to any one of claims 1-6.

9. A computer-readable storage medium having stored thereon computer-readable instructions, wherein, The computer readable instructions are executed to implement the steps of the DCS intelligent decision-making method of fusing large language model and knowledge graph according to any one of claims 1-6.

Citation Information

Patent Citations

  • Policy question and answer method and system based on large language model and knowledge graph technology

    CN117725170A