Construction of power knowledge system and intelligent question-answering method based on lightweight large model

Through the construction of power knowledge system and intelligent question-and-answer methods based on lightweight large models, the shortcomings in the construction of knowledge system, problem matching strategies and inference link generation in the existing technology are solved, and intelligent question-and-answer capabilities with high accuracy are achieved, especially in scenarios such as power equipment fault diagnosis, maintenance plan recommendation and risk assessment.

CN119597864BActive Publication Date: 2025-05-02GUANGDONG YTD TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510145074.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2025-05-02
Estimated Expiration
2045-02-10

AI Technical Summary

Technical Problem

The existing power equipment question and answer technology has shortcomings in the construction of knowledge system, problem matching strategies and inference link generation, and it is difficult to accurately express the inherent connections of different types of knowledge such as equipment status, maintenance procedures and safety specifications. It is not accurate when dealing with professional terms and parameter descriptions, and it is difficult to deal with complex scenarios.

Method used

The power knowledge system construction and intelligent question-and-answer method are adopted based on lightweight large models, including building a knowledge system in the power field, establishing an inference logic classification system, adopting a multi-dimensional similarity matching strategy and generating inference links. This method realizes the systematic management of power professional knowledge by building a knowledge system in the power field that includes structured and unstructured knowledge, and establishes a reasoning logic classification system for equipment diagnosis, operation and maintenance decision-making and risk warning.

Benefits of technology

It improves the matching accuracy of complex professional problems and improves the system's intelligent Q&A capabilities in scenarios such as power equipment fault diagnosis, maintenance plan recommendation and risk assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597864B_ABST
    Figure CN119597864B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for constructing an electric power knowledge system and intelligent question-answering based on a lightweight large model, which relates to the field of artificial intelligence technology, including: constructing an electric power field knowledge system, and establishing an inference logic classification system to classify and label the knowledge base in the electric power field knowledge system; based on the electric power field knowledge system, a multi-dimensional similarity matching strategy is used to process user input questions; based on the matching results of the multi-dimensional similarity matching strategy, an inference link is generated; the inference link is used to extract and combine answers from the electric power field knowledge system, and the generation process of the inference link includes question decomposition and answer integration. The present invention realizes the systematic management of electric power professional knowledge and improves the matching accuracy of professional questions; by generating an adaptive multi-hop inference link based on the question type, combined with the question decomposition and answer integration technology, the system's intelligent question-answering capabilities in scenarios such as electric power equipment fault diagnosis, maintenance plan recommendation, and risk assessment are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and specifically to a construction of an electric power knowledge system and an intelligent question-answering method based on a lightweight large model. Background Art

[0002] With the continuous improvement of the intelligence level of power systems, intelligent question-answering systems based on knowledge graphs have been widely used in the fields of power equipment operation and maintenance, fault diagnosis and decision support. Existing technologies mainly use semantic matching methods based on word vectors and rule-based reasoning methods to build question-answering systems. Among them, semantic matching technology has developed from the initial TF-IDF algorithm to word vector models, and then to deep semantic understanding based on pre-trained language models; knowledge reasoning technology has experienced an evolution from simple pattern matching to multi-hop path reasoning, and then to neural network reasoning combined with attention mechanisms. The development of these technologies has greatly improved the ability of question-answering systems to handle natural language questions, providing strong support for the intelligent operation and maintenance of power equipment.

[0003] However, the existing power equipment question-answering technology still has the following shortcomings: First, the knowledge system construction lacks in-depth consideration of the characteristics of professional knowledge in the power field, and it is difficult to accurately express the internal connection between different types of knowledge such as equipment status, maintenance procedures, and safety specifications; second, the question matching strategy often adopts a single semantic similarity calculation method, which fails to fully utilize the multi-dimensional feature information of power equipment, resulting in low accuracy when processing professional terms and parameter descriptions; third, the processing of question decomposition and answer integration in the process of reasoning link generation is relatively simple, and it is difficult to cope with complex scenarios involving multi-device collaborative analysis and cross-professional knowledge association. These problems seriously restrict the actual application effect of the question-answering system in the intelligent operation and maintenance of power equipment. Summary of the invention

[0004] In view of the above-mentioned problems, the present invention is proposed.

[0005] Therefore, the present invention provides an electric power knowledge system construction and intelligent question-answering method based on a lightweight large model, which can solve the problems mentioned in the background technology.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: a method for constructing an electric power knowledge system and intelligent question answering based on a lightweight large model, comprising: constructing an electric power field knowledge system, and establishing a reasoning logic classification system to classify and label the knowledge base in the electric power field knowledge system;

[0007] Based on the power field knowledge system, a multi-dimensional similarity matching strategy is adopted to process the questions input by the user; wherein the multi-dimensional similarity matching strategy selects the corresponding knowledge base for matching according to the characteristics of the question, and the multi-dimensional similarity matching strategy includes semantic similarity matching and feature similarity matching;

[0008] An inference link is generated based on the matching result of the multi-dimensional similarity matching strategy; wherein the inference link is used to extract and combine answers from the power field knowledge system, and the generation process of the inference link includes question decomposition and answer integration.

[0009] As a preferred solution of the power knowledge system construction and intelligent question-answering method based on a lightweight large model described in the present invention, wherein: the power field knowledge system includes a structured knowledge base and an unstructured knowledge base;

[0010] The process of constructing the power field knowledge system includes:

[0011] Use knowledge graph construction technology to preprocess the original corpus in the power field;

[0012] The relation extraction model based on attention mechanism is used to extract entity relations from the preprocessed text and generate power knowledge triples;

[0013] Importing the power knowledge triples into a graph database to construct a knowledge graph in the power field, i.e., an unstructured knowledge base;

[0014] Normalize the structured data in the power field and establish a structured knowledge base; the structured knowledge base includes a power equipment parameter library, an operating procedure library and a standard specification library;

[0015] The power field knowledge graph, power equipment parameter library, operating procedure library, and standard specification library are integrated to form a power field knowledge system.

[0016] As a preferred solution of the power knowledge system construction and intelligent question-answering method based on lightweight large model described in the present invention, the reasoning logic classification system includes equipment diagnosis reasoning for fault diagnosis based on equipment parameters, operation and maintenance decision reasoning for maintenance plan formulation based on maintenance procedures, and risk warning reasoning for risk assessment based on historical cases;

[0017] The process of establishing the reasoning logic classification system is specifically to classify and label the knowledge system in the power field based on the semantic features of entities and relationships in the power knowledge triples, and obtain equipment diagnosis class, operation and maintenance decision class and risk warning class;

[0018] The knowledge base in the electric power field knowledge system is classified and annotated, specifically, based on the reasoning logic classification system, a lightweight large model is used to semantically understand the knowledge in the electric power field knowledge system and extract the contextual features of the knowledge; the classification and annotation results of the hierarchical clustering algorithm are optimized to obtain optimized scene annotations; the scene annotations are added to the corresponding knowledge items in the electric power field knowledge system to form an electric power field knowledge base with scene annotations.

[0019] As a preferred solution of the power knowledge system construction and intelligent question-answering method based on a lightweight large model described in the present invention, the classification labeling result of the hierarchical clustering algorithm is optimized to obtain the optimized scene labeling, including the following steps:

[0020] Obtaining classification labeling results of the knowledge items by the hierarchical clustering algorithm as initial category labels;

[0021] Encoding the knowledge item and the initial category label into corresponding feature vectors respectively;

[0022] Calculate the correlation between the feature vector of the knowledge item and the feature vector of the initial category label to obtain the correlation score;

[0023] The relevance score is normalized to obtain the normalized score, and the normalized score is activated to obtain the single-head attention score;

[0024] Projecting the knowledge item feature vectors to multiple feature subspaces to obtain subspace feature vectors;

[0025] Calculate the attention score of knowledge items in each feature subspace based on the subspace feature vector;

[0026] Obtain the fusion weight coefficient of the feature subspace;

[0027] The attention score of each feature subspace is weightedly fused with the corresponding fusion weight coefficient to obtain the multi-head attention score;

[0028] The initial category label corresponding to the highest multi-head attention score is selected as the optimized scene annotation of the knowledge item.

[0029] As a preferred solution of the power knowledge system construction and intelligent question answering method based on a lightweight large model described in the present invention, wherein: based on the power field knowledge system, a multi-dimensional similarity matching strategy is used to process the questions input by the user, including the following steps:

[0030] Extract the question type identifier;

[0031] Based on the question type identifier, the corresponding knowledge base is selected from the knowledge system of the power field, and the semantic similarity and feature similarity between the user question text and the knowledge items in the knowledge base are calculated; among which, the semantic similarity is calculated by the cosine distance between the word vectors of the user question text and the knowledge items, and the feature similarity is calculated by the named entity overlap between the user question text and the knowledge items;

[0032] The semantic similarity weight and the feature similarity weight are set according to the question type identifier, the semantic similarity and the feature similarity are weightedly combined to obtain a comprehensive similarity score, and the knowledge item with the highest comprehensive similarity score is selected as a candidate answer.

[0033] As a preferred solution of the power knowledge system construction and intelligent question-answering method based on a lightweight large model described in the present invention, wherein: generating an inference link based on the matching result of the multi-dimensional similarity matching strategy includes the following steps:

[0034] Decomposing the user question text into query intent and constraints; extracting the query intent through a hierarchical intent recognition model based on an attention mechanism; obtaining the constraints through named entity recognition and dependency syntax analysis;

[0035] Construct a multi-hop reasoning graph based on the query intent and constraint conditions, and connect the candidate answer nodes with the relevant knowledge nodes to form a reasoning path;

[0036] Performing interpretability scoring on the reasoning paths in the multi-hop reasoning graph, and selecting the path with the highest score as the final reasoning link;

[0037] Based on the reasoning link, relevant knowledge is extracted and combined and reconstructed to generate an answer text that conforms to the logic of the user's question.

[0038] As a preferred solution of the power knowledge system construction and intelligent question-answering method based on a lightweight large model described in the present invention, the construction of the multi-hop reasoning graph includes the following steps:

[0039] Starting from the candidate answer node, recursively expand the related nodes through the relationship edges in the knowledge graph to build a multi-layer reasoning subgraph;

[0040] Calculating the relevance scores between nodes using a graph attention network, establishing direct connections based on a first preset threshold of the relevance scores, and retaining indirect connections on the shortest path based on a second preset threshold of the relevance scores; and disconnecting the connections between nodes if the relevance scores are lower than the second preset threshold;

[0041] For parameter query type problems, equipment parameter nodes and fault feature nodes are preferred as intermediate nodes; for solution consultation type problems, maintenance procedure nodes and expert experience nodes are preferred as intermediate nodes; for risk assessment type problems, safety specification nodes and accident case nodes are preferred as intermediate nodes;

[0042] If the constraint contains a time requirement, the nodes are filtered based on the timestamp of the knowledge entry, and only the nodes that meet the time constraint are retained; if the constraint contains a device type restriction, only the knowledge nodes related to the specified device type are selected.

[0043] To further solve the above technical problems, the present invention provides the following technical solutions: an electric power knowledge system construction and intelligent question-answering system based on a lightweight large model, comprising: a knowledge system construction module, used to construct an electric power field knowledge system, and establish an inference logic classification system to classify and label the knowledge base in the electric power field knowledge system; a question processing module, based on the electric power field knowledge system, adopts a multi-dimensional similarity matching strategy to process user input questions; wherein the multi-dimensional similarity matching strategy selects the corresponding knowledge base for matching according to the characteristics of the question, and the multi-dimensional similarity matching strategy includes semantic similarity matching and feature similarity matching; an inference answer generation module, which generates an inference link based on the matching result of the multi-dimensional similarity matching strategy; wherein the inference link is used to extract and combine answers from the electric power field knowledge system, and the generation process of the inference link includes question decomposition and answer integration.

[0044] A computer device includes a memory and a processor, wherein the memory stores a computer program, and is characterized in that when the processor executes the computer program, the steps of constructing an electric power knowledge system and an intelligent question-answering method based on a lightweight large model as described above are implemented.

[0045] A computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of constructing an electric power knowledge system and an intelligent question-answering method based on a lightweight large model as described above are implemented.

[0046] Beneficial effects of the present invention: The present invention realizes the systematic management of power professional knowledge by constructing a knowledge system in the power field including structured and unstructured knowledge, and establishing a reasoning logic classification system for equipment diagnosis, operation and maintenance decision-making and risk warning; adopts a multi-dimensional matching strategy that integrates semantic similarity and feature similarity to handle user problems, thereby improving the matching accuracy of complex professional problems; by generating an adaptive multi-hop reasoning link based on the question type, combined with question decomposition and answer integration technology, the system's intelligent question-answering capabilities in scenarios such as power equipment fault diagnosis, maintenance plan recommendation and risk assessment are effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0048] Figure 1 It is a schematic diagram of the overall process of the construction of the power knowledge system and the intelligent question-answering method based on the lightweight large model proposed in the present invention;

[0049] Figure 2 This is a computer equipment diagram for the construction of an electric power knowledge system and an intelligent question-answering method based on a lightweight large model proposed in the present invention. DETAILED DESCRIPTION

[0050] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0051] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0052] Example 1, reference Figure 1 , which is an embodiment of the present invention, provides an electric power knowledge system construction and intelligent question-answering method based on a lightweight large model.

[0053] Figure 1 The overall flow chart of the construction of the power knowledge system and the intelligent question-answering method based on the lightweight large model is shown, including:

[0054] S1: Construct a knowledge system in the power field and establish a reasoning logic classification system to classify and annotate the knowledge base in the knowledge system in the power field.

[0055] Specifically, the knowledge system in the electric power field contains multiple knowledge bases with different attributes (structured knowledge bases and unstructured knowledge bases). Reasoning logic classification is used to determine the application scenarios of the knowledge base.

[0056] S1.1: Build a knowledge system in the power sector.

[0057] Specifically, firstly, the original corpus such as power equipment operation and maintenance manual, fault case library, maintenance procedures, etc. is preprocessed, including word segmentation, part-of-speech tagging and named entity recognition; then, the relation extraction model based on the attention mechanism is used to extract entity relations from the preprocessed text to form power knowledge triples containing entities, relations and attributes; the power knowledge triples are imported into the graph database to construct the power field knowledge graph, and a structured knowledge base (including power equipment parameter library, operating procedure library and standard specification library) is established; at the same time, the structured data in the power field (such as power standard specification documents, equipment parameter tables, operation manuals, etc.) is normalized to establish a structured knowledge base (including power equipment parameter library, operating procedure library and standard specification library); the power field knowledge graph, power equipment parameter library, operating procedure library and standard specification library are integrated to form a power field knowledge system.

[0058] It should be noted that the relationship extraction model of the attention mechanism calculates the semantic association between different words in the text, focusing on the contextual information that is most critical to the judgment of entity relationships, so as to accurately identify and extract entities and their relationships in the power field text. Specifically, the model first performs word segmentation and encoding on the input power professional text to obtain the vector representation of the word; then uses the multi-layer self-attention mechanism to calculate the association weights between word units, so that the model can capture long-distance semantic dependencies; then highlights the key information based on the attention weights, while suppressing the interference of irrelevant information; finally, the specific relationship type between entity pairs is determined by the relationship classifier, so as to realize the accurate extraction of complex relationships between entities such as power equipment, parameters, and faults. This model is particularly suitable for processing complex entity relationships contained in long texts in the power field, and can effectively extract and identify the composition relationship between equipment components, the attribute relationship between equipment and parameters, and the causal relationship between faults and symptoms.

[0059] Preferably, since the existing technology cannot effectively handle the fusion problem of multi-source heterogeneous knowledge in the power field, the present invention adopts the relational extraction model of the attention mechanism to construct knowledge triples, and integrates them with structured data into the knowledge system, thereby realizing the effective fusion of multi-source heterogeneous data such as equipment parameters, operating procedures, and standards and specifications. This improvement is crucial to building a complete power knowledge system, because the knowledge in the power field has the characteristics of diverse sources and non-uniform formats, and simple data integration methods are difficult to ensure the integrity and consistency of knowledge.

[0060] S1.2: Establish a package reasoning logic classification system.

[0061] Specifically, the reasoning logic classification system includes equipment diagnosis reasoning for fault diagnosis based on equipment parameters, operation and maintenance decision reasoning for maintenance plan formulation based on maintenance procedures, and risk warning reasoning for risk assessment based on historical cases.

[0062] The process of establishing the reasoning logic classification system is to classify and annotate the knowledge system in the power field based on the semantic features of entities and relationships in the power knowledge triples using a hierarchical clustering algorithm to obtain equipment diagnosis, operation and maintenance decision-making, and risk warning categories. Among them, the equipment diagnosis category includes the knowledge of equipment parameters and fault characteristics, which is used for fault diagnosis based on equipment parameters; the operation and maintenance decision-making category includes the knowledge of maintenance procedures and expert experience, which is used for the formulation of maintenance plans based on maintenance procedures; the risk warning category includes the knowledge of safety regulations and accident cases, which is used for risk assessment based on historical cases.

[0063] It should be noted that traditional knowledge classification methods are difficult to adapt to the reasoning needs of the power sector. Therefore, the present invention closely associates knowledge with actual application scenarios (equipment diagnosis, operation and maintenance decision-making, and risk warning) to make knowledge classification more in line with the actual application needs of the power sector, thereby overcoming the problem that traditional classification methods are too general and lack scenario adaptability.

[0064] S1.3: Classify and annotate the knowledge base in the knowledge system of the power field.

[0065] Specifically, based on the reasoning logic classification system, a lightweight large model is used to semantically understand the knowledge in the power field knowledge system and extract the contextual features of the knowledge; the attention mechanism is used to optimize the classification labeling results of the hierarchical clustering algorithm to obtain the optimized scene labeling; the scene labeling is added to the corresponding knowledge items in the power field knowledge system to form a power field knowledge base with scene labeling.

[0066] It should be noted that optimizing the classification labeling results of the hierarchical clustering algorithm to obtain optimized scene labeling specifically includes the following steps:

[0067] Obtain the classification and annotation results of the knowledge items by the hierarchical clustering algorithm as the initial category labels;

[0068] Encode the knowledge items and initial category labels into corresponding feature vectors respectively;

[0069] Calculate the correlation between the feature vector of the knowledge item and the feature vector of the initial category label to obtain the correlation score;

[0070] The relevance score is normalized to obtain the normalized score, and the normalized score is activated to obtain the single-head attention score;

[0071] Projecting the knowledge item feature vectors to multiple feature subspaces to obtain subspace feature vectors;

[0072] Calculate the attention score of knowledge items in each feature subspace based on the subspace feature vector;

[0073] Obtain the fusion weight coefficient of the feature subspace;

[0074] The attention score of each feature subspace is weightedly fused with the corresponding fusion weight coefficient to obtain the multi-head attention score;

[0075] The initial category label corresponding to the highest multi-head attention score is selected as the optimized scene annotation of the knowledge item.

[0076] Preferably, the present invention combines hierarchical clustering with a multi-head attention mechanism, and improves classification accuracy through feature subspace projection and dynamic weight fusion, thereby solving the problem of low accuracy of a single classification method when processing professional knowledge on electricity, and is particularly suitable for processing knowledge content with strong professionalism and high correlation in the field of electricity.

[0077] S2: Based on the knowledge system in the power field, a multi-dimensional similarity matching strategy is used to handle user input problems.

[0078] Among them, the multi-dimensional similarity matching strategy selects the corresponding knowledge base for matching according to the problem characteristics, and the multi-dimensional similarity matching strategy includes semantic similarity matching and feature similarity matching.

[0079] S2.1: Extract question type identification.

[0080] Specifically, the problem type identification includes parameter query type, solution consultation type and risk assessment type.

[0081] S2.2: Based on the question type identification, the corresponding knowledge base is selected from the power field knowledge system, and the semantic similarity and feature similarity between the user question text and the knowledge items in the knowledge base are calculated.

[0082] Among them, the semantic similarity is calculated by the cosine distance between the word vectors of the user question text and the knowledge item, and the formula is expressed as:

[0083] ;

[0084] Among them, Q represents the user question text; D represents the knowledge item; and Represent the overall text vector representation of Q and D respectively; Represents the word vector of the i-th word in Q; represents the word vector of the jth word in D; L represents the number of words in question Q, M represents the number of words in knowledge item D; α is the weight coefficient, which is used to balance the similarity between the overall semantics and the local word level.

[0085] The feature similarity is calculated by the overlap between the user question text and the named entity of the knowledge item, and the formula is expressed as:

[0086] ;

[0087] In the formula, and Represents the set of all named entities extracted from Q and D respectively; and represents the k-th named entity set (such as equipment, parameters, faults, etc.); K represents the total number of named entity types; β is the weight coefficient of overall entity matching and classification entity matching; is the importance weight of the k-th named entity, and .

[0088] S2.3: Set semantic similarity weights and feature similarity weights according to the question type identifier, perform weighted combination of semantic similarity and feature similarity to obtain a comprehensive similarity score, and select the knowledge item with the highest comprehensive similarity score as the candidate answer.

[0089] Preferably, the existing similarity matching technology only uses a single semantic similarity or feature similarity calculation method, which is difficult to accurately capture the deep semantic associations and domain features in the professional text in the power field; and lacks an adaptive weight adjustment mechanism for different types of questions, resulting in insufficient accuracy when processing diversified query requirements in the power field. Therefore, the multi-dimensional similarity matching strategy of the present invention improves the matching accuracy by combining the calculation of semantic similarity and feature similarity. Specifically, a double-layer matching mechanism of the overall text vector and the local word vector is introduced in the semantic similarity calculation, which not only retains the global semantic information of the text, but also captures the fine-grained matching relationship of keywords; in the feature similarity calculation, the named entities are innovatively classified and weighted according to the professional categories in the power field, and the differentiated contributions of different types of entities (such as equipment, parameters, faults, etc.) in similarity matching are fully considered. The necessity of this improvement lies in that the problem query in the power field is highly professional and diverse in type, and the traditional general similarity calculation method is difficult to accurately understand the user's intention and match the relevant knowledge. By introducing an adaptive weight adjustment mechanism for question types, the present invention can dynamically adjust the weight ratio of semantic similarity and feature similarity according to different query scenarios, which significantly improves the accuracy of knowledge matching in practical applications, especially when dealing with highly professional problems such as equipment parameter query, maintenance plan consultation and safety risk assessment. It shows obvious advantages.

[0090] S3: Generate reasoning links based on the matching results of the multi-dimensional similarity matching strategy.

[0091] Among them, the reasoning link is used to extract and combine answers from the knowledge system in the power field, and the generation process of the reasoning link includes question decomposition and answer integration.

[0092] S3.1: Decompose the user question text into query intent and constraints, where the query intent is extracted through a hierarchical intent recognition model based on the attention mechanism, and the constraints are obtained through named entity recognition and dependency syntax analysis.

[0093] Specifically, the hierarchical intent recognition model contains three layers of intent classifiers: the first layer identifies query types (parameter query, solution consultation, risk assessment), the second layer identifies operation types (viewing, comparison, analysis, prediction), and the third layer identifies specific attributes (equipment parameters, maintenance steps, risk levels); the classification results of each layer are combined through the residual connection mechanism to achieve accurate recognition of intent.

[0094] S3.2: Construct a multi-hop reasoning graph based on query intent and constraints, and connect candidate answer nodes with related knowledge nodes to form a reasoning path.

[0095] Specifically, the construction of a multi-hop reasoning graph includes the following steps:

[0096] S3.2.1: Starting from the candidate answer node, recursively expand the related nodes through the relationship edges in the knowledge graph to build a multi-layer reasoning subgraph;

[0097] S3.2.2: Calculate the relevance scores between nodes using the graph attention network, establish direct connections based on a first preset threshold of the relevance scores, and retain indirect connections on the shortest path based on a second preset threshold of the relevance scores; if the relevance score is lower than the second preset threshold, disconnect the connection between the nodes;

[0098] S3.2.3: For parameter query type problems, equipment parameter nodes and fault feature nodes are preferred as intermediate nodes; for solution consultation type problems, maintenance procedure nodes and expert experience nodes are preferred as intermediate nodes; for risk assessment type problems, safety specification nodes and accident case nodes are preferred as intermediate nodes;

[0099] S3.2.4: If the constraints include time requirements, the nodes are filtered based on the timestamps of the knowledge entries, and only the nodes that meet the time constraints are retained; if the constraints include device type restrictions, only the knowledge nodes related to the specified device type are selected.

[0100] Preferably, an adaptive multi-hop reasoning mechanism based on question type is introduced in S3.2, and accurate traversal of the knowledge graph is achieved by setting node expansion rules with dynamic threshold adjustment. This mechanism solves the problems of redundant reasoning paths and inaccurate knowledge associations in the prior art. In actual application tests, the question-answering system using this mechanism is significantly superior to traditional methods in terms of answer accuracy and reasoning efficiency, and can generate complete reasoning links for most questions.

[0101] S3.3: Score the interpretability of the reasoning paths in the multi-hop reasoning graph and select the path with the highest score as the final reasoning link.

[0102] Specifically, the explainability score adopts a multi-index fusion calculation method based on the entropy weight method, including:

[0103] The first step is to calculate the path structure score: convert the node sequence of the reasoning path into an adjacency matrix, calculate the path structure entropy based on the eigenvalue distribution of the matrix, and use the normalized value of the structure entropy as the path structure score;

[0104] The second step is to calculate the semantic coverage score: construct a cross-attention matrix between the user question text and the path node text, and calculate the singular value decomposition of the attention matrix to obtain the cumulative contribution rate of the main semantic components as the semantic coverage score;

[0105] The third step is to calculate the entity mapping score: construct a bipartite graph with the key entities in the problem and the entities in the path nodes, use the Hungarian algorithm to solve the maximum weight matching, and use the ratio of the maximum weight matching value to the total number of entities as the entity mapping score;

[0106] The fourth step is to calculate the weight coefficient of each score based on the information gain principle: calculate the information entropy of each score of all candidate paths. The higher the discreteness of the score distribution, the larger the corresponding weight coefficient;

[0107] In the fifth step, the path structure score, semantic coverage score, and entity mapping score are weighted and combined with the corresponding weight coefficients to obtain the overall score of the reasoning path.

[0108] It should be noted that in the prior art, the reasoning path scoring mainly adopts a vectorized representation method based on node similarity or a simple path length weighting method. These methods have the following problems when dealing with professional questions and answers about power equipment: they cannot effectively characterize the structured relationship between nodes in the reasoning path, resulting in inaccurate scoring when dealing with hierarchical relationships of equipment components; it is difficult to capture the fine-grained semantic associations between question texts and path nodes, especially when dealing with professional terms and equipment parameters, which are prone to association deviations; for complex problems of multi-entity associations in power equipment, existing methods find it difficult to accurately evaluate the integrity and rationality of entity mappings. These problems make it difficult for existing technologies to find the optimal reasoning path in professional scenarios involving equipment fault propagation analysis, maintenance plan recommendations, and so on.

[0109] Preferably, the present invention introduces structural entropy calculation based on eigenvalue distribution, combines singular value decomposition of cross-attention matrix and entity mapping scoring based on Hungarian algorithm, and establishes a multi-dimensional scoring mechanism that integrates path structure characteristics, semantic coverage and entity mapping integrity. This improvement fully considers the professional characteristics of power equipment knowledge: the hierarchical association characteristics of equipment components are characterized by structural entropy, the fine-grained semantic associations of professional terms are captured by attention mechanism and singular value decomposition, and the Hungarian algorithm is used to ensure the optimal match of entity mapping. In practical applications, the scoring mechanism can accurately identify the reasoning path that reflects the evolution of equipment status, effectively associate maintenance procedures with historical cases, and maintain a high degree of accuracy when dealing with complex problems such as multi-equipment collaborative analysis. These technical effects are difficult to achieve through simple combinations of existing methods.

[0110] S3.4: Extract relevant knowledge based on the reasoning link and reconstruct it in combination to generate an answer text that conforms to the logic of the user's question.

[0111] Specifically, first extract knowledge fragments from each node of the reasoning chain; then select the corresponding answer template according to the question type; then reorganize the knowledge fragments according to the template structure; finally, use a lightweight large model to optimize the reorganized text to improve the coherence and professionalism of the answer.

[0112] In summary, the present invention realizes the systematic management of power professional knowledge by constructing a knowledge system in the power field including structured and unstructured knowledge, and establishing a reasoning logic classification system for equipment diagnosis, operation and maintenance decision-making and risk warning; adopts a multi-dimensional matching strategy that integrates semantic similarity and feature similarity to handle user problems, thereby improving the matching accuracy of complex professional problems; by generating an adaptive multi-hop reasoning link based on the question type, combined with question decomposition and answer integration technology, the system's intelligent question-answering capabilities in scenarios such as power equipment fault diagnosis, maintenance plan recommendation and risk assessment are effectively improved.

[0113] Embodiment 2 is an embodiment of the present invention, which provides a power knowledge system construction and intelligent question-answering system based on a lightweight large model, including:

[0114] The knowledge system construction module is used to construct the knowledge system in the power field and establish a reasoning logic classification system to classify and annotate the knowledge base in the knowledge system in the power field;

[0115] The question processing module, based on the knowledge system of the power field, adopts a multi-dimensional similarity matching strategy to process the questions input by the user; wherein the multi-dimensional similarity matching strategy selects the corresponding knowledge base for matching according to the characteristics of the question, and the multi-dimensional similarity matching strategy includes semantic similarity matching and feature similarity matching;

[0116] The reasoning answer generation module generates a reasoning link based on the matching results of the multi-dimensional similarity matching strategy; wherein the reasoning link is used to extract and combine answers from the knowledge system in the power field, and the generation process of the reasoning link includes question decomposition and answer integration.

[0117] Example 3, reference Figure 2 , is an embodiment of the present invention, which is different from the previous embodiment in that: if the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0118] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0119] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0120] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0121] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. Construction of power knowledge system and intelligent question-answering method based on lightweight large model, characterized by: include: Constructing a knowledge system in the electric power field, and establishing a reasoning logic classification system to classify and annotate the knowledge base in the electric power field knowledge system; Based on the power field knowledge system, a multi-dimensional similarity matching strategy is adopted to process the questions input by the user; wherein the multi-dimensional similarity matching strategy selects the corresponding knowledge base for matching according to the characteristics of the question, and the multi-dimensional similarity matching strategy includes semantic similarity matching and feature similarity matching; Generate an inference link based on the matching result of the multi-dimensional similarity matching strategy; wherein the inference link is used to extract and combine answers from the power field knowledge system, and the generation process of the inference link includes question decomposition and answer integration; The power field knowledge system includes a structured knowledge base and an unstructured knowledge base; The process of constructing the power field knowledge system includes: Use knowledge graph construction technology to preprocess the original corpus in the power field; The relation extraction model based on attention mechanism is used to extract entity relations from the preprocessed text and generate power knowledge triples; Importing the power knowledge triples into a graph database to construct a knowledge graph in the power field, i.e., an unstructured knowledge base; Normalize the structured data in the power field and establish a structured knowledge base; the structured knowledge base includes a power equipment parameter library, an operating procedure library and a standard specification library; Integrate the power field knowledge graph, power equipment parameter library, operating procedure library, and standard specification library to form a power field knowledge system; The reasoning logic classification system includes equipment diagnosis reasoning for fault diagnosis based on equipment parameters, operation and maintenance decision reasoning for maintenance plan formulation based on maintenance procedures, and risk warning reasoning for risk assessment based on historical cases; The process of establishing the reasoning logic classification system is specifically to classify and annotate the knowledge system in the power field based on the semantic features of entities and relationships in the power knowledge triples, and obtain equipment diagnosis class, operation and maintenance decision class and risk warning class; Classify and annotate the knowledge base in the power field knowledge system, specifically, based on the reasoning logic classification system, use a lightweight large model to semantically understand the knowledge in the power field knowledge system and extract the contextual features of the knowledge; optimize the classification and annotation results of the hierarchical clustering algorithm to obtain optimized scene annotations; add the scene annotations to the corresponding knowledge items in the power field knowledge system to form a power field knowledge base with scene annotations; Generating an inference link based on the matching result of the multi-dimensional similarity matching strategy includes the following steps: Decomposing the user question text into query intent and constraints; the query intent is extracted through a hierarchical intent recognition model based on an attention mechanism; the constraints are obtained through named entity recognition and dependency syntax analysis; Construct a multi-hop reasoning graph based on the query intent and constraint conditions, and connect the candidate answer nodes with the relevant knowledge nodes to form a reasoning path; Performing interpretability scoring on the reasoning paths in the multi-hop reasoning graph, and selecting the path with the highest score as the final reasoning link; Extract relevant knowledge based on the reasoning link and perform combined reconstruction to generate an answer text that conforms to the logic of the user's question; The construction of the multi-hop reasoning graph includes the following steps: Starting from the candidate answer node, recursively expand the related nodes through the relationship edges in the knowledge graph to build a multi-layer reasoning subgraph; Calculating the relevance scores between nodes using a graph attention network, establishing direct connections based on a first preset threshold of the relevance scores, and retaining indirect connections on the shortest path based on a second preset threshold of the relevance scores; and disconnecting the connections between nodes if the relevance scores are lower than the second preset threshold; For parameter query type problems, equipment parameter nodes and fault feature nodes are preferred as intermediate nodes; for solution consultation type problems, maintenance procedure nodes and expert experience nodes are preferred as intermediate nodes; for risk assessment type problems, safety specification nodes and accident case nodes are preferred as intermediate nodes; If the constraint contains a time requirement, the nodes are filtered based on the timestamp of the knowledge entry, and only the nodes that meet the time constraint are retained; if the constraint contains a device type restriction, only the knowledge nodes related to the specified device type are selected.

2. The method for constructing a power knowledge system and intelligent question answering based on a lightweight large model as claimed in claim 1, characterized in that: Optimizing the classification labeling results of the hierarchical clustering algorithm to obtain optimized scene labels includes the following steps: Obtaining classification labeling results of the knowledge items by the hierarchical clustering algorithm as initial category labels; Encoding the knowledge item and the initial category label into corresponding feature vectors respectively; Calculate the correlation between the feature vector of the knowledge item and the feature vector of the initial category label to obtain the correlation score; The relevance score is normalized to obtain the normalized score, and the normalized score is activated to obtain the single-head attention score; Projecting the knowledge item feature vectors to multiple feature subspaces to obtain subspace feature vectors; Calculate the attention score of knowledge items in each feature subspace based on the subspace feature vector; Obtain the fusion weight coefficient of the feature subspace; The attention score of each feature subspace is weightedly fused with the corresponding fusion weight coefficient to obtain the multi-head attention score; The initial category label corresponding to the highest multi-head attention score is selected as the optimized scene annotation of the knowledge item.

3. The method for constructing a power knowledge system and intelligent question answering based on a lightweight large model as claimed in claim 2, characterized in that: Based on the power field knowledge system, a multi-dimensional similarity matching strategy is used to process user input questions, including the following steps: Extract the question type identifier; Based on the question type identifier, the corresponding knowledge base is selected from the knowledge system of the power field, and the semantic similarity and feature similarity between the user question text and the knowledge items in the knowledge base are calculated; among which, the semantic similarity is calculated by the cosine distance between the word vectors of the user question text and the knowledge items, and the feature similarity is calculated by the named entity overlap between the user question text and the knowledge items; The semantic similarity weight and the feature similarity weight are set according to the question type identifier, the semantic similarity and the feature similarity are weightedly combined to obtain a comprehensive similarity score, and the knowledge item with the highest comprehensive similarity score is selected as a candidate answer.

4. A power knowledge system construction and intelligent question-answering system based on a lightweight large model, based on a power knowledge system construction and intelligent question-answering method based on a lightweight large model according to any one of claims 1 to 3, characterized in that: include, A knowledge system construction module is used to construct a knowledge system in the electric power field and establish a reasoning logic classification system to classify and annotate the knowledge base in the knowledge system in the electric power field; A question processing module, based on the power field knowledge system, adopts a multi-dimensional similarity matching strategy to process the questions input by the user; wherein the multi-dimensional similarity matching strategy selects the corresponding knowledge base for matching according to the question features, and the multi-dimensional similarity matching strategy includes semantic similarity matching and feature similarity matching; An inference answer generation module generates an inference link based on the matching result of the multi-dimensional similarity matching strategy; wherein the inference link is used to extract and combine answers from the power field knowledge system, and the generation process of the inference link includes question decomposition and answer integration.

5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for constructing an electric power knowledge system and intelligent question answering based on a lightweight large model described in any one of claims 1 to 3 are implemented.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of constructing an electric power knowledge system and an intelligent question-answering method based on a lightweight large model described in any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Construction method of intelligent question answering system based on lightweight large model

    CN117370513A

  • Data analysis method based on knowledge graph

    CN117932089A