Boiler safety technical regulation intelligent question-answering system and method based on retrieval enhancement generation
By using a search-enhanced intelligent question-answering system, which leverages a large language model and a RAG search module, the problems of low efficiency and poor accuracy in boiler safety technical regulations retrieval have been solved, achieving efficient and accurate regulations retrieval and an optimized user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-06
- Publication Date
- 2026-04-10
AI Technical Summary
The existing methods for querying boiler safety technical regulations rely on manual retrieval, which is inefficient. The electronic document retrieval results are poorly relevant and difficult for non-professionals to understand, resulting in slow response speed and low accuracy.
An intelligent question-answering system based on retrieval enhancement is adopted. It uses a large language model (LLM) for semantic analysis, and combines a RAG retrieval module and a knowledge management module to generate accurate retrieval results through chapter title positioning, vector retrieval and multi-round iterative optimization.
It enables precise location and efficient response for boiler safety technical regulations queries, improves query efficiency and accuracy, lowers the professional technical threshold, and optimizes the user experience.
Smart Images

Figure CN121833901A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of artificial intelligence natural language processing, in particular to a boiler safety technical regulation intelligent question and answer system and method based on retrieval enhancement generation. BACKGROUND
[0002] As a core and key equipment in the power industry, the operation safety of a boiler is directly related to the stability and reliability of the power system and the safety of personnel and property. The corresponding boiler safety technical regulation is the core basis for ensuring the safe operation of the boiler throughout its life cycle. This regulation has characteristics such as strict clauses, dense professional terms, and complex associated logic. Whether it is daily equipment maintenance, fault disposal, or professional personnel training, users need to frequently search and consult the regulation clauses to accurately grasp the relevant technical requirements and standardize the operation process.
[0003] However, there are some technical problems in the current query method of the boiler safety technical regulation. On the one hand, the traditional query method relies on manual retrieval of paper documents, which is inefficient and slow in response. On the other hand, the existing electronic document retrieval system only supports keyword matching, and the returned search results have poor relevance, much redundant information, and non-professionals are difficult to accurately understand the specific requirements of the technical clauses through scattered search results. SUMMARY
[0004] To solve the above problems, the present disclosure provides a boiler safety technical regulation intelligent question and answer system and method based on retrieval enhancement generation, which can partially or completely solve the technical problems existing in the current query method of the boiler safety technical regulation.
[0005] To achieve the above-mentioned purposes, the technical solutions adopted by the present disclosure are as follows: In a first aspect, the present disclosure provides a boiler safety technical regulation intelligent question and answer system based on retrieval augmented generation, comprising a user interaction module, an intelligent question and answer engine, an RAG retrieval module, and a knowledge management module; the intelligent question and answer engine comprises a large language model LLM, which is configured to, under the guidance of a preset system prompt word, perform semantic analysis on question text related to the boiler safety technical regulation received by the user interaction module, determine a chapter title corresponding to the question text and a vector retrievable query statement; call the RAG retrieval module and obtain the retrieval result returned by the RAG retrieval module; iteratively perform semantic analysis on the question text until the LLM no longer calls the RAG retrieval module, generate an answer result of the question text based on the retrieval result returned by the RAG retrieval module last time, and return the answer result to the user interaction module for display; the RAG retrieval module is configured to, when called by the LLM, determine a matched regulation text segment based on the chapter title corresponding to the question text and the vector retrievable query statement in combination with a vector database of the boiler safety technical regulation stored by the knowledge management module, and generate a retrieval result based on the regulation text segment and return it to the LLM.
[0006] In a possible implementation, the preset system prompt word comprises a first prompt word and a second prompt word; under the guidance of the preset system prompt word, the semantic analysis on the question text related to the boiler safety technical regulation received by the user interaction module to determine the chapter title corresponding to the question text and the vector retrievable query statement comprises: under the guidance of the first prompt word, determining the chapter title corresponding to the question text based on the question text in combination with a chapter directory database of the boiler safety technical regulation stored by the knowledge management module; the chapter title comprises a second-level title; under the guidance of the second prompt word, extracting a keyword related to the boiler safety technical regulation in the question text and converting the keyword into the vector retrievable query statement corresponding to the question text.
[0007] In a possible implementation, based on the chapter title corresponding to the question text and the vector retrievable query statement in combination with the vector database of the boiler safety technical regulation stored by the knowledge management module, the matched regulation text segment is determined, comprising: based on the chapter title corresponding to the question text, determining a chapter range to be queried of the question text; converting the vector retrievable query statement into a corresponding semantic vector through a vectorization model, and based on the semantic vector, determining a target semantic vector with the highest similarity to the semantic vector in the vector database of the boiler safety technical regulation stored by the knowledge management module, taking the chapter range as the minimum query unit; taking the regulation text segment corresponding to the target semantic vector with the highest similarity as the matched regulation text segment.
[0008] In a possible implementation, the determining of the target semantic vector with the highest similarity to the semantic vector in the vector database of the boiler safety technical regulations stored in the knowledge management module comprises: performing similarity calculation in the vector database of the boiler safety technical regulations stored in the knowledge management module based on the semantic vector to obtain similarity calculation results of each target semantic vector; sorting the similarity calculation results of each target semantic vector to generate a similarity sorting result; and determining the target semantic vector with the highest similarity to the semantic vector based on the similarity sorting result.
[0009] In a possible implementation, the generating of the retrieval result based on the regulation text segment comprises: obtaining context content of the regulation text segment through a context expansion mechanism based on the regulation text segment; and integrating the regulation text segment and the context content of the regulation text segment to generate the retrieval result.
[0010] In a possible implementation, the user interaction module is configured to receive question text input by a user and related to the boiler safety technical regulations, display an answer result for the question text, and display a historical interaction record of the user and the system.
[0011] In a possible implementation, the knowledge management module is configured to store a chapter directory database and a vector database of the boiler safety technical regulations.
[0012] In a possible implementation, the second aspect of the present disclosure provides a boiler safety technical regulations intelligent question-answering method based on retrieval enhancement generation, comprising: obtaining question text input by a user and related to the boiler safety technical regulations; performing semantic analysis on the question text under the guidance of preset system prompt words to determine a chapter title corresponding to the question text and a vector retrievable query statement; determining a matched regulation text segment based on the chapter title corresponding to the question text and the vector retrievable query statement and combining a pre-stored vector database of the boiler safety technical regulations, and generating a retrieval result based on the regulation text segment; and performing semantic analysis on the question text through cyclic iteration based on the retrieval result until an iteration stop condition is met, generating an answer result for the question text based on a retrieval result of a last iteration, and returning the answer result to a user interface.
[0013] In a possible implementation, the preset system prompt words comprise first prompt words and second prompt words; and the performing of the semantic analysis on the question text under the guidance of the preset system prompt words to determine the chapter title corresponding to the question text and the vector retrievable query statement comprises: determining the chapter title corresponding to the question text based on the question text and combining a pre-stored chapter directory database of the boiler safety technical regulations under the guidance of the first prompt words; the chapter title comprises a second-level title; and extracting keywords related to the boiler safety technical regulations in the question text and converting the keywords into the vector retrievable query statement corresponding to the question text under the guidance of the second prompt words.
[0014] In a possible implementation, the matched regulation text segment is determined based on the chapter title corresponding to the question text and the vector retrievable query statement, and in combination with the pre-stored vector database of the boiler safety technical regulation, including: determining the chapter range to be queried of the question text based on the chapter title corresponding to the question text; converting the vector retrievable query statement corresponding to the question text into a corresponding semantic vector through a vectorization model, and based on the semantic vector, determining the target semantic vector with the highest similarity to the semantic vector in the pre-stored vector database of the boiler safety technical regulation, with the chapter range as the minimum query unit; and taking the regulation text segment corresponding to the target semantic vector with the highest similarity as the matched regulation text segment.
[0015] Compared with the prior art, the present disclosure has the following beneficial effects: The present disclosure realizes accurate positioning of the retrieval range by determining the chapter title corresponding to the question text, realizes accurate retrieval and matching of the relevant regulation text segment by determining the vector retrievable query statement corresponding to the question text, and realizes dynamic optimization of the retrieval result and continuous improvement of the question and answer logic through the multi-round iteration mechanism, so as to comprehensively optimize the question and answer experience of the user and improve the response efficiency and content accuracy of the boiler safety technical regulation related question and answer. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 is a structural schematic diagram of a boiler safety technical regulation intelligent question and answer system generated based on retrieval enhancement provided by an embodiment of the present disclosure; Figure 2 is a core processing flowchart of a boiler safety technical regulation intelligent question and answer system provided by an embodiment of the present disclosure; Figure 3 is a result display page diagram of a boiler safety technical regulation intelligent question and answer system provided by an embodiment of the present disclosure; Figure 4 is a flowchart of a boiler safety technical regulation intelligent question and answer method generated based on retrieval enhancement provided by an embodiment of the present disclosure; Figure 5 is a system architecture diagram of a boiler safety technical regulation intelligent question and answer system provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0017] The present disclosure will be further described below in conjunction with the drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present disclosure, and cannot be used to limit the protection scope of the present disclosure. It should be noted that the following detailed description is exemplary and is intended to provide further description of the present application.
[0018] The acquisition, transmission, storage, use, processing, etc. of data in the technical solutions of the present disclosure comply with relevant provisions of national laws and regulations. In the embodiments of the present disclosure, some industry existing solutions, components, models, etc. may be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility in the implementation of the technical solutions of the present disclosure, but it does not mean that the applicant has or will necessarily use the solutions.
[0019] All terms used in the present disclosure have the same meaning as understood by those of ordinary skill in the art to which the present disclosure belongs, unless otherwise specifically defined. It should also be understood that terms defined in general dictionaries should be interpreted to have meanings consistent with their meanings in the context of the relevant art, and should not be interpreted in an idealized or excessively formalized sense, unless specifically defined herein.
[0020] The core modules of the boiler safety technical regulation intelligent question and answer system provided by the present disclosure include a user interaction module, an intelligent question and answer engine, a RAG (Retrieval-Augmented Generation) retrieval module, and a knowledge management module.
[0021] The present disclosure provides a boiler safety technical regulation intelligent question and answer system based on retrieval augmented generation, as shown in Figure 1 The boiler safety technical regulation intelligent question and answer system includes a user interaction module 110, an intelligent question and answer engine 120, a RAG retrieval module 130, and a knowledge management module 140. The intelligent question and answer engine 120 includes an LLM (Large Language Model), which is configured to perform semantic analysis on the question text related to the boiler safety technical regulation received by the user interaction module 110 under the guidance of the preset system prompt word, determine the chapter title corresponding to the question text and the vector retrievable query statement, call the RAG retrieval module 130 and obtain the retrieval result returned by the RAG retrieval module 130, iteratively analyze the semantic analysis of the question text until the LLM no longer calls the RAG retrieval module 130, generate an answer result for the question text based on the last retrieval result returned by the RAG retrieval module 130, and return the answer result to the user interaction module 110 for display. The RAG retrieval module 130 is configured to, when called by the LLM, determine the matching regulation text segment based on the chapter title corresponding to the question text and the vector retrievable query statement in combination with the vector database of the boiler safety technical regulation stored by the knowledge management module 140, and generate a retrieval result based on the regulation text segment and return it to the LLM.
[0022] In a possible implementation, the preset system prompt word includes a first prompt word and a second prompt word; under the guidance of the preset system prompt word, the semantic analysis is performed on the question text related to the boiler safety technical regulation received by the user interaction module, and the chapter title corresponding to the question text and the vector retrievable query statement are determined, which can specifically include: under the guidance of the first prompt word, based on the question text, the chapter title corresponding to the question text is determined in combination with the chapter directory database of the boiler safety technical regulation stored in the knowledge management module, and the chapter title includes a secondary title; under the guidance of the second prompt word, the keywords related to the boiler safety technical regulation in the question text are extracted, and the keywords are converted into the vector retrievable query statement corresponding to the question text.
[0023] It should be noted that the secondary title refers to a subdivided clause title below the primary title in the regulation text, for example, “6.1 Boiler Body”, “5.1 Safety Valve” and the like; the keyword refers to a term or phrase that can represent the core query intention of the user, for example, “flash tank, safety valve, number” and the like; and the vector retrievable query statement refers to a retrieval statement that can be directly used for vector similarity calculation after language reconstruction, for example, “flash tank safety valve number requirement”.
[0024] In addition, it should be noted that the first prompt word is a text instruction for guiding the large language model LLM to locate the chapter title in the chapter directory database of the boiler safety technical regulation, for example, in a specific implementation, the first prompt word can be “analyze the user's question, select the secondary title from the previous directory that you think may have relevant content, copy the title name, and cannot be modified in any way”. The second prompt word is a text instruction for guiding the LLM to extract keywords from the question text and generate a vector retrievable query statement, for example, in a specific implementation, the second prompt word can be “analyze the user's question, extract the keywords, and generate a RAG QUERY suitable for retrieving the required content according to the keywords”.
[0025] In another possible implementation, the preset system prompt word can also include a third prompt word, a fourth prompt word, a fifth prompt word, and the like to further constrain the semantic analysis process of the LLM. For example, the third prompt word can be used to prohibit the LLM from asking the RAG database, and force it to output a specification query that can be directly used for retrieval at one time; the fourth prompt word can be used to require the LLM to perform synonym expansion on the keywords.
[0026] For example, in a specific embodiment, the user inputs a question text "How many safety valves should be installed on the flash tank with rated thermal power greater than 1.4 MW", the system determines the secondary title "5.1 Safety Valve" from the chapter directory database under the guidance of the first prompt word, extracts the keywords "flash tank, safety valve, installation" under the guidance of the second prompt word, and generates the vector retrievable query statement "flash tank safety valve setting requirements".
[0027] In a possible implementation, based on the chapter title corresponding to the question text and the vector retrievable query statement, and in combination with the vector database of the boiler safety technical regulations stored by the knowledge management module, the matched regulation text segment is determined, which can specifically include: determining the chapter range to be queried of the question text based on the chapter title corresponding to the question text; converting the vector retrievable query statement into a corresponding semantic vector through a vectorization model, and based on the semantic vector, determining the target semantic vector with the highest similarity to the semantic vector in the vector database of the boiler safety technical regulations stored by the knowledge management module, taking the chapter range as the minimum query unit.
[0028] It should be noted that in the embodiments of the present disclosure, the vector retrievable query statement is converted into a corresponding semantic vector through a vectorization model (such as BERT (Bidirectional Encoder Representations from Transformers, bidirectional encoder representation model) or Text2Vec), and the semantic vector refers to a high-dimensional dense vector used to represent the semantic information of the query statement. The similarity calculation can use an approximate nearest neighbor (ANN) algorithm or cosine similarity calculation, which is not specifically limited in the embodiments of the present disclosure.
[0029] In a possible implementation, in the vector database of the boiler safety technical regulations stored by the knowledge management module, the target semantic vector with the highest similarity to the semantic vector is determined, which can specifically include: based on the semantic vector, performing similarity calculation in the vector database of the boiler safety technical regulations stored by the knowledge management module to obtain the similarity calculation results of each target semantic vector; sorting the similarity calculation results of each target semantic vector to generate a similarity sorting result; and based on the similarity sorting result, determining the target semantic vector with the highest similarity to the semantic vector.
[0030] In a possible implementation, the generating the retrieval result based on the procedure text segment specifically can include: based on the procedure text segment, obtaining context content of the procedure text segment through a context expansion mechanism; and based on the procedure text segment and the context content of the procedure text segment, integrating to generate the retrieval result.
[0031] It should be noted that the generating the retrieval result based on the procedure text segment in the embodiments of the present disclosure refers to: after obtaining the most matched procedure text segment, the system further obtains context content of the segment through a context expansion mechanism to avoid isolated segment information. The context expansion mechanism includes forward expansion and backward expansion. The forward expansion refers to extracting one or more preceding segments of the segment, and the backward expansion refers to extracting one or more following segments of the segment, so as to incorporate associated information such as applicable conditions, parameter definitions, and exceptional situations of the clause. Subsequently, the system integrates based on the procedure text segment and the context content thereof. The integration manner includes deduplication, sorting, splicing, and formatting processing. For example, multiple paragraphs are arranged according to the original chapter order, and cross-references in the form of "see chapter X, section Y" are inserted between the paragraphs. Finally, a complete retrieval result is generated to ensure that the answer obtained by the user is self-consistent and explainable.
[0032] In addition, it should be noted that in a possible implementation, the context expansion range can be dynamically adjusted according to the chapter title level. For example, when the chapter title is a second-level title, the forward expansion is performed to the start position of the second-level title, and the backward expansion is performed to before the next same-level title. In another possible implementation, the system can introduce a confidence threshold mechanism. When the similarity of the most matched segment is lower than a preset threshold, the context expansion range is automatically expanded to the upper-level title to improve the answer recall rate.
[0033] In a possible implementation, the user interaction module is configured to receive a question text input by a user and related to the boiler safety technical regulation; display an answer result for the question text; and display a historical interaction record of the user and the system.
[0034] It should be noted that the user interaction module refers to a visual or voice interface for information exchange between the system and the user, which can be in the form of a Web page, a mobile APP, a WeChat mini-program or an industrial touch screen; the way of receiving the question text includes keyboard input, voice-to-text, OCR (Optical Character Recognition) scanning paper procedures to automatically extract questions, etc.; the way of displaying the answer result includes highlighting the procedure clauses, folding the context, providing a one-key export PDF function, etc.; the way of displaying the historical interaction record includes a dialogue list in the form of a timeline, a history record retrieval supporting keyword search, and multi-terminal synchronization based on user identity, thereby improving user experience and audit traceability.
[0035] In a possible implementation, the knowledge management module is configured to store a chapter directory database and a vector database of the boiler safety technical procedure.
[0036] It should be noted that the knowledge management module refers to a functional module in the system responsible for the storage, updating, version control and permission management of the boiler safety technical procedure knowledge. The module can store a chapter directory database using a relational database MySQL (My Structured Query Language), which includes metadata such as hierarchical titles, paragraph numbers, text content, release date, version number, applicable boiler type of the procedure; at the same time, a vector database Milvus or Pinecone is used to store a vector database, which includes semantic vectors corresponding to each paragraph of text, vector dimensions, similarity indexes, update timestamps, etc.; the knowledge management module also provides an incremental update interface, when a new procedure is released, the system can automatically pull the text differences through the API (Application Programming Interface), complete the synchronous update of the directory and the vector, and retain the historical version, realizing the sustainable evolution of knowledge assets.
[0037] For easy understanding, the following will be combined with Figure 2 The core processing flow of the boiler safety technical procedure intelligent question-answering system provided by the embodiments of the present disclosure is exemplified.
[0038] As shown in Figure 2 The core processing flow includes the following steps S11 to S16.
[0039] Step S11, start processing. Specifically, it includes step S11a: the user interaction module receives the question text input by the user, initializes the session and performs parameter verification.
[0040] For example, in a specific embodiment, the user input question text is "How many safety valves should be installed on a flash tank with a rated thermal power greater than 1.4 MW?"
[0041] In addition, it should be noted that the parameter verification is automatically completed by the FastAPI (Fast Application Programming Interface) service, which is used to verify whether the question is compliant.
[0042] Step S12, intent analysis and understanding. Specifically, it includes step S12a: LLM performs semantic analysis, extracts keywords of the question text and converts them into a vector retrievable query statement.
[0043] It should be noted that in the embodiments of the present disclosure, intent analysis and understanding specifically means that the intelligent question and answer engine guides LLM to perform semantic analysis on the question text through system prompt words, and converts the extracted keywords into a professional query (query_question) statement suitable for vector retrieval, i.e., a vector retrievable query statement. In addition, it should be noted that converting keywords into query_question to ask questions belongs to the Hypothetical Document Embeddings (HDE) method in query rewriting.
[0044] For example, in a specific embodiment, LLM performs semantic analysis on the question text "How many safety valves should be installed on a flash tank with a rated thermal power greater than 1.4 MW", and the extracted keywords are "flash tank safety valve setting requirements", and the vector retrievable query statement is 'query_question': 'flash tank safety valve setting requirements'.
[0045] Step S13, chapter positioning and screening. Specifically, it includes step S13a: LLM performs directory matching to determine the secondary title of the question text to locate the chapter range to be retrieved.
[0046] It should be noted that in the embodiments of the present disclosure, chapter positioning and screening specifically means that the intelligent question and answer engine module determines the secondary title (query_title) of the question text based on the complete directory information in the system prompt words, accurately selects the relevant secondary title from the pre-defined procedure directory through LLM semantic analysis of the user input question text, determines the chapter range to be retrieved and passes it to the retrieval tool (the retrieval tool calls the RAG retrieval module) to perform chapter filtering retrieval.
[0047] In addition, it should be noted that in the embodiments of the present disclosure, the catalog matching is implemented by LLM inference, and the main inference steps include: 1, LLM receives complete catalog information as context; 2, LLM analyzes the semantic content of the user question; 3, LLM selects the most relevant chapter title from the catalog; 4, LLM accurately copies the title name (query_title) without any modification.
[0048] For example, in a specific embodiment, the LLM performs catalog matching on the question text "How many safety valves should be installed on the flash tank with rated thermal power greater than 1.4 MW", and determines the secondary title as "5.1 Safety Valve".
[0049] Step S14, vector retrieval execution. Specifically, it includes step S14a: the RAG retrieval module converts the vector retrievable query statement into a semantic vector, performs similarity calculation, result sorting and context expansion within the chapter range, generates the retrieval result and returns.
[0050] It should be noted that in the embodiments of the present disclosure, the vector retrieval execution specifically refers to: the RAG retrieval module receives the vector retrievable query statement (query_question) and the verified chapter title (query_title) transmitted from the intelligent question and answer engine, converts the query_question into a semantic vector through a vectorization model, performs similarity calculation within the specified chapter range of the vector database, obtains the text segment with the highest similarity, and perfects the retrieval result through the context before and after the expansion mechanism for 4 lines, and finally returns the procedure text content containing complete context. In addition, it can be understood that high similarity means that the query question is highly related to the semantic content of the document; the document is likely to contain the direct answer to the question; the retrieval result quality is high.
[0051] In a possible implementation, the similarity calculation is the cosine similarity calculation used in the ChromaDB database; the top 5 are ranked from high to low according to the similarity score, for example, assuming that there are 5 retrieval results, the similarity scores are respectively: line_123: 0.92, line_456: 0.85, line_789: 0.78, line_234: 0.72, line_567: 0.65, the context expansion is performed on the already sorted high similarity ID, and the context expanded content is returned to the LLM for answer generation.
[0052] For example, in a specific embodiment, the RAG retrieval module performs similarity calculation, result sorting and context expansion according to the parameters {'query_title': '5.1 Safety valve', 'query_question': 'Flash tank safety valve quantity requirement'} and returns the retrieval result "According to the Boiler Safety Technical Regulations 5.1.3: Flash tank should be at least set two independent spring safety valve".
[0053] Step S15, answer generation and optimization. Specifically, it includes step S15a: LLM iteratively optimizes the returned retrieval results, integrates the final retrieval results into a standardized answer result and returns.
[0054] It should be noted that in the embodiments of the present disclosure, the answer generation and optimization specifically refers to: the intelligent question and answer engine receives the retrieval results from step S14, and through a multi-round iteration mechanism, in each round of iteration, the LLM performs reasoning based on the current dialogue context, when the LLM decides to call the retrieval tool, the vector retrieval obtains the content of the regulation, and the retrieval result is integrated into the dialogue history to continue optimizing the reasoning; when the LLM no longer calls the tool, a final standardized answer is generated, and the complete reasoning process is recorded through the dialogue log and returned to the user interaction module.
[0055] In addition, it should be noted that when the LLM decides to call the retrieval tool, the complete execution process is: calling the retrieval tool; the retrieval tool calls the RAG retrieval module.
[0056] For example, in a specific embodiment, after the LLM iteratively optimizes the retrieval results, the extracted keywords are "flash tank safety valve setting", the secondary title is "10.2 Organic heat carrier boiler and system", the final retrieval result is "《Boiler Safety Technical Regulations》10.2.3.1.1 Article (2) provides: The rated heat power of the flash tank shall be greater than 1.4MW, and two safety valves shall be installed.", and the integrated answer result is "According to the retrieved content of the boiler safety technical regulations, I found the specific provisions for the setting of the flash tank safety valve: According to the 《Boiler Safety Technical Regulations》10.2.3.1.1 Article (2) provides: The rated heat power of the flash tank shall be greater than 1.4MW, and two safety valves shall be installed. This provision is for the safety valve setting requirement of the flash tank of the liquid phase forced circulation flash evaporation gas phase system. When the rated heat power of the flash tank exceeds 1.4MW, two safety valves must be installed to ensure the safe operation of the system. In addition, the regulation also requires: A rupture disc shall be connected in series on the short pipe connected with the safety valve and the boiler or pipeline, and the discharge capacity of the safety valve and the rupture disc shall not be less than the rated evaporation capacity of the boiler. A stop valve shall be installed on the short pipe connected with the safety valve and the boiler or pipeline, and the stop valve shall be in the locked open position during the operation of the boiler." Step S16, result returns and rendering. Specifically, it includes step S16a: the user interaction module performs Markdown conversion and front-end display on the returned answer result, while also displaying the historical conversation record.
[0057] In a possible implementation, for the question text "How many safety valves should be installed on a flash tank with a rated thermal power greater than 1.4 MW?", the answer result is "According to the content of the retrieved boiler safety technical regulations, I found the specific provisions for the setting of safety valves on flash tanks: According to Article 10.2.3.1.1 (2) of the Boiler Safety Technical Regulations, two safety valves should be installed on flash tanks with a rated thermal power greater than 1.4 MW. This provision is for the safety valve setting requirements of flash tanks in liquid-phase forced-circulation throttling and pressure-reducing vapor-phase systems. When the rated thermal power of the flash tank exceeds 1.4 MW, two safety valves must be installed to ensure the safe operation of the system. In addition, the regulations also require that a rupture disc should be connected in series on the short pipe connected to the safety valve, and the discharge capacity of the safety valve and the rupture disc should not be less than the rated evaporation capacity of the boiler, and a stop valve should be installed on the short pipe connected to the boiler or pipeline, and the stop valve should be in the locked-open position during boiler operation.", which is rendered in the front end and the displayed front-end page is as shown in Figure 3 .
[0058] The boiler safety technical regulations intelligent question-answering system provided in the embodiments of the present disclosure realizes accurate positioning of the retrieval clause by using the hierarchical structure of technical documents through the "accurate retrieval mechanism based on chapter title filtering", and ensures retrieval accuracy through title legality verification; reduces reasoning errors and improves answer confidence through the "multi-round iterative intelligent reasoning engine" based on the complex problem decomposition capability of Deep Seek Reasoner, closed-loop optimization of tool calling and result feedback; ensures the integrity of the answer through the "context-aware vector retrieval algorithm" with the combination of context expansion retrieval and dynamic range self-adaptation; and realizes full-process automation from user input to answer generation through the "end-to-end intelligent question-answering pipeline", and can manage real-time conversation history and state to optimize the user's question-answering experience.
[0059] The embodiments of the present disclosure also provide a boiler safety technical regulations intelligent question-answering method based on retrieval enhancement generation, as shown in Figure 4 , which includes the following steps S101 to S104.
[0060] Step S101, acquiring a question text related to the boiler safety technical regulations input by a user.
[0061] Step S102, under the guidance of a preset system prompt word, performing semantic analysis on the question text to determine a chapter title corresponding to the question text and a vector-retrievable query sentence.
[0062] In a possible implementation, the preset system prompt word includes a first prompt word and a second prompt word; under the guidance of the preset system prompt word, the semantic analysis on the question text is performed to determine the chapter title corresponding to the question text and the vector retrievable query statement, which can specifically include: under the guidance of the first prompt word, the chapter title corresponding to the question text is determined based on the question text and in combination with the chapter directory database of the boiler safety technical regulation pre-stored, and the chapter title includes a secondary title; under the guidance of the second prompt word, the keywords related to the boiler safety technical regulation in the question text are extracted, and the keywords are converted into the vector retrievable query statement corresponding to the question text.
[0063] Step S103: Based on the chapter title corresponding to the question text and the vector retrievable query statement, in combination with the vector database of the boiler safety technical regulation pre-stored, the matched regulation text segment is determined, and a retrieval result is generated based on the regulation text segment.
[0064] In a possible implementation, based on the chapter title corresponding to the question text and the vector retrievable query statement, in combination with the vector database of the boiler safety technical regulation pre-stored, the matched regulation text segment is determined, which can specifically include: based on the chapter title corresponding to the question text, the chapter range to be queried of the question text is determined; the vector retrievable query statement corresponding to the question text is converted into a corresponding semantic vector through a vectorization model, and based on the semantic vector, the chapter range is taken as a minimum query unit, and in the vector database of the boiler safety technical regulation pre-stored, a target semantic vector with the highest similarity to the semantic vector is determined; the regulation text segment corresponding to the target semantic vector with the highest similarity is taken as the matched regulation text segment.
[0065] Step S104: Based on the retrieval result, the semantic analysis on the question text is iteratively performed in a loop until the iteration stop condition is met, the answer result of the question text is generated based on the retrieval result of the last iteration, and the answer result is returned to the user interface.
[0066] The specific details and benefits of the boiler safety technical regulation intelligent question answering method provided by the embodiments of the present disclosure based on retrieval enhancement generation can be referred to the description of the boiler safety technical regulation intelligent question answering system based on retrieval enhancement generation described above, and will not be described here.
[0067] The boiler safety technical regulation intelligent question answering system provided by the present disclosure adopts a hierarchical architecture design, including a front-end interaction layer, a business logic layer, an intelligent processing layer, and a data storage layer.
[0068] The embodiments of the present disclosure provide a system architecture of a boiler safety technical regulation intelligent question answering system, as shown in Figure 5As shown, the system architecture includes a front-end interaction layer 10, a business logic layer 20, an intelligent processing layer 30, and a data storage layer 40. Among them, the front-end interaction layer 10 includes a Web front-end, user input and result display; the business logic layer 20 includes Fast API service, session management and history record management; the intelligent processing layer 30 includes RAG engine, LLM inference and tool invocation; the data storage layer 40 includes vector database, document database and metadata storage.
[0069] It should be noted that the layers communicate through standard protocols: the front end interacts with the Fast API through HTTP POST (Hyper Text Transfer Protocol POST) requests; the business logic layer interacts with the intelligent processing layer through Python function calls; the intelligent processing layer interacts with external services through API calls and with the data storage layer through database interfaces.
[0070] In one possible implementation, the user submits a question text through the Web interface, the FastAPI service receives the request and calls the intelligent processing layer's question and answer engine, the question and answer engine analyzes the intent of the question text, retrieves relevant knowledge from the vector database through RAG, generates an answer by combining LLM inference, the entire process supports multiple rounds of iterative optimization, and the final answer is returned to the user interface for display.
[0071] The boiler safety technical regulation intelligent question and answer system provided by the present disclosure consists of four parts: user interaction module, intelligent question and answer engine, RAG retrieval module, and knowledge management module.
[0072] It should be noted that the user interaction module is responsible for all interactive operations between the system and the user, providing a friendly user experience. This module builds a Web service interface based on the Fast API framework, supporting real-time question and answer and history record management functions. The front end uses responsive design, which can automatically adapt to different device screen sizes, ensuring good display on computers, tablets and mobile phones. At the same time, the module integrates a Markdown (markup language) format rendering engine, which can convert complex format content in technical specifications into clear and readable display forms. The session management system is responsible for maintaining the user's conversation state, supporting context maintenance for multiple rounds of conversation, ensuring that the system can understand the association between questions when the user continuously asks questions. The history record function automatically saves the user's question and answer history for easy subsequent review and reference, while providing a one-click clear history record management option.
[0073] The intelligent question answering engine is the core reasoning component of the entire system, built based on the DeepSeek Reasoner model, with strong logical reasoning and problem decomposition capabilities. The engine uses a multi-round iteration processing mechanism, supports up to 15 rounds of dialogue iteration, and can handle complex multi-step technical problems. The engine integrates tool invocation functions, can dynamically perform retrieval, verification, calculation and other operations, and obtains external information and performs specific tasks through function execution. The dialogue state manager is responsible for maintaining the complete session context, including user intent tracking, historical message management and dialogue flow control. The quality evaluation system performs multi-dimensional evaluation of the relevance, accuracy and completeness of the generated answers to ensure the quality of the output content. The reasoning decision maker can automatically select the optimal processing strategy according to the problem type, directly generating answers for simple problems, and decomposing complex problems into multiple sub-problems for step-by-step solution. The iteration controller monitors the entire processing process and automatically ends the processing and returns the best available answer when the maximum number of iterations is reached or the termination condition is met.
[0074] The RAG retrieval module is responsible for accurately locating and retrieving relevant technical content from the knowledge base, based on advanced vector retrieval technology to achieve semantic-level similarity matching. The module uses the text-embedding-v4 model of Bing AI to perform text vectorization, generating 1024-dimensional high-quality embedding vectors. The module integrates ChromaDB (Chroma DataBase) vector database, supporting efficient similarity search and nearest neighbor search. The query understanding component can deeply analyze the semantic intent of the user's question, automatically perform query expansion and synonym replacement, and improve the recall rate of retrieval. The chapter title filtering mechanism ensures that the retrieval results are within the most relevant technical chapter range, avoiding irrelevant content interference. The context expansion algorithm automatically obtains the relevant paragraph information before and after the core content after retrieval, ensuring the completeness and coherence of the answer. The reordering system optimizes the preliminary retrieval results, considering multiple dimensions such as semantic relevance, content importance and user demand, and outputs the optimal content combination.
[0075] The knowledge management module is responsible for the storage, organization and maintenance of technical documents, ensuring the accuracy and timeliness of the knowledge base content. This module has intelligent document parsing capabilities and can handle technical documents in Markdown format. Vector database management is based on ChromaDB to generate persistent vector storage, and can also use the text-embedding-v4 model to generate 1024-dimensional vectors. It also supports query functions based on title filtering. The implementation of the directory structure management is as follows: the directory structure is stored in catalog.py (chapter directory management module) through hard coding; the complete chapter hierarchy is defined through the guolu_catalog variable (boiler regulation chapter hierarchy variable); and the enumeration basis for title verification is provided in tools.py (general tool module). The actual implemented functions include: title verification to ensure the legality of the chapter titles used in the search; structure maintenance to provide standard chapter division for the boiler regulation; navigation support to provide chapter positioning basis for the intelligent question and answer engine; and metadata management processing flow, which is automatically generated during document preprocessing in the extraction stage, stored in the vector database together with the document content in the storage stage, and used for retrieval filtering and result classification in the query stage.
[0076] The boiler safety technical regulation intelligent question and answer system and method provided by the present disclosure has the following overall technical effects: 1. Query efficiency is significantly improved: the technical specification query time is shortened from 10-15 minutes to 10-15 seconds; 2. Accuracy is greatly improved: the retrieval accuracy based on semantic understanding is above 90%; 3. User experience is optimized: natural language interaction reduces the professional technical threshold; 4. The front-end interface is clear: the user can more intuitively ask questions and receive answers; 5. Strong scalability: modular design supports quick adaptation to other technical standard documents.
[0077] It should be further noted that the "first", "second" and similar words used in the present disclosure do not represent any order, quantity or importance, but are only used to distinguish different parts. "Include" or "contain" and similar words mean that the elements before the word cover the elements listed after the word, and do not exclude the possibility of also covering other elements.
[0078] Although the operations are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood as requiring the operations to be performed in the specific order or serial order shown, or requiring all the operations to be performed to obtain the desired results. In a specific environment, multi-tasking and parallel processing can be advantageous.
[0079] Finally, it should be noted that the above is only to illustrate the technical solutions of the present disclosure, and is not a limitation on the scope of protection of the present disclosure. Simple modifications or equivalent replacements of the technical solutions of the present disclosure made by those skilled in the art do not deviate from the essence and scope of the technical solutions of the present disclosure.
Claims
1. A smart question-and-answer system for boiler safety technical regulations based on retrieval enhancement generation, characterized in that, It includes a user interaction module, an intelligent question-answering engine, a RAG search module, and a knowledge management module; The intelligent question-answering engine includes a Large Language Model (LLM). The LLM is configured to, under the guidance of preset system prompts, perform semantic analysis on question text related to boiler safety technical regulations received by the user interaction module, determine the corresponding chapter title and vectorizable search query statement; call the RAG retrieval module and obtain the retrieval results returned by the RAG retrieval module; iteratively perform semantic analysis on the question text until the LLM no longer calls the RAG retrieval module, generate an answer to the question text based on the last retrieval result returned by the RAG retrieval module; and return the answer to the user interaction module for display. The RAG retrieval module is configured to, when invoked by the LLM, determine matching procedure text fragments based on the chapter title corresponding to the question text and the vector search query statement, combined with the vector database of the boiler safety technical regulations stored in the knowledge management module; and generate retrieval results based on the procedure text fragments and return them to the LLM.
2. The intelligent question-and-answer system for boiler safety technical regulations according to claim 1, characterized in that, The preset system prompt words include a first prompt word and a second prompt word; the step of performing semantic analysis on the question text related to boiler safety technical regulations received by the user interaction module under the guidance of the preset system prompt words, and determining the chapter title and vector-searchable query statement corresponding to the question text, includes: Guided by the first prompt, based on the question text and in conjunction with the chapter directory database of the boiler safety technical regulations stored in the knowledge management module, the chapter title corresponding to the question text is determined; the chapter title includes a second-level title. Guided by the second prompt, keywords related to the boiler safety technical regulations are extracted from the question text, and the keywords are converted into vector-based search query statements corresponding to the question text.
3. The intelligent question-and-answer system for boiler safety technical regulations according to claim 1, characterized in that, The process of determining matching code text fragments based on the chapter title corresponding to the question text and the vector-searchable query statement, combined with the vector database of the boiler safety technical regulations stored in the knowledge management module, includes: Based on the chapter titles corresponding to the question text, determine the range of chapters to be queried for the question text; The vectorizable query statement is converted into a corresponding semantic vector using a vectorization model. Based on the semantic vector, and taking the chapter range as the smallest query unit, the target semantic vector with the highest similarity to the semantic vector is determined in the vector database of the boiler safety technical regulations stored in the knowledge management module. The procedural text fragment corresponding to the target semantic vector with the highest similarity is used as the matched procedural text fragment.
4. The intelligent question-and-answer system for boiler safety technical regulations according to claim 3, characterized in that, The process of determining the target semantic vector with the highest similarity to the semantic vector in the vector database of the boiler safety technical regulations stored in the knowledge management module includes: Based on the semantic vectors, similarity calculations are performed in the vector database of the boiler safety technical regulations stored in the knowledge management module to obtain the similarity calculation results of each target semantic vector. The similarity calculation results of each target semantic vector are sorted to generate a similarity ranking result; Based on the similarity ranking results, the target semantic vector with the highest similarity to the semantic vector is determined.
5. The intelligent question-and-answer system for boiler safety technical regulations according to any one of claims 1-4, characterized in that, The generation of search results based on the procedure text fragment includes: Based on the procedure text fragment, the context content of the procedure text fragment is obtained through a context expansion mechanism; The search results are generated by integrating the procedure text fragment with its contextual content.
6. The intelligent question-and-answer system for boiler safety technical regulations according to any one of claims 1-4, characterized in that, The user interaction module is configured to receive user-inputted question text related to boiler safety technical regulations; and display the answer results for the question text. It also displays the user's historical interaction records with the system.
7. The intelligent question-and-answer system for boiler safety technical regulations according to any one of claims 1-4, characterized in that, The knowledge management module is configured to store the chapter directory database and vector database of the boiler safety technical regulations.
8. A method for intelligent question-and-answering of boiler safety technical regulations based on retrieval enhancement generation, characterized in that, include: Obtain the user-input text related to boiler safety technical regulations; Guided by preset system prompts, semantic analysis is performed on the question text to determine the corresponding chapter title and vector-searchable query statement. Based on the chapter title corresponding to the question text and the vector search query statement, combined with the pre-stored vector database of the boiler safety technical regulations, the matching regulation text fragments are determined and search results are generated based on the regulation text fragments. Based on the search results, the semantic analysis of the question text is performed iteratively until the iteration deadline is met. Then, the answer to the question text is generated based on the search results of the last iteration, and the answer is returned to the user interface.
9. The intelligent question-and-answer method for boiler safety technical regulations according to claim 8, characterized in that, The preset system prompt words include a first prompt word and a second prompt word; the step of performing semantic analysis on the question text under the guidance of the preset system prompt words to determine the chapter title and vector-searchable query statement corresponding to the question text includes: Guided by the first prompt, based on the question text and in conjunction with the pre-stored chapter directory database of the boiler safety technical regulations, the chapter title corresponding to the question text is determined; the chapter title includes a second-level title. Guided by the second prompt, keywords related to the boiler safety technical regulations are extracted from the question text, and the keywords are converted into vector-based search query statements corresponding to the question text.
10. The intelligent question-and-answer method for boiler safety technical regulations according to claim 8, characterized in that, The process of determining matching code text fragments based on the chapter titles corresponding to the question text and vector-searchable query statements, combined with a pre-stored vector database of the boiler safety technical regulations, includes: Based on the chapter titles corresponding to the question text, determine the range of chapters to be queried for the question text; The vectorization model converts the vectorizable query statement corresponding to the question text into a corresponding semantic vector. Based on the semantic vector, and taking the chapter range as the smallest query unit, the target semantic vector with the highest similarity to the semantic vector is determined in the pre-stored vector database of the boiler safety technical regulations. The procedural text fragment corresponding to the target semantic vector with the highest similarity is used as the matched procedural text fragment.