RAG-based main network infrastructure power transmission and transformation engineering technical question and answer method and system thereof
Patent Information
- Application Number
- CN202611235179.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-14
- Publication Date
- 2026-10-20
AI Technical Summary
[0004]现有知识查询系统主要依赖关键词匹配,无法理解自然语言的问题语义,导致检索结果不精准,用户需要花费大量时间筛选
1、提升了技经知识查询的准确性与专业性。通过构建由技术规范、管理制度和历史案例组成的专业向量化知识库,并采用结合语义理解与关键词匹配的混合检索方式,能够精准定位最相关的规范条款和案例数据,使大语言模型在生成答案时严格遵循权威知识,有效抑制了通用模型的“幻觉”现象,确保最终结果符合行业标准与内部规定。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a Q&A method and system for main grid infrastructure transmission and transformation engineering based on RAG. Background Technology
[0002] In the technical and economic management of power grid infrastructure projects, especially main grid transmission and transformation projects, staff need to frequently consult massive amounts of multi-source professional knowledge, including national and industry budget preparation and calculation standards, quota standards, management systems of companies at all levels, and cost data of historical projects. Traditional knowledge acquisition methods rely on manual memorization, manually flipping through paper or electronic documents, and simple keyword searches, which are inefficient and difficult to handle complex, cross-disciplinary, and comprehensive problems.
[0003] Currently, the industry commonly uses document management systems or simple FAQ (Frequently Asked Questions) systems to assist in knowledge retrieval. These systems are usually based on traditional information retrieval techniques, such as keyword matching, and lack a deep understanding of natural language issues. Some systems that attempt to introduce generalized large language models often suffer from "illusions" when faced with technical terms, complex calculation rules, and internal management systems due to a lack of expertise in the power grid technology and economics field, resulting in inaccurate or even incorrect answers.
[0004] Existing knowledge retrieval systems primarily rely on keyword matching, failing to understand the semantics of natural language questions, resulting in inaccurate search results and requiring users to spend significant time filtering them. Attempts to use general-purpose models often generate incorrect or fabricated answers due to a lack of domain-specific knowledge, leading to low credibility. Furthermore, current technologies struggle to connect multi-source knowledge such as regulations, systems, and case studies, making it impossible to answer complex questions and providing the original source of the answers, which hinders business decision-making. Summary of the Invention
[0005] This application provides a Q&A method and system for main grid infrastructure transmission and transformation engineering based on RAG, so as to at least solve the shortcomings of the above-mentioned related technologies.
[0006] In a first aspect, embodiments of this application provide a Q&A method for technical and economic issues in RAG-based main grid infrastructure transmission and transformation engineering, including the following steps: Step 1: Collect and integrate unstructured documents from several databases, and use an embedding model to process the unstructured documents to form a vectorized knowledge base with semantic similarity detection; Step 2: Obtain the natural language question input by the user, and use a large language model to perform intent recognition and key entity extraction on the natural language question. Combine domain knowledge to perform synonym expansion and semantic enhancement on the original query to generate query terms for retrieval. Step 3: Based on the query terms, perform hybrid retrieval and re-ranking in the vectorized knowledge base to filter out the top-ranked knowledge fragments as reliable context; Step 4: Construct prompt words by combining the trusted context, the natural language question, and the preset system instructions. Input the prompt words into the large language model. Generate the final result according to the constraints of the trusted context, and mark the knowledge sources and origins cited in the result.
[0007] Furthermore, step one includes: Collect and integrate unstructured documents from the technical specification library, management system library, and historical engineering case library, and parse each unstructured document into text fragments; The text fragments are cleaned and standardized, and each processed text fragment is converted into a high-dimensional vector using an embedding model to form a vectorized knowledge base with semantic similarity retrieval.
[0008] Furthermore, step two includes: Obtain the question text in natural language format input by the user through the terminal; Using a fine-tuned large language model based on corpus of economics and technology, intent recognition and key entity extraction are performed on the question text to obtain the corresponding question category and at least one key entity related to economics and technology. The question category includes cost calculation, standard query, system consultation or case reference. The key entity includes one or more of the following: project type, voltage level, cost type, equipment and material category or management process. Based on a pre-built domain thesaurus and semantic expansion rules, the original expression in the question text is expanded with synonyms, and the implicit context conditions that may be missing in the question are filled in according to the extracted key entities, generating semantically enhanced query terms.
[0009] Furthermore, step three includes: The query terms are converted into query vectors using the embedding model, and a first number of candidate text fragments are recalled to form a first candidate set by calculating vector similarity in the vector database. Based on the inverted index, the core keywords in the query terms are used to perform precise matching in the text fragments or original documents to recall a second number of candidate text fragments to form a second candidate set. The first candidate set and the second candidate set are merged and deduplicated. A pre-trained relevance ranking model is used to score the semantic relevance of each merged candidate text fragment to the question text. The fragments are then re-ranked from high to low based on the score results, and the highest-scoring knowledge fragments are extracted as credible context.
[0010] Furthermore, step four includes: Construct a prompt word template, which includes at least the system instruction area, the trusted context, and the natural language question; The filled-in prompt words are input into the large language model. The system instructions restrict the large language model to generate the final result based on the content of the provided knowledge fragments. The specific knowledge sources cited are marked in the generated final result in a preset taggable format. The knowledge sources include at least the source file name and chapter identifier.
[0011] Furthermore, the method also includes: The final result generated by the large language model and the corresponding source information are merged into structured data and pushed to the user interface for display. In the user interface, the names and chapter identifiers of the referenced source files are highlighted and provided with an interactive viewing entry point, so that users can retrieve and display the corresponding original document fragments by clicking on the entry point.
[0012] Secondly, this invention also proposes a technical Q&A system for main grid infrastructure transmission and transformation engineering based on RAG, comprising: The data acquisition module is used to collect and integrate unstructured documents from several databases, and to process the unstructured documents using an embedding model to form a vectorized knowledge base with semantic similarity detection. The data processing module is used to acquire the natural language question input by the user, and to perform intent recognition and key entity extraction on the natural language question using a large language model. It also combines domain knowledge to perform synonym expansion and semantic enhancement on the original query to generate query terms for retrieval. The data filtering module is used to perform mixed retrieval and reordering in the vectorized knowledge base based on the query terms, so as to filter out the top-ranked knowledge fragments as reliable contexts; The result generation module is used to construct prompt words by combining the trusted context, the natural language question, and preset system instructions, input the prompt words into the large language model, generate the final result according to the constraints of the trusted context, and mark the knowledge sources and origins cited in the result.
[0013] Furthermore, the data acquisition module is specifically used for: Collect and integrate unstructured documents from the technical specification library, management system library, and historical engineering case library, and parse each unstructured document into text fragments; The text fragments are cleaned and standardized, and each processed text fragment is converted into a high-dimensional vector using an embedding model to form a vectorized knowledge base with semantic similarity retrieval.
[0014] Furthermore, the data processing module is specifically used for: Obtain the question text in natural language format input by the user through the terminal; Using a fine-tuned large language model based on corpus of economics and technology, intent recognition and key entity extraction are performed on the question text to obtain the corresponding question category and at least one key entity related to economics and technology. The question category includes cost calculation, standard query, system consultation or case reference. The key entity includes one or more of the following: project type, voltage level, cost type, equipment and material category or management process. Based on a pre-built domain thesaurus and semantic expansion rules, the original expression in the question text is expanded with synonyms, and the implicit context conditions that may be missing in the question are filled in according to the extracted key entities, generating semantically enhanced query terms.
[0015] Furthermore, the data filtering module is specifically used for: The query terms are converted into query vectors using the embedding model, and a first number of candidate text fragments are recalled to form a first candidate set by calculating vector similarity in the vector database. Based on the inverted index, the core keywords in the query terms are used to perform precise matching in the text fragments or original documents to recall a second number of candidate text fragments to form a second candidate set. The first candidate set and the second candidate set are merged and deduplicated. A pre-trained relevance ranking model is used to score the semantic relevance of each merged candidate text fragment to the question text. The fragments are then re-ranked from high to low based on the score results, and the highest-scoring knowledge fragments are extracted as credible context.
[0016] Furthermore, the result generation module is specifically used for: Construct a prompt word template, which includes at least the system instruction area, the trusted context, and the natural language question; The filled-in prompt words are input into the large language model. The system instructions restrict the large language model to generate the final result based on the content of the provided knowledge fragments. The specific knowledge sources cited are marked in the generated final result in a preset taggable format. The knowledge sources include at least the source file name and chapter identifier.
[0017] Furthermore, the system also includes: The data display module is used to integrate the final results generated by the large language model and the corresponding source information into structured data and push it to the user interface for display. The user interaction module is used to highlight the referenced source file name and chapter identifier in the user interaction interface and provide an interactive viewing entry point so that users can retrieve and display the corresponding original document fragment by clicking the entry point.
[0018] Compared to related technologies, the Q&A method and system for main grid infrastructure transmission and transformation engineering based on RAG provided in this application have the following advantages: 1. Improved the accuracy and professionalism of technical and economic knowledge retrieval. By constructing a professional vectorized knowledge base composed of technical specifications, management systems, and historical cases, and adopting a hybrid retrieval method combining semantic understanding and keyword matching, the most relevant regulatory clauses and case data can be accurately located. This ensures that the large language model strictly follows authoritative knowledge when generating answers, effectively suppressing the "illusion" phenomenon of general models and ensuring that the final results comply with industry standards and internal regulations.
[0019] 2. It enables precise traceability of results, enhancing the credibility of decision-making. When generating each conclusion, the original document name and chapter number are forcibly cited, allowing users to view the original text with a single click. This ensures that every answer is verifiable, greatly improving the trust that business personnel have in the information they receive during auditing, settlement, and other scenarios.
[0020] 3. Significantly improved the ability to handle complex problems and the efficiency of knowledge retrieval. By performing intent recognition, synonym expansion, and semantic enhancement on user questions, it can automatically complete the implicit constraints such as voltage level and cost type in the question, and perform comprehensive analysis by linking multiple sources of knowledge. This allows comprehensive solutions that originally required consulting multiple specifications to be completed in seconds, significantly improving work efficiency.
[0021] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0022] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart of the Q&A method for main grid infrastructure transmission and transformation engineering technology based on RAG in the first embodiment of the present invention; Figure 2 This is a structural block diagram of the RAG-based main grid infrastructure transmission and transformation engineering technical question-and-answer system in the second embodiment of the present invention; Figure 3 This is an architecture diagram of the RAG-based main grid infrastructure transmission and transformation engineering technical Q&A system in the second embodiment of the present invention.
[0023] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this application clearer, the application is described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.
[0025] Obviously, the accompanying drawings described below are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar scenarios based on these drawings without any inventive effort. Furthermore, it is understood that although the efforts made in this development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this application, any changes to design, manufacturing, or production based on the technical content disclosed in this application are merely conventional technical means and should not be construed as insufficient disclosure of the content of this application.
[0026] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment that is mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0027] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms “a,” “an,” “an,” “the,” and similar words used in this application do not indicate quantity limitation and may represent singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to such processes, methods, products, or devices. The terms “connected,” “linked,” “coupled,” and similar words used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Example 1
[0028] Please see Figure 1 The image shows a Q&A method for main grid infrastructure transmission and transformation engineering based on RAG in the first embodiment of the present invention. The method specifically includes steps S101 to S106: S101, collect and integrate unstructured documents from several databases, and use an embedding model to process the unstructured documents to form a vectorized knowledge base with semantic similarity detection; Furthermore, step S101 specifically includes steps S1011 to S1012: S1011, Collect and integrate unstructured documents from the technical specification library, management system library and historical engineering case library, and parse each unstructured document into text fragments; S1012, the text fragments are cleaned and standardized, and each processed text fragment is converted into a high-dimensional vector using an embedding model to form a vectorized knowledge base with semantic similarity retrieval.
[0029] In practice, unstructured documents from three major knowledge sources are collected and integrated: a technical specification library, covering industry-issued budget preparation and calculation specifications and quota standards; a management system library, covering technical and economic management system documents issued by companies at all levels; and a historical engineering case library, covering cost data and analysis conclusions of historical power transmission and transformation projects.
[0030] Furthermore, these documents undergo preprocessing: they are parsed according to chapters, clauses, or semantic boundaries, breaking them down into independent text fragments to ensure that each fragment carries a relatively complete and independent normative clause or case information. Subsequently, the text fragments are cleaned and standardized, including removing irrelevant formatting characters, standardizing encoding and punctuation, and using a pre-compiled dictionary of standardized technical and economic terminology to map abbreviations and alternative names appearing in the text to standard expressions. Finally, a pre-trained high-dimensional embedding model (in this embodiment, the model includes any one of the GTE, E5, or FinBERT models) is used to convert each standardized text fragment into a fixed-length high-dimensional semantic vector. This vector, along with the corresponding original text fragment, is stored in a vector database, forming a vectorized knowledge base that supports semantic similarity retrieval.
[0031] S102, obtain the natural language question input by the user, and use a large language model to perform intent recognition and key entity extraction on the natural language question, and combine domain knowledge to perform synonym expansion and semantic enhancement on the original query to generate query terms for retrieval; Furthermore, step S102 specifically includes steps S1021 to S1023: S1021, Obtain the question text in natural language form input by the user through the terminal; S1022, using a fine-tuned large language model based on corpus in the economic, technical and economic fields, perform intent recognition and key entity extraction on the question text to obtain the corresponding question category and at least one key entity related to economic, technical and economic fields. The question category includes cost calculation, standard query, system consultation or case reference. The key entity includes one or more of the following: project type, voltage level, cost type, equipment and material category or management link. S1023, Based on the pre-built domain thesaurus and semantic expansion rules, the original expression in the question text is expanded with synonyms, and the implicit context conditions that may be missing in the question are supplemented according to the extracted key entities, so as to generate semantically enhanced query terms.
[0032] In practical implementation, the user inputs a question text in natural language form via a terminal. A large language model fine-tuned from a technical and economic corpus (in this embodiment, the model includes any one of the GPT model, Gemini model, or Claude model) is used to perform intent recognition and key entity extraction on the question text, resulting in the question category (e.g., cost calculation, regulation query, system consultation, case reference) and at least one key entity related to technical and economic aspects (e.g., project type, voltage level, cost type, equipment and material category, management process, etc.).
[0033] Furthermore, the original query is reconstructed based on a pre-built domain thesaurus and semantic expansion rules. Specifically, colloquial or non-standard expressions in the user's question are synonymously expanded into standard terms used in the knowledge base. At the same time, based on the extracted key entities, potentially missing implicit contextual conditions in the question are intelligently completed. For example, when a certain fee type is identified, constraints such as its associated voltage level or engineering stage are automatically added according to rules, thereby generating more semantically accurate and complete search query terms.
[0034] S103, Based on the query terms, perform mixed retrieval and reordering in the vectorized knowledge base to filter out the top-ranked knowledge fragments as reliable context; Furthermore, step S103 specifically includes steps S1031 to S1033: S1031, The query term is converted into a query vector using the embedding model, and a first number of candidate text fragments are recalled to form a first candidate set by calculating the vector similarity in the vector database. S1032, Based on the inverted index, the core keywords in the query terms are used to perform precise matching in the text fragments or original documents to recall a second number of candidate text fragments to form a second candidate set; S1033, merge the first candidate set and the second candidate set to remove duplicates, use a pre-trained relevance ranking model to score the semantic relevance of each merged candidate text segment to the question text, re-rank them from high to low according to the score results, and extract the highest-scoring knowledge segments as credible context.
[0035] In practice, a hybrid approach of "vector retrieval and keyword retrieval" is adopted. In the vector retrieval sub-step, the reconstructed query terms are converted into query vectors using the aforementioned embedding model. By calculating cosine similarity in the vector database, a first number of semantically relevant candidate text fragments are recalled to form the first candidate set.
[0036] In the keyword retrieval sub-step, based on the inverted index, the core keywords in the query terms are used to perform precise matching in the text fragments or original documents to ensure that core terms such as specific specification numbers and quota names are accurately hit, and to recall a second number of candidate text fragments to form a second candidate set.
[0037] Furthermore, the two candidate sets are merged and deduplicated, followed by a re-ranking process: a pre-trained relevance ranking model (such as a cross-encoder based on the BERT architecture) is used as input, with the question text and each candidate fragment concatenated as input, to perform deep semantic relevance scoring one by one. After re-ranking from high to low according to the scoring results, the top K knowledge fragments with the highest scores are extracted as the "credible context" for subsequent answer generation.
[0038] S104, construct prompt words by combining the trusted context, the natural language question, and preset system instructions, input the prompt words into the large language model, generate the final result according to the constraints of the trusted context, and mark the knowledge sources and origins cited in the result.
[0039] Furthermore, step S104 specifically includes steps S1041 to S1042: S1041, Construct a prompt word template, the prompt word template including at least the system instruction area, the trusted context, and the natural language question; S1042, the filled-in prompt words are input into the large language model, and the system instructions restrict the large language model to generate the final result based on the content of the provided knowledge fragments. The specific knowledge sources cited are marked in the generated final result in a preset taggable format, wherein the knowledge sources include at least the source file name and chapter identifier.
[0040] In practice, a strict prompt template is pre-defined, which includes the system instruction area, the aforementioned trusted context content, and the user's original question. The system instructions explicitly require the large language model to possess expert functions that comply with power grid technical and economic specifications, answering only based on provided knowledge fragments and prohibiting the introduction of external knowledge stored in the model's own parameters. Simultaneously, the instructions also set a direct rejection condition: when the highest relevance score of all trusted context fragments falls below a preset threshold, the model is forced to output a statement: "Unable to answer, please provide additional information."
[0041] Furthermore, after the completed prompts are input into the large language model, the model generates the final answer under the dual constraints of instructions and context. The instructions require that for each fact or data point, the citation source must be clearly marked in the answer text in a preset taggable format (such as [Source: Filename, Chapter Number]).
[0042] Furthermore, the method also includes: The final result generated by the large language model and the corresponding source information are merged into structured data and pushed to the user interface for display. In the user interface, the names and chapter identifiers of the referenced source files are highlighted and provided with an interactive viewing entry point, so that users can retrieve and display the corresponding original document fragments by clicking on the entry point.
[0043] In practice, the generated answers and source tags are integrated into structured data and pushed to the user interface. The interface highlights all source file names and chapter identifiers, setting them as interactive entry points. Users can click on these entry points to retrieve and display the corresponding original document paragraphs from the document library based on the path information carried by the tags, enabling convenient verification of the answers.
[0044] In summary, the RAG-based Q&A method for main grid infrastructure transmission and transformation engineering in the above embodiments of the present invention has the following beneficial effects: 1. Improved the accuracy and professionalism of technical and economic knowledge retrieval. By constructing a professional vectorized knowledge base composed of technical specifications, management systems, and historical cases, and adopting a hybrid retrieval method combining semantic understanding and keyword matching, the most relevant regulatory clauses and case data can be accurately located. This ensures that the large language model strictly follows authoritative knowledge when generating answers, effectively suppressing the "illusion" phenomenon of general models and ensuring that the final results comply with industry standards and internal regulations.
[0045] 2. It enables precise traceability of results, enhancing the credibility of decision-making. When generating each conclusion, the original document name and chapter number are forcibly cited, allowing users to view the original text with a single click. This ensures that every answer is verifiable, greatly improving the trust that business personnel have in the information they receive during auditing, settlement, and other scenarios.
[0046] 3. Significantly improved the ability to handle complex problems and the efficiency of knowledge retrieval. By performing intent recognition, synonym expansion, and semantic enhancement on user questions, it can automatically complete the implicit constraints such as voltage level and cost type in the question, and perform comprehensive analysis by linking multiple sources of knowledge. This allows comprehensive solutions that originally required consulting multiple specifications to be completed in seconds, significantly improving work efficiency. Example 2
[0047] Another aspect of this invention proposes a Q&A system for the technical aspects of main grid infrastructure transmission and transformation engineering based on RAG. Please refer to [link / reference]. Figures 2 to 3 The image shows a Q&A system for main grid infrastructure transmission and transformation engineering based on RAG, as shown in the second embodiment of the present invention, comprising: The data acquisition module 11 is used to collect and integrate unstructured documents from several databases, and to process the unstructured documents using an embedding model to form a vectorized knowledge base with semantic similarity detection. The data processing module 12 is used to obtain the natural language question input by the user, and to perform intent recognition and key entity extraction on the natural language question using a large language model. It also combines domain knowledge to perform synonym expansion and semantic enhancement on the original query to generate query terms for retrieval. Data filtering module 13 is used to perform mixed retrieval and reordering in the vectorized knowledge base based on the query terms, so as to filter out the top-ranked knowledge fragments as reliable contexts; The result generation module 14 is used to construct prompt words by combining the trusted context, the natural language question, and preset system instructions, input the prompt words into the large language model, generate the final result according to the constraints of the trusted context, and mark the knowledge sources and origins cited in the result.
[0048] Furthermore, the data acquisition module 11 is specifically used for: Collect and integrate unstructured documents from the technical specification library, management system library, and historical engineering case library, and parse each unstructured document into text fragments; The text fragments are cleaned and standardized, and each processed text fragment is converted into a high-dimensional vector using an embedding model to form a vectorized knowledge base with semantic similarity retrieval.
[0049] Furthermore, the data processing module 12 is specifically used for: Obtain the question text in natural language format input by the user through the terminal; Using a fine-tuned large language model based on corpus of economics and technology, intent recognition and key entity extraction are performed on the question text to obtain the corresponding question category and at least one key entity related to economics and technology. The question category includes cost calculation, standard query, system consultation or case reference. The key entity includes one or more of the following: project type, voltage level, cost type, equipment and material category or management process. Based on a pre-built domain thesaurus and semantic expansion rules, the original expression in the question text is expanded with synonyms, and the implicit context conditions that may be missing in the question are filled in according to the extracted key entities, generating semantically enhanced query terms.
[0050] Furthermore, the data filtering module 13 is specifically used for: The query terms are converted into query vectors using the embedding model, and a first number of candidate text fragments are recalled to form a first candidate set by calculating vector similarity in the vector database. Based on the inverted index, the core keywords in the query terms are used to perform precise matching in the text fragments or original documents to recall a second number of candidate text fragments to form a second candidate set. The first candidate set and the second candidate set are merged and deduplicated. A pre-trained relevance ranking model is used to score the semantic relevance of each merged candidate text fragment to the question text. The fragments are then re-ranked from high to low based on the score results, and the highest-scoring knowledge fragments are extracted as credible context.
[0051] Furthermore, the result generation module 14 is specifically used for: Construct a prompt word template, which includes at least the system instruction area, the trusted context, and the natural language question; The filled-in prompt words are input into the large language model. The system instructions restrict the large language model to generate the final result based on the content of the provided knowledge fragments. The specific knowledge sources cited are marked in the generated final result in a preset taggable format. The knowledge sources include at least the source file name and chapter identifier.
[0052] Furthermore, the system also includes: The data display module is used to integrate the final results generated by the large language model and the corresponding source information into structured data and push it to the user interface for display. The user interaction module is used to highlight the referenced source file name and chapter identifier in the user interaction interface and provide an interactive viewing entry point so that users can retrieve and display the corresponding original document fragment by clicking the entry point.
[0053] The functions or operation steps implemented by the above modules are largely the same as those in the above method embodiments, and will not be repeated here.
[0054] The technical Q&A system for main grid infrastructure transmission and transformation engineering based on RAG provided in this embodiment of the invention has the same implementation principle and technical effects as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the system embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0055] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0056] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A Q&A method for main grid infrastructure transmission and transformation engineering based on RAG, characterized in that, Includes the following steps: Step 1: Collect and integrate unstructured documents from several databases, and use an embedding model to process the unstructured documents to form a vectorized knowledge base with semantic similarity detection; Step 2: Obtain the natural language question input by the user, and use a large language model to perform intent recognition and key entity extraction on the natural language question. Combine domain knowledge to perform synonym expansion and semantic enhancement on the original query to generate query terms for retrieval. Step 3: Based on the query terms, perform hybrid retrieval and re-ranking in the vectorized knowledge base to filter out the top-ranked knowledge fragments as reliable context; Step 4: Construct prompt words by combining the trusted context, the natural language question, and the preset system instructions. Input the prompt words into the large language model. Generate the final result according to the constraints of the trusted context, and mark the knowledge sources and origins cited in the result.
2. The Q&A method for technical and economic issues in RAG-based main grid infrastructure transmission and transformation engineering as described in claim 1, characterized in that, Step one includes: Collect and integrate unstructured documents from the technical specification library, management system library, and historical engineering case library, and parse each unstructured document into text fragments; The text fragments are cleaned and standardized, and each processed text fragment is converted into a high-dimensional vector using an embedding model to form a vectorized knowledge base with semantic similarity retrieval.
3. The Q&A method for technical and economic issues in RAG-based main grid infrastructure transmission and transformation engineering as described in claim 1, characterized in that, Step two includes: Obtain the question text in natural language format input by the user through the terminal; Using a fine-tuned large language model based on corpus of economics and technology, intent recognition and key entity extraction are performed on the question text to obtain the corresponding question category and at least one key entity related to economics and technology. The question category includes cost calculation, standard query, system consultation or case reference. The key entity includes one or more of the following: project type, voltage level, cost type, equipment and material category or management process. Based on a pre-built domain thesaurus and semantic expansion rules, the original expression in the question text is expanded with synonyms, and the implicit context conditions that may be missing in the question are filled in according to the extracted key entities, generating semantically enhanced query terms.
4. The Q&A method for technical and economic issues in RAG-based main grid infrastructure transmission and transformation engineering as described in claim 3, characterized in that, Step three includes: The query terms are converted into query vectors using the embedding model, and a first number of candidate text fragments are recalled to form a first candidate set by calculating vector similarity in the vector database. Based on the inverted index, the core keywords in the query terms are used to perform precise matching in the text fragments or original documents to recall a second number of candidate text fragments to form a second candidate set. The first candidate set and the second candidate set are merged and deduplicated. A pre-trained relevance ranking model is used to score the semantic relevance of each merged candidate text fragment to the question text. The fragments are then re-ranked from high to low according to the score results, and the highest-scoring knowledge fragments are extracted as credible context.
5. The Q&A method for technical and economic issues in RAG-based main grid infrastructure transmission and transformation engineering as described in claim 3, characterized in that, Step four includes: Construct a prompt word template, which includes at least the system instruction area, the trusted context, and the natural language question; The filled-in prompt words are input into the large language model. The system instructions restrict the large language model to generate the final result based on the content of the provided knowledge fragments. The specific knowledge sources cited are marked in the generated final result in a preset taggable format. The knowledge sources include at least the source file name and chapter identifier.
6. The Q&A method for technical and economic issues in RAG-based main grid infrastructure transmission and transformation engineering according to claim 1, characterized in that, The method further includes: The final result generated by the large language model and the corresponding source information are merged into structured data and pushed to the user interface for display. In the user interface, the names and chapter identifiers of the referenced source files are highlighted and provided with an interactive viewing entry point, so that users can retrieve and display the corresponding original document fragments by clicking on the entry point.
7. A Q&A system for main grid infrastructure transmission and transformation engineering based on RAG, characterized in that, include: The data acquisition module is used to collect and integrate unstructured documents from several databases, and to process the unstructured documents using an embedding model to form a vectorized knowledge base with semantic similarity detection. The data processing module is used to acquire the natural language question input by the user, and to perform intent recognition and key entity extraction on the natural language question using a large language model. It also combines domain knowledge to perform synonym expansion and semantic enhancement on the original query to generate query terms for retrieval. The data filtering module is used to perform mixed retrieval and reordering in the vectorized knowledge base based on the query terms, so as to filter out the top-ranked knowledge fragments as reliable contexts; The result generation module is used to construct prompt words by combining the trusted context, the natural language question, and preset system instructions, input the prompt words into the large language model, generate the final result according to the constraints of the trusted context, and mark the knowledge sources and origins cited in the result.
8. The RAG-based main grid infrastructure transmission and transformation engineering technical Q&A system according to claim 7, characterized in that, The data acquisition module is specifically used for: Collect and integrate unstructured documents from the technical specification library, management system library, and historical engineering case library, and parse each unstructured document into text fragments; The text fragments are cleaned and standardized, and each processed text fragment is converted into a high-dimensional vector using an embedding model to form a vectorized knowledge base with semantic similarity retrieval.
9. The RAG-based main grid infrastructure transmission and transformation engineering technical Q&A system according to claim 7, characterized in that, The data processing module is specifically used for: Obtain the question text in natural language format input by the user through the terminal; Using a fine-tuned large language model based on corpus of economics and technology, intent recognition and key entity extraction are performed on the question text to obtain the corresponding question category and at least one key entity related to economics and technology. The question category includes cost calculation, standard query, system consultation or case reference. The key entity includes one or more of the following: project type, voltage level, cost type, equipment and material category or management process. Based on a pre-built domain thesaurus and semantic expansion rules, the original expression in the question text is expanded with synonyms, and the implicit context conditions that may be missing in the question are filled in according to the extracted key entities, generating semantically enhanced query terms.
10. The RAG-based main grid infrastructure transmission and transformation engineering technical Q&A system according to claim 9, characterized in that, The data filtering module is specifically used for: The query terms are converted into query vectors using the embedding model, and a first number of candidate text fragments are recalled to form a first candidate set by calculating vector similarity in the vector database. Based on the inverted index, the core keywords in the query terms are used to perform precise matching in the text fragments or original documents to recall a second number of candidate text fragments to form a second candidate set. The first candidate set and the second candidate set are merged and deduplicated. A pre-trained relevance ranking model is used to score the semantic relevance of each merged candidate text fragment to the question text. The fragments are then re-ranked from high to low according to the score results, and the highest-scoring knowledge fragments are extracted as credible context.