DTS intelligent interaction method and system fusing large language model and vector database
By integrating a large language model with a vector database, constructing a semantic vector knowledge base, and combining it with a memory mechanism, the problems of insufficient semantic understanding and insufficient coverage of professional knowledge in the DTS system are solved, realizing efficient and accurate intelligent question answering, which is suitable for multi-round dialogues in the field of power control and dispatcher training.
Patent Information
- Application Number
- CN202511488199.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2026-01-23
AI Technical Summary
Traditional DTS systems suffer from insufficient semantic understanding and unintelligent responses in natural language interaction. Existing large language models lack sufficient coverage of professional knowledge in the field of power regulation, resulting in insufficient accuracy and professionalism in responses, and high update costs.
By integrating large language models and vector databases, a semantic vector knowledge base is constructed. Semantic segmentation algorithms and multidimensional similarity measures are adopted, combined with a memory mechanism, to achieve deep integration of knowledge in the field of power regulation and intelligent question answering.
It improves the accuracy and professionalism of the dispatcher training system's question-and-answer capabilities, enhances multi-round dialogue capabilities, adapts to different power control business scenarios, and provides efficient and accurate artificial intelligence interaction tools.
Smart Images

Figure CN121387889A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of electric power automation, and particularly relates to a DTS intelligent interaction method and system fusing a large language model and a vector database. BACKGROUND
[0002] In recent years, the construction of new power systems has accelerated the pace of digitalization, and power grid dispatching and operation are facing unprecedented complexity challenges. With the large-scale access of new energy, dynamic changes in power grid topology, and the continuous improvement of the intelligent level of dispatching business, the traditional dispatcher training system urgently needs to be transformed into a digital and intelligent system. Under this background, how to deeply integrate artificial intelligence into the dispatcher training simulation system while ensuring the accuracy of professional knowledge and achieving intelligent answers to natural language interaction has become an important research direction in the field of electric power education and training.
[0003] The traditional question and answer module of the DTS system, as the core platform for training electric power control personnel, mainly relies on keyword matching and rule reasoning. Although it performs well in simple problem processing, it lacks deep semantic understanding ability and has low accuracy and insufficient intelligence in responding to complex and diverse natural language inquiries from dispatchers, making it difficult to meet individual training needs.
[0004] The large language model provides a new technical path to solve this problem with its powerful natural language understanding and generation capabilities. However, existing large models have the defects of insufficient professional knowledge coverage and deviation in understanding domain terminology when applied in the vertical field of electric power control, making it difficult for the model to accurately grasp the professional connotation of electric power control problems, resulting in insufficient professional and accurate answers. When facing updates to electric power control procedures or the need to incorporate the latest dispatching knowledge, relying solely on pre-training knowledge of large models has the limitations of poor knowledge timeliness and high update costs. SUMMARY
[0005] The purpose of the present application is to provide a DTS intelligent interaction method and system fusing a large language model and a vector database to solve the problems of insufficient professional and accurate answers and poor timeliness in the prior art.
[0006] To achieve the above-mentioned purpose, the technical solutions adopted by the present application are as follows: In a first aspect, the present application provides a DTS intelligent interaction method fusing a large language model and a vector database, comprising: acquiring electric power control and dispatcher training simulation system DTS domain text data to construct a semantic vector knowledge base; based on the constructed semantic vector space mapping and knowledge base, reconstructing the representation of the question, and then converting the reconstructed representation of the question into a vector through an embedding network; Based on the transformed vector, retrieval is performed in the constructed semantic vector knowledge base, comprehensive similarity between the problem vector and the vectors in the knowledge base is calculated, and the most relevant knowledge fragments are retrieved; The most relevant knowledge fragments and the dialogue context provided by the memory mechanism are combined as inputs to drive the large language model to generate the final intelligent question and answer response.
[0007] Further, the power regulation and dispatching officer training simulation system DTS field text data is obtained, including: The text data of the dispatching officer training simulation field and the text data of the power regulation field are collected, including the dispatching operation data set, the power regulation data, the DTS drill teaching plan and the dispatching rules.
[0008] Further, the semantic vector knowledge base is constructed, including: The semantic segmentation algorithm fusing field knowledge and text semantics is used to segment and slice the text, and the semantic vector space mapping of the segmented and sliced text is obtained through the BERT model. The text embedding process is represented as:
[0009]
[0010] Among them, represents the input segmented and sliced text, represents the final vector representation of the text, which represents and the corresponding text segment The HNSW algorithm in FAISS is used to establish an index and store it in the vector knowledge base. The final vector representation of the text is composed of the following three components: first, the multi-layer BERT encoder component The text is encoded by different depth BERT variants, each layer corresponds to different granularity of semantic abstraction, and the weight According to the complexity of the text, the contribution of each layer is dynamically adjusted; second, the context adapter Optimized for the language characteristics of power system terminology and dispatching instructions, the parameters are obtained through pre-training in the field, which can identify the deep semantic association of professional concepts; finally, the domain memory module Maintain an updatable knowledge memory bank to store historical dispatching experience and DTS operation mode, and the parameters Encode the field expert knowledge, so that the model can reason based on historical cases; the three components are adaptively fused through learnable weights , and to form a text vector representation with general versatility.
[0011] Furthermore, based on the constructed semantic vector space mapping and knowledge base, the proposed question is reconstructed into a question representation, and then the reconstructed question representation is converted into a vector through an embedding network, including: When a user asks a question, the system first preprocesses the question text. The process of restating the question is represented as follows:
[0012]
[0013] in, Representing a hierarchical large language model component, it uses a multi-level inference chain to address the user's original question. Perform progressive refinement, parameters Controlling the depth of semantic understanding at different levels of abstraction; This indicates the retrieval enhancement module, which retrieves data from the knowledge base. Retrieve relevant context from the data and use a value function. Assess information quality, parameters Adjust search strategies and relevance weights; Representative domain expert knowledge injection module. The system encodes the professional rules and constraints in the field of power dispatching; the three modules are added together to adaptively integrate information and form a problem reconstruction representation.
[0014] Furthermore, based on the transformed vector, a retrieval is performed in the constructed semantic vector knowledge base, calculating the comprehensive similarity between the question vector and the vectors in the knowledge base, and retrieving the most relevant knowledge fragments, including: An adaptive multi-scale similarity fusion algorithm is introduced, employing adaptive text-vector fusion similarity for knowledge retrieval; for two vectors formed by text embeddings... , The formula for calculating cosine similarity is:
[0015] Introducing kernel transform function Capture non-linear semantic associations and use positional bias terms. Compensate for text structure information; for two text segments , The Jaccard similarity calculation formula is:
[0016] in, and Text respectively and The word set, through fuzzy membership function Handling lexical boundary ambiguity issues, semantic weight function According to the lexical importance, the weight of the intersection and union set calculation is dynamically adjusted; the information difference between two vectors is introduced based on the information theory:
[0017] Among them , is the information entropy of two vectors, is the mutual information between two vectors, and the comprehensive similarity calculation method is given based on the above-mentioned measurement:
[0018] Among them, , and are weight parameters that can be adjusted according to the difference between text types.
[0019] Further, the most relevant knowledge fragments and the dialogue context provided by the memory mechanism are combined as inputs to drive the large language model to generate the final intelligent question and answer response, including: A dynamic context processing and memory mechanism is introduced, which is mainly realized through a memory component. The information writing process of the memory component is represented as:
[0020] The information reading process of the memory component is represented as:
[0021] Among them, represents the memory component, represents the memory storage process, represents the memory reading process, represents other components in the chain workflow, represents the information generated by other components, represents the information stored in the memory module; the memory module compresses the chat history and user query in each interaction, and indexes and retrieves it as a new query. The retrieved context is input into the large language model together with the original user message to generate the final answer.
[0022] In the second aspect, the present application provides a DTS intelligent interaction system integrating a large language model and a vector database, comprising: A data acquisition module is used to acquire power regulation and dispatching operator training simulation system (DTS) field text data, and construct a semantic vector knowledge base; A reconstruction representation module is used to reconstruct the representation of the proposed question based on the constructed semantic vector space mapping and knowledge base, and then convert the question reconstruction representation into a vector through an embedding network. The similarity calculation module is configured to calculate the comprehensive similarity between the problem vector and the vectors in the constructed semantic vector knowledge base based on the converted vectors, and retrieve the most relevant knowledge fragments. The output module is configured to combine the most relevant knowledge fragments and the dialogue context provided by the memory mechanism as inputs to drive the large language model to generate a final intelligent question and answer response.
[0023] Further, the power regulation and dispatcher training simulation system DTS field text data is obtained, comprising: The text data of the dispatcher training simulation field and the text data of the power regulation field are collected, including the dispatcher operation data set, the power regulation data, the DTS drill teaching plan and the dispatching rules.
[0024] Further, the semantic vector knowledge base is constructed, comprising: The semantic segmentation algorithm fusing field knowledge and text semantics is used to segment and slice the text, and the semantic vector space mapping of the segmented and sliced text is obtained through the BERT model, and the text embedding process is represented as:
[0025]
[0026] wherein, represents the input segmented and sliced text, represents the final vector representation of the text, which represents and the corresponding text fragment The HNSW algorithm in FAISS is used to establish an index and store it in the vector knowledge base; The final vector representation of the text is composed of the following three components: first, the multi-layer BERT encoder component The text is encoded by different depth BERT variants, each layer corresponds to a different granularity of semantic abstraction, and the weight The contribution of each layer is dynamically adjusted according to the complexity of the text; second, the context adapter optimized for the language characteristics of power system terminology and dispatching instructions, the parameters obtained through pre-training in the field, which can identify the deep semantic association of professional concepts; finally, the domain memory module maintains an updatable knowledge memory bank, stores historical dispatching experience and DTS operation mode, and the parameters encode the field expert knowledge, so that the model can reason based on historical cases; the three components are connected through learnable weights , and Adaptive fusion is performed to form a text vector representation that is both versatile and applicable.
[0027] Furthermore, based on the constructed semantic vector space mapping and knowledge base, the proposed question is reconstructed into a question representation, and then the reconstructed question representation is converted into a vector through an embedding network, including: When a user asks a question, the system first preprocesses the question text. The process of restating the question is represented as follows:
[0028]
[0029] in, Representing a hierarchical large language model component, it uses a multi-level inference chain to address the user's original question. Perform progressive refinement, parameters Controlling the depth of semantic understanding at different levels of abstraction; This indicates the retrieval enhancement module, which retrieves data from the knowledge base. Retrieve relevant context from the data and use a value function. Assess information quality, parameters Adjust search strategies and relevance weights; Representative domain expert knowledge injection module. The system encodes the professional rules and constraints in the field of power dispatching; the three modules are added together to adaptively integrate information and form a problem reconstruction representation.
[0030] Furthermore, based on the transformed vector, a retrieval is performed in the constructed semantic vector knowledge base, calculating the comprehensive similarity between the question vector and the vectors in the knowledge base, and retrieving the most relevant knowledge fragments, including: An adaptive multi-scale similarity fusion algorithm is introduced, employing adaptive text-vector fusion similarity for knowledge retrieval; for two vectors formed by text embeddings... , The formula for calculating cosine similarity is:
[0031] Introducing kernel transform function Capture non-linear semantic associations and use positional bias terms. Compensate for text structure information; for two text segments , The Jaccard similarity calculation formula is:
[0032] in, and Text respectively and word set, fuzzy membership function processing fuzzy word boundary problem, semantic weight function According to the importance of vocabulary, the weight of the intersection and union set calculation is dynamically adjusted; the information difference between two vectors is introduced based on the information theory:
[0033] Wherein , is the information entropy of two vectors, is the mutual information between two vectors, and the comprehensive similarity calculation method is given based on the above-mentioned measurement:
[0034] Wherein, , and are weight parameters that can be adjusted according to the difference between text types.
[0035] Further, the most relevant knowledge fragments and the dialogue context provided by the memory mechanism are combined as inputs to drive the large language model to generate the final intelligent question and answer response, including: Introducing a dynamic context processing and memory mechanism, which is mainly realized through a memory component, and the information writing process of the memory component is represented as:
[0036] The information reading process of the memory component is represented as:
[0037] Wherein, represents the memory component, represents the memory storage process, represents the memory reading process, represents other components in the chain workflow, represents the information generated by other components, represents the information stored in the memory module; the memory module compresses the chat history and user query in each interaction, and indexes and retrieves it as a new query. The retrieved context is input into the large language model together with the original user message to generate the final answer.
[0038] In a third aspect, the present application provides a computer device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to realize the steps of the DTS intelligent interaction method of the fusion of the large language model and the vector database.
[0039] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the DTS intelligent interaction method of fusing a large language model and a vector database.
[0040] Compared with the prior art, the present application has the following technical effects: The present application explicitly models the relevance of power regulation field knowledge through a semantic block algorithm and multi-dimensional similarity measurement, and designs a modular chain workflow architecture and a memory mechanism, thereby realizing efficient and accurate intelligent question answering for complex scheduling business problems, and providing a new artificial intelligence interaction tool for the training of new digital power system dispatchers. Compared with the traditional question answering module of the dispatcher training simulation system and the intelligent question answering method relying solely on a large language model, the present application can significantly improve the accuracy of question answering while maintaining the professionalism and intelligence level of the answers. Specifically, the present application improves the comprehensive accuracy of retrieval and matching in the question answering part of the dispatcher training simulation system, and the fine-tuned large language model outperforms the traditional method in terms of accuracy, precision, recall rate and F1 score. In addition, the method of the present application has the beneficial effects of strong scalability and good interaction experience, and through the modular chain workflow architecture, it can flexibly adapt to different power regulation business scenarios, has good multi-turn dialogue capability and context understanding capability, and can be applied to dispatcher intelligent training, power knowledge question answering, scheduling auxiliary decision-making and other application scenarios, thereby providing an efficient and accurate artificial intelligence interaction tool for the new digital power grid dispatcher training system. BRIEF DESCRIPTION OF DRAWINGS
[0041] Figure 1 The logic block diagram of the present application is shown in the figure.
[0042] Figure 2 The flowchart of the present application is shown in the figure. DETAILED DESCRIPTION
[0043] The present application is further described below in conjunction with the accompanying drawings: Glossary: 1. Dispatcher Training Simulator (DTS): A simulation platform that simulates power grid operation conditions to provide dispatchers with a simulation training platform that closely resembles real work scenarios, and is an important tool for power system dispatcher training.
[0044] 2. Retrieval Augmented Generation (RAG): A technology that combines information retrieval and text generation to enhance the generation capability of a large language model by retrieving relevant information from an external knowledge base.
[0045] 3. Vector Knowledge Base: A knowledge base that converts text information into high-dimensional vector representations through embedding models and establishes indexed storage, supporting semantic retrieval based on vector similarity.
[0046] 4. Chain workflow: a processing flow that sequentially connects multiple functional modules in a chain method, with the characteristics of standardization, standardization, and modularization, supporting flexible module replacement and adjustment.
[0047] 5. Semantic segmentation: a document slicing method that combines domain knowledge and text semantics, which can combine semantically related content together to improve the accuracy of text retrieval.
[0048] 6. Memory mechanism: a technical mechanism for storing and reading context information in multiple rounds of dialogue, including memory modules and memory components, supporting coherent multi-round interaction.
[0049] Embodiment 1, please refer to Figure 2 The present application provides a DTS intelligent interaction method combining large language models and vector databases, comprising: Obtain the power regulation and dispatcher training simulation system DTS field text data, and construct a semantic vector knowledge base; Based on the constructed semantic vector space mapping and knowledge base, the problem reconstruction representation is obtained, and then the problem reconstruction representation is converted into a vector through an embedding network; Based on the converted vector, search in the constructed semantic vector knowledge base, calculate the comprehensive similarity between the problem vector and the vector in the knowledge base, and retrieve the most relevant knowledge fragment; Combine the most relevant knowledge fragment and the dialogue context provided by the memory mechanism as input to drive the large language model to generate the final intelligent question and answer response.
[0050] The purpose of the present application is to provide a DTS intelligent interaction method combining large models and vector databases, aiming to solve the challenges faced by intelligent question and answer systems in the new digital power grid dispatcher training system, to solve the problem of insufficient semantic understanding and low intelligent response caused by the dependence on keyword matching in the traditional DTS system in the question and answer interaction, and the defects of answer accuracy deviation and professional term understanding error caused by the lack of professional knowledge in the power regulation field of the existing large language model. An intelligent interaction method combining retrieval enhancement generation technology and vector knowledge base is proposed, the semantic segmentation algorithm and multi-dimensional similarity measurement are used to explicitly model the relevance of power regulation field knowledge, and a modular chain workflow architecture and memory mechanism are designed to realize efficient and accurate intelligent question and answer for complex dispatching business problems, and provide a new artificial intelligence interaction tool for the dispatcher training of the new digital power system.
[0051] Embodiment 2, please refer to Figure 1The application provides a DTS intelligent interaction method combining a large model and a vector database. The method combines a large language model and a retrieval enhancement generation technology to provide a new intelligent question and answer solution for a dispatcher training simulation system. The complete technical solution of the application comprises the following steps: Semantic vector space mapping and knowledge base construction; Multi-level intelligent question and answer chain workflow construction; Adaptive multi-scale similarity fusion algorithm; Dynamic context processing and memory mechanism.
[0052] The following is a detailed description of each step: Step 1: First, a vector knowledge base is constructed based on power regulation and DTS field text data. Text materials in the dispatcher training simulation field and various text materials in the power regulation field are collected, including dispatcher operation data sets, power regulation related articles, DTS drill teaching plans, and dispatching regulations. A semantic segmentation algorithm combining field knowledge and text semantics is used to segment and slice the text. The semantic vector space mapping of the segmented and sliced text is obtained through a BERT model. The text embedding process is represented as:
[0053]
[0054] Among them, represents the input segmented and sliced text, represents the final vector representation of the text, which represents and the corresponding text segment The HNSW algorithm in FAISS is used to establish an index and store it in the vector knowledge base. The final vector representation of the text is composed of the following three core components: first, a multi-layer BERT encoder component Through a BERT variant with different depths, the text is encoded in layers, each layer corresponding to a different granularity of semantic abstraction, and the weight is dynamically adjusted according to the complexity of the text. Second, the context adapter is optimized specifically for the language characteristics of power system terminology and dispatching instructions, and the parameters are obtained through pre-training in the field, which can identify deep semantic associations of professional concepts. Finally, the domain memory module maintains an updatable knowledge memory bank, storing historical dispatching experience and DTS operation modes, and the parameters encode domain expert knowledge, enabling the model to reason based on historical cases. The three components are connected through learnable weights , and Adaptive fusion is performed to form a text vector representation with both generality and professionalism.
[0055] Step two: A multi-level intelligent question and answer chain workflow module is constructed, and a large language model is combined with a retrieval enhancement generation method. When a user raises a question, the system first pre-processes the question text, and the question re-statement process is represented as:
[0056]
[0057] Among them, represents a hierarchical large language model component, which performs progressive refinement on the user's original question through a multi-level inference chain, and the parameter controls the semantic understanding depth of different abstraction levels; represents a retrieval enhancement module, which retrieves relevant context from a knowledge base and evaluates the information quality through a value function , and the parameter adjusts the retrieval strategy and relevance weight; represents a domain expert knowledge injection module, which encodes professional rules and constraints in the power dispatching field. The three modules are adaptively integrated by addition to form a question re-statement representation with rich semantics, complete context and professional domain. This architecture not only retains the core intent of the original question, but also supplements the domain background knowledge and relevant technical details, laying a solid foundation for subsequent accurate retrieval and answer generation. Then, the pre-processed user question text is converted into a vector by an embedding network for retrieval matching.
[0058] Step three: The present application introduces an adaptive multi-scale similarity fusion algorithm, and uses a text-vector fusion similarity based on adaptive fusion for knowledge retrieval. For two vectors , , the cosine similarity calculation formula is:
[0059] Among them, the kernel transformation function is introduced on the basis of traditional calculation to capture nonlinear semantic association, and the position bias term compensates for the text structure information. For two texts , , the Jaccard similarity calculation formula is:
[0060] wherein, and are the word sets of texts and respectively, the fuzzy membership function handles the fuzzy boundary problem of words, and the semantic weight function dynamically adjusts the weight of the intersection and union set calculation according to the importance of words. The patent also introduces an information theory-based metric, the information difference between two vectors is:
[0061] wherein , is the information entropy of two vectors, is the mutual information between two vectors, and a mutual information regularization term is added to avoid overfitting, and a cross-domain penalty term ensures the consistency of the field. Based on the above metric, the comprehensive similarity calculation method is given:
[0062] wherein, , and are weight parameters that can be adjusted according to the difference between text types.
[0063] Step four: To solve the context understanding problem in multi-round dialogue, the invention introduces a dynamic context processing and memory mechanism. This mechanism is mainly realized through a memory component. The information writing process of the memory component is represented as:
[0064] The information reading process of the memory component is represented as:
[0065] wherein, represents the memory component, represents the memory storage process, represents the memory reading process, represents other components in the chain workflow, represents the information generated by other components, represents the information stored in the memory module. The memory module compresses the chat history and user query in each interaction, and indexes and retrieves it as a new query. The retrieved context is input into the large language model together with the original user message to generate the final answer.
[0066] Embodiment 3: Taking the dispatcher training simulation system of a certain power grid dispatching center as an example, the specific implementation process of the invention is described in detail: Step 1: Vector knowledge base construction The dispatch center collected a total of 120,000 power regulation field text data of multiple types. The system uses the semantic segmentation algorithm of the invention to cut long documents into suitable retrieval segments according to semantic relevance, with an average of 150-300 characters per segment. The BERT model is used for vector embedding of the text segments to generate 768-dimensional vector representations, and the HNSW algorithm of FAISS is used to construct vector index to establish a DTS field knowledge base containing about 500,000 vectors.
[0067] Step 2: Fine-tuning of large language model Yi-1.5-34B is selected as the basic large language model, and the collected power regulation field data is used for fine-tuning training. The learning rate is set to 2e-4, the training rounds are set to 3 rounds, and the LoRA fine-tuning technology is used to reduce the demand for computing resources. After fine-tuning, the model's accuracy in identifying DTS field problems is greatly improved.
[0068] Step 3: Deployment of intelligent interaction system When the dispatcher asks in the DTS system: "What measures should be taken when a single-phase ground fault occurs in xxkV XX substation?", the system processing flow is as follows: 1) The preprocessing module performs format conversion and noise removal on the question; 2) The BERT model converts the question into a 768-dimensional vector; 3) The retrieval module uses a comprehensive similarity measure (cosine similarity weight 0.3, Jaccard similarity weight 0.3, information difference weight 0.4) to retrieve the 5 most relevant text segments in the vector knowledge base; 4) The post-processing module rearranges, summarizes and fuses the retrieval results to extract key information; 5) Combine the preset prompt words and the context information in the memory module to fine-tune the large language model to generate a professional answer.
[0069] Step 4: Multi-round dialogue support When the dispatcher continues to ask: "If the fault cannot be quickly isolated, what else needs to be considered?", the system memory module saves the content of the previous dialogue and can understand that it is a continuation of the previous question, and generates a targeted answer in combination with the context to introduce the subsequent measures.
[0070] Implementation effect: After trial operation, the accuracy of the DTS system's question and answer is improved, and the efficiency of dispatcher training is improved.
[0071] The retrieval enhancement generation (RAG) technology is used to fuse a large language model and a DTS field vector knowledge base, a semantic segmentation algorithm and a multi-dimensional similarity measurement method are combined, and therefore, the accurate retrieval and intelligent question answering of power regulation professional knowledge in the dispatcher training simulation system are effectively realized.
[0072] A modular chain workflow architecture design method for the DTS system is proposed, a memory mechanism and a dispatcher training context processing module are integrated, and prompt compression, text rearrangement, summary fusion and other post-processing technologies are introduced, so that the coherence of multiple rounds of dialogue and the professional accuracy of answers in the dispatcher training simulation process are ensured.
[0073] In another embodiment of the present application, a DTS intelligent interaction system fusing a large language model and a vector database is provided, which can be used to realize the DTS intelligent interaction method fusing a large language model and a vector database, and specifically, the system comprises: A data acquisition module is configured to acquire power regulation and dispatcher training simulation system DTS field text data and construct a semantic vector knowledge base. A reconstruction representation module is configured to perform question reconstruction representation based on the constructed semantic vector space mapping and knowledge base, and then convert the question reconstruction representation into a vector through an embedding network. A similarity calculation module is configured to perform retrieval in the constructed semantic vector knowledge base based on the converted vector, calculate the comprehensive similarity between the question vector and the vector in the knowledge base, and retrieve the most relevant knowledge segment. An output module is configured to combine the most relevant knowledge segment and the dialogue context provided by the memory mechanism as input to drive the large language model to generate a final intelligent question answering response.
[0074] The division of the modules in the embodiments of the present application is illustrative, and is only a logical functional division, and another division method can be used in actual implementation, and in addition, each functional module in each embodiment of the present application can be integrated in one processor, or can be physically separated, or two or more modules can be integrated in one module.
[0075] In another embodiment of the present application, a computer device is provided, which comprises a processor and a memory for storing a computer program comprising program instructions, and the processor is configured to execute the program instructions stored in the computer storage medium. The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., which are the computing core and control core of the terminal, and are suitable for implementing one or more instructions, and are specifically suitable for loading and executing one or more instructions in the computer storage medium to implement a corresponding method process or a corresponding function; the processor in the embodiments of the present application can be used for the operation of the DTS intelligent interaction method of fusing a large language model and a vector database.
[0076] In another embodiment of the present application, the present application further provides a storage medium, specifically a computer readable storage medium (Memory), which is a memory device in a computer device, and is used for storing programs and data. It can be understood that the computer readable storage medium here can include an internal storage medium in the computer device, and of course can also include an expansion storage medium supported by the computer device. The computer readable storage medium provides a storage space, and the storage space stores an operating system of the terminal. Moreover, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer readable storage medium here can be a high-speed RAM memory, or a non-volatile memory such as at least one disk memory. One or more instructions stored in the computer readable storage medium can be loaded and executed by the processor to implement the corresponding steps of the DTS intelligent interaction method of fusing a large language model and a vector database in the above embodiments.
[0077] Those skilled in the art will appreciate that embodiments of the application can be devised for a method, a system, or a computer program product. Accordingly, the present application can be embodied in the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer readable program code.
[0078] The present application is described in reference to the flowchart and / or block diagrams of the method, apparatus (system) and computer program product according to embodiments of the application. It will be understood that each block of the flowchart and / or block diagrams, and combinations of blocks in the flowchart and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing device or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks.
[0079] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks.
[0080] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks.
[0081] Finally, it should be noted that the above-mentioned embodiments are merely intended for describing the technical solutions of the present application, but not for limiting it. Although the present application is described in detail with reference to the above embodiments, those skilled in the field should understand that the specific embodiments of the present application can be modified or replaced equivalently without departing from the spirit and scope of the present application, and any modification or equivalent replacement without departing from the spirit and scope of the present application should be covered in the protection scope of the claims of the present application.
Claims
1. A DTS intelligent interaction method of fusing a large language model and a vector database, characterized in that, The application relates to an intelligent question-answering method based on a semantic vector knowledge base, and belongs to the technical field of artificial intelligence. The method comprises the following steps: acquiring power regulation and dispatcher training simulation system (DTS) field text data, and constructing a semantic vector knowledge base; based on the constructed semantic vector space mapping and the knowledge base, reconstructing a question representation, and then converting the question representation into a vector through an embedding network; based on the converted vector, searching in the constructed semantic vector knowledge base, calculating the comprehensive similarity between the question vector and the vector in the knowledge base, and searching out the most relevant knowledge fragment; 2. The DTS intelligent interaction method of fusing a large language model and a vector database according to claim 1, characterized in that, combining the most relevant knowledge fragment and the dialogue context provided by a memory mechanism to serve as input, and driving a large language model to generate a final intelligent question-answering response. The acquiring of the power regulation and dispatcher training simulation system (DTS) field text data comprises the following steps:
3. The DTS intelligent interaction method of fusing a large language model and a vector database according to claim 2, characterized in that, collecting dispatcher training simulation field text materials and power regulation field text materials, including dispatcher operation data sets, power regulation data, DTS drill teaching plans and dispatching rules. The constructing of the semantic vector knowledge base comprises the following steps: wherein, representing the input segmented slice text, denotes the final vector representation of this text, which represents and its corresponding text segment are stored into the vector knowledge base by indexing with the HNSW algorithm in FAISS; The final vector representation of the text is composed of the following three components: first, the multi-layer BERT encoder component By layered encoding of the text with BERT variants of different depths, each layer corresponding to a different granularity of semantic abstraction, the weights adjust the contribution of each layer dynamically according to the complexity of the text; second, the context adapter optimized for the language characteristics of power system terminology and dispatch instructions, the parameters obtained through pre-training within the field, capable of identifying deep semantic associations of professional concepts; finally, the domain memory module maintains an updatable knowledge memory bank, storing historical dispatch experience and DTS operation modes, the parameters encodes the knowledge of domain experts, enabling the model to reason based on historical cases; the three components are adaptively fused through learnable weights 、 and to form a text vector representation with general versatility.
4. The DTS intelligent interaction method of fusing a large language model and a vector database according to claim 1, characterized in that, adopting a semantic segmentation algorithm fusing field knowledge and text semantics to segment and slice the text, and acquiring semantic vector space mapping of the segmented and sliced text through a BERT model, and the text embedding process is represented as follows: The reconstructing of the question representation based on the constructed semantic vector space mapping and the knowledge base comprises the following steps: wherein, represents a hierarchical large language model component that progressively refines the user's original question through a multi-stage inference chain , parameters control the depth of semantic understanding at different levels of abstraction; represents a retrieval enhancement module that retrieves relevant context from a knowledge base and evaluates the quality of the information through a value function , parameters adjust the retrieval strategy and relevance weight; represents a domain expert knowledge injection module, encoding professional rules and constraints in the power dispatching field; the three modules are integrated through addition to form a problem reconstruction representation.
5. The DTS intelligent interaction method of fusing a large language model and a vector database according to claim 1, characterized in that, when a user proposes a question, the system firstly pre-processes the question text, and the question re-expression process is represented as follows: An adaptive multi-scale similarity fusion algorithm is introduced, employing adaptive text-vector fusion similarity for knowledge retrieval; for two vectors formed by text embeddings... , The formula for calculating cosine similarity is: Introducing a kernel transformation function Capture non-linear semantic associations and through position bias terms Compensate for text structure information; for two pieces of text 、 The Jaccard similarity calculation formula is: wherein, and are the word sets of texts and respectively, the fuzzy membership function handles the fuzzy word boundary problem, the semantic weight function dynamically adjusts the weights of the intersection and union according to the importance of the words; the information difference between two vectors is introduced based on information theory: where , is the information entropy of two vectors, is the mutual information between two vectors, the comprehensive similarity calculation method is given based on the above metrics: wherein, , and are weight parameters adjustable according to text type differences.
6. The DTS intelligent interaction method of fusing a large language model and a vector database according to claim 5, characterized in that, The searching in the constructed semantic vector knowledge base based on the converted vector, the calculating of the comprehensive similarity between the question vector and the vector in the knowledge base, and the searching out of the most relevant knowledge fragment comprise the following steps: The combining of the most relevant knowledge fragment and the dialogue context provided by the memory mechanism to serve as input, and the driving of the large language model to generate the final intelligent question-answering response comprise the following steps: a dynamic context processing and memory mechanism is introduced, and the mechanism is mainly realized through a memory component, the information writing process of the memory component is represented as follows: wherein, represents a memory component, represents a memory storage process, represents a memory reading process, represents other components in a chain workflow, represents information generated by other components, represents information stored in a memory module; the memory module compresses the chat history and user queries in each interaction, indexes and retrieves them as new queries, and inputs the retrieved context together with the original user message to a large language model to generate a final answer.
7. The DTS intelligent interaction system fusing a large language model and a vector database, characterized in that, the information reading process of the memory component is represented as follows: The application relates to an intelligent question-answering method based on a semantic vector knowledge base, and belongs to the technical field of artificial intelligence. The method comprises the following steps: acquiring power regulation and dispatcher training simulation system (DTS) field text data, and constructing a semantic vector knowledge base; based on the constructed semantic vector space mapping and the knowledge base, reconstructing a question representation, and then converting the question representation into a vector through an embedding network; 8. The DTS intelligent interaction system of fusing a large language model and a vector database according to claim 7, characterized in that, based on the converted vector, searching in the constructed semantic vector knowledge base, calculating the comprehensive similarity between the question vector and the vector in the knowledge base, and searching out the most relevant knowledge fragment; combining the most relevant knowledge fragment and the dialogue context provided by a memory mechanism to serve as input, and driving a large language model to generate a final intelligent question-answering response.
9. The DTS intelligent interaction system of fusing a large language model and a vector database according to claim 8, characterized in that, The acquiring of the power regulation and dispatcher training simulation system (DTS) field text data comprises the following steps: collecting dispatcher training simulation field text materials and power regulation field text materials, including dispatcher operation data sets, power regulation data, DTS drill teaching plans and dispatching rules. The constructing of the semantic vector knowledge base comprises the following steps: The semantic segmentation algorithm fusing field knowledge and text semantics is used to segment and slice the text, the semantic vector space mapping of the segmented and sliced text is obtained through the BERT model, and the text embedding process is represented as: wherein, representing the input segmented slice text, denotes the final vector representation of this text, which represents and its corresponding text segment is stored into the vector knowledge base by indexing with the HNSW algorithm in FAISS; The final vector representation of the text is composed of three components: first, a multi-layer BERT encoder component By layered encoding of the text with BERT variants of different depths, each layer corresponding to a different granularity of semantic abstraction, the weights According to the complexity of the text, the contribution of each layer is dynamically adjusted; second, a context adapter Optimized for the language characteristics of power system terminology and dispatch instructions, parameters Obtained through pre-training within the field, capable of identifying deep semantic associations of professional concepts; finally, a domain memory module Maintain an updatable knowledge memory bank, store historical dispatch experience and DTS operation mode, parameters Encode domain expert knowledge, enabling the model to reason based on historical cases; the three components are adaptively fused through learnable weights , and to form a text vector representation with general versatility.
10. The DTS intelligent interaction system of fusing a large language model and a vector database according to claim 7, characterized in that, The question reconstruction representation is performed on the proposed question based on the constructed semantic vector space mapping and the knowledge base, and then the question reconstruction representation is converted into a vector through an embedding network, including: When the user proposes a question, the system first pre-processes the question text, and the question re-expression process is represented as: wherein, represents a hierarchical large language model component that progressively refines the user's original question through a multi-stage inference chain , parameters control the depth of semantic understanding at different levels of abstraction; represents a retrieval enhancement module that retrieves relevant context from a knowledge base and evaluates the quality of the information through a value function , parameters adjust the retrieval strategy and relevance weight; represents a domain expert knowledge injection module, which encodes professional rules and constraints in the power dispatching field; the three modules are adaptively integrated through addition to form a question reconstruction representation.
11. The DTS intelligent interaction system of fusing a large language model and a vector database according to claim 7, characterized in that, Based on the converted vector, the constructed semantic vector knowledge base is searched, the comprehensive similarity between the question vector and the vector in the knowledge base is calculated, the most relevant knowledge segment is retrieved, including: An adaptive multi-scale similarity fusion algorithm is introduced, and an adaptive fusion text-vector fusion similarity is used for knowledge retrieval; for two vectors embedded by texts , The cosine similarity calculation formula is: . Introducing a kernel transformation function Capture non-linear semantic associations and through position bias terms Compensate for text structure information; for two pieces of text , The Jaccard similarity calculation formula is: wherein, and are the word sets of texts and respectively, the fuzzy membership function handles the fuzzy word boundary problem, the semantic weight function dynamically adjusts the weight of the intersection and union calculation according to the importance of the word; the information difference between two vectors is: where , is the information entropy of two vectors, is the mutual information between two vectors, the comprehensive similarity calculation method is given based on the above metrics: wherein, , and are weight parameters adjustable according to text type differences.
12. The DTS intelligent interaction system of fusing a large language model and a vector database according to claim 11, characterized in that, The most relevant knowledge segment and the dialogue context provided by the memory mechanism are combined as inputs to drive the large language model to generate the final intelligent question and answer response, including: A dynamic context processing and memory mechanism is introduced, which is mainly realized through a memory component, the information writing process of the memory component is represented as: The information reading process of the memory component is represented as: wherein, represents a memory component, represents a memory storage process, represents a memory reading process, represents other components in a chain workflow, represents information generated by other components, represents information stored in a memory module; the memory module compresses the chat history and user queries in each interaction, indexes and retrieves them as new queries, and inputs the retrieved context together with the original user message to a large language model to generate a final answer.
13. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the steps of the DTS intelligent interaction method of fusing the large language model and the vector database according to any one of claims 1 to 6.
14. A computer-readable storage medium, the computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the DTS intelligent interaction method of fusing the large language model and the vector database according to any one of claims 1 to 7.
Citation Information
Cited By
Large model semantic representation generation method based on scene knowledge fusion
CN122112236A
A large model semantic representation generation method based on scene knowledge fusion
CN122112236B