A thinking chain question and answer data synthesis method and device for a power dispatching scene
By using a thought chain question-and-answer data synthesis method for power dispatch scenarios, and leveraging a large language model for data slicing and multi-strategy selection, the problems of correctness and diversity of generated data in power dispatch scenarios are solved, and the professional adaptability and intelligent question-and-answer capabilities of the large model are improved.
Patent Information
- Application Number
- CN202511329646.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-17
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2045-09-17
AI Technical Summary
Existing large language models suffer from poor accuracy, homogeneous content, and incomplete knowledge coverage when generating thought chain question-and-answer data in power dispatching scenarios, making it difficult to meet the demand for high-quality data.
A thought chain question-and-answer data synthesis method for power dispatch scenarios is adopted. Typical power industry data is acquired and sliced to construct a slice database and a seed database. A large language model is used to synthesize thought chain question-and-answer data according to the set synthesis instruction prompts, including fast thinking and slow thinking forms. The method introduces a raw data slicing mechanism, multi-strategy selection of seed data, and refined synthesis instruction arrangement.
It improves the accuracy, diversity, and knowledge coverage of the generated data, provides high-quality training samples, significantly enhances the interpretability and practicality of large models in professional fields, and supports intelligent question-answering systems for large models in the power industry.
Smart Images

Figure CN121303370B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology, and specifically relates to a method and apparatus for synthesizing Chain of Thought (CoT) question-and-answer data for power dispatching scenarios. Background Technology
[0002] In recent years, Large Language Models (LLMs) have made groundbreaking progress in semantic understanding, knowledge representation, and reasoning capabilities. Driven by instruction fine-tuning technology based on foundational models such as LLaMA (Large Language Model Meta AI) and GPT (Generative Pre-trained Transformer), large scheduling model systems have demonstrated strong application potential in the power industry. In particular, by rationally designing prompt words, contextual examples, and input structures, large scheduling models can not only accurately understand user intent but also invoke power grid analysis models according to context, assisting dispatchers in making intelligent decisions.
[0003] The effectiveness of large-scale scheduling models in power scenarios hinges on the quality, quantity, and diversity of the thought chain question-and-answer data used during fine-tuning. Power business is characterized by high specialization, dense terminology, and fragmented knowledge, leading to significant shortcomings in traditional data generation methods based on general techniques like Self-Instruct. These shortcomings include: the generated thought chain question-and-answer data often suffers from low accuracy and obvious content illusions; the generated samples are often simple variations of seed data, lacking diversity; and there are blind spots in covering original business knowledge slices, making it difficult to meet the high-quality data requirements for large-scale model fine-tuning. Summary of the Invention
[0004] The purpose of this invention is to provide a method and apparatus for synthesizing thought chain question-and-answer data for power dispatching scenarios, so as to solve the technical problems of poor accuracy, homogenization of content and incomplete knowledge coverage in the generation of thought chain question-and-answer data by existing large language models in power dispatching scenarios.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, this invention provides a method for synthesizing thought chain question-and-answer data for power dispatching scenarios, comprising the following steps: Obtain selected typical data from the power industry; wherein, the typical data from the power industry is document-type data or test question-type data; Based on selected typical data from the power industry, the selected large language model is used to synthesize thought chain question and answer data according to the set synthesis instruction prompt words to obtain thought chain question and answer data for power dispatch scenarios. in, For document-type data, first, slice processing is performed to obtain a slice database, and a preset number of slice data are selected to build a seed database; then, slice data is selected from the slice database and seed data is selected from the seed database in a preset order; for the selected slice data and seed data, the selected large language model is used and the set synthesis instruction prompt words are used to synthesize mind chain question and answer data. For test question data, the thought chain question and answer data is synthesized using either a fast thinking or slow thinking method. When synthesizing thought chain question and answer data using the fast thinking method, the synthesized thought chain question and answer data only contains questions and answers. When synthesizing thought chain question and answer data using the slow thinking method, the synthesized thought chain question and answer data contains questions, answers, and thought chains, and the thought chains are synthesized based on questions and answers.
[0006] A further improvement to the technical solution of this invention lies in the step of synthesizing thought chain question-and-answer data using a selected large language model and according to set synthesis instruction prompts for selected slice data and seed data. The synthesis instruction prompts include: persona information prompts, data synthesis requirement prompts, slice data, seed data, and output requirements; wherein, The character profile prompt is, "You are an excellent expert in synthesizing Q&A data in the power industry." The prompt for data synthesis is: "Please refer to the question-and-answer data example and synthesize new question-and-answer data based on the given original data and output requirements; where slice data serves as the original data; seed data serves as the question-and-answer data example; output requirements include format requirements."
[0007] A further improvement to the technical solution of the present invention is that the output requirement is specifically to generate new question and answer data directly in JSON format, without adding any analysis or explanation before or after it; The specific fields in the JSON format are {"Question": "...", "Think": "...", "Answer": "..."}.
[0008] A further improvement to the technical solution of the present invention lies in the step of first performing slicing processing on document-type data to obtain a slice database, and then selecting a preset number of slice data to construct a seed database. For document data whose length exceeds a preset threshold, data slicing is performed using methods such as chapter segmentation, fixed window sliding, semantic boundary division, or structural tag extraction to obtain a slice database; wherein, the length of each slice data in the slice database is within a set length range, and adjacent slice data are set to have a certain degree of overlap; In addition, a seed database is constructed by selecting a preset number of slice data from the slice database through random selection, similarity selection, keyword matching, topic classification preset, or information retrieval.
[0009] A further improvement to the technical solution of this invention lies in the following format for synthesizing thought chain question-and-answer data in the fast-thinking format: { “context”: “You are an excellent expert in the power industry. Please answer the multiple-choice questions according to the following rules: Carefully read the questions and options to ensure you understand the core requirements of the questions; if a question has more than one correct option, output the content of the correct option and its identifier; pay attention to factual accuracy and beware of word traps in your thinking process; Question: …; Options: …; Answer: …” "target": "The content of the correct option; the option identifier of the correct option;" }
[0010] A further improvement to the technical solution of this invention lies in the fact that, when synthesizing thought chain question-and-answer data in a slow-thinking manner, the specific method of thought chain synthesis based on questions and answers is as follows: Use the rewritten content based on "question and correct answer" as the thought chain; or, use the rewritten content based on "question, correct answer, and incorrect answer" as the thought chain; or, modify the original question into the opposite question while filtering out model illusions, and use the rewritten content as the thought chain.
[0011] A further improvement of the technical solution of the present invention is that, when synthesizing thought chain question-and-answer data in the form of slow thinking, the synthesized thought chain question-and-answer data includes a reasoning part and a final response part.
[0012] In a second aspect, the present invention provides a thought chain question-and-answer data synthesis system for power dispatching scenarios, comprising: The data acquisition module is used to acquire selected typical data from the power industry; wherein, the typical data from the power industry is document-type data or test question-type data; The data synthesis module is used to synthesize thought chain question and answer data based on selected typical data in the power industry, using a selected large language model and set synthesis instruction prompts, to obtain thought chain question and answer data for power dispatch scenarios. in, For document-type data, first, slice processing is performed to obtain a slice database, and a preset number of slice data are selected to build a seed database; then, slice data is selected from the slice database and seed data is selected from the seed database in a preset order; for the selected slice data and seed data, the selected large language model is used and the set synthesis instruction prompt words are used to synthesize mind chain question and answer data. For test question data, the thought chain question and answer data is synthesized using either a fast thinking or slow thinking method. When synthesizing thought chain question and answer data using the fast thinking method, the synthesized thought chain question and answer data only contains questions and answers. When synthesizing thought chain question and answer data using the slow thinking method, the synthesized thought chain question and answer data contains questions, answers, and thought chains, and the thought chains are synthesized based on questions and answers.
[0013] In a third aspect, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the thought chain question-and-answer data synthesis method for power dispatch scenarios as described in any one of the first aspects of the present invention.
[0014] In a fourth aspect, the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the thought chain question-answering data synthesis method for power dispatching scenarios as described in any one of the first aspects of the present invention.
[0015] Compared with the prior art, the present invention has the following beneficial effects: This invention discloses a method for synthesizing thought chain question-and-answer data for power dispatch scenarios. Specifically, it is a method for synthesizing power grid dispatch thought chain data based on a large language model. It introduces techniques such as original data slicing, multi-strategy selection of seed data, and refined synthesis instruction arrangement to improve the accuracy, diversity, and knowledge coverage of the generated data. This provides high-quality training samples for fine-tuning large power industry models, promoting the application and performance optimization of intelligent dispatch question-and-answer systems. In summary, the technical solution disclosed in this invention can automatically synthesize high-quality fine-tuning training data through a structured process, further significantly improving the interpretability and practicality of large models in professional fields.
[0016] In a further preferred embodiment, this invention constructs a structured synthesis instruction prompt template for document-type data, which can guide a large language model to generate question-and-answer content containing reasoning chains. Furthermore, this invention constructs synthesis methods for two data types—fast thinking and slow thinking—for test-type data, and provides specific thought-linking synthesis methods.
[0017] In a further preferred technical solution, the present invention adopts a mechanism that combines raw data and seed data to segment large-volume documents according to structural or semantic logic, ensuring that each data unit has independence and contextual integrity; in addition, by using a multi-strategy seed data selection method, including random selection and semantic similarity matching, the present invention provides Few-Shot guidance for the generation process, thereby enhancing the diversity and adaptability of the generated content.
[0018] In summary, the technical solution of this invention employs advanced artificial intelligence algorithms to automatically generate question-and-answer pairs with a thought chain structure related to power dispatching, thereby enabling multi-step reasoning and accurate solutions to dispatching problems. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating a method for synthesizing thought chain question-and-answer data for power dispatch scenarios, as described in an embodiment of the present invention. Figure 2 This is a schematic diagram of the document data synthesis process in an embodiment of the present invention; Figure 3 This is a schematic diagram of the test question data synthesis process in an embodiment of the present invention; Figure 4 This is a schematic diagram of a thought chain question-and-answer data synthesis system for power dispatching scenarios, as described in an embodiment of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention; obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0022] Based on the technical solutions disclosed in the embodiments of this invention, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of this invention. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.
[0023] Please see Figure 1 Given that existing large-scale model fine-tuning data generated based on general methods such as Self-Instruct have significant shortcomings in terms of correctness, diversity, and knowledge coverage, making it difficult to meet the data requirements of high-quality CoT question-answering in power dispatching scenarios, this invention proposes a method for synthesizing thought chain question-answering data for power dispatching scenarios. Specifically, it is a power grid dispatching thought chain data synthesis method based on a large language model, which can effectively improve the professional adaptability and reasoning ability of large language model fine-tuning. The method includes the following steps: Step 1: Obtain selected typical data from the power industry; wherein, the typical data from the power industry is document-type data or test question-type data; Step 2: Based on selected typical data from the power industry, use the selected large language model to synthesize thought chain question and answer data according to the set synthesis instruction prompts to obtain thought chain question and answer data for power dispatch scenarios. in, For document-type data, first, slice processing is performed to obtain a slice database, and a preset number of slice data are selected to build a seed database; then, slice data is selected from the slice database and seed data is selected from the seed database in a preset order; for the selected slice data and seed data, the selected large language model is used and the set synthesis instruction prompt words are used to synthesize mind chain question and answer data. For test question data, the thought chain question and answer data is synthesized using either a fast thinking or slow thinking method. When synthesizing thought chain question and answer data using the fast thinking method, the synthesized thought chain question and answer data only contains questions and answers. When synthesizing thought chain question and answer data using the slow thinking method, the synthesized thought chain question and answer data contains questions, answers, and thought chains, and the thought chains are synthesized based on questions and answers.
[0024] The technical solution provided in this invention combines typical power industry data sources (exemplarily, these may include dispatcher exam questions, regulations manuals, basic knowledge bases, marketing test questions, and daily morning meeting documents) with a large language model. It designs a refined synthesis instruction arrangement and data slicing mechanism to construct a professional, structured, and highly controllable CoT question-and-answer pair generation process. Through the synergistic effect of seed data selection and diverse generation strategies, it efficiently extracts and generates question-and-answer data that conforms to format specifications and has clear logic from the original business content. Further, the overall process of the technical solution in this invention includes: prompt synthesis, question-and-answer pair (QA pair) synthesis, etc., extracting dispatch elements from real business slices, constructing diverse question templates, and guiding the large speech model to generate answers with logical reasoning. Furthermore, a quality inspection mechanism that integrates preset rules and algorithms ensures the correctness and coverage of the data, thereby significantly improving the professionalism, interpretability, and practical value of the fine-tuned data, providing a solid data foundation for building a high-quality power dispatching model.
[0025] Please see Figure 2 and Figure 3 The CoT data synthesis process of the technical solution of this invention includes data screening, QA pair synthesis, and thought chain synthesis; among which, the document data processing process is as follows: Figure 2 As shown, the data processing flow for test questions is as follows: Figure 3 As shown.
[0026] Specifically, as an example, the scope and method of CoT data generation are shown in Table 1, which includes 9 original data sources, in two main categories (question data and document data).
[0027] Table 1. Examples of data types and data content
[0028] Please see Figure 2 In the specific example of the technical solution of this invention, the process of synthesizing document-type data is as follows: The synthesis of document-type data is based on raw data and seed data, and new CoT data is synthesized through methods such as manual synthesis and large-scale model synthesis; these include: 1) Raw Data Slicing: Raw data types include documents, web pages, manuals, books, etc. Shorter documents or web pages do not require slicing; manuals or books require slicing, dividing the document into chapters or similar categories. Each slice, within a set length range (default 512 tokens), has a 20% content overlap to ensure slice independence and facilitate the generation of suitable data from subsequent large models. Further explanation: in addition to scheduling questions, regulations, and daily reports, operation logs, operation tickets, incident reports, and customer service FAQs can also be used as raw data sources. Furthermore, besides chapter-based slicing, fixed-window sliding, semantic boundary division, and structural label extraction methods can also be used for data slicing.
[0029] 2) Seed Data Selection: Seed data guides the large model in generating suitable CoT data from data slices. Essentially, it's a few-shot approach, preventing the model from generating data that doesn't meet actual needs. This embodiment uses two methods: random selection and similarity selection. Random selection involves selecting 3-5 seed data points each time, repeating multiple times until the required number is met. Similarity selection is based on the content of the current data slice, sorting them according to the relevance of the text embedding, and selecting the corresponding number of slices in that order of relevance. Further explanation: seed data can be obtained through random selection, keyword matching, topic classification presets, information retrieval, or by not using seeds at all.
[0030] 3) Synthesis Prompt: Sets prompts to guide the large model on how to generate new CoT data; the exemplary format includes the following points in order: Character profile: "You are an excellent expert in synthesizing Q&A data in the power industry." The data synthesis requirements state, "Please refer to the question-and-answer data example and synthesize new question-and-answer data based on the given original data and data synthesis requirements. Specific data synthesis requirements are as follows:..." Data slices are selected from the slice dataset, and by default, they are selected sequentially from the data slice set. Each data slice is used to generate one or more new CoT data. Seed data, selected from the seed database; Output requirements, including formatting requirements, such as "Now please generate new question and answer data in the following format (generate the data directly, do not add any analysis or explanation before or after):..."; Formatting requirements: To facilitate parsing and processing of the generated CoT data, it must be in JSON format. Specific fields are as follows: { “Question”: “…”, “Think”: “…”, “Answer”: “…”}.
[0031] 4) Large Language Models: Supports currently available open-source large models, such as DeepSeek, Qwen, GPT, LLaMA, ChatGLM, Baichuan, Claude and other generative models.
[0032] Please see Figure 3 In the technical solution of a specific example of the present invention, the synthesis process of test question data is as follows; wherein, the generated CoT data is divided into two categories, namely slow thinking and fast thinking.
[0033] The quick thinking format only includes Q and A, without any thought process chain, and uses the answer to the question directly as the target, in the following format: { "context": "You are an excellent expert in the power industry. Please answer the multiple-choice questions according to the following rules:\n1. Carefully read the questions and options to ensure you understand the core requirements of the questions.\n2. If there is more than one correct option, output the content of the correct option and the number of the option (e.g., "1, 3" or "2, 4").\n3. Pay attention to factual accuracy and beware of word traps in your thinking process.\nQuestion: What impact do harmonics in the power system have on the power quality of the power grid?\n\nOptions:\n1. Voltage and current waveforms are distorted\n2. Voltage waveform is distorted, current waveform is not distorted\n3. Reduces grid voltage\n4. Increases grid voltage\nAnswer:\n", "target": "\n\nVoltage and current waveforms are distorted, reducing the mains voltage. 1, 3" }
[0034] For the slow thinking format, which includes Q, A, and thought chains, to ensure the correctness of the thought chains, we do not use thought chains obtained by teacher models such as DS and Qwen (because the accuracy of the data cannot be guaranteed). Instead, we use thought chains synthesized based on the original questions and answers, including but not limited to the following forms: (1) The content rewritten based on "question + correct answer" serves as a thought chain, for example: { "system:": "You are an excellent expert in the power industry, focusing on providing high-quality, factual answers to user questions. Your answers include both reasoning and a final response. Please first..." <think> ...< / think> Use the tags to reason and think, and then give the final response. "context": "Please answer the multiple-choice questions according to the following rules:\n1. Carefully read the question and options to ensure you understand the core requirements of the question.\n2. If there is only one correct option, output the content of the correct option and the number of the option (e.g., "1" or "2").\n3. Pay attention to factual accuracy and beware of word traps in your thinking process.\nQuestion: What impact do harmonics in a power system have on the power quality of the power grid?\n\nOptions:\n1. Voltage and current waveforms are distorted\n2. Voltage waveform is distorted, current waveform is not distorted\n3. The grid voltage is reduced\n4. The grid voltage is increased\n", "target": " <think> The impact of harmonics in a power system on the power quality of the grid includes distortion of voltage and current waveforms; therefore, the answer is 1.< / think> The content states: Voltage and current waveforms are distorted. 1"}
[0035] In addition, to enhance the generalizability of the data, the position of the options can be changed to rewrite the data.
[0036] (2) Use the rewritten content based on "question + correct answer + wrong answer" as a thought chain, for example: { "system:": "You are an excellent expert in the power industry, focusing on providing high-quality, factual answers to user questions. Your answers include both reasoning and a final response. Please first..." <think> ...< / think> Use the tags to reason and think, and then give the final response. "context": "Please answer the multiple-choice questions according to the following rules:\n1. Carefully read the question and options to ensure you understand the core requirements of the question.\n2. If there is only one correct option, output the content of the correct option and the number of the option (e.g., "1" or "2").\n3. Pay attention to factual accuracy and beware of word traps in your thinking process.\nQuestion: What impact do harmonics in a power system have on the power quality of the power grid?\n\nOptions:\n1. Voltage and current waveforms are distorted\n2. Voltage waveform is distorted, current waveform is not distorted\n3. The grid voltage is reduced\n4. The grid voltage is increased\n", "target": " <think> The impact of harmonics in a power system on the power quality of the grid includes distortion of voltage and current waveforms, but does not include lowering or raising the grid voltage. Therefore, the answer is 1.< / think> The voltage and current waveforms are distorted. }
[0037] (3) To change the original problem into its opposite, the original problem needs to be modified, and the model illusion content needs to be filtered out, for example: { "system:": "You are an excellent expert in the power industry, focusing on providing high-quality, factual answers to user questions. Your answers include both reasoning and a final response. Please first..."<think> ...< / think> Use the tags to reason and think, and then give the final response. "context": "Please answer the multiple-choice questions according to the following rules:\n1. Carefully read the questions and options to ensure you understand the core requirements of the questions.\n2. If there is only one correct option, output the content of the correct option and the number of the option (e.g., "1, 2" or "2, 4").\n3. Pay attention to factual accuracy and beware of word traps in your thinking process.\nQuestion: Which of the following options have no impact on the power quality of the power grid?\n\nOptions:\n1. Voltage and current waveforms are distorted\n2. Voltage waveform is distorted, current waveform is not distorted\n3. Lower the grid voltage\n4. Increase the grid voltage\n", "target": " <think> The impact of harmonics in a power system on the power quality of the grid includes distortion of voltage and current waveforms, but does not include lowering or raising the grid voltage. Therefore, the answers are 2, 3, and 4.< / think> 2. Voltage waveform is distorted, current waveform is not distorted. 3. Reduce grid voltage. 4. Increase grid voltage. (2, 3, 4) }
[0038] In the technical solution of the above embodiments, when the thought chain question-and-answer data is synthesized in the slow thinking form, the synthesized thought chain question-and-answer data includes a reasoning part and a final response part.
[0039] Explained in the context of the prior art, the existing Self-Instruct technique mentioned in the background is an efficient method for constructing fine-tuning data for large language models. Its core idea is to utilize a small amount of manually annotated high-quality seed data, combined with the language generation capabilities of the large speech model itself, to automatically synthesize more fine-tuning sample data that meets format and semantic requirements, thereby significantly reducing manual costs. Specifically, the aforementioned data construction method typically includes three steps: First, constructing high-quality, diverse seed data to cover as wide a range of task styles and semantic expressions as possible; second, in the generation stage, randomly selecting a small number of seed instructions as examples, and designing refined prompts based on user needs, context, and reference documents to guide the large language model in generating new question-and-answer data; finally, through filtering and post-processing mechanisms, eliminating duplicate, low-quality, or logically inconsistent data samples to ensure the correctness, diversity, and usability of the generated data. While the aforementioned existing methods are suitable for large-scale instruction data expansion in general scenarios, they still present certain challenges in the application of power dispatching. In view of the above, the applicant proposes the novel solution described in the embodiments of this invention.
[0040] Existing Self-Instruct-generated question-and-answer content often lacks reliable factual support, and is particularly prone to logical errors, misuse of terminology, leaps in reasoning, and even fabricated background knowledge in specialized fields. This is especially true when generating CoT structures, where seemingly reasonable but actually erroneous chains of reasoning can occur. Analysis reveals that the root cause lies in Self-Instruct's default reliance on open-source language modeling, lacking a structured mechanism for referencing raw data, and the fact that synthesized instructions are typically based solely on task definitions rather than specific business data. In contrast, the method proposed in this invention enforces a focus on raw business data slices and pre-defined constraints, controlling the reasoning chain structure through instruction orchestration, effectively mitigating the risk of generating illusory content.
[0041] In existing Self-Instruct techniques, the generation process largely relies on "imitating" seed data. While different question-and-answer samples may vary in form, they are often semantically and structurally similar. This makes it difficult for fine-tuned models to handle novel or complex instructions, limiting their generalization ability. Especially in complex scenarios, model responses tend to "memorize templates." Analysis reveals that the root cause lies in the overly simplistic use of seed data, which is highly random but lacks contextual relevance and fails to leverage business structural features for diversified generation. In contrast, the method proposed in this invention supports dual-channel generation: fast thinking (combining question Q and answer A) and slow thinking (combining question Q, answer A, and thought chain). It introduces techniques such as question rewriting, interference utilization, and option order transformation, and allows the construction of reasoning logic based on combinations of correct or incorrect answers, significantly enhancing data structure and content diversity.
[0042] In existing Self-Instruct technologies, the generation process often revolves around a small number of seed tasks, easily falling into "task centralization" or "knowledge blind spots." The model cannot accurately respond to certain business processes in the scheduling system, resulting in knowledge gaps. Analysis reveals that the root cause lies in the lack of systematic segmentation analysis of the original business data, leading to the generation of data concentrated on a few familiar tasks while ignoring marginal or low-frequency scheduling conditions. In contrast, the method proposed in this invention performs chapter-based segmentation, segment matching with seeds, and multi-round generation for different document types. By setting "personas, synthesis requirements, segment inputs, and precise instruction arrangement," it covers multiple sources such as the power dispatch knowledge base, regulations, marketing knowledge, and exam question banks, achieving a systematic and panoramic knowledge generation.
[0043] In summary, large language models have been widely used in fine-tuning instructions in general domains, with typical methods such as Self-Instruct guiding the model to generate training samples using a small amount of seed data. However, these existing methods have significant shortcomings in specialized scenarios such as power dispatching, often exhibiting problems such as poor accuracy of generated content, missing reasoning chains, and high sample repetition. Furthermore, they struggle to cover the breadth and depth of actual business knowledge, failing to meet the demands of high-quality fine-tuning. Therefore, this invention proposes a method for generating thought chain question-and-answer data for power dispatching. This method achieves automated, high-quality CoT question-and-answer data synthesis through raw data slicing, multi-strategy seed selection, prompt word template design, and structured output control. Compared to existing methods, the technical solution of this invention outperforms these methods in terms of correctness, diversity, and knowledge coverage, providing strong data support for fine-tuning large power dispatching models and demonstrating significant industry adaptability and practical application value.
[0044] Technical terms are explained in a supplementary manner. Large Language Models (LLMs): These are deep neural network models trained on massive amounts of text data. They possess powerful natural language understanding and generation capabilities and can perform various language tasks such as question answering, translation, summarization, and reasoning. These models typically have billions or even hundreds of billions of parameters and are capable of learning semantic relationships from context and autonomously generating language content. They are one of the core technologies in the field of artificial intelligence natural language processing.
[0045] Instruction fine-tuning refers to the process of further training a large language model after pre-training using a set of high-quality samples consisting of "instructions and responses". The aim is to improve the model's ability to understand and execute user instructions. Through this process, the model can respond more accurately to instructional inputs (such as questions, requests, and commands) in accordance with the task objectives, thereby enhancing its practicality and human-computer interaction performance.
[0046] Prompt: refers to the input text used to guide the large language model to generate target content. It usually consists of elements such as role setting, task description, contextual examples, data fragments, and output format requirements.
[0047] Question-answer pairs (QA pairs) are data units consisting of a user question and its corresponding model answer. They are the basic data form for training and evaluating large language models.
[0048] Thinking Chain (CoT): This is a method that simulates the human reasoning process. In a large language model, it guides the model to express the intermediate thinking process step by step, thereby improving the ability to understand and solve complex problems (such as mathematics, logic, scheduling, etc.).
[0049] In summary, as the intelligence level of power systems continues to improve, dispatching assistance and intelligent question-answering systems based on large language models are gradually becoming an important direction for the next generation of intelligent operation and maintenance of power grids. Currently, the demand for models with professional knowledge and reasoning capabilities in power dispatching scenarios is increasing, especially in fault diagnosis, regulation interpretation, and knowledge-based question answering, where the reliance on high-quality question-answering data is particularly prominent. The thought chain question-answering data generation method proposed in this invention can efficiently construct training samples with logical reasoning structures, significantly improving the professional adaptability and intelligence level of large models in the power industry. This technology can be widely applied in scenarios such as dispatch control centers, intelligent customer service, and emergency command platforms, and can be expanded to multiple sub-fields such as distribution network automation, operation and maintenance assistance, and marketing services in the future. As the digitalization and intelligentization of power grids continue to deepen, the demand and application scale of this type of technology will continue to expand, possessing good prospects for promotion and commercialization potential. To further explain, this invention integrates the original data slicing mechanism, seed data multi-strategy selection, and prompt word template technology to propose a power grid dispatch thinking chain data synthesis scheme based on a large language model. This scheme aims to address the problems of poor accuracy, content homogenization, and insufficient knowledge coverage in existing methods for generating CoT question-and-answer data in power dispatch scenarios. Through a standardized Prompt orchestration process, it guides the large language model to generate high-quality question-and-answer data with reasoning logic from real business corpora, comprehensively improving the accuracy, diversity, and knowledge coverage of the generated data. This provides strong data support for the fine-tuning of large models and the construction of intelligent question-and-answer systems in the power dispatch field.
[0050] The following are embodiments of the apparatus of the present invention, which can be used to execute embodiments of the method of the present invention. For details not disclosed in the apparatus embodiments, please refer to the embodiments of the method of the present invention.
[0051] Please see Figure 4 In this embodiment of the invention, a thought chain question-and-answer data synthesis system for power dispatching scenarios is provided, comprising: The data acquisition module is used to acquire selected typical data from the power industry; wherein, the typical data from the power industry is document-type data or test question-type data; The data synthesis module is used to synthesize thought chain question and answer data based on selected typical data in the power industry, using a selected large language model and set synthesis instruction prompts, to obtain thought chain question and answer data for power dispatch scenarios. in, For document-type data, first, slice processing is performed to obtain a slice database, and a preset number of slice data are selected to build a seed database; then, slice data is selected from the slice database and seed data is selected from the seed database in a preset order; for the selected slice data and seed data, the selected large language model is used and the set synthesis instruction prompt words are used to synthesize mind chain question and answer data. For test question data, the thought chain question and answer data is synthesized using either a fast thinking or slow thinking method. When synthesizing thought chain question and answer data using the fast thinking method, the synthesized thought chain question and answer data only contains questions and answers. When synthesizing thought chain question and answer data using the slow thinking method, the synthesized thought chain question and answer data contains questions, answers, and thought chains, and the thought chains are synthesized based on questions and answers.
[0052] In one embodiment of the present invention, a computer device is provided, comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in the computer storage medium to achieve a corresponding method flow or corresponding function. The processor described in this embodiment can be used to execute the operation of a thought chain question-and-answer data synthesis method for power dispatching scenarios.
[0053] In one embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM (Random Access Memory) or non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the thought chain question-and-answer data synthesis method for power dispatch scenarios in the above embodiments.
[0054] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, etc.) containing computer-usable program code.
[0055] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations 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 processor, 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, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0056] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0057] These computer program instructions may 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, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0058] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for synthesizing thought chain question-and-answer data for power dispatching scenarios, characterized in that, Includes the following steps: Obtain selected typical data from the power industry; wherein, the typical data from the power industry is document-type data or test question-type data; Based on selected typical data from the power industry, the selected large language model is used to synthesize thought chain question and answer data according to the set synthesis instruction prompt words to obtain thought chain question and answer data for power dispatch scenarios. in, For document-type data, first, slice processing is performed to obtain a slice database, and a preset number of slice data are selected to build a seed database; then, slice data is selected from the slice database and seed data is selected from the seed database in a preset order; for the selected slice data and seed data, the selected large language model is used and the set synthesis instruction prompt words are used to synthesize mind chain question and answer data. For test question data, the thought chain question and answer data is synthesized in either a fast thinking or slow thinking format. When synthesizing thought chain question and answer data in the fast thinking format, the synthesized thought chain question and answer data only contains questions and answers. When synthesizing thought chain question and answer data in the slow thinking format, the synthesized thought chain question and answer data contains questions, answers, and thought chains, and the thought chains are synthesized based on questions and answers. In the step of first performing slicing processing on document-type data to obtain a slice database, and then selecting a preset number of slice data to construct a seed database, for document-type data whose length exceeds a preset threshold, data slicing is performed using methods such as chapter-based segmentation, fixed window sliding, semantic boundary division, or structural tag extraction to obtain a slice database; wherein, the length of each slice data in the slice database is within a set length range, and adjacent slice data are set with an overlap; in addition, a preset number of slice data are selected from the slice database to construct the seed database through random selection, similarity selection, keyword matching, preset topic classification, or information retrieval.
2. The method for synthesizing thought chain question-and-answer data for power dispatching scenarios according to claim 1, characterized in that, In the step of synthesizing thought chain question-and-answer data using a selected large language model and according to the set synthesis instruction prompts for the selected slice data and seed data, the synthesis instruction prompts include: persona information prompts, data synthesis requirement prompts, slice data, seed data, and output requirements; wherein, The character profile prompt is, "You are an excellent expert in synthesizing Q&A data in the power industry." The prompt for data synthesis is: "Please refer to the question-and-answer data example and synthesize new question-and-answer data based on the given original data and output requirements; where slice data serves as the original data; seed data serves as the question-and-answer data example; output requirements include format requirements." 3. The method for synthesizing thought chain question-and-answer data for power dispatching scenarios according to claim 2, characterized in that, The specific output requirement is to generate new question-and-answer data directly in JSON format, without adding any analysis or explanation before or after it. The specific fields in the JSON format are {"Question": "...", "Think": "...", "Answer": "..."}.
4. A method for synthesizing thought chain question-and-answer data for power dispatching scenarios according to claim 1, characterized in that, The format for synthesizing thought chain question-and-answer data in the quick thinking format is as follows: { "context": "You are an excellent expert in the power industry. Please answer the multiple-choice questions according to the following rules: Carefully read the questions and options to ensure you understand the core requirements of the questions; if a question has more than one correct option, output the content of the correct option and its identifier; pay attention to factual accuracy and beware of word traps in your thinking process; Question: ...; Options: ...; Answer: ..." "target": "The content of the correct option; the option identifier of the correct option;" }。 5. The method for synthesizing thought chain question-and-answer data for power dispatching scenarios according to claim 1, characterized in that, When using the slow-thinking approach to synthesize thought chain question-and-answer data, the specific method by which the thought chain is synthesized based on questions and answers is as follows: Use the rewritten content based on "question and correct answer" as the thought chain; or, use the rewritten content based on "question, correct answer, and incorrect answer" as the thought chain; or, modify the original question into the opposite question while filtering out model illusions, and use the rewritten content as the thought chain.
6. The method for synthesizing thought chain question-and-answer data for power dispatching scenarios according to claim 5, characterized in that, When synthesizing thought chain question-and-answer data using the slow thinking method, the synthesized thought chain question-and-answer data includes the reasoning part and the final response part.
7. A thought-chain question-and-answer data synthesis system for power dispatching scenarios, characterized in that, include: The data acquisition module is used to acquire selected typical data from the power industry; wherein, the typical data from the power industry is document-type data or test question-type data; The data synthesis module is used to synthesize thought chain question and answer data based on selected typical data in the power industry, using a selected large language model and set synthesis instruction prompts, to obtain thought chain question and answer data for power dispatch scenarios. in, For document-type data, first, slice processing is performed to obtain a slice database, and a preset number of slice data are selected to build a seed database; then, slice data is selected from the slice database and seed data is selected from the seed database in a preset order; for the selected slice data and seed data, the selected large language model is used and the set synthesis instruction prompt words are used to synthesize mind chain question and answer data. For test question data, the thought chain question and answer data is synthesized in either a fast thinking or slow thinking format. When synthesizing thought chain question and answer data in the fast thinking format, the synthesized thought chain question and answer data only contains questions and answers. When synthesizing thought chain question and answer data in the slow thinking format, the synthesized thought chain question and answer data contains questions, answers, and thought chains, and the thought chains are synthesized based on questions and answers. For document-type data, the process involves first performing slicing to obtain a slice database, and then selecting a preset number of slice data to construct a seed database. For document-type data whose length exceeds a preset threshold, data slicing is performed using methods such as chapter segmentation, fixed window sliding, semantic boundary division, or structural tag extraction to obtain a slice database. Each slice data in the slice database has a length within a set range, and adjacent slice data have an overlap setting. Furthermore, a preset number of slice data are selected from the slice database using methods such as random selection, similarity selection, keyword matching, preset topic classification, or information retrieval to construct the seed database.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the thought chain question-and-answer data synthesis method for power dispatch scenarios as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the thought chain question-and-answer data synthesis method for power dispatching scenarios as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for automatically constructing instruction fine tuning sample set in power field
CN120086381A