Power grid autonomous operation and maintenance question-answering system based on large model and RAG open source framework
By developing a power grid autonomous operation and maintenance question-and-answer system based on a large model and the RAG open-source framework, the problem of existing intelligent question-and-answer systems being unable to cope with the rapid changes in intelligent power grid equipment has been solved. This system achieves efficient and accurate generation of operation and maintenance answers, reduces development costs, and improves the system's adaptability.
Patent Information
- Application Number
- CN202511226369.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2026-01-09
AI Technical Summary
Existing intelligent question-and-answer systems are unable to cope with the rapidly changing operation and maintenance needs of smart grid equipment. Traditional operation and maintenance methods are inefficient and prone to errors, and large language models have high fine-tuning costs and long update cycles, making it difficult to meet the high-efficiency, dynamic, and accurate requirements of power grid operation and maintenance.
The system employs a power grid autonomous operation and maintenance question-and-answer system based on a large model and the RAG open-source framework. Through knowledge document processing, vector generation and storage, query processing and retrieval, and answer generation and return modules, combined with dynamic multi-granularity segmentation, semantic enhancement, vector similarity calculation, and open-source search engine, it achieves efficient and accurate answers to operation and maintenance questions.
It improves operation and maintenance efficiency, enhances the accuracy of answers, reduces development costs, and improves the scalability and adaptability of the system, enabling it to quickly respond to the dynamic needs of smart grid equipment.
Smart Images

Figure CN121303320A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and in particular to a power grid autonomous operation and maintenance question-answering system based on a large model and the RAG open-source framework. Background Technology
[0002] With the development of smart grids, the number and types of smart grid equipment are constantly increasing, making operation and maintenance work increasingly complex. Traditional operation and maintenance methods rely on manual review of a large number of business documents and operation manuals, which is not only inefficient but also prone to human error. In addition, due to the rapid technological updates of smart grid equipment, traditional operation and maintenance methods struggle to keep up with the pace of technological development.
[0003] In recent years, with the rapid development of natural language processing technology, intelligent question answering systems have gradually become an effective way to solve operation and maintenance problems. However, most existing intelligent question answering systems rely on static knowledge bases, which are difficult to cope with rapidly changing operation and maintenance needs. In addition, traditional fine-tuning methods of large language models have problems such as high development costs, long update cycles, and outdated knowledge bases, which are difficult to meet the efficient, dynamic, and accurate operation and maintenance needs of smart power grid equipment.
[0004] RAG is a natural language processing framework that combines retrieval and generation capabilities. By retrieving relevant text as input to the generative model, the RAG framework can fully utilize knowledge from large-scale corpora to improve the accuracy and richness of generated answers. Applying the RAG framework to an intelligent question-and-answer system for the operation and maintenance of smart grid equipment is expected to achieve more efficient and accurate answers to operation and maintenance questions. Summary of the Invention
[0005] The technical problem to be solved by this invention is to provide a power grid autonomous operation and maintenance question-and-answer system based on a large model and the RAG open-source framework to solve existing problems.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: A power grid autonomous operation and maintenance question-answering system based on a large model and the RAG open-source framework includes: a knowledge document processing module, which segments a knowledge document of a specific domain into multiple semantically independent text blocks and performs semantic enhancement processing on the multiple text blocks in combination with the knowledge characteristics of the specific domain; a vector generation and storage module, which generates a high-dimensional vector representation for each text block through an embedding model and stores the generated vector in a vector database; and a query processing and retrieval module, which obtains the query statement input by the user, converts the query statement into a query vector through an embedding model, and retrieves the query statement from the vector database using a vector similarity calculation algorithm. The system includes a set of text blocks related to the query vector, and also includes an answer generation and return module. This module is divided into an answer generation module and an answer return module. The answer generation module reorders the text blocks in the set according to their relevance to the user query, combines dynamically generated prompt templates with the reordered text blocks to generate input for a large language model, and passes this input to the large language model for answer generation. The answer return module performs post-processing on the answer generated by the large language model and finally returns it to the user. The knowledge document processing module, vector generation and storage module, query processing and retrieval module, and answer generation and return module communicate through a data interface to achieve data transmission and processing.
[0007] Preferably, the operation of dividing a domain-specific knowledge document into multiple semantically independent text blocks includes: employing a dynamic multi-granularity segmentation strategy, combining paragraph hierarchy, sentence semantic similarity, and contextual logical relationships to perform in-depth analysis and segmentation of the document content.
[0008] Preferably, the semantic enhancement process includes: dynamically supplementing missing contextual information by analyzing the semantic relationships between text blocks and utilizing knowledge graph or semantic network technology.
[0009] Preferably, the step of generating a high-dimensional vector representation for each text block through an embedding model includes: selecting advanced pre-trained language models such as BERT and GPT as the basis for the embedding model, and fine-tuning them in combination with specific data from the field of smart grid equipment operation and maintenance.
[0010] Preferably, the metric method for calculating vector similarity is selected in the following way: a suitable similarity calculation algorithm, such as cosine similarity or Euclidean distance, is selected based on task characteristics and data distribution.
[0011] Preferably, it also includes: combining search results from at least one open-source search engine to improve retrieval recall and accuracy through cross-validation and fusion ranking.
[0012] Preferably, the prompt template is obtained by dynamically matching or generating a corresponding prompt template based on the characteristics and context information of the query statement through keyword extraction and corpus distribution analysis.
[0013] The power grid autonomous operation and maintenance question answering method based on the large model and RAG open source framework includes the following steps: S1, performing text block segmentation and semantic enhancement of knowledge documents; specifically, adopting a dynamic multi-granularity segmentation strategy, combining paragraph level, sentence semantic similarity and contextual logical relationship, to segment the knowledge document into multiple semantically independent text blocks, and dynamically supplementing missing contextual information by analyzing the semantic correlation between text blocks.
[0014] S2. Perform vector generation and vector storage; specifically: use an embedding model to encode text blocks and generate high-dimensional vector representations; store the generated vectors in a vector database for easy retrieval and matching later. S3. Perform query vectorization, similarity calculation, and result optimization; S4. Reorder the text blocks, generate the hint template, generate the answer, and return the answer.
[0015] Preferably, step S3 includes the following steps: S301, Query Vectorization: Obtain the operation and maintenance query statement input by the user and transform it into a query vector through the embedding model; S302. Similarity Calculation: Using a vector similarity calculation algorithm, retrieve a set of text blocks related to the query vector from the vector database; S303. Result Optimization: By combining search results from open-source search engines and using methods such as cross-validation and fusion ranking, the recall and accuracy of retrieval can be improved.
[0016] Preferably, step S4 includes the following steps: S401, Text Block Reordering: Reorder the retrieved text block set according to the relevance priority of the text blocks to the user query; S402. Prompt Template Generation: Dynamically generate corresponding prompt templates based on the characteristics of the query statement and context information; S403, Answer Generation: The reordered text block and the prompt template are taken as input and passed to the large language model to generate the answer; S404, Answer Return: The answer generated by the large language model is post-processed and finally returned to the user.
[0017] Compared with the prior art, the present invention has at least the following beneficial effects: This invention improves power grid operation and maintenance efficiency: Through an intelligent question-and-answer system, users can quickly obtain answers to operation and maintenance questions without manually consulting numerous documents, significantly improving efficiency; enhances answer accuracy: Combining a large language model and the RAG open-source framework, the system can fully utilize knowledge from a large-scale corpus to generate more accurate and richer answers; reduces development costs: The elimination of frequent fine-tuning of the large language model reduces the need for computational resources and labeled data, lowering development costs; and enhances system scalability: The system architecture is flexible, easy to expand and upgrade, and can adapt to the operation and maintenance needs of different fields and scenarios. Attached Figure Description
[0018] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments of the present disclosure and, together with the specification, further serve to explain the principles of the present disclosure and enable those skilled in the art to implement and use the present disclosure.
[0019] Figure 1 The system architecture diagram of a power grid autonomous operation and maintenance question-and-answer system based on a large model and the RAG open-source framework; Figure 2 The system architecture diagram of a power grid autonomous operation and maintenance question-and-answer system based on a large model and the RAG open-source framework; Figure 3 This is a system flowchart for a power grid autonomous operation and maintenance question-and-answer system based on a large model and the RAG open-source framework.
[0020] As shown in the figure, specific structures and devices are labeled in the figure to clearly illustrate the structure of the embodiments of the present invention. However, this is only for illustrative purposes and is not intended to limit the present invention to the specific structure, device and environment. Those skilled in the art can adjust or modify these devices and environments according to specific needs, and such adjustments or modifications are still included in the scope of the appended claims. Detailed Implementation
[0021] The following describes in detail the power grid autonomous operation and maintenance question-and-answer system based on a large model and the RAG open-source framework provided by the present invention, with reference to the accompanying drawings and specific embodiments. It should be noted that, to make the embodiments more detailed, the following embodiments are listed as best and preferred embodiments; other alternative methods may be used by those skilled in the art. Furthermore, the accompanying drawings are only for more specific description of the embodiments and are not intended to specifically limit the present invention.
[0022] like Figure 1As shown, embodiments of the present invention provide a power grid autonomous operation and maintenance question-and-answer system based on a large model and the RAG open-source framework, including: a knowledge document processing module (implemented by MinerU), wherein the knowledge document processing module is used to divide a knowledge document of a specific domain into multiple semantically independent text blocks, and to perform semantic enhancement processing on the multiple text blocks in combination with the knowledge characteristics of the specific domain; It also includes a vector generation and storage module, which generates a high-dimensional vector representation for each text block through an embedding model (combining a general pre-trained language model and a domain-specific fine-tuned language model) and stores the generated vectors in a vector database; It also includes a query processing and retrieval module, which is used to obtain the query statement input by the user, convert the query statement into a query vector through an embedding model, use vector similarity calculation algorithms (such as cosine similarity, Euclidean distance, etc.) to retrieve a set of text blocks related to the query vector from the vector database, and combine the search results of the open source search engine to improve the retrieval recall and accuracy through cross-validation and fusion ranking. It also includes an answer generation and return module, which is divided into an answer generation module and an answer return module. The answer generation module is used to reorder the text blocks in the text block set according to their relevance to the user query, and combine the dynamically generated prompt template with the reordered text blocks to generate input for the large language model, and pass it to the large language model for answer generation processing. The answer return module is used to post-process the answer generated by the large language model and finally return it to the user. The knowledge document processing module, vector generation and storage module, query processing and retrieval module and answer generation and return module communicate with each other through a data interface to realize data transmission and processing.
[0023] This embodiment requires further explanation that the operation of dividing a domain-specific knowledge document into multiple semantically independent text blocks includes: adopting a dynamic multi-granularity segmentation strategy, combining paragraph level, sentence semantic similarity, and contextual logical relationship to perform in-depth analysis and segmentation of the document content.
[0024] It should be further explained in this embodiment that the semantic enhancement process includes: dynamically supplementing missing contextual information by analyzing the semantic relationships between text blocks and using technologies such as knowledge graphs or semantic networks.
[0025] It should be further explained in this embodiment that the step of generating a high-dimensional vector representation for each text block through the embedding model includes: selecting advanced pre-trained language models such as BERT and GPT as the basis of the embedding model, and fine-tuning them in combination with specific data from the field of smart grid equipment operation and maintenance.
[0026] In this embodiment, it should be further explained that the prompt template is obtained in the following way: based on the characteristics and context information of the query statement, a corresponding prompt template is dynamically matched or generated through keyword extraction and corpus distribution analysis.
[0027] like Figure 2 As shown, the power grid autonomous operation and maintenance question-answering method based on a large model and the RAG open-source framework includes the following steps: S1. Perform text block segmentation and semantic enhancement of knowledge documents; specifically, adopt a dynamic multi-granularity segmentation strategy, combining paragraph hierarchy, sentence semantic similarity, and contextual logical relationships to segment the knowledge document into multiple semantically independent text blocks. In practice, semantic analysis algorithms in natural language processing can be used to perform deep analysis and segmentation of the document content, and to dynamically supplement missing contextual information by analyzing the semantic relationships between text blocks. In practice, knowledge graphs or semantic networks can be used to construct a semantic relationship graph between text blocks, and contextual information can be supplemented and improved based on the relationship graph.
[0028] S2. Perform vector generation and storage; specifically: encode text blocks using an embedding model to generate high-dimensional vector representations; in practice, advanced pre-trained language models such as BERT and GPT can be selected as the basis for the embedding model, and fine-tuned by combining specific data from the field of smart grid equipment operation and maintenance; store the generated vectors in a vector database for easy subsequent retrieval and matching; in practice, efficient vector databases such as Faiss and Annoy can be selected as storage solutions to improve retrieval speed and accuracy; S3. Perform query vectorization, similarity calculation, and result optimization; S301, Query Vectorization: Obtain the operation and maintenance query statement input by the user and convert it into a query vector through an embedding model; in specific implementation, the same embedding model as the text block vector generation can be used to encode the query statement; S302. Similarity Calculation: Using vector similarity calculation algorithms (such as cosine similarity, Euclidean distance, etc.), retrieve a set of text blocks related to the query vector from the vector database; in specific implementation, an appropriate similarity calculation algorithm can be selected according to the dimension and distribution characteristics of the text block vectors. S303. Result Optimization: Combine search results from open-source search engines with methods such as cross-validation and fusion ranking to improve retrieval recall and accuracy. In practice, open-source search engines such as Elasticsearch and Solr can be selected as auxiliary retrieval tools, and machine learning algorithms can be combined to optimize and rank the retrieval results. S4. Perform text block reordering, prompt template generation, answer generation, and answer return; S401, Text Block Reordering: Reorder the retrieved text block set according to the relevance priority of the text blocks to the user query; in specific implementation, classic text matching algorithms such as TF-IDF and BM25 can be used, and relevance scoring and sorting can be performed by combining the content and context information of the text blocks. S402. Prompt Template Generation: Dynamically generate corresponding prompt templates based on the characteristics of the query statement and context information; in specific implementation, template matching or natural language generation technology can be used to generate suitable prompt templates based on the semantics and domain characteristics of the query statement. S403, Answer Generation: The reordered text block and the prompt template are taken as input and passed to the large language model for answer generation. In specific implementation, advanced large language models such as GPT-3 and T5 can be selected as the basis for the generation model, and training and optimization can be carried out in combination with specific data and knowledge in the field of power grid intelligent equipment operation and maintenance. S404, Answer Return: Post-process the answer generated by the large language model (such as formatting, deduplication, etc.) and finally return it to the user; in specific implementation, post-processing operations such as syntax checking and semantic analysis can be performed on the generated answer to ensure the quality and accuracy of the answer.
[0029] Example 1 Taking the operation and maintenance of smart meters in a power grid company as an example, the intelligent question-and-answer system for autonomous operation and maintenance of smart grid equipment in this embodiment of the invention can achieve the following functions: User Question: The user entered the query "How to calibrate a smart meter?"
[0030] System processing: The knowledge document processing module divides the smart meter operation and maintenance knowledge document into multiple text blocks and performs semantic enhancement processing; The vector representation and storage module converts text blocks into high-dimensional vector representations and stores them in the vector database; The query processing and retrieval module converts the query statement into a query vector and retrieves a set of text blocks related to calibration from the vector database; The answer generation and return module reorders the retrieved text block set and generates a prompt template, then passes it to the large language model to generate the answer, and returns the generated answer to the user; The system replied: "The calibration of smart meters typically involves the following steps: First, turn off the meter's power; second, adjust the meter's parameters according to the calibration manual; finally, turn the meter's power back on and test it. Please ensure that safety procedures are followed during the operation." Example 2 Taking the operation and maintenance of transformers in a power dispatch center as an example, the intelligent question-and-answer system for autonomous operation and maintenance of smart grid equipment according to this embodiment of the invention can achieve the following functions: User Question: The user entered the query "How to deal with excessively high transformer oil temperature?" System processing: The knowledge document processing module divides the transformer operation and maintenance knowledge document into multiple text blocks and performs semantic enhancement processing; The vector representation and storage module converts text blocks into high-dimensional vector representations and stores them in the vector database; The query processing and retrieval module converts the query statement into a query vector and retrieves a set of text blocks related to oil temperature overheating from the vector database. The answer generation and return module reorders the retrieved text block set and generates a prompt template, then passes it to the large language model to generate the answer, and returns the generated answer to the user; The system replied: "When the transformer oil temperature is too high, please first check if the cooling system is working properly; second, check if the transformer load is too heavy; finally, take appropriate cooling measures based on the inspection results. If the problem persists, please contact professional technicians for further processing." This invention encompasses any substitutions, modifications, equivalent methods, and solutions made within the spirit and scope of this invention. To provide the public with a thorough understanding of this invention, specific details are described in detail in the following preferred embodiments; however, those skilled in the art will fully understand the invention even without these details. Furthermore, to avoid unnecessary misunderstanding of the essence of this invention, well-known methods, processes, procedures, components, and circuits are not described in detail.
[0031] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc.
[0032] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A power grid autonomous operation and maintenance question-and-answer system based on a large model and the RAG open-source framework, characterized in that: include: The knowledge document processing module is used to divide a knowledge document in a specific domain into multiple semantically independent text blocks, and to perform semantic enhancement processing on the multiple text blocks in combination with the knowledge characteristics of the specific domain. It also includes a vector generation and storage module, which generates a high-dimensional vector representation for each text block through an embedding model and stores the generated vectors in a vector database; It also includes a query processing and retrieval module, which is used to obtain the query statement input by the user, convert the query statement into a query vector through an embedding model, and retrieve a set of text blocks related to the query vector from the vector database using a vector similarity calculation algorithm. It also includes an answer generation and return module, which is divided into an answer generation module and an answer return module. The answer generation module is used to reorder the text blocks in the text block set according to their relevance to the user query, combine the dynamically generated prompt template with the reordered text blocks to generate the input of the large language model, and pass it to the large language model for answer generation processing. The answer return module is used to post-process the answer generated by the large language model and finally return it to the user. The knowledge document processing module, vector generation and storage module, query processing and retrieval module, and answer generation and return module communicate with each other through a data interface to realize data transmission and processing.
2. The power grid autonomous operation and maintenance question-and-answer system based on a large model and the RAG open-source framework as described in claim 1, characterized in that, The operation of dividing a domain-specific knowledge document into multiple semantically independent text blocks includes: using a dynamic multi-granularity segmentation strategy, combining paragraph level, sentence semantic similarity, and contextual logical relationship to perform in-depth analysis and segmentation of the document content.
3. The power grid autonomous operation and maintenance question-and-answer system based on a large model and the RAG open-source framework as described in claim 1, characterized in that, The semantic enhancement process includes: dynamically supplementing missing contextual information by analyzing the semantic relationships between text blocks and utilizing knowledge graph or semantic network technologies.
4. The power grid autonomous operation and maintenance question-and-answer system based on a large model and the RAG open-source framework as described in claim 1, characterized in that, The process of generating a high-dimensional vector representation for each text block through an embedding model includes: selecting advanced pre-trained language models such as BERT and GPT as the basis for the embedding model, and fine-tuning them by combining them with specific data from the field of smart grid equipment operation and maintenance.
5. The power grid autonomous operation and maintenance question-and-answer system based on a large model and the RAG open-source framework as described in claim 1, characterized in that, The metric method for vector similarity calculation is selected as follows: a suitable similarity calculation algorithm, such as cosine similarity or Euclidean distance, is selected based on task characteristics and data distribution.
6. The power grid autonomous operation and maintenance question-and-answer system based on a large model and the RAG open-source framework as described in claim 1, characterized in that, Also includes: By combining search results from at least one open-source search engine, the recall and accuracy of retrieval can be improved through cross-validation and fusion ranking.
7. The power grid autonomous operation and maintenance question-and-answer system based on a large model and the RAG open-source framework as described in claim 1, characterized in that, The prompt template is obtained by dynamically matching or generating a corresponding prompt template based on the characteristics and context information of the query statement through keyword extraction and corpus distribution analysis.
8. A power grid autonomous operation and maintenance question-answering method based on a large model and the RAG open-source framework, applied to the power grid autonomous operation and maintenance question-answering system based on a large model and the RAG open-source framework as described in any one of claims 1-7, characterized in that, Includes the following steps: S1. Perform text block segmentation and semantic enhancement of knowledge documents; specifically: adopt a dynamic multi-granularity segmentation strategy, combine paragraph level, sentence semantic similarity and contextual logical relationship to segment the knowledge document into multiple semantically independent text blocks, and dynamically supplement missing contextual information by analyzing the semantic relationship between text blocks. S2. Perform vector generation and vector storage; specifically: use an embedding model to encode text blocks and generate high-dimensional vector representations; store the generated vectors in a vector database for easy retrieval and matching later. S3. Perform query vectorization, similarity calculation, and result optimization; S4. Reorder the text blocks, generate the hint template, generate the answer, and return the answer.
9. The power grid autonomous operation and maintenance question-answering method based on a large model and the RAG open-source framework as described in claim 8, characterized in that, S3 includes the following steps: S301, Query Vectorization: Obtain the operation and maintenance query statement input by the user and transform it into a query vector through the embedding model; S302. Similarity Calculation: Using a vector similarity calculation algorithm, retrieve a set of text blocks related to the query vector from the vector database; S303. Result Optimization: By combining search results from open-source search engines and using methods such as cross-validation and fusion ranking, the recall and accuracy of retrieval can be improved.
10. The power grid autonomous operation and maintenance question-answering method based on a large model and the RAG open-source framework as described in claim 8, characterized in that, S4 includes the following steps: S401, Text Block Reordering: Reorder the retrieved text block set according to the relevance priority of the text blocks to the user query; S402. Prompt Template Generation: Dynamically generate corresponding prompt templates based on the characteristics of the query statement and context information; S403, Answer Generation: The reordered text block and the prompt template are taken as input and passed to the large language model to generate the answer; S404, Answer Return: The answer generated by the large language model is post-processed and finally returned to the user.
Citation Information
Cited By
Community service robot-oriented multi-mode perception fusion man-machine interaction system
CN122064273A
