A method and apparatus for power distribution system fault recovery based on large and small model collaboration
By collaborating with large and small models, and leveraging the textual semantic understanding and reinforcement learning capabilities of the large language model, fault information is decomposed into sub-tasks to generate power system fault recovery strategies. This solves the problems of limited coverage scenarios and utilization of prior knowledge in existing technologies, and achieves efficient and stable fault recovery strategy generation.
Patent Information
- Application Number
- CN202510129996.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-05
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2045-02-05
AI Technical Summary
In existing technologies, fault recovery strategies based on graph retrieval enhancement only cover a limited number of scenarios and cannot generate effective strategies for uncovered scenarios. Furthermore, the large amount of prior knowledge in the form of text in power systems is difficult to effectively utilize for intelligent agents.
A collaborative approach using large and small models is adopted. By combining the text semantic understanding capabilities of the large language model and the specific problem-solving capabilities of the small reinforcement learning model, fault information is decomposed into sub-tasks and fault recovery strategies are generated.
It enables efficient generation of power system fault recovery strategies, covering unknown scenarios and improving the generation performance and stability of fault recovery strategies.
Smart Images

Figure CN120012936B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method for constructing a power distribution system fault recovery intelligent agent based on big-small model collaboration. Background Technology
[0002] With the continuous expansion of the power grid and the increasing integration of new energy sources and distributed power generation, the structure of the distribution network has become more complex, increasing the difficulty of grid dispatch and control and posing challenges to grid operation safety. Traditional analysis and control technologies are no longer sufficient to meet the requirements for safe and stable grid operation. Against this backdrop, intelligent agent construction methods based on advanced technologies such as artificial intelligence and big data have emerged.
[0003] Graph retrieval augmentation generation is a retrieval augmentation generation technique that combines knowledge graphs and large language models (LLM). Its basic idea is as follows: the user poses a question, the model first analyzes the question and identifies the entities and relationships within it; it then retrieves entities and relationships related to the question from a pre-built knowledge graph; based on the keywords of the question and hints from the knowledge graph, the retrieval engine selects relevant document fragments from the document library; and the generator combines the retrieved document fragments with the knowledge graph to provide an answer.
[0004] However, the fault recovery strategy generated by graph retrieval enhancement only includes scenarios covered by the fault contingency plan; effective strategies cannot be generated for scenarios not covered. Summary of the Invention
[0005] This invention provides a method for constructing intelligent agents for power distribution system fault recovery based on large and small model collaboration. This method addresses the problem in existing technologies where it is difficult to extract and utilize the large amount of prior knowledge in the form of text in power systems for intelligent agents, thereby achieving a higher-performance intelligent agent for generating power distribution system fault recovery strategies.
[0006] This invention provides a power distribution system fault recovery method based on large and small model collaboration, applicable to large models, including:
[0007] Based on the received fault information recovery statements, retrieve the large model prompt words and large model context from the pre-built knowledge base;
[0008] The fault information recovery statement is decomposed into several sub-tasks according to a predefined task decomposition prompt word template, and the small model corresponding to each sub-task is called to execute the sub-task. At least one of the small models is trained using the demonstration-based deep Q-learning DQfD method.
[0009] A first recovery strategy is generated based on the large model prompts, the large model context, and the fault information recovery statements. A second recovery strategy is generated based on the output results of all the small models. The first recovery strategy and the second recovery strategy are used as the output fault recovery strategy. Fault recovery is performed on the power distribution system based on the fault recovery strategy.
[0010] According to the present invention, a power distribution system fault recovery method based on big-small model collaboration is characterized in that the knowledge base includes a knowledge graph base and a vector knowledge base, and the step of retrieving the big-small model prompt words and big-small model context based on the received fault information recovery statement from the pre-built knowledge base specifically includes:
[0011] Keywords from the fault information recovery statement are extracted and retrieved from the knowledge graph to obtain the large model's prompt words;
[0012] After vectorizing the fault information recovery statement, a similarity search is used to retrieve it from the vector knowledge base to obtain the large model context.
[0013] According to the present invention, a power distribution system fault recovery method based on size model collaboration, prior to the step of retrieving the received fault information recovery statement from a pre-built knowledge base, further includes:
[0014] The regulations for the power system are divided into blocks according to content.
[0015] The segmented text blocks are vectorized to construct the vector knowledge base.
[0016] Keyword extraction, entity recognition, and relation extraction are performed on each segmented text block. A knowledge graph is then constructed based on the extracted entities and the relationships between them.
[0017] According to the present invention, a power distribution system fault recovery method based on big-small model collaboration includes the following steps: decomposing the fault information recovery statement into several sub-tasks according to a predefined task decomposition prompt word template, and calling the small model corresponding to each sub-task to execute the sub-task.
[0018] Pre-design explanatory text and accompanying prompt templates for each small model, wherein the explanatory text represents the function of the small model and the accompanying prompt template represents the calling method of the small model;
[0019] Based on the explanatory text, a corresponding small model is configured for each of the sub-tasks, and the small model is called to execute the sub-task based on the matching prompt word template.
[0020] According to the present invention, a power distribution system fault recovery method based on size model collaboration, prior to the step of decomposing the fault information recovery statement into several sub-tasks according to a predefined task decomposition prompt word template, the method further includes:
[0021] Using text data containing fault information and predefined task decomposition prompt word templates as input, and the task decomposition results of the text data containing fault information as output, sample pairs are designed and a task decomposition training set is constructed.
[0022] The large model is fine-tuned on the task decomposition training set based on the LoRA low-rank adaptive method.
[0023] According to the present invention, a power distribution system fault recovery method based on small-scale model collaboration, when the small model is a fault recovery small model, before the step of calling the small model corresponding to each subtask to execute the subtask, the method further includes:
[0024] A small model dataset containing expert demonstration strategies was constructed based on the power system dispatching regulations text.
[0025] The fault recovery mini-model was obtained by training the DQfD method on the mini-model dataset.
[0026] The present invention also provides a power distribution system fault recovery device based on large-scale model collaboration, comprising:
[0027] The acquisition module is used to retrieve large model prompts and large model context based on the received fault information recovery statements in a pre-built knowledge base;
[0028] The calling module is used to decompose the fault information recovery statement into several sub-tasks according to the predefined task decomposition prompt word template, and call the small model corresponding to each sub-task to execute the sub-task, wherein at least one of the small models is trained using the demonstration-based deep Q-learning DQfD method.
[0029] The generation module is used to generate a first recovery strategy based on the large model prompt words, the large model context and the fault information recovery statement, generate a second recovery strategy based on the output results of each small model, use the first recovery strategy and the second recovery strategy as the output fault recovery strategy, and perform fault recovery on the power distribution system based on the fault recovery strategy.
[0030] The present invention also 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 executes the program to implement the power distribution system fault recovery method based on size model collaboration as described above.
[0031] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the power distribution system fault recovery method based on size model collaboration as described above.
[0032] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the power distribution system fault recovery method based on size model collaboration as described above.
[0033] This invention provides a method for constructing a power distribution system fault recovery agent based on large and small model collaboration. By employing a large-scale model collaborative approach, it effectively leverages the superior text semantic understanding and extraction capabilities of large language models, overcoming the challenge of extracting and utilizing the vast amounts of prior knowledge in power system text form for the agent. Furthermore, it utilizes the problem-solving capabilities of small reinforcement learning models to enhance the agent's fault recovery strategy generation performance. Ultimately, it achieves excellent power distribution system fault recovery strategy generation capabilities with high stability. Attached Figure Description
[0034] 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.
[0035] Figure 1 This is one of the flowcharts of the power distribution system fault recovery method based on big-small model collaboration provided by the present invention;
[0036] Figure 2 This is the second flowchart of the power distribution system fault recovery method based on big-small model collaboration provided by the present invention;
[0037] Figure 3 This is a schematic diagram of the power distribution system fault recovery device based on large and small model collaboration provided by the present invention;
[0038] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0040] The following is combined with Figure 1 and Figure 2 This invention introduces a power distribution system fault recovery method based on large and small model collaboration, such as... Figure 1 As shown, this is applied to large models, including:
[0041] Step 101: Based on the received fault information recovery statement, retrieve the large model prompt words and large model context from the pre-built knowledge base;
[0042] The received fault information recovery statement is the statement entered by the user into the large model. The fault information recovery statement contains basic fault information.
[0043] The large model retrieves the received fault information recovery statements from a pre-built knowledge base, which is based on the power system dispatching procedure text. Therefore, the retrieved large model context represents the fault recovery strategy text corresponding to the received fault information. Large model prompts guide the large model to output formatted entity and entity relationship extraction results, which are used to generate power system recovery strategies.
[0044] Step 102: Decompose the fault information recovery statement into several sub-tasks according to the predefined task decomposition prompt word template, and call the small model corresponding to each sub-task to execute the sub-task, wherein at least one of the small models is trained using the demonstration-based deep Q-learning DQfD method.
[0045] The large model decomposes the received fault information recovery statements into several sub-tasks based on a predefined task decomposition prompt word template.
[0046] Small models corresponding to possible subtasks in the power system are pre-trained. After the received fault information recovery statement is decomposed into subtasks, a small model corresponding to each subtask is allocated based on the specific content of the subtask, and the small model executes the subtask.
[0047] Optionally, subtasks may include tasks directly related to fault recovery, such as fault recovery strategy generation tasks; subtasks may also include tasks indirectly related to fault recovery, such as fault recovery strategy accuracy assessment tasks.
[0048] Among them, at least one small model used to perform the sub-task is a fault recovery small model trained based on the DQfD (Deep Q-Learning from Demonstrations) method.
[0049] DQfD is a method that combines deep reinforcement learning and imitation learning. The core idea of DQfD is to train an agent by combining expert demonstration data and reward signals in reinforcement learning. It aims to accelerate and improve the training process of reinforcement learning algorithms by utilizing expert demonstration data.
[0050] The problem-solving small model trained using the DQfD method relies heavily on expert demonstration data in the early stages of training. As training progresses, the reliance on expert data gradually decreases, and the model relies more on the agent's own exploratory data. In other words, during training, the agent's own exploration enhances the small model's ability to solve specific problems, improving its performance in generating fault recovery strategies and enabling it to generate effective solutions for unknown faults.
[0051] Step 103: Generate a first recovery strategy based on the large model prompt words, the large model context, and the fault information recovery statement; generate a second recovery strategy based on the output results of all the small models; use the first recovery strategy and the second recovery strategy as the output fault recovery strategy; and perform fault recovery on the power distribution system based on the fault recovery strategy.
[0052] The large model generates the first recovery strategy based on the large model prompt words, the large model context, and the fault information recovery statement.
[0053] At the same time, a second recovery strategy is generated based on the output results of all small models.
[0054] In generating fault recovery strategies, the large model regularizes fault information and calls reinforcement learning smaller models based on prompts. Based on the fault information, a power distribution system simulation is performed under a given operating scenario to construct a reinforcement learning state space. The fault recovery strategy is then generated through a DQfD model and output by the large model.
[0055] It is understandable that the first recovery strategy represents the power system recovery strategy generated based on graph retrieval enhancement, while the second recovery strategy represents the power system recovery strategy obtained based on a reinforcement learning small model. For fault information in existing problem scenarios, the first recovery strategy can provide a more standardized solution, while for fault information in unknown scenarios, the second recovery strategy can also provide a reasonable solution.
[0056] The large model uses both the first and second recovery strategies as the output of the fault recovery statement input by the user. This allows the user to determine a more suitable fault recovery strategy based on the actual situation, using the first and / or second recovery strategies. As a result, the selected fault recovery strategy enables more accurate and rapid fault recovery of the power distribution system.
[0057] This invention effectively leverages the superior text semantic understanding and extraction capabilities of large language models by employing a collaborative approach of large and small models. This overcomes the challenge of extracting and utilizing the vast amounts of prior knowledge in power system text for intelligent agents. Furthermore, it utilizes the problem-solving capabilities of small reinforcement learning models to enhance the agent's performance in generating fault recovery strategies. Ultimately, this results in a robust and stable ability to generate fault recovery strategies for power distribution systems.
[0058] In the power distribution system fault recovery method based on big-small model collaboration of the present invention, the knowledge base includes a knowledge graph base and a vector knowledge base. The step of retrieving the big-small model prompt words and big-small model context based on the received fault information recovery statement from the pre-built knowledge base specifically includes:
[0059] Keywords from the fault information recovery statement are extracted and retrieved from the knowledge graph to obtain the large model's prompt words;
[0060] After vectorizing the fault information recovery statement, a similarity search is used to retrieve it from the vector knowledge base to obtain the large model context.
[0061] In this embodiment, the knowledge base includes a knowledge graph base and a vector knowledge base.
[0062] Among them, the knowledge graph base is a knowledge base built in the form of a knowledge graph based on the regulations of the power system; the vector knowledge base is a knowledge base built in the form of vectors based on the regulations of the power system.
[0063] Optionally, keywords are extracted from the received fault information recovery statements and generalized, taking into account factors such as capitalization, aliases, and synonyms. Based on the keywords, relevant subgraphs are traversed in the graph-based knowledge base to retrieve entities and relationships related to the query. Local searches are used to extend to the neighbors and related concepts of specific entities to infer questions about those entities. Global searches utilize community summaries to infer answers about the overall knowledge base.
[0064] Optionally, the query text is vectorized through embedding, and similar text blocks are obtained from the similarity search vector knowledge base to construct a large model context;
[0065] Specifically, the similarity search uses cosine similarity:
[0066] ;
[0067] In the formula, A represents the vector of fault information recovery statements, and B represents the text block of the power system regulations stored in vector form in the vector knowledge base.
[0068] Based on cosine similarity, the most similarw Each text block serves as the context for the larger model.
[0069] In the power distribution system fault recovery method based on big-small model collaboration of the present invention, before the step of retrieving the recovery statement based on the received fault information from a pre-built knowledge base, the method further includes:
[0070] The regulations for the power system are divided into blocks according to content.
[0071] The regulations and technical documents of the power system are standardized by formatting and professional terminology. Based on the content characteristics of the power system dispatch regulations, various data such as tables in the documents are processed to transform all information into text that can be processed by a generative large model.
[0072] Optionally, specifically, for the file to be processed, extract all text type information, for table type information, convert it into Markdown table format, and store all information in txt text format.
[0073] Based on this, the power system dispatching procedure text is divided into blocks according to its content. Specifically, based on the content characteristics of the power system dispatching procedure text, without affecting the semantic coherence of the text or the coherence of the table content, the power system dispatching procedure text is divided into blocks according to the maximum number of tokens.
[0074] In one feasible implementation, text blocks are divided according to paragraphs. The longest consecutive paragraph is used as a text block without exceeding the maximum number of tokens. If a single paragraph or a single table exceeds the maximum number of tokens, it is allowed to exceed the maximum number of tokens and is used as a text block in order not to affect semantic coherence.
[0075] The segmented text blocks are vectorized to construct the vector knowledge base.
[0076] Based on the embedding model, text blocks are vectorized to form a vector knowledge base for power system dispatching procedures.
[0077] Keyword extraction, entity recognition, and relation extraction are performed on each segmented text block. A knowledge graph is then constructed based on the extracted entities and the relationships between them.
[0078] For each block, keyword extraction, entity recognition, and relation extraction are performed. Based on the text content characteristics of the power system dispatching regulations and the requirements for constructing power field terminology and knowledge graphs, a large model prompt word template is designed for each block to perform keyword extraction, entity recognition, and relation extraction. Together with the text blocks, the large model prompt words are constructed to provide the large model with formatted entity and entity relation extraction results for output.
[0079] Based on the entities and relationships extracted from text blocks, a power system scheduling knowledge graph is constructed. The Leiden algorithm (community detection algorithm) is used to detect the community structure in the knowledge graph, identify closely connected groups of nodes to establish communities, and build community summaries based on community elements.
[0080] By locally moving nodes, for each node in the network, we attempt to assign it to the community of neighboring nodes in turn. We calculate the change in modularity before and after the assignment and record the maximum modularity gain.
[0081] The modularity gain is as follows:
[0082] ;
[0083] In the formula, m Let be the number of edges in the graph. For the community c Number of internal edges For the community c The sum of all internal degrees.
[0084] Based on the partitions obtained during the local movement phase, an aggregated network is created. Each community becomes a node in the aggregated network, and the weights between nodes within a community are converted into the ring weights of the new node, while the weights between communities are converted into the edge weights between the new nodes.
[0085] Within the aggregated network, further local shifts are performed to optimize the modularity.
[0086] By refining the steps, the segmentation results are improved to prevent unhealthy connections within communities. This step is achieved by periodically and randomly breaking down communities into smaller, well-connected communities.
[0087] Repeat the local movement and cohesion and improvement phases until the modularity can no longer be improved.
[0088] Key features (such as keywords, topics, and summaries) are extracted from each community node. By aggregating the features of its member nodes, community-level features are extracted, and summaries are generated based on the extracted community features.
[0089] In the power distribution system fault recovery method based on large and small model collaboration of the present invention, the step of decomposing the fault information recovery statement into several sub-tasks according to a predefined task decomposition prompt word template, and calling the small model corresponding to each sub-task to execute the sub-task, specifically includes:
[0090] Pre-design explanatory text and accompanying prompt templates for each small model, wherein the explanatory text represents the function of the small model and the accompanying prompt template represents the calling method of the small model;
[0091] Based on the explanatory text, a corresponding small model is configured for each of the sub-tasks, and the small model is called to execute the sub-task based on the matching prompt word template.
[0092] Design explanatory text for each small model to clearly define its function.
[0093] Specifically, the explanatory text includes a paragraph explaining the functionality of the small model, and examples illustrating suitable scenarios for applying the small model. An example of explanatory text is shown in Table 1 below:
[0094] Table 1
[0095]
[0096] Optionally, the small model also includes a data import model and a fault recovery result evaluation model. The data import model is used to import real-time data from the distribution network into the simulation system, and the fault recovery result evaluation model is used to evaluate the fault recovery results. Specifically, the fault recovery result evaluation scoring method is as follows:
[0097] ;
[0098] In the formula, For the load recovery of important users, Its weight; This represents the load recovery amount for non-critical users. Its weight; The number of times the switch is activated. Its weight.
[0099] Furthermore, a prompt word template was designed to guide the generative large model to correctly call the small model.
[0100] Specifically, the accompanying prompt template includes a text explaining the functionality of the small model, an example, and examples illustrating suitable scenarios and parameters for applying the small model. A specific accompanying prompt template is shown in Table 2 below:
[0101] Table 2
[0102]
[0103] For each subtask, the explanatory text is provided to the generative large model, which then selects the appropriate small model. The corresponding small model, along with the prompt word template, is then provided to the large model, enabling the large model to correctly call the corresponding small model to generate the result.
[0104] In the power distribution system fault recovery method based on big-small model collaboration of the present invention, before the step of decomposing the fault information recovery statement into several sub-tasks according to a predefined task decomposition prompt word template, the method further includes:
[0105] Using text data containing fault information and predefined task decomposition prompt word templates as input, and the task decomposition results of the text data containing fault information as output, sample pairs are designed and a task decomposition training set is constructed.
[0106] The large model is fine-tuned on the task decomposition training set based on the low-rank adaptive LoRA method.
[0107] Based on the expert's operational steps for fault recovery tasks, input-output sample pairs are designed, and a task decomposition training set is designed.
[0108] Specifically, in the input-output sample pair, the input is text data containing fault information and a task decomposition prompt word template. The task decomposition prompt word template specifies that the large model should perform task decomposition. The output is the task decomposition result in a standard format, which includes the sub-tasks that need to be completed to complete the complex task of fault recovery.
[0109] Optionally, the training set can be enriched by using synonym replacement and syntax transformation methods for input-output sample pairs; a small number of other task input-output sample pairs of the power system can be added to increase the system robustness, resulting in the final task decomposition training set.
[0110] In one specific implementation, the input-output sample pairs are shown in Table 3 below:
[0111] Table 3
[0112]
[0113] On the constructed task decomposition training set, a small learning rate is used, and the LoRA (Low-Rank Adaptation) fine-tuning method is employed to fine-tune the feedforward layer of the large model.
[0114] In LoRA, when fine-tuning the model, the weight matrix of the pre-trained model is not directly modified. Instead, two low-rank matrices (A and B) are introduced to approximate the update of the weight matrix. Fine-tuning large models based on the LoRA method enables the fine-tuned model to automatically decompose received fault information recovery statements into multiple sub-tasks.
[0115] In the power distribution system fault recovery method based on big-small model collaboration of the present invention, when the small model is a fault recovery small model, before the step of calling the small model corresponding to each subtask to execute the subtask, the method further includes:
[0116] A small model dataset containing expert demonstration strategies was constructed based on the power system dispatching regulations text.
[0117] The fault recovery mini-model was obtained by training the DQfD method on the mini-model dataset.
[0118] Extract contingency plans and strategies related to load transfer during grid fault recovery from electronic and rule-based power system dispatching regulations; based on the extracted contingency plans and strategies, construct a series of grid operation sample data simulating grid faults under the scenario of load transfer during grid fault recovery, forming a small model dataset containing expert demonstration strategies.
[0119] Specifically, corresponding fault scenarios are constructed based on expert plans, and actions are taken based on expert strategies. These actions interact with the simulation platform to form a small model dataset containing expert demonstration strategies.
[0120] In this embodiment, the small model dataset centrally contains the power system node voltage, branch current, and fault information in its state space, and the action space consists of all switches.
[0121] Based on this, a small model for generating fault recovery strategies is trained using the DQfD model.
[0122] Specifically, the constructed small model dataset is input into the DQfD fault recovery strategy generation small model for pre-training. The DQfD fault recovery strategy generation small model interacts with the power system simulation environment. A random fault training DQfD reinforcement learning agent is set up. Through continuous iterative training, the small model can learn the relevant knowledge of the power grid fault recovery load transfer strategy and has the ability to generate fault recovery strategies according to the power grid fault situation in practical applications.
[0123] In summary, a complete process for generating and outputting a large model policy is as follows: Figure 2 As shown.
[0124] The following describes the power distribution system fault recovery device based on big-small model collaboration provided by the present invention. The power distribution system fault recovery device based on big-small model collaboration described below and the power distribution system fault recovery method based on big-small model collaboration described above can be referred to in correspondence.
[0125] like Figure 3 As shown, the power distribution system fault recovery device based on big-small model collaboration includes an acquisition module 301, a calling module 302, and a generation module 303.
[0126] The acquisition module 301 is used to retrieve the large model prompt words and large model context from the pre-built knowledge base based on the received fault information recovery statement;
[0127] The received fault information recovery statement is the statement entered by the user into the large model. The fault information recovery statement contains basic fault information.
[0128] The large model retrieves the received fault information recovery statements from a pre-built knowledge base, which is based on the power system dispatching procedure text. Therefore, the retrieved large model context represents the fault recovery strategy text corresponding to the received fault information. Large model prompts guide the large model to output formatted entity and entity relationship extraction results, which are used to generate power system recovery strategies.
[0129] The module 302 is used to decompose the fault information recovery statement into several sub-tasks according to the predefined task decomposition prompt word template, and call the small model corresponding to each sub-task to execute the sub-task, wherein at least one of the small models is trained using the demonstration-based deep Q-learning DQfD method.
[0130] The large model decomposes the received fault information recovery statements into several sub-tasks based on a predefined task decomposition prompt word template.
[0131] Small models corresponding to possible subtasks in the power system are pre-trained. After the received fault information recovery statement is decomposed into subtasks, a small model corresponding to each subtask is allocated based on the specific content of the subtask, and the small model executes the subtask.
[0132] Optionally, subtasks may include tasks directly related to fault recovery, such as fault recovery strategy generation tasks; subtasks may also include tasks indirectly related to fault recovery, such as fault recovery strategy accuracy assessment tasks.
[0133] Among them, at least one small model used to perform the sub-task is a fault recovery small model trained based on the DQfD (Deep Q-Learning from Demonstrations) method.
[0134] DQfD is a method that combines deep reinforcement learning and imitation learning. The core idea of DQfD is to train an agent by combining expert demonstration data and reward signals in reinforcement learning. It aims to accelerate and improve the training process of reinforcement learning algorithms by utilizing expert demonstration data.
[0135] The problem-solving small model trained using the DQfD method relies heavily on expert demonstration data in the early stages of training. As training progresses, the reliance on expert data gradually decreases, and the model relies more on the agent's own exploratory data. In other words, during training, the agent's own exploration enhances the small model's ability to solve specific problems, improving its performance in generating fault recovery strategies and enabling it to generate effective solutions for unknown faults.
[0136] The generation module 303 is used to generate a first recovery strategy based on the large model prompt words, the large model context and the fault information recovery statement, generate a second recovery strategy based on the output results of each small model, use the first recovery strategy and the second recovery strategy as the output fault recovery strategy, and perform fault recovery on the power distribution system based on the fault recovery strategy.
[0137] The large model generates the first recovery strategy based on the large model prompt words, the large model context, and the fault information recovery statement.
[0138] At the same time, a second recovery strategy is generated based on the output results of all small models.
[0139] In developing a fault recovery strategy, the large model regularizes the fault information and calls the reinforcement learning small model based on the corresponding prompt words. Based on the fault information, a power distribution system simulation is performed under a given operating scenario to construct a reinforcement learning state space. A fault recovery strategy is generated through a DQfD model and output by the large model.
[0140] It is understandable that the first recovery strategy represents the power system recovery strategy generated based on graph retrieval enhancement, while the second recovery strategy represents the power system recovery strategy obtained based on a reinforcement learning small model. For fault information in existing problem scenarios, the first recovery strategy can provide a more standardized solution, while for fault information in unknown scenarios, the second recovery strategy can also provide a reasonable solution.
[0141] The large model uses both the first and second recovery strategies as the output of the fault recovery statement input by the user. This allows the user to determine a more suitable fault recovery strategy from the first and / or second recovery strategies based on the actual situation, thereby enabling more accurate and rapid fault recovery of the power distribution system based on the selected fault recovery strategy.
[0142] This invention effectively leverages the superior text semantic understanding and extraction capabilities of large language models by employing a collaborative approach of large and small models. This overcomes the challenge of extracting and utilizing the vast amounts of prior knowledge in power system text for intelligent agents. Furthermore, it utilizes the problem-solving capabilities of small reinforcement learning models to enhance the agent's performance in generating fault recovery strategies. Ultimately, this results in a robust and stable ability to generate fault recovery strategies for power distribution systems.
[0143] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 can call logic instructions in the memory 430 to execute a power distribution system fault recovery method based on big-small model collaboration. This method includes: retrieving large-scale model prompts and context from a pre-built knowledge base based on received fault information recovery statements; decomposing the fault information recovery statements into several sub-tasks according to a predefined task decomposition prompt template, and calling a small model corresponding to each sub-task to execute the sub-task, wherein at least one of the small models is trained using a demonstration-based deep Q-learning (DQfD) method; generating a first recovery strategy based on the large-scale model prompts, the large-scale model context, and the fault information recovery statements; generating a second recovery strategy based on the output results of all the small models; using the first recovery strategy and the second recovery strategy as the output fault recovery strategy; and performing fault recovery on the power distribution system based on the fault recovery strategy.
[0144] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0145] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the power distribution system fault recovery method based on big-small model collaboration provided by the above methods. The method includes: retrieving a large model prompt word and a large model context from a pre-built knowledge base based on a received fault information recovery statement; decomposing the fault information recovery statement into several sub-tasks according to a predefined task decomposition prompt word template, and calling a small model corresponding to each sub-task to execute the sub-task, wherein at least one of the small models is trained using a demonstration-based deep Q-learning (DQfD) method; generating a first recovery strategy based on the large model prompt word, the large model context, and the fault information recovery statement; generating a second recovery strategy based on the output results of all the small models; using the first recovery strategy and the second recovery strategy as the output fault recovery strategy; and performing fault recovery on the power distribution system based on the fault recovery strategy.
[0146] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the power distribution system fault recovery method based on big-small model collaboration provided by the above methods. The method includes: retrieving a large model prompt word and a large model context from a pre-built knowledge base based on a received fault information recovery statement; decomposing the fault information recovery statement into several sub-tasks according to a predefined task decomposition prompt word template, and calling a small model corresponding to each sub-task to execute the sub-task, wherein at least one of the small models is trained using a demonstration-based deep Q-learning (DQfD) method; generating a first recovery strategy based on the large model prompt word, the large model context, and the fault information recovery statement; generating a second recovery strategy based on the output results of all the small models; using the first recovery strategy and the second recovery strategy as the output fault recovery strategy; and performing fault recovery on the power distribution system based on the fault recovery strategy.
[0147] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0148] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0149] 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 them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for fault recovery in power distribution systems based on large-scale model collaboration, characterized in that, Applied to large models, including: Based on the received fault information recovery statements, retrieve the large model prompt words and large model context from the pre-built knowledge base; The fault information recovery statement is decomposed into several sub-tasks according to a predefined task decomposition prompt word template, and the small model corresponding to each sub-task is called to execute the sub-task. At least one of the small models is trained using the demonstration-based deep Q-learning DQfD method. A first recovery strategy is generated based on the large model prompts, the large model context, and the fault information recovery statements. A second recovery strategy is generated based on the output results of all the small models. The first recovery strategy and the second recovery strategy are used as the output fault recovery strategy. Fault recovery is performed on the power distribution system based on the fault recovery strategy.
2. The power distribution system fault recovery method based on big-small model collaboration according to claim 1, characterized in that, The knowledge base includes a knowledge graph base and a vector knowledge base. The step of retrieving large model prompt words and large model context from the pre-built knowledge base based on the received fault information recovery statement specifically includes: Keywords from the fault information recovery statement are extracted and retrieved from the knowledge graph to obtain the large model's prompt words; After vectorizing the fault information recovery statement, a similarity search is used to retrieve it from the vector knowledge base to obtain the large model context.
3. The power distribution system fault recovery method based on large-scale model collaboration according to claim 2, characterized in that, Before the step of retrieving the received fault information recovery statement from a pre-built knowledge base, the method further includes: The regulations for the power system are divided into blocks according to content. The segmented text blocks are vectorized to construct the vector knowledge base. Keyword extraction, entity recognition, and relation extraction are performed on each segmented text block. A knowledge graph is then constructed based on the extracted entities and the relationships between them.
4. The power distribution system fault recovery method based on large-scale model collaboration according to claim 1, characterized in that, The step of decomposing the fault information recovery statement into several sub-tasks based on a predefined task decomposition prompt word template, and calling the small model corresponding to each sub-task to execute the sub-task, specifically includes: Pre-design explanatory text and accompanying prompt templates for each small model, wherein the explanatory text represents the function of the small model and the accompanying prompt template represents the calling method of the small model; Based on the explanatory text, a corresponding small model is configured for each of the sub-tasks, and the small model is called to execute the sub-task based on the matching prompt word template.
5. The power distribution system fault recovery method based on large-scale model collaboration according to claim 1, characterized in that, Before the step of decomposing the fault information recovery statement into several sub-tasks according to a predefined task decomposition prompt template, the method further includes: Using text data containing fault information and predefined task decomposition prompt word templates as input, and the task decomposition results of the text data containing fault information as output, sample pairs are designed and a task decomposition training set is constructed. The large model is fine-tuned on the task decomposition training set based on the low-rank adaptive LoRA method.
6. The power distribution system fault recovery method based on big-small model collaboration according to claim 1, characterized in that, In the case where the small model is a fault recovery small model, before the step of calling the small model corresponding to each subtask to execute the subtask, the method further includes: A small model dataset containing expert demonstration strategies was constructed based on the power system dispatching regulations text. The fault recovery mini-model was obtained by training the DQfD method on the mini-model dataset.
7. A power distribution system fault recovery device based on large-scale model collaboration, comprising: The acquisition module is used to retrieve large model prompts and large model context based on the received fault information recovery statements in a pre-built knowledge base; The calling module is used to decompose the fault information recovery statement into several sub-tasks according to the predefined task decomposition prompt word template, and call the small model corresponding to each sub-task to execute the sub-task, wherein at least one of the small models is trained using the demonstration-based deep Q-learning DQfD method. The generation module is used to generate a first recovery strategy based on the large model prompt words, the large model context and the fault information recovery statement, generate a second recovery strategy based on the output results of each small model, use the first recovery strategy and the second recovery strategy as the output fault recovery strategy, and perform fault recovery on the power distribution system based on the fault recovery strategy.
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 power distribution system fault recovery method based on size model collaboration 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 power distribution system fault recovery method based on size model collaboration as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the power distribution system fault recovery method based on size model collaboration as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Active power distribution network fault recovery method, apparatus and device, and storage medium
CN118432072A
Industrial pollution knowledge relation extraction method based on enhanced knowledge retrieval and large language model collaborative optimization
CN119312897A