Knowledge question answering method and device, and storage medium

By tagging and hierarchically managing target text fragments in knowledge-based question-answering technology, the problem of lacking multi-level knowledge management in existing technologies has been solved. This enables collaborative retrieval and accurate answer generation between the knowledge bases of the group headquarters and subsidiaries, improving the accuracy and reliability of retrieval results.

CN122114109APending Publication Date: 2026-05-29JIANGSU XCMG CONSTRUCTION MACHINERY RESEARCH INSTITUTE LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGSU XCMG CONSTRUCTION MACHINERY RESEARCH INSTITUTE LTD
Filing Date
2026-02-27
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing knowledge-based question-answering technologies lack multi-level knowledge management, cannot achieve collaborative retrieval between the group headquarters and subsidiary company knowledge bases, and have insufficient retrieval structure and weak interpretability of sorting methods, making it difficult to meet the hierarchical knowledge management needs of large enterprises.

Method used

By tagging the retrieved target text fragments into a set of exclusive fragments and a set of public fragments, multi-level answers are generated using the exclusive and public solution sets. The priority of the search results is determined according to the output rules, and a large language model is used to assist in the generation, thereby achieving accurate knowledge-based question answering.

Benefits of technology

It improves the accuracy and reliability of search results, meets the needs of hierarchical knowledge management for large enterprises, and enables precise generation and sorting of multi-level knowledge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122114109A_ABST
    Figure CN122114109A_ABST
Patent Text Reader

Abstract

The present disclosure provides a knowledge question answering method, device and storage medium. The knowledge question answering method comprises: searching in a preset knowledge base according to a query sentence input by a user to obtain a plurality of target text segments; dividing the plurality of target text segments into an exclusive segment set and a common segment set according to a label of each target text segment in the plurality of target text segments; generating a plurality of exclusive schemes by using all target text segments in the exclusive segment set to obtain an exclusive scheme set; generating a plurality of common schemes by using all target text segments in the common segment set to obtain a common scheme set; and determining a search result by using at least one of the exclusive scheme set and the common scheme set according to an output rule.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a knowledge question-answering method, apparatus and storage medium. Background Technology

[0002] Intelligent question answering technology has evolved from rule-based template-based question answering methods to those relying on Large Language Models (LLMs), and then to those based on Retrieval-Augmented Generation (RAG) technology.

[0003] Early knowledge graph-based question-answering systems could return accurate answers by parsing questions into structured queries, but their knowledge coverage and ability to understand natural language were limited. Later, generative large models, represented by ChatGPT, demonstrated strong language understanding and fluent generation capabilities, but their inherent "illusion" problem, lagging knowledge updates, and lack of traceability of knowledge sources made them difficult to apply directly to professional fields with stringent accuracy requirements.

[0004] To address the aforementioned issues, retrieval-enhanced generation technology has been proposed. Its core lies in retrieving relevant information from external knowledge bases to enhance the generation process of LLM, effectively improving the factual accuracy of the answers. Summary of the Invention

[0005] The inventors noted that current knowledge-based question-answering technologies lack hierarchical management of knowledge, lack traceability of knowledge sources, and may suffer from inconsistencies in expression, contradictory conclusions, or conflicting data between different sources, thus reducing the authority and timeliness of the answers. For example, in a hierarchical organizational structure between a group headquarters and its subsidiaries, the standardized documents formulated by the group headquarters may differ from the internal regulations of the subsidiaries. Therefore, a knowledge-based question-answering method is urgently needed.

[0006] Accordingly, this disclosure provides a knowledge question answering method that divides the retrieved target text fragments according to tags and accurately generates multi-level answers, which can improve the accuracy and reliability of the retrieval results.

[0007] According to a first aspect of the present disclosure, a knowledge question answering method is provided, comprising: retrieving multiple target text fragments from a preset knowledge base based on a query input by a user; dividing the multiple target text fragments into a dedicated fragment set and a public fragment set based on the tags of each target text fragment; generating multiple dedicated solutions using all target text fragments in the dedicated fragment set to obtain a dedicated solution set; generating multiple public solutions using all target text fragments in the public fragment set to obtain a public solution set; and determining a search result using at least one of the dedicated solution set and the public solution set according to an output rule.

[0008] In some embodiments, determining the search results based on at least one of the dedicated solution set and the public solution set according to the output rule includes: if the output rule is to output all solutions, then determining whether both the dedicated solution set and the public solution set are non-empty sets; if both the dedicated solution set and the public solution set are non-empty sets, then sorting all dedicated solutions in the dedicated solution set according to the sorting rule to obtain a dedicated solution sequence, which serves as the first search result; sorting all public solutions in the public solution set according to the sorting rule to obtain a public solution sequence, which serves as the second search result; and sorting the first search result and the second search result in descending order of priority to generate a search result, wherein the priority of the first search result is higher than the priority of the second search result.

[0009] In some embodiments, determining the search results based on at least one of the dedicated solution set and the public solution set according to the output rules further includes: if the dedicated solution set is a non-empty set and the public solution set is an empty set, then sorting all dedicated solutions in the dedicated solution set according to the sorting rules to obtain a sequence of dedicated solutions as the search results.

[0010] In some embodiments, determining the search results based on at least one of the dedicated solution set and the public solution set according to the output rules further includes: if the dedicated solution set is empty and the public solution set is non-empty, then sorting all public solutions in the public solution set according to the sorting rules to obtain a public solution sequence as the search result.

[0011] In some embodiments, determining the search results based on the output rules using at least one of the dedicated solution set and the public solution set further includes: if both the dedicated solution set and the public solution set are empty, determining whether the intelligent generation function is enabled; if the intelligent generation function is enabled, processing the query statement using the first major language model to generate multiple auxiliary solutions to obtain an auxiliary solution set; and sorting all the auxiliary solutions in the auxiliary solution set according to the sorting rules to obtain an auxiliary solution sequence as the search result.

[0012] In some embodiments, determining the search results based on output rules, using at least one of the proprietary scheme set and the public scheme set, further includes: if the intelligent generation function is disabled, the search results are an empty set.

[0013] In some embodiments, determining the search results based on the output rule, using at least one of the dedicated solution set and the public solution set, further includes: if the output rule is to output dedicated solutions, then sorting all dedicated solutions in the dedicated solution set according to the sorting rule to obtain a dedicated solution sequence as the search result.

[0014] In some embodiments, determining the search results based on the output rule, using at least one of the dedicated solution set and the public solution set, further includes: if the output rule is to output public solutions, then sorting all public solutions in the public solution set according to the sorting rule to obtain a public solution sequence as the search result.

[0015] In some embodiments, the sorting rule includes: for the i-th solution in the set of solutions to be processed, calculating the relevance between the i-th solution and the query statement to obtain a relevance score for the i-th solution, wherein... Let I be the total number of solutions to be processed in the solution set. The solution set can be a dedicated solution set, a public solution set, or an auxiliary solution set. Determine the quality score of the i-th solution to be processed. Sort all solutions to be processed in the solution set according to the relevance score from largest to smallest to obtain the initial solution sequence. For solutions to be processed with the same relevance score in the initial solution sequence, sort them according to the quality score from largest to smallest to obtain the solution sequence.

[0016] In some embodiments, calculating the relevance of the i-th solution to be processed with the query statement to obtain the relevance score of the i-th solution to be processed includes: calculating the semantic similarity between the i-th solution to be processed and the device information and fault information in the query statement, as the relevance score of the i-th solution to be processed.

[0017] In some embodiments, determining the quality score of the i-th solution to be processed includes: determining the content integrity metric of the i-th solution to be processed; determining the operability metric of the i-th solution to be processed; and calculating the weighted sum of the content integrity metric and the operability metric of the i-th solution to obtain the quality score of the i-th solution to be processed.

[0018] In some embodiments, determining the content integrity metric of the i-th solution to be processed includes: detecting whether the i-th solution to be processed includes multiple specified items, obtaining the detection result of the i-th solution to be processed, wherein the multiple specified items include troubleshooting steps, fault causes and repair methods; and determining the content integrity metric of the i-th solution to be processed based on the detection result and the preset score of each specified item.

[0019] In some embodiments, determining the operability metric of the i-th solution to be processed includes: evaluating the repair method in the i-th solution to be processed to obtain the original operability metric of the i-th solution to be processed; calculating the ratio of the original operability metric of the i-th solution to the maximum value among the original operability metric values ​​of all solutions to be processed to determine the operability metric of the i-th solution to be processed.

[0020] In some embodiments, retrieving multiple target text fragments from a preset knowledge base based on a user-input query includes: retrieving a first candidate fragment set from the preset knowledge base using a first retrieval method based on the query; retrieving a second candidate fragment set from the preset knowledge base using a second retrieval method based on the query, wherein the second retrieval method is different from the first retrieval method; retrieving a third candidate fragment set from the preset knowledge base using a third retrieval method based on the query, wherein the third retrieval method is different from the first and second retrieval methods; and merging all candidate text fragments from the first, second, and third candidate fragment sets to obtain multiple target text fragments.

[0021] In some embodiments, performing a search in a preset knowledge base using a first search method includes: converting a query statement into a query vector; segmenting the query statement into words to obtain multiple keywords; and using the query vector and multiple keywords to perform a search in the preset knowledge base to obtain a first candidate fragment set.

[0022] In some embodiments, performing a search in a preset knowledge base using a second search method includes: processing the query statement using a second language model to obtain the device entity and fault entity corresponding to the query statement; obtaining a structured query statement based on the device entity and fault entity; converting the structured query statement into a query vector; segmenting the structured query statement into multiple keywords; and performing a search in the preset knowledge base using the query vector and multiple keywords to obtain a second candidate fragment set.

[0023] In some embodiments, performing a retrieval in a preset knowledge base using a third retrieval method includes: processing the query statement using a third language model to obtain the device entity and fault entity corresponding to the query statement; extracting a relational subgraph from a preset knowledge graph based on the device entity and fault entity; extracting supplementary entities from the relational subgraph; obtaining a reconstructed query statement based on the device entity, fault entity, and supplementary entities; converting the reconstructed query statement into a query vector; segmenting the reconstructed query statement to obtain multiple keywords; and performing a retrieval in the preset knowledge base using the query vector and multiple keywords to obtain a third candidate fragment set.

[0024] In some embodiments, the source document is processed to obtain multiple text fragments and a tag for each text fragment; a preset knowledge base is constructed using the multiple text fragments and the tags for each text fragment.

[0025] According to a second aspect of the present disclosure, a knowledge question-answering device is provided, comprising: a memory; and a processor coupled to the memory, the processor being configured to execute instructions stored in the memory to implement the knowledge question-answering method as described in any of the above embodiments.

[0026] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions that, when executed by a processor, implement the knowledge question-answering method as described in any of the above embodiments.

[0027] According to a fourth aspect of the present disclosure, a computer program product is provided, including computer instructions, wherein when executed by a processor, the computer instructions implement the knowledge question-answering method as described in any of the above embodiments.

[0028] Other features and advantages of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0029] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0030] Figure 1 This is a flowchart illustrating a knowledge question-answering method according to an embodiment of this disclosure;

[0031] Figure 2 This is a flowchart illustrating a knowledge base construction method according to an embodiment of the present disclosure;

[0032] Figure 3 This is a flowchart illustrating a knowledge question-answering method according to another embodiment of this disclosure;

[0033] Figure 4 This is a flowchart illustrating a knowledge question-answering method according to yet another embodiment of this disclosure;

[0034] Figure 5 This is a schematic diagram of the structure of a knowledge question-answering device according to an embodiment of the present disclosure. Detailed Implementation

[0035] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit this disclosure or its application or use. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.

[0036] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of this disclosure.

[0037] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.

[0038] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0039] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.

[0040] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0041] The inventors noted that, taking the knowledge-based question-and-answer method for equipment fault repair as an example, there are several solutions for realizing intelligent question-and-answer of hierarchical maintenance knowledge in large enterprises.

[0042] (1) Independent multi-system parallel solution. Deploy completely independent question-and-answer systems for the group and each subsidiary. This solution can achieve the strongest data isolation and customization, but it will lead to extremely high construction and maintenance costs, form "knowledge silos" that hinder experience sharing, and cannot achieve unified knowledge governance and standardization at the group level.

[0043] (2) Pure large language model fine-tuning solution. This solution does not use RAG and knowledge graphs, but only performs full fine-tuning on a large language model using massive maintenance documents, relying on the model's parameter memory to answer questions. This solution has a fast response, but it has fundamental defects such as high risk of "illusion", difficulty in updating knowledge (requiring retraining), inability to trace the source of answers, and difficulty in embedding complex permissions and business rules (such as prioritizing the company's own solution), which cannot meet the requirements of industrial-grade reliability.

[0044] (3) Traditional expert system solution. The maintenance diagnosis system is built based on a strict rule base and decision tree. This solution is highly interpretable when the rules are clear, but it lacks flexibility, cannot handle fuzzy and complex natural language queries, and the construction and maintenance cost of the rule base is extremely high, making it difficult to adapt to rapidly changing technologies and equipment systems.

[0045] The following problems exist in relevant knowledge-based question-answering technologies:

[0046] (1) Lack of multi-level knowledge management: There is a lack of collaborative retrieval mechanism between the group headquarters and subsidiaries' knowledge bases, making it impossible to route knowledge or distinguish the priority of answers during retrieval, which makes it difficult to meet the hierarchical knowledge management needs of large enterprises.

[0047] (2) Insufficient structured retrieval capabilities: RAG technology relies on vector and keyword matching and lacks the ability to generate structured retrieval instructions based on entity recognition (e.g., equipment model-fault code combination query), and cannot perform precise field-level targeted retrieval of structured documents such as CSV and Excel.

[0048] (3) The ranking method has weak interpretability: the large language model is completely left to evaluate the generated answers in a black box to obtain the ranking results. There is a lack of systematic evaluation of key business dimensions such as the relevance of the answers to the questions, the completeness of the content and the operability. It is difficult to identify the optimal solution and present it to the priority users.

[0049] Accordingly, this disclosure provides a knowledge question answering method that divides the retrieved target text fragments according to tags and accurately generates multi-level answers, which can improve the accuracy and reliability of the retrieval results.

[0050] Figure 1This is a schematic flowchart of a knowledge question-answering method according to an embodiment of the present disclosure. In some embodiments, the following knowledge question-answering method is executed by a knowledge question-answering device, including steps 11-15.

[0051] In step 11, based on the query statement entered by the user, a search is performed in the preset knowledge base to obtain multiple target text fragments.

[0052] In some embodiments, the source document is processed to obtain multiple text fragments and a tag for each text fragment. A pre-defined knowledge base is then constructed using the multiple text fragments and the tags for each text fragment.

[0053] In some embodiments, the source documents include equipment maintenance documents collected from multiple different sources, and the preset knowledge base built based on the source documents is a knowledge base related to equipment maintenance.

[0054] For example, the source documents include general maintenance knowledge at the group level and specialized maintenance knowledge at the subsidiary level. General maintenance knowledge at the group level includes common maintenance manuals from standard equipment manufacturers such as FANUC and Siemens, as well as unified maintenance standards and specifications issued by the group. Specialized maintenance knowledge at the subsidiary level includes localized maintenance knowledge lists compiled by internal experts of each subsidiary, historical fault records, and verified maintenance cases.

[0055] In some embodiments, the method for processing the source document includes the following steps S11-S13.

[0056] In step S11, the original text is extracted from the source document.

[0057] In some embodiments, for unstructured documents in the source document, a document parsing engine is invoked to process the unstructured documents and obtain the original text.

[0058] For example, unstructured documents include PDF documents, Word documents, and image documents. The document parsing engine is called to convert the content of unstructured documents (e.g., text and tables) into structured Markdown format raw text, in order to preserve the hierarchy and logical structure of the unstructured documents.

[0059] In some embodiments, for a structured document in a source document, the header information of the structured document is concatenated with the data information of each row to obtain the original text of the structured document.

[0060] For example, structured documents include CSV and Excel format documents. For structured documents, a structure enhancement processing strategy is used to concatenate header information with each row of data, generating a series of semantically complete and independent plain text entries, ensuring that each data entry retains its clear field meaning even after being removed from the original table structure.

[0061] In some embodiments, the original image is extracted from the source document. The original image is uploaded to a server, and a corresponding image reference link is generated. Based on the original text and the position of the original image in the source document, the image reference link is added to the original text.

[0062] For example, images embedded in all source documents are automatically extracted and uploaded to a dedicated Minio object storage server, while accessible image reference links are preserved in the generated original text to ensure the integrity of the knowledge content.

[0063] In step S12, multiple text fragments are extracted from the original text.

[0064] In some embodiments, the structure of the original text is detected to determine whether it is structured or unstructured. The structured original text is processed using preset text segmentation rules to obtain multiple first original text fragments. The unstructured original text is processed using a fourth language model to obtain multiple second original text fragments. The multiple first and second original text fragments are then merged to obtain multiple text segments.

[0065] It's important to note that structured raw text refers to raw text containing multiple specified standard fields whose content forms a complete repair case. For example, standard fields include equipment model, fault code, fault symptoms, troubleshooting steps, and repair methods. Raw text extracted from structured source documents (e.g., CSV and Excel format source documents) is considered structured raw text.

[0066] For example, repair cases are shown in Examples 1 and 2 below. Examples 1 and 2 are both structured raw text.

[0067] Example 1. Repairing a fault caused by an external 200V short circuit.

[0068] Fault phenomenon: A vertical machining center equipped with a FANUC 6M motor failed to connect to the power supply when turned on for the first time after being out of use for a long period of time.

[0069] Analysis and troubleshooting process: Measurements of the power input unit TP1 showed a normal 200V input (U / V / W), but there was no AC 200V at the U1 and V1 terminals. The fault was likely caused by blown fuses F1 and F2, which were confirmed to be blown. Further inspection revealed a short circuit between 200A and 200B cables on input unit TP3. To pinpoint the fault location, the 200A and 200B cables on TP3 were disconnected and measured again, confirming the fault was external to the input unit. Inspection of the wiring revealed damaged insulation on the 200A and 200B cables. After replacing the cables and fuses F1 and F2, and eliminating the short circuit, the machine tool returned to normal operation.

[0070] Example 2. Spindle speed fluctuates significantly.

[0071] Machine tool model: MJ-50 CNC lathe.

[0072] CNC system: FANUC 0TE.

[0073] Fault phenomenon: During the operation of the spindle, the speed suddenly changes, sometimes fast and sometimes slow, with obvious large fluctuations. The speed displayed on the CRT also keeps jumping.

[0074] Inspection and Analysis: (1) The AC power supply voltage was checked and all three phases were in normal condition. The fuses in the main circuit were also intact. (2) The actual rotational speed was measured with a tachometer and compared with the value displayed on the CRT. The two values ​​were completely consistent and both were in a state of large fluctuation. This indicates that there was no problem with the tested components. (3) The electrical control cabinet was opened and the spindle drive section was inspected. No component damage or other abnormalities were found. Further inspection revealed that one of the three phases of the U, V, and W cables connected to the spindle motor had poor contact due to loose screws. The connection terminals were burned black, and the insulation of the adjacent wires was also burned.

[0075] Troubleshooting: Replace the burnt terminal block, cut off the burnt section of wire, and reconnect it.

[0076] Another HC-800 horizontal machining center suddenly displayed alarm #5010 (Spindle drive unit alarm) on its CRT during operation, and then could not perform any machining. This alarm message indicated a fault in the spindle drive unit. The spindle motor, actuators, and spindle control board were checked sequentially from the downstream to the upstream stage, and all were found to be normal. Finally, it was determined that severe moisture on the main terminal block was causing a short circuit. Replacing the terminal block resolved the problem.

[0077] For example, by using regular expressions and key field recognition methods, structured raw text can be accurately segmented into multiple semantically complete raw text fragments to achieve automated extraction of structured information.

[0078] It's also important to clarify that unstructured raw text refers to long texts that cannot match preset rules, are loosely structured, or are descriptive (e.g., experience summaries or technical notes). By invoking a large language model, the unstructured raw text is intelligently segmented based on semantic coherence and contextual relevance, resulting in multiple second raw text fragments. This ensures that each first raw text fragment is semantically relatively independent and complete. The fourth large language model can be a large language model specifically designed for knowledge segmentation or a general-purpose large language model.

[0079] In step S13, the label of each text fragment is determined based on the source of the multiple text fragments.

[0080] In some embodiments, the tags for each text fragment include knowledge source hierarchy tags.

[0081] For example, if the source document corresponding to a text fragment originates from the group headquarters, then the knowledge source level tag for that text fragment is determined to be at the group headquarters level. If the source document corresponding to a text fragment originates from a subsidiary, then the knowledge source level tag for that text fragment is determined to be at the subsidiary level, and the subsidiary identifier tag in the text fragment's tags is determined to be the corresponding subsidiary identifier.

[0082] It should be noted that, to support knowledge routing and priority retrieval under the two-tier architecture of the group and its subsidiaries, tags are added to each text fragment. The knowledge source hierarchy tag in the tag is the core tag, used to clearly indicate whether the text fragment belongs to "general knowledge of the group" or "specific knowledge of the subsidiary". If the text fragment belongs to specific knowledge of the subsidiary, the specific subsidiary identifier to which it belongs is simultaneously tagged, thereby achieving the addition of hierarchical metadata tags to each text fragment.

[0083] In some embodiments, multiple text fragments are stored in a first database according to their text content. The tags for each text fragment are stored in a second database. A knowledge base is constructed using the first and second databases.

[0084] For example, the first database is a vector database. The second database is a relational database.

[0085] It should be noted that all text fragments with hierarchical metadata tags are used to store all text fragments in a vector database according to their text content to support semantic retrieval, and the metadata tags of all text fragments are stored in a relational database for management. The vector database and the relational database are used together to form a knowledge base.

[0086] The methods described in the above embodiments collect multi-source heterogeneous knowledge and preprocess it, perform intelligent knowledge segmentation and information extraction based on rule templates and large language models, and build a knowledge base. This enables the automatic extraction, structuring and storage of knowledge from heterogeneous and multi-source equipment maintenance documents, and hierarchical metadata annotation, providing a high-quality and distinguishable data foundation for subsequent retrieval and question answering.

[0087] In some embodiments, a pre-defined knowledge graph can also be constructed using source documents. The method for constructing a pre-defined knowledge graph includes the following steps S21-S23.

[0088] In step S21, multiple entities of the preset knowledge graph and the semantic relationships between different entities are determined.

[0089] It should be noted that, taking a pre-defined knowledge graph for equipment fault repair as an example, a data model for a knowledge graph in the field of equipment fault repair has been constructed. This knowledge graph data model is centered on equipment, fault, and repair, and defines multiple key entities and the relationships between them.

[0090] For example, the core entity types of the preset knowledge graph include equipment information, fault information, and maintenance information. Among them, equipment information includes entities such as name, code, and CNC system model; fault information includes entities such as fault code, fault phenomenon, and fault cause; and maintenance information includes entities such as troubleshooting steps and maintenance methods.

[0091] For example, based on the logic of equipment fault repair, the semantic relationships between the aforementioned entities are predefined, forming a predefined relationship system to constitute the skeleton of the predefined knowledge graph. The semantic relationships between different entities include: <equipment name> possesses <equipment code>, <equipment code> belongs to <CNC system model>, <CNC system model> triggers <fault code>, <fault code> manifests as <fault phenomenon>, <fault phenomenon> corresponds to <troubleshooting steps>, <CNC system model> is associated with <troubleshooting steps>, <fault phenomenon> corresponds to <fault cause>, <repair method> resolves <fault cause>, and <CNC system model> is associated with <fault cause>, etc. This predefined relationship system provides a standard framework for the automated and standardized organization of knowledge.

[0092] In step S22, multiple triples are extracted from the source document based on multiple entities in the preset knowledge graph and the semantic relationships between different entities.

[0093] In some embodiments, for unstructured documents in the source document, a document parsing engine is invoked to process the unstructured document to obtain the original text. Based on multiple entities in a preset knowledge graph, the semantic relationships between different entities, and customized prompt words, the fifth language model is invoked to process the original text to obtain multiple triples.

[0094] It's important to note that unstructured documents include PDF, Word, and image documents. The document parsing engine converts the content of unstructured documents (e.g., text and tables) into structured Markdown format. For Markdown text obtained from PDF, Word, and other document parsing, the fifth language model is invoked, and triple extraction is performed based on the data patterns and customized prompts from the constructed knowledge graph of equipment fault repair.

[0095] It should also be noted that the customized prompt word instruction explicitly requires the fifth language model to: (1) perform accurate entity recognition and normalization, and strictly follow domain specifications. For example, extract "XX machining center" as a whole, directly output the equipment code, and distinguish between equipment model and CNC system model, etc. (2) perform relation extraction and alignment, and identify and output the binary relationship between entities according to the predefined relation system.

[0096] It should also be noted that the formatted triples output by the fifth language model (e.g., entity|entity|type|description, and relation|head entity|tail entity|relation|description) are directly parsed as candidate data for the predefined knowledge graph.

[0097] In some embodiments, multiple triples are extracted from a structured document in a source document using preset mapping rules.

[0098] For example, structured documents include CSV and Excel format documents. Through predefined field-entity type mapping rules, the column data of the table (e.g., device code, fault code) is directly mapped to entity attributes or the entities themselves in the preset knowledge graph, and the row data of the table is transformed into "entity-relationship-entity" triples. This process does not require calling a large language model, making it efficient and accurate.

[0099] It's important to note that for structured documents in the source document, triples can be extracted directly from the structured document; alternatively, the original text can be extracted first, and then triples can be extracted from the original text. A hybrid strategy is employed for knowledge extraction based on different types of source documents, achieving the transformation from source documents to structured knowledge graphs.

[0100] In step S23, a pre-defined knowledge graph is constructed using multiple triples.

[0101] In some embodiments, entity disambiguation and fusion are performed on multiple triples to obtain multiple normalized entities. A source attribute is added to each of the multiple normalized entities. A text embedding model is used to process each of the multiple normalized entities to obtain a vector representation of each normalized entity. A predefined knowledge graph is constructed using the multiple normalized entities, their vector representations, and the relationships between entities in the multiple triples.

[0102] For example, a hierarchical disambiguation strategy of "automatic matching as the main method and manual verification as a supplement" is adopted to perform entity disambiguation processing on entities in multiple triples. First, entities in multiple triples are clustered and matched based on semantic relevance, resulting in multiple matching pairs, each containing multiple entities. The confidence score of each matching pair is calculated. If the confidence score of the nth matching pair is greater than or equal to a first confidence threshold, the multiple entities in the nth matching pair are merged into a single entity. N represents the total number of matching pairs. If the confidence level of the nth matching pair is less than or equal to the second confidence threshold, then the entities in the nth matching pair are treated as distinct entities, where the second confidence threshold is less than the first confidence threshold. If the confidence level of the nth matching pair is less than the first confidence threshold but greater than the second confidence threshold, then the nth matching pair undergoes manual verification to obtain the manually processed result. This entity disambiguation strategy improves efficiency while ensuring the accuracy of entity fusion.

[0103] For example, a key "knowledge source" attribute can be added to each normalized entity, labeled as "general knowledge of the group" or "knowledge specific to subsidiaries." If a normalized entity originates from a subsidiary, the specific subsidiary name can be clearly indicated in the "knowledge source" attribute. By labeling the source of each normalized entity, hierarchical management of knowledge within the knowledge graph can be achieved.

[0104] For example, to support semantic-based graph retrieval and association analysis, a text embedding model is used to generate a high-dimensional vector representation for each normalized entity. This text embedding model is optimized for the equipment fault repair domain. Based on normalized entities with attached source attributes, vectorized representations, and relationships between entities, a pre-defined knowledge graph integrating structured knowledge, semantic vectors, and source metadata is constructed.

[0105] The methods described in the above embodiments employ a hybrid extraction strategy to automatically extract structured knowledge from heterogeneous maintenance documents. This knowledge is then fused and vectorized to construct a knowledge graph for equipment fault repair, supporting intelligent retrieval. During the knowledge construction phase, automated tagging adds hierarchical source labels ("general for the group / specific for subsidiaries") to all knowledge units (document blocks, graph entities), building a two-level knowledge management architecture based on metadata. Logical isolation is achieved in unified storage, laying a data foundation for secure and accurate retrieval in complex knowledge scenarios for large enterprises.

[0106] In some embodiments, the method for retrieving information from a preset knowledge base includes the following steps S31-S34.

[0107] It should be noted that after receiving the user's natural query statement, the system determines the user's organizational structure information and determines the search permissions based on the user's organizational structure information. The search permissions include the scope of knowledge base access.

[0108] For example, a user's organizational structure information includes the hierarchy of their organization. If the hierarchy is a subsidiary, the organizational structure information also includes information about the subsidiary. A user's search permissions can be configured to only retrieve knowledge tagged with "general knowledge of the group" and "knowledge specific to the user's current subsidiary," to meet data confidentiality requirements.

[0109] In step S31, based on the query statement, a search is performed in the preset knowledge base using the first retrieval method to obtain the first candidate fragment set.

[0110] In some embodiments, the query statement is converted into a query vector. The query statement is then segmented into multiple keywords. Using the query vector and the multiple keywords, a search is performed in a preset knowledge base to obtain a first set of candidate fragments.

[0111] It's important to note that the first retrieval method is a hybrid approach combining vector retrieval and keyword matching. For example, the user's input query is converted into a query vector. The query is then segmented and preprocessed to obtain multiple keywords. The semantic similarity between the query vector and each text segment in the knowledge base is calculated. These keywords are then matched against each text segment in the knowledge base to obtain keyword matching results. Based on the semantic similarity between the query vector and each text segment, and the keyword matching results, a first candidate segment set is determined. Here, the query vector is a high-dimensional numerical vector. Preprocessing of the query includes stop word removal and stemming.

[0112] In step S32, based on the query statement, a second retrieval method is used to search the preset knowledge base to obtain a second set of candidate fragments. The second retrieval method differs from the first retrieval method.

[0113] In some embodiments, the query statement is processed using a second language model to obtain the device entity and fault entity corresponding to the query statement. A structured query statement is obtained based on the device entity and fault entity. The structured query statement is converted into a query vector. The structured query statement is segmented into multiple keywords. Using the query vector and multiple keywords, a search is performed in a preset knowledge base to obtain a second candidate fragment set.

[0114] It's important to note that the second retrieval method is an entity-enhanced structured retrieval approach. A large language model is used to deeply analyze the query statement, accurately identifying and extracting key domain entities, including equipment entities and fault entities. Equipment entities include equipment code, equipment name, and equipment model. Fault entities include fault code and fault symptom. The entity name and entity value are concatenated to obtain the structured query statement. For example, the structured query statement is "Equipment Code: XX, Fault Code: YY". Based on the structured query statement, vector retrieval and keyword matching methods are used to accurately retrieve relevant text fragments from the knowledge base.

[0115] For example, suppose the user enters a query statement of "double-sided milling machine with model number CP101 alarm 6037". The large language model is used to extract the equipment model, equipment name and fault code from the query statement. The names and values ​​of these extracted entities are concatenated into "Model:CP101; Equipment Name: Double-sided Milling Machine; Fault Code:6037" as a structured query statement to improve the recall rate.

[0116] It should also be noted that this approach addresses the issue of failing to retrieve relevant text fragments in certain situations. For example, suppose a user enters the query "6037," meaning they only input the fault code. Directly searching the knowledge base using this query might not retrieve the relevant text fragments. However, by using the method described in the above embodiment to obtain the structured query "Fault Code: 6037" and then searching the knowledge base, the relevant text fragments can be retrieved.

[0117] It should also be noted that in the second retrieval method, after generating the structured query statement, the same hybrid retrieval method as in the first retrieval method can be used to retrieve the structured query statement in the knowledge base to obtain the second candidate fragment set.

[0118] It should also be noted that the second large language model can be a general large language model or a large language model specifically designed for extracting key entities.

[0119] In step S33, based on the query statement, a third retrieval method is used to search the preset knowledge base to obtain a third set of candidate fragments. The third retrieval method differs from the first and second retrieval methods.

[0120] In some embodiments, the query statement is processed using a third language model to obtain the device entity and fault entity corresponding to the query statement. Based on the device entity and fault entity, a relational subgraph is extracted from a preset knowledge graph. Supplementary entities are extracted from the relational subgraph. Based on the device entity, fault entity, and supplementary entities, a reconstructed query statement is obtained. The reconstructed query statement is converted into a query vector. The reconstructed query statement is segmented to obtain multiple keywords. Using the query vector and multiple keywords, a search is performed in a preset knowledge base to obtain a third candidate fragment set.

[0121] It should be noted that the third retrieval method is a knowledge graph-guided relational retrieval. Using the device entity and fault entity corresponding to the query statement as input, a deep relational query is performed within a preset knowledge graph. When querying the preset knowledge graph, the current user's organizational permissions are automatically injected, limiting the graph query scope to only traversing entity nodes whose source attribute is "General Knowledge of the Group" or "Specific Knowledge of Subsidiaries" to which the current user belongs.

[0122] It's also important to note that a hybrid keyword and semantic retrieval mode is used to locate fault information entities and maintenance information entities directly related to the input device and fault entities within a pre-defined knowledge graph. Starting from these entities, a subgraph integrating multi-hop relationships is constructed by expanding along predefined relationship paths such as "phenomenon-step-cause-method". The core entities and relationship information in this subgraph are used as semantically enhanced keywords to expand and reconstruct the query statement, resulting in a reconstructed query. This reconstructed query is then used to retrieve deep, actionable maintenance knowledge logically related to the pre-defined knowledge graph. The core entities and relationship information in the subgraph can include entities such as troubleshooting steps, fault causes, and maintenance methods.

[0123] For example, suppose the user inputs a query statement of "fault code 2216". Based on this query statement, the associated subgraph extracted from the preset knowledge graph includes entities such as equipment code (E09-110), equipment name (double-sided floor milling machining center), CNC system model (FUNAC 0i), fault code (2216), fault cause (liquid level sensor failure), troubleshooting steps (check coolant level, check if the liquid level sensor is damaged or malfunctioning), and repair method (replace liquid level sensor). The query statement is then reconstructed to "fault code 2216 liquid level sensor failure check coolant level, check if the liquid level sensor is damaged or malfunctioning replace liquid level sensor".

[0124] It should be noted that the third language model can be a general-purpose language model or a language model specifically designed for extracting key entities.

[0125] In step S34, all candidate text fragments in the first candidate fragment set, the second candidate fragment set, and the third candidate fragment set are fused to obtain multiple target text fragments.

[0126] For example, by summarizing all candidate text fragments in the first, second, and third candidate fragment sets, multiple target text fragments can be obtained.

[0127] The methods described in the above embodiments receive natural language queries from users regarding equipment maintenance. By collaboratively invoking knowledge bases and knowledge graphs, multi-level, multi-path intelligent retrieval and information fusion are performed to obtain multiple precise target text fragments. Through a multi-path collaborative retrieval strategy oriented towards heterogeneous knowledge sources, a three-pronged parallel retrieval method is adopted: "general hybrid retrieval - entity-enhanced retrieval - knowledge graph-guided retrieval." In particular, the "entity-enhanced structured retrieval" and "knowledge graph-guided association retrieval" paths achieve targeted querying of tabular knowledge such as CSV files and deep information expansion based on graph logic, significantly improving the accuracy and recall rate of professional domain retrieval.

[0128] In step 12, based on the label of each target text fragment in the multiple target text fragments, the multiple target text fragments are divided into a dedicated fragment set and a common fragment set.

[0129] For example, based on the knowledge source hierarchy tag for each target text fragment, multiple target text fragments are divided into a dedicated fragment set and a public fragment set. If the knowledge source hierarchy tag for a target text fragment is at the group headquarters level, then the target text fragment is assigned to the public fragment set; if the knowledge source hierarchy tag for a target text fragment is at the subsidiary level, then the target text fragment is assigned to the dedicated fragment set. The public fragment set is a set of general knowledge fragments for the entire group, while the dedicated fragment set is a set of knowledge fragments specific to subsidiaries.

[0130] It should be noted that a semantic similarity-based fusion deduplication algorithm can be used to deduplicatize the exclusive fragment set and the common fragment set separately, resulting in a redundant and highly relevant exclusive fragment set and common fragment set.

[0131] In step 13, multiple exclusive schemes are generated using all target text fragments in the exclusive fragment set, resulting in an exclusive scheme set.

[0132] For example, the sixth language model is used to process all target text fragments in the dedicated fragment set and the user's original input query statement to generate multiple dedicated solutions, resulting in a dedicated solution set.

[0133] It's important to note that the dedicated solutions are candidate maintenance solutions based on the subsidiary's proprietary knowledge. Dedicated solutions in the dedicated solution set are marked as high priority. When the dedicated fragment set is not empty, the sixth language model may generate 0, 1, or more dedicated solutions. In other words, there may be cases where the dedicated fragment set is not empty, but the sixth language model cannot generate a complete dedicated solution based on all the target text fragments in the dedicated fragment set.

[0134] It should also be noted that the sixth language model can be a general-purpose language model or a language model specifically designed for generating maintenance solutions.

[0135] In step 14, multiple common schemes are generated using all target text fragments in the common fragment set to obtain a common scheme set.

[0136] For example, the seventh language model is used to process all target text fragments in the common fragment set and the user's original input query statement to generate multiple common solutions, resulting in a common solution set.

[0137] It's important to note that common solutions are candidate maintenance solutions based on the group's general knowledge. Common solutions in the common solution set are marked as medium priority, with lower priority than dedicated solutions. When the common fragment set is not empty, the seventh language model may generate 0, 1, or more common solutions. In other words, there may be cases where the common fragment set is not empty, but the seventh language model cannot generate a complete common solution based on all target text fragments in the common fragment set.

[0138] It should also be noted that the seventh language model can be a general-purpose language model or a language model specifically designed for generating maintenance solutions.

[0139] The method described in the above embodiments initiates a dual-channel answer generation process to generate two sets of candidate solutions from different sources in parallel.

[0140] In step 15, the search results are determined using at least one of the proprietary solution set and the public solution set, based on the output rules.

[0141] It should be noted here that the output rules include outputting all solutions, outputting specific solutions, and outputting common solutions.

[0142] In some embodiments, if the output rule is to output all solutions, it is determined whether both the dedicated solution set and the public solution set are non-empty sets. If both sets are non-empty, all dedicated solutions in the dedicated solution set are sorted according to the sorting rule to obtain a dedicated solution sequence, which serves as the first search result. All public solutions in the public solution set are then sorted according to the sorting rule to obtain a public solution sequence, which serves as the second search result. The first and second search results are then sorted in descending order of priority to generate the final search result, where the first search result has a higher priority than the second search result.

[0143] It should be noted that the ranking rules are used to sort multiple solutions belonging to the same priority. When displaying search results to users, proprietary solutions and public solutions should be distinguished by prominent source tags, such as "Core Recommendation: Based on our company's practical experience" and "Extended Reference: General Technical Information".

[0144] In some embodiments, if the exclusive solution set is a non-empty set and the public solution set is an empty set, then all exclusive solutions in the exclusive solution set are sorted according to the sorting rules to obtain an exclusive solution sequence, which is used as the retrieval result.

[0145] It should be noted that if the public solution set is empty, when displaying the search results to the user, a prompt phrase such as "No relevant information was found in the general knowledge base" can be added.

[0146] In some embodiments, if the exclusive solution set is empty and the public solution set is non-empty, then all public solutions in the public solution set are sorted according to the sorting rules to obtain a public solution sequence, which is used as the retrieval result.

[0147] It should be noted that if the dedicated solution set is empty, when displaying search results to users, you can add the prompt "No relevant information was found in our knowledge base. The following answers are from general technical documents and are for reference only."

[0148] In some embodiments, if both the dedicated solution set and the public solution set are empty, it is determined whether the intelligent generation function is enabled. If the intelligent generation function is enabled, the query statement is processed using the first major language model to generate multiple auxiliary solutions, resulting in an auxiliary solution set. All auxiliary solutions in the auxiliary solution set are then sorted according to a sorting rule to obtain an auxiliary solution sequence, which serves as the retrieval result.

[0149] It's important to note that if both the dedicated solution set and the public solution set are empty and the intelligent generation function is enabled, a large language model will be invoked to generate an auxiliary solution to provide a fallback output. Auxiliary solutions in the auxiliary solution set will be marked as low priority, with their priority lower than that of the public solution. When displaying search results to users, a prompt can be added: "No relevant information was found in either our company's knowledge base or the general knowledge base. The answer was generated by an AI model and has not been verified by examples; please refer to it with caution."

[0150] It should also be noted that the first through seventh language models can all be obtained by fine-tuning existing large language models. The first through seventh language models can be the same or different.

[0151] In some embodiments, if the intelligent generation feature is disabled, the search results will be an empty set.

[0152] It should be noted that if both the proprietary solution set and the public solution set are empty and the intelligent generation function is disabled, then when displaying the search results to the user, the prompt phrase "No relevant information was found in either our company's knowledge base or the general knowledge base" can be added.

[0153] In some embodiments, if the output rule is to output a dedicated solution, then all dedicated solutions in the dedicated solution set are sorted according to the sorting rule to obtain a dedicated solution sequence, which is used as the retrieval result.

[0154] In some embodiments, if the output rule is to output common solutions, then all common solutions in the common solution set are sorted according to the sorting rule to obtain a sequence of common solutions as the retrieval result.

[0155] In some embodiments, the sorting rules include the following steps S41-S44.

[0156] In step S41, for the i-th solution in the set of solutions to be processed, the relevance between the i-th solution and the query statement is calculated to obtain the relevance score of the i-th solution. I represents the total number of solutions to be processed in the solution set, which can be a dedicated solution set, a public solution set, or an auxiliary solution set.

[0157] In some embodiments, the semantic similarity between the i-th solution to be processed and the device information and fault information in the query statement is calculated as the relevance score of the i-th solution to be processed.

[0158] In step S42, the quality score of the i-th solution to be processed is determined.

[0159] In some embodiments, the method for determining the quality score of the i-th solution to be processed includes the following steps S421-S423.

[0160] In step S421, the content integrity metric value of the i-th scheme to be processed is determined.

[0161] In some embodiments, it is detected whether the i-th solution to be processed includes multiple specified items to obtain the detection result of the i-th solution to be processed. The multiple specified items include troubleshooting steps, fault causes, and repair methods. Based on the detection result and the preset score of each specified item, a content integrity metric value for the i-th solution to be processed is determined.

[0162] It should be noted that the content integrity metric is used to evaluate the completeness of the content structure of the solution to be processed. The three key components of the solution are troubleshooting steps, causes of failure, and repair methods. Preset scores are determined for these three key components, and the content integrity metric for the i-th solution to be processed is the sum of the scores of each of its components.

[0163] For example, suppose the preset score for the investigation step is The preset score for the cause of the fault is The preset score for the repair method is If the i-th solution to be processed only includes troubleshooting steps and causes of failure, but does not include repair methods, then the content completeness metric of the i-th solution to be processed is... As shown in formula (1).

[0164] (1)

[0165] In step S422, the operability metric of the i-th solution to be processed is determined.

[0166] In some embodiments, the repair method in the i-th solution to be processed is evaluated to obtain the original operability metric of the i-th solution to be processed. The ratio of the original operability metric of the i-th solution to the maximum value among the original operability metrics of all solutions to be processed is calculated to determine the operability metric of the i-th solution to be processed.

[0167] For example, the "repair method" section of the i-th solution to be processed is parsed and processed, and the operable elements contained therein, such as the number of steps, quantitative parameters, specific parts or models, tools used, checkpoints, and diagrams, are identified and scored to obtain the original operability metric value of the i-th solution to be processed. Assume that the maximum value among the original operability metrics of all solutions to be processed is... Then the operability metric of the i-th solution to be processed is... As shown in formula (2).

[0168] (2)

[0169] In step S423, the weighted sum of the content integrity metric and the operability metric of the i-th solution to be processed is calculated to obtain the quality score of the i-th solution to be processed.

[0170] For example, the weight of content integrity metrics Weighting of operability metrics The relationship between them is shown in formula (3).

[0171] (3)

[0172] For example, the quality score of the i-th solution to be processed. As shown in formula (4).

[0173] (4)

[0174] In step S43, all the solutions to be processed in the solution set are sorted in descending order of relevance score to obtain the initial solution sequence.

[0175] It should be noted here that the relevance score will be used. As the primary criterion for ranking.

[0176] In step S44, for the solutions with the same relevance score in the initial solution sequence, they are sorted in descending order of quality score to obtain the solution sequence.

[0177] The methods described in the above embodiments employ a two-level ranking mechanism to determine the optimal output order for multiple solutions of the same priority. This mechanism first performs a primary ranking based on equipment fault relevance, and then performs a secondary ranking based on the quality of the repair plan for solutions with the same relevance. It abandons the technical paradigm of simply relying on large-scale black-box model judgments or relying solely on textual semantic relevance for single ranking, and constructs a configurable, multi-dimensional, interpretable, and business rule-driven dynamic ranking model for generated results. This model comprehensively evaluates the source relevance, equipment fault relevance, plan completeness, and operability of the solutions to be processed, ensuring the optimality, reliability, and security of the final output plan in terms of business requirements.

[0178] It should be noted that in the knowledge-based question-answering method described in the above embodiments, organizational permissions, retrieval strategies, sorting rules, and output logic can be customized. These customized configurations can be determined by the system administrator.

[0179] In some embodiments, the scope of the search in the knowledge base is determined based on the user's identity.

[0180] It should be noted that permission-aware retrieval is supported by maintaining the mapping relationship between user roles, departments and accessible knowledge (general knowledge or knowledge of specific subsidiaries).

[0181] In some embodiments, for a specific user, it is determined whether to enable or disable a specific knowledge source.

[0182] For example, for a specific user, text snippets from a specified knowledge source can be disabled based on the tags of the text snippets in the knowledge base. If general knowledge across the group is disabled for a specific user, then text snippets with the knowledge source level tag of "group headquarters" will not be retrieved when that user searches.

[0183] For example, if a user belongs to the first subsidiary, and we determine that knowledge from both the first and second subsidiaries is enabled for that user, then when that user searches, they can obtain text fragments from the first subsidiary as well as knowledge from the second subsidiary. This allows for personalized configuration for different users under the organizational structure mapping.

[0184] In some embodiments, the first search method, the second search method, the third search method, and the number of returned search results (Top-K) are determined respectively.

[0185] For example, you can set separate limits for vector search, keyword search, and the number of answers returned to the user.

[0186] In some embodiments, a first confidence threshold and a second confidence threshold are determined for entity fusion. A device fault relevance threshold and a retrieval result semantic similarity threshold are also determined.

[0187] In some embodiments, the weights of content integrity metrics and operability metrics are determined in order to balance the theoretical completeness and operability preferences of the scheme.

[0188] It should be noted that by dynamically adjusting the weight coefficients of the two dimensions of maintenance plan completeness and maintenance plan operability, the sum of which is ensured to be 1, in order to balance the preference for theoretical completeness and operability of the plan.

[0189] In some embodiments, preset scores are determined for troubleshooting steps, causes of failure, and repair methods.

[0190] It should be noted that preset scores for custom troubleshooting steps, causes of failures, and repair methods are used to reflect the degree of importance attached to each part in different business scenarios.

[0191] In some embodiments, scoring rules are determined for operability elements such as the number of steps, quantified parameters, identified components or models, tools used, checkpoints, and diagrams in the repair method of the solution.

[0192] It should be noted that the parameters for answer generation and sorting are configured by configuring the weight of sorting rules, the details of completeness scoring, and the scoring rules for operability elements.

[0193] In some embodiments, the output rule is determined to be outputting all solutions, outputting specific solutions, or outputting common solutions. The template for the prompt message when displaying search results to the user is determined.

[0194] It should be noted here that in the answer tracing and output rule configuration, you can configure whether to enforce the "specialized knowledge priority" strategy, as well as the output conditions and templates for accompanying prompts for each level of answer.

[0195] In some embodiments, parameters such as the base URL, API key, temperature, and maximum output length of the large language model are configured.

[0196] In some embodiments, the cache update frequency and strategy of the knowledge base and vector index are configured.

[0197] It should be noted that the above custom configurations can be achieved through a graphical interface or configuration files.

[0198] The methods described in the above embodiments enable comprehensive and flexible configuration of organizational permissions, retrieval strategies, sorting rules, and output logic, ensuring secure and accurate adaptation to the complex organizational structures and diverse business scenarios of large enterprise groups. By deeply integrating user organizational identity, knowledge source tags, and custom business rules into the entire process of retrieval, generation, sorting, and output, a complete intelligent question-answering closed loop characterized by "secure isolation, precise routing, and controllable quality" is formed.

[0199] The knowledge-based question-answering method described in the above embodiments constructs a knowledge base and knowledge graph using source documents from different sources. It employs three retrieval methods, dividing the retrieved text fragments into a dedicated fragment set and a public fragment set based on the knowledge source. Dedicated solutions and public solutions are then generated using these sets respectively. Based on output rules, sorting rules, the dedicated solution set, and the public solution set, the final retrieval results are determined. This method can accurately retrieve relevant text fragments, generate multi-level answers, improve the traceability of knowledge sources, and provide users with the optimal answers specifically, thereby improving the accuracy and reliability of the retrieval results.

[0200] Figure 2 This is a flowchart illustrating a knowledge base construction method according to an embodiment of this disclosure. Figure 2 As shown, the knowledge base construction method includes steps 21-28.

[0201] In step 21, determine the source document type.

[0202] If the source document is an unstructured document, proceed to step 22.

[0203] If the source document is a structured document, proceed to step 23.

[0204] In step 22, the document parsing engine is invoked to process the unstructured document and obtain the original text.

[0205] In step 23, the header information of the structured document is concatenated with the data information of each row to obtain the original text of the structured document.

[0206] In some embodiments, the original image is extracted from the source document. The original image is uploaded to a server, and a corresponding image reference link is generated. Based on the original text and the position of the original image in the source document, the image reference link is added to the original text.

[0207] In step 24, determine the original text type.

[0208] If the original text is unstructured, proceed to step 25.

[0209] If the original text is structured original text, then proceed to step 26.

[0210] In step 25, the unstructured original text is processed using the fourth language model to obtain multiple second original text fragments.

[0211] In step 26, the structured original text is processed using preset text segmentation rules to obtain multiple first original text fragments.

[0212] In step 27, multiple first original text fragments and multiple second original text fragments are merged to obtain multiple text fragments. Based on the source of each text fragment, a tag is determined for each text fragment.

[0213] In step 28, a knowledge base is constructed using multiple text fragments.

[0214] The knowledge base construction method described in the above embodiments collects heterogeneous knowledge from multiple sources and preprocesses it. Based on rule templates and large language models, intelligent knowledge segmentation and information extraction are performed to construct a knowledge base. This enables the automatic extraction, structuring, and storage of knowledge from heterogeneous and multi-source equipment maintenance documents, and hierarchical metadata annotation is performed on it, providing a high-quality and distinguishable data foundation for subsequent retrieval and question answering.

[0215] Figure 3 This is a flowchart illustrating a knowledge question-answering method according to another embodiment of this disclosure. Figure 3 As shown, the knowledge-based question-and-answer method includes steps 301-313.

[0216] In step 301, the user enters a query statement.

[0217] In step 302, the query statement is parsed to obtain the query vector and multiple keywords. The user's search permissions are determined based on the user's identity.

[0218] In step 303, the text fragments in the knowledge base are filtered according to the user's search permissions in order to limit the search scope.

[0219] In step 304, based on the query vector and multiple keywords, a mixed search is performed using the first search method to obtain the first candidate fragment set.

[0220] In step 305, based on the query statement, entity enhancement retrieval is performed using the second retrieval method to obtain the second candidate fragment set.

[0221] In step 306, based on the query statement, a third retrieval method is used to perform a graph-guided retrieval to obtain a third set of candidate fragments.

[0222] In step 307, the first candidate fragment set, the second candidate fragment set, and the third candidate fragment set are combined to obtain multiple target text fragments as search results.

[0223] In step 308, the search results are divided into a dedicated fragment set and a public fragment set based on the knowledge source hierarchy tag of each target text fragment.

[0224] In step 309, a dedicated fragment set is obtained. The knowledge source hierarchy tag for the target text fragments in the dedicated fragment set is at the subsidiary / company level.

[0225] In step 310, multiple exclusive schemes are generated using all target text fragments in the exclusive fragment set, resulting in an exclusive scheme set.

[0226] In step 311, a set of common fragments is obtained. Among them, the knowledge source level label of the target text fragments in the set of common fragments is group headquarters level.

[0227] In step 312, multiple common schemes are generated using all target text fragments in the common fragment set to obtain a common scheme set.

[0228] In step 313, the search results are determined based on multiple proprietary schemes and multiple public schemes.

[0229] By using the knowledge-based question-answering method described in the above embodiments, the user's retrieval permissions are determined, three retrieval methods are used in conjunction for retrieval, the retrieval results are divided according to the knowledge source, and multiple exclusive solutions and multiple public solutions are generated respectively to determine the retrieval results. This method can accurately retrieve relevant text fragments, generate multi-level answers, improve the traceability of knowledge sources, and thus improve the accuracy and credibility of retrieval results.

[0230] Figure 4 This is a flowchart illustrating another embodiment of the knowledge question-answering method of this disclosure. Figure 4 As shown, the knowledge-based question-and-answer method includes steps 401-410.

[0231] It should be noted here that, using Figure 3 Steps 301-312 in the process yield the specific solution set and the public solution set, which are then utilized... Figure 4 Steps 401-410 in the process are used to process the above-mentioned dedicated solution set and public solution set to obtain the search results.

[0232] In step 401, the solutions to be processed in the set of solutions to be processed are evaluated. The set of solutions to be processed can be a dedicated set of solutions or a common set of solutions.

[0233] In step 402, the relevance of each solution to be processed to the query statement is evaluated to obtain a relevance score for each solution to be processed.

[0234] In step 403, the integrity of each solution to be processed is evaluated to obtain a content integrity metric for each solution to be processed.

[0235] In step 404, the operability of each proposed solution is evaluated to obtain an operability metric for each proposed solution.

[0236] In step 405, the solutions to be processed are ranked according to the evaluation results. Specifically, multiple solutions in the solution set are ranked based on their relevance score, content integrity metric, and operability metric. Multiple dedicated solutions in the dedicated solution set are ranked to obtain a dedicated solution sequence. Multiple public solutions in the public solution set are ranked to obtain a public solution sequence.

[0237] In step 406, the decision is output.

[0238] If the dedicated scheme set is not empty, then proceed to step 407.

[0239] If the exclusive solution set is empty and the public solution set is not empty, then proceed to step 408.

[0240] If both the dedicated solution set and the public solution set are empty, proceed to step 409.

[0241] In step 407, a specific solution is output. The sequence of specific solutions is used as the search result.

[0242] In step 408, common solutions are output. The sequence of common solutions is used as the search result.

[0243] In step 409, an auxiliary solution is generated using a large language model, and the auxiliary solution is used as the retrieval result.

[0244] In step 410, the search results are obtained.

[0245] The knowledge-based question-answering method described in the above embodiments determines the user's retrieval permissions, employs three retrieval methods in a collaborative manner, categorizes the retrieval results according to the knowledge source, generates multiple exclusive solutions and multiple public solutions, evaluates the relevance, completeness, and operability of the solutions, sorts the solutions, and determines the retrieval results according to the output rules. This method can accurately retrieve relevant text fragments, generate multi-level answers, improve the traceability of knowledge sources, and provide users with the optimal answers specifically, thereby improving the accuracy and credibility of the retrieval results.

[0246] Figure 5 This is a schematic diagram of the structure of a knowledge question-answering device according to an embodiment of this disclosure. Figure 5As shown, the knowledge question answering device 50 includes a memory 51, a processor 52, and a bus 53 connecting different system components.

[0247] The memory 51 may include, for example, system memory, non-volatile storage media, etc. System memory may store, for example, an operating system, application programs, a boot loader, and other programs. System memory may include volatile storage media, such as random access memory (RAM) and / or cache memory. Non-volatile storage media may store, for example, instructions for a corresponding embodiment of at least one knowledge question-answering method being executed. Non-volatile storage media include, but are not limited to, disk storage, optical storage, flash memory, etc.

[0248] The processor 52 can be implemented using a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete hardware components such as discrete gates or transistors. Accordingly, the method in any of the above embodiments can be implemented by instructions in the central processing unit (CPU) running memory to execute the corresponding steps, or by dedicated circuitry to execute the corresponding steps.

[0249] For example, processor 52 is configured for memory-based instruction execution implementation such as Figure 1 , Figure 3 or Figure 4 The knowledge question-and-answer method involved in any of the embodiments.

[0250] Bus 53 can use any of the various bus architectures. For example, bus architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MCA) bus, and the Peripheral Component Interconnect (PCI) bus.

[0251] The interfaces 54, 55, and 56 of the knowledge-answering device 50, as well as the memory 51 and processor 52, can be connected via bus 53. Input / output interface 54 provides a connection interface for input / output devices such as a monitor, mouse, and keyboard. Network interface 55 provides a connection interface for various networked devices. Storage interface 56 provides a connection interface for external storage devices such as floppy disks, USB flash drives, and SD cards.

[0252] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations thereof, can be implemented by computer-readable program instructions.

[0253] These computer-readable program instructions are provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable device to produce a machine, such that execution of the instructions by the processor produces means for implementing the functions specified in one or more boxes of the flowchart and / or block diagram.

[0254] These computer-readable program instructions may also be stored in a computer-readable storage medium. These instructions cause a computer to work in a particular manner to produce an article of manufacture, including instructions that implement the functions specified in one or more boxes in a flowchart and / or block diagram.

[0255] This disclosure may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects.

[0256] This disclosure also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement... Figure 1 , Figure 3 or Figure 4 The knowledge question-and-answer method involved in any of the embodiments.

[0257] This disclosure also provides a computer program product, including computer instructions, wherein the computer instructions, when executed by a processor, implement as follows: Figure 1 , Figure 3 or Figure 4 The knowledge question-and-answer method involved in any of the embodiments.

[0258] By implementing the knowledge question-answering method involved in the above embodiments, the following beneficial effects can be obtained:

[0259] (1) Precise classification, safe and controllable: Through metadata tags and permission mapping, the automatic isolation and precise authorization of general knowledge and special knowledge are realized, ensuring the security of core maintenance data of each company and meeting the requirements of enterprise-level knowledge governance and compliance.

[0260] (2) Intelligent retrieval and reliable answers: The "three-way collaborative retrieval" strategy deeply integrates semantics, entity and graph relationships, and realizes accurate targeted recall of multi-source heterogeneous knowledge, including CSV tables; the "dual-channel generation" and multi-dimensional business ranking model give priority to outputting verified special maintenance solutions, ensuring that the answers have high credibility, completeness and operability.

[0261] (3) Flexible and configurable, continuously evolving: Through custom configuration, it supports dynamic adjustment of retrieval, sorting and output rules, which can quickly adapt to different business scenarios; through continuous learning of maintenance cases and expert experience, it forms a closed loop of knowledge accumulation and optimization, and promotes the continuous value-added of the enterprise's maintenance knowledge system.

[0262] The knowledge-based question-and-answer method described in the above embodiments improves the accuracy, security, and operability of intelligent maintenance question-and-answer in complex environments of large enterprises.

[0263] In some embodiments, the functional units described above may be implemented as general-purpose processors, programmable logic controllers (PLCs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or any suitable combination thereof for performing the functions described herein.

[0264] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0265] The description in this disclosure is provided for illustrative and descriptive purposes only and is not intended to be exhaustive or to limit the disclosure to its forms. Many modifications and variations will be apparent to those skilled in the art. The embodiments were chosen and described in order to better illustrate the principles and practical application of this disclosure and to enable those skilled in the art to understand this disclosure and to design various embodiments with various modifications suitable for a particular purpose.

Claims

1. A knowledge-based question-and-answer method, comprising: Based on the user's query, a search is performed in a preset knowledge base to obtain multiple target text fragments; Based on the tag of each target text fragment in the plurality of target text fragments, the plurality of target text fragments are divided into a dedicated fragment set and a public fragment set; Using all target text fragments in the dedicated fragment set, generate multiple dedicated schemes to obtain a dedicated scheme set; Using all target text fragments in the public fragment set, multiple public schemes are generated to obtain a public scheme set; Based on the output rules, the search results are determined using at least one of the proprietary solution set and the public solution set.

2. The knowledge question-answering method according to claim 1, wherein, The step of determining the search results based on the output rules, using at least one of the dedicated solution set and the public solution set, includes: If the output rule is to output all solutions, then determine whether both the exclusive solution set and the public solution set are non-empty sets; If both the dedicated solution set and the public solution set are non-empty sets, then all dedicated solutions in the dedicated solution set are sorted according to the sorting rules to obtain a dedicated solution sequence, which is used as the first retrieval result. The public solutions in the public solution set are sorted according to the sorting rules to obtain a public solution sequence, which is used as the second retrieval result. The first search result and the second search result are sorted in descending order of priority to generate the search results, wherein the priority of the first search result is higher than that of the second search result.

3. The knowledge question-answering method according to claim 2, wherein, The step of determining the search results based on the output rules, using at least one of the dedicated solution set and the public solution set, further includes: If the exclusive solution set is a non-empty set and the public solution set is an empty set, then all exclusive solutions in the exclusive solution set are sorted according to the sorting rules to obtain an exclusive solution sequence, which is used as the retrieval result.

4. The knowledge question-answering method according to claim 2, wherein, The step of determining the search results based on the output rules, using at least one of the dedicated solution set and the public solution set, further includes: If the exclusive solution set is empty and the public solution set is non-empty, then all public solutions in the public solution set are sorted according to the sorting rules to obtain a public solution sequence, which is used as the retrieval result.

5. The knowledge question-answering method according to claim 2, wherein, The step of determining the search results based on the output rules, using at least one of the dedicated solution set and the public solution set, further includes: If both the dedicated solution set and the public solution set are empty sets, then determine whether the intelligent generation function is enabled; If the intelligent generation function is enabled, the query statement is processed using the first major language model to generate multiple auxiliary solutions to obtain an auxiliary solution set. All auxiliary schemes in the auxiliary scheme set are sorted according to the sorting rules to obtain an auxiliary scheme sequence, which is used as the retrieval result.

6. The knowledge question-answering method according to claim 5, wherein, The step of determining the search results based on the output rules, using at least one of the dedicated solution set and the public solution set, further includes: If the intelligent generation function is disabled, the search results will be an empty set.

7. The knowledge question-answering method according to claim 1, wherein, The step of determining the search results based on the output rules, using at least one of the dedicated solution set and the public solution set, further includes: If the output rule is to output a specific solution, then all specific solutions in the specific solution set are sorted according to the sorting rule to obtain a specific solution sequence, which is used as the retrieval result.

8. The knowledge question-answering method according to claim 1, wherein, The step of determining the search results based on the output rules, using at least one of the dedicated solution set and the public solution set, further includes: If the output rule is to output a common solution, then all common solutions in the common solution set are sorted according to the sorting rule to obtain a common solution sequence, which is used as the retrieval result.

9. The knowledge question-answering method according to any one of claims 2-8, wherein, The sorting rules include: For the i-th solution in the set of solutions to be processed, the relevance between the i-th solution and the query statement is calculated to obtain a relevance score for the i-th solution. I represents the total number of solutions to be processed in the set of solutions to be processed, and the set of solutions to be processed can be the dedicated solution set, the public solution set, or the auxiliary solution set. Determine the quality score of the i-th solution to be processed; Sort all the solutions in the set of solutions to be processed according to the relevance scores from largest to smallest to obtain the initial sequence of solutions to be processed. For the solutions with the same relevance score in the initial sequence of solutions to be processed, sort them in descending order of quality score to obtain the sequence of solutions to be processed.

10. The knowledge question-answering method according to claim 9, wherein, The process of calculating the relevance between the i-th solution to be processed and the query statement to obtain the relevance score of the i-th solution to be processed includes: Calculate the semantic similarity between the i-th solution to be processed and the device information and fault information in the query statement, and use it as the relevance score of the i-th solution to be processed.

11. The knowledge question-answering method according to claim 9, wherein, Determining the quality score of the i-th solution to be processed includes: Determine the content integrity metric value for the i-th solution to be processed; Determine the operability metric value of the i-th solution to be processed; Calculate the weighted sum of the content integrity metric and the operability metric of the i-th solution to obtain the quality score of the i-th solution.

12. The knowledge question-answering method according to claim 11, wherein, Determining the content integrity metric of the i-th solution to be processed includes: Detect whether the i-th solution to be processed includes multiple specified items, and obtain the detection result of the i-th solution to be processed, wherein the multiple specified items include troubleshooting steps, fault causes and repair methods; Based on the detection results and the preset score of each specified item, the content integrity metric value of the i-th solution to be processed is determined.

13. The knowledge question-answering method according to claim 11, wherein, The determination of the operability metric for the i-th solution to be processed includes: The repair method in the i-th solution to be addressed is evaluated to obtain the original operability metric value of the i-th solution to be addressed; Calculate the ratio of the original operability metric of the i-th solution to the maximum value among the original operability metrics of all solutions to be processed, and determine the operability metric of the i-th solution.

14. The knowledge question-answering method according to claim 1, wherein, The step of retrieving multiple target text fragments from a preset knowledge base based on the user's input query includes: Based on the query statement, a first retrieval method is used to search the preset knowledge base to obtain a first candidate fragment set; Based on the query statement, a second retrieval method is used to search the preset knowledge base to obtain a second candidate fragment set, wherein the second retrieval method is different from the first retrieval method; Based on the query statement, a third retrieval method is used to search the preset knowledge base to obtain a third candidate fragment set, wherein the third retrieval method is different from the first retrieval method and the second retrieval method; All candidate text fragments in the first candidate fragment set, the second candidate fragment set, and the third candidate fragment set are fused to obtain the plurality of target text fragments.

15. The knowledge question-answering method according to claim 14, wherein, The step of using the first retrieval method to perform a retrieval in the preset knowledge base includes: Convert the query statement into a query vector; The query statement is segmented into words to obtain multiple keywords; Using the query vector and the multiple keywords, a search is performed in the preset knowledge base to obtain the first candidate fragment set.

16. The knowledge question-answering method according to claim 14, wherein, The second retrieval method for searching the preset knowledge base includes: The query statement is processed using the second major language model to obtain the device entity and fault entity corresponding to the query statement; Based on the device entity and the fault entity, a structured query statement is obtained; Convert the structured query statement into a query vector; The structured query statement is segmented into words to obtain multiple keywords; Using the query vector and the multiple keywords, a search is performed in the preset knowledge base to obtain the second candidate fragment set.

17. The knowledge question-answering method according to claim 14, wherein, The use of a third retrieval method to perform a retrieval in the preset knowledge base includes: The query statement is processed using the third major language model to obtain the device entity and fault entity corresponding to the query statement; Based on the device entity and the fault entity, extract the associated subgraph from the preset knowledge graph; Extract supplementary entities from the associated subgraph; Based on the device entity, the fault entity, and the supplementary entity, a reconstructed query statement is obtained; Convert the reconstructed query statement into a query vector; The reconstructed query statement is segmented into words to obtain multiple keywords; Using the query vector and the multiple keywords, a search is performed in the preset knowledge base to obtain the third candidate fragment set.

18. The knowledge question-answering method according to any one of claims 1-8, further comprising: The source document is processed to obtain multiple text fragments and a tag for each of the multiple text fragments; The preset knowledge base is constructed using the multiple text fragments and the tags of each text fragment.

19. A knowledge-based question-and-answer device, comprising: Memory; A processor, coupled to a memory, is configured to implement the knowledge question-answering method as described in any one of claims 1-18 based on the execution of instructions stored in the memory.

20. A computer-readable storage medium, wherein, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the knowledge question-answering method as described in any one of claims 1-18.

21. A computer program product comprising computer instructions, wherein the computer instructions, when executed by a processor, implement the knowledge question-answering method as described in any one of claims 1-18.