Power distribution system fault recovery method and device based on cooperation of large and small models

By adopting the method of collaborative size and model in the power distribution system, the advantages of large language models and reinforcement learning small models are used to solve the problem of difficult to extract and utilize text knowledge in the power system, and better failure recovery strategy generation is achieved, and performance and stability are improved.

CN120012936AActive Publication Date: 2025-05-16WUHAN UNIV +2
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510129996.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-05
Publication Date
2025-05-16
Estimated Expiration
2045-02-05

AI Technical Summary

Technical Problem

In the prior art, it is difficult to extract and use a priori knowledge in the form of text of the power system in large quantities of texts to be used in the agent, resulting in poor performance in the generation of fault recovery strategies of the power distribution system.

Method used

Using a method based on size and model collaboration, through the coordination between large models and small models, the text semantic understanding ability of large language models and the specific problem solving ability of small models are used to extract and utilize the prior knowledge of the power system to generate better fault recovery strategies.

Benefits of technology

The performance improvement of the generation of fault recovery strategies of power distribution system has been achieved, the problem of difficult to extract and utilize text knowledge has been overcome, and the accuracy and stability of strategy generation has been improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120012936A_ABST
    Figure CN120012936A_ABST
Patent Text Reader

Abstract

The invention provides a power distribution system fault recovery agent construction method based on big and small model collaboration, and the method comprises the steps: carrying out the retrieval in a pre-constructed knowledge base based on a received fault information recovery statement, and obtaining a big model prompt word and a big model context; decomposing the fault information recovery statement into a plurality of subtasks according to the task decomposition prompt word template, and calling a small model corresponding to each subtask to execute the subtask; and generating a first recovery strategy based on the big model cue word, the big model context and the fault information recovery statement, generating a second recovery strategy based on output results of all the small models, and performing fault recovery on the power distribution system by taking the first recovery strategy and the second recovery strategy as output fault recovery strategies. According to the method, by adopting a large and small model collaborative matching method, the excellent text semantic understanding and extraction capability of a large language model is effectively drawn, and the problem that a large amount of text-form priori knowledge of a power system is difficult to extract and utilize for an intelligent agent is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method for constructing a distribution system fault recovery intelligent agent based on large and small model collaboration. Background Art

[0002] With the continuous increase in the scale of power grids and the continuous access to new energy and distributed power sources, the structure of distribution networks has become more complex, the difficulty of power grid dispatching and control has also increased, and the safe operation of power grids is facing challenges. Traditional analysis and control technologies have been difficult to meet the requirements of safe and stable operation of power grids. In this context, intelligent agent construction methods based on advanced technologies such as artificial intelligence and big data have emerged.

[0003] Graph retrieval enhancement generation is a retrieval enhancement generation technology that combines knowledge graph and large language model (LLM). Its basic idea is: when the user asks a question, the model first analyzes the question and identifies the entities and relationships therein; retrieves entities and relationships related to the question from the pre-built knowledge graph; based on the keywords of the question and the prompts of the knowledge graph, the retriever selects relevant document fragments from the document library; the generator combines the retrieved document fragments and the knowledge graph to give an answer.

[0004] However, the fault recovery strategy generated by graph retrieval enhancement only includes the scenarios covered by the fault plan, and no effective strategy can be generated for the uncovered scenarios. Summary of the invention

[0005] The present invention provides a method for constructing a distribution system fault recovery intelligent agent based on the collaboration of large and small models, so as to solve the defect in the prior art that a large amount of prior knowledge in the form of text of the power system is difficult to extract and utilize for the intelligent agent, and realize the generation of a distribution system fault recovery strategy with better performance.

[0006] The present invention provides a distribution system fault recovery method based on large and small model collaboration, which is applied to a large model and includes: Based on the received fault information recovery statement, a pre-built knowledge base is searched to obtain a large model prompt word and a large model context; Decomposing the fault information recovery statement into a plurality of subtasks according to a predefined task decomposition prompt word template, and calling a small model corresponding to each subtask to execute the subtask, wherein at least one of the small models is trained using a demonstration-based deep Q learning (DQfD) method; A first recovery strategy is generated based on the large model prompt word, the large model context and the fault information recovery statement, 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 output fault recovery strategies, and the distribution system is recovered based on the fault recovery strategies.

[0007] According to a distribution system fault recovery method based on large and small model collaboration provided by the present invention, it is characterized in that the knowledge base includes a knowledge graph base and a vector knowledge base, and the step of retrieving the received fault information recovery statement in the pre-built knowledge base to obtain the large model prompt word and the large model context specifically includes: Extract the keywords of the fault information recovery sentence and search in the knowledge graph library to obtain the large model prompt words; After the fault information recovery statement is vectorized, similarity search is used to retrieve it in the vector knowledge base to obtain the large model context.

[0008] According to a distribution system fault recovery method based on large and small model collaboration provided by the present invention, before the step of retrieving the received fault information recovery statement in a pre-built knowledge base, it also includes: Divide the power system regulations into blocks according to content; Vectorizing the divided text blocks to construct the vector knowledge base; Keyword extraction, entity recognition and relationship extraction are performed on each segmented text block, and a knowledge graph is constructed based on the extracted entities and the relationships between them.

[0009] According to a distribution system fault recovery method based on large and small model collaboration provided by the present invention, the steps of decomposing the fault information recovery statement into a plurality of subtasks according to a predefined task decomposition prompt word template, and calling a small model corresponding to each subtask to execute the subtask specifically include: Pre-design the description text and matching prompt word template of each small model, wherein the description text represents the function of the small model, and the matching prompt word template represents the calling method of the small model; A corresponding small model is configured for each of the subtasks based on the description text, and the small model is called to execute the subtask based on the matching prompt word template.

[0010] According to a distribution system fault recovery method based on large and small model collaboration provided by the present invention, before the step of decomposing the fault information recovery statement into a plurality of subtasks according to a predefined task decomposition prompt word template, the method further includes: Taking text data containing fault information and a predefined task decomposition prompt word template as input, taking the task decomposition result of the text data containing fault information as output, designing sample pairs and constructing a task decomposition training set; The large model is fine-tuned based on the LoRA low-rank adaptive method on the task decomposition training set.

[0011] According to a distribution system fault recovery method based on large and small model collaboration provided by 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 perform the subtask, it also includes: A small model dataset containing expert demonstration strategies is constructed based on the power system dispatch regulations text; The fault recovery small model is obtained by training the small model data set using the DQfD method.

[0012] The present invention also provides a distribution system fault recovery device based on large and small model collaboration, comprising: An acquisition module, used for searching in a pre-built knowledge base based on the received fault information recovery statement, and acquiring a large model prompt word and a large model context; A calling module, used to decompose the fault information recovery statement into a plurality of subtasks according to a predefined task decomposition prompt word template, and call a small model corresponding to each subtask to perform the subtask, wherein at least one of the small models is trained using a demonstration-based deep Q learning (DQfD) method; A generation module is used to generate a first recovery strategy based on the large model prompt word, the large model context and the fault information recovery statement, generate a second recovery strategy based on the output result of each of the small models, use the first recovery strategy and the second recovery strategy as output fault recovery strategies, and perform fault recovery on the power distribution system based on the fault recovery strategies.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the distribution system fault recovery method based on large and small model collaboration as described in any one of the above-mentioned methods is implemented.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for fault recovery of a power distribution system based on coordination of large and small models as described in any one of the above is implemented.

[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for fault recovery of a power distribution system based on size model collaboration as described in any one of the above is implemented.

[0016] The method for constructing a distribution system fault recovery intelligent agent based on large and small model collaboration provided by the present invention effectively absorbs the excellent text semantic understanding and extraction capabilities of the large language model by adopting the large and small model collaboration method, overcomes the problem that a large amount of prior knowledge in the form of text in the power system is difficult to extract and use for the intelligent agent, and utilizes the specific problem-solving ability of the small model of reinforcement learning to improve the intelligent agent fault recovery strategy generation performance. Finally, a good distribution system fault recovery strategy generation capability is achieved with high stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 It is one of the flow charts of the power distribution system fault recovery method based on large and small model collaboration provided by the present invention; Figure 2 This is the second flow chart of the power distribution system fault recovery method based on large and small model collaboration provided by the present invention; Figure 3 It is a structural schematic diagram of a distribution system fault recovery device based on large and small model collaboration provided by the present invention; Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0020] Combine the following Figure 1 and Figure 2 The present invention introduces a distribution system fault recovery method based on large and small model collaboration, such as Figure 1 As shown, it is applied to large models, including: Step 101, based on the received fault information recovery statement, a search is performed in a pre-built knowledge base to obtain a large model prompt word and a large model context; The received fault information recovery statement is a statement input by the user into the large model, and the fault information recovery statement contains basic information about the fault.

[0021] The big model searches a pre-built knowledge base based on the received fault information recovery statements, wherein the knowledge base is pre-built based on the power system dispatching procedure text. Therefore, the retrieved big model context represents the fault recovery strategy text corresponding to the received fault information. The big model prompt words are used to guide the big model to output formatted entities and entity relationship extraction results, which are used to generate power system recovery strategies.

[0022] Step 102, decomposing the fault information recovery statement into a plurality of subtasks according to a predefined task decomposition prompt word template, and calling a small model corresponding to each subtask to execute the subtask, wherein at least one of the small models is trained using a demonstration-based deep Q learning (DQfD) method; The large model decomposes the received fault information recovery statement into several subtasks based on the pre-defined task decomposition prompt word template.

[0023] Pre-train small models corresponding to possible subtasks of the power system. After decomposing subtasks from the received fault information recovery statements, allocate corresponding small models for each subtask based on the specific content of the subtask, and the subtasks are executed by the small models.

[0024] Optionally, the subtasks may include tasks directly related to fault recovery, such as a fault recovery strategy generation task; the subtasks may also include tasks indirectly related to fault recovery, such as a fault recovery strategy accuracy assessment task.

[0025] Among them, at least one small model for executing the subtask is a fault recovery small model trained based on the DQfD (Deep Q-Learning from Demonstrations) method.

[0026] DQfD is a method that combines deep reinforcement learning and imitation learning. The core idea of ​​DQfD is to train the 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.

[0027] Based on the DQfD method, the problem-solving model is trained. In the early stage of the training phase, it relies more on expert demonstration data. As the training progresses, it gradually reduces its reliance on expert data and relies more on the agent's own exploration data. In other words, during the training process, through the agent's own exploration, the specific problem-solving ability of the learning model is strengthened, and the performance of the agent's fault recovery strategy generation is improved, so that it can be used to generate effective solution strategies for unknown faults.

[0028] Step 103: Generate a first recovery strategy based on the large model prompt word, 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 output fault recovery strategies, and perform fault recovery on the power distribution system based on the fault recovery strategies.

[0029] The large model generates a first recovery strategy based on the large model prompt word, the large model context and the fault information recovery statement.

[0030] At the same time, a second recovery strategy is generated based on the output results of all small models.

[0031] When generating a fault recovery strategy, the large model regularizes the fault information and calls the small reinforcement learning model based on the matching prompt words. Based on the fault information, the distribution system is simulated in a given operating scenario, the reinforcement learning state space is constructed, and the fault recovery strategy is generated through the DQfD model and output by the large model.

[0032] It can be understood that the first recovery strategy represents the power system recovery strategy generated based on graph retrieval enhancement, and the second recovery strategy represents the power system recovery strategy obtained based on the reinforcement learning small model. For fault information in existing problem scenarios, the first recovery strategy can have a more standardized solution, and for fault information in unknown scenarios, the second recovery strategy can also provide a reasonable solution.

[0033] The large model uses the first recovery strategy and the second recovery strategy together as the fault recovery strategy for the output of the fault information recovery statement input by the user, so that the user can determine a more appropriate fault recovery strategy based on the first recovery strategy and / or the second recovery strategy based on actual conditions, thereby more accurately and quickly recovering the distribution system based on the selected fault recovery strategy.

[0034] The present invention adopts the method of coordinating large and small models, effectively draws on the excellent text semantic understanding and extraction capabilities of the large language model, overcomes the problem that a large amount of prior knowledge in the form of text in the power system is difficult to extract and use for the intelligent agent, and uses the specific problem-solving capabilities of the small model of reinforcement learning to improve the performance of the intelligent agent fault recovery strategy generation. Finally, a good distribution system fault recovery strategy generation capability is achieved with high stability.

[0035] In the distribution system fault recovery method based on large and small model collaboration of the present invention, the knowledge base includes a knowledge graph base and a vector knowledge base, and the step of retrieving the received fault information recovery statement in the pre-built knowledge base to obtain the large model prompt word and the large model context specifically includes: Extract the keywords of the fault information recovery sentence and search in the knowledge graph library to obtain the large model prompt words; After the fault information recovery statement is vectorized, similarity search is used to retrieve it in the vector knowledge base to obtain the large model context.

[0036] In this implementation, the knowledge base includes a knowledge graph base and a vector knowledge base.

[0037] Among them, the knowledge graph base is a knowledge base constructed in the form of a knowledge graph based on the regulations text of the power system; the vector knowledge base is a knowledge base constructed in the form of a vector based on the regulations text of the power system.

[0038] Optionally, extract keywords from the received fault information recovery statement and perform generalization processing, taking into account capitalization, aliases, synonyms, etc. Traverse the relevant subgraphs in the graphed knowledge base based on the keywords to retrieve entities and relationships related to the query. Through local search, expand to the neighbors and related concepts of a specific entity to reason about questions about a specific entity. Through global search, use the community summary to reason about the answer to the overall question of the knowledge base.

[0039] Optionally, the query text is vectorized through embedding, and the vector knowledge base is searched based on similarity to obtain similar text blocks to build a large model context; Specifically, the similarity search uses cosine similarity: ; Where A represents the vector of fault information recovery statements, and B represents the text block of the power system regulations text stored in the vector form in the vector knowledge base.

[0040] Based on cosine similarity, the highest similarity w A block of text as a large model context.

[0041] In the distribution system fault recovery method based on large and small model collaboration of the present invention, before the step of retrieving the received fault information recovery statement in a pre-built knowledge base, the method further includes: Divide the power system regulations into blocks according to content; The text of the power system regulations is processed in a regular manner, such as format unification and professional terminology standardization. Based on the content characteristics of the power system dispatch regulations, various types of data such as tables in the files are processed to convert all information into text that can be processed by the generative large model.

[0042] Optionally, specifically, for the file to be processed, all text type information is extracted, and for the table type information, it is converted into Markdown table format, and all information is stored in txt text format.

[0043] On this basis, the power system regulations text is divided into blocks according to the content. Specifically, according to the content characteristics of the power system dispatch regulations text, the power system dispatch regulations text is divided into blocks according to the maximum number of tokens without affecting the semantic coherence of the text and the coherence of the table content, to obtain the power system dispatch regulations text blocks.

[0044] In a feasible implementation, the text blocks are divided according to paragraphs, and the longest continuous paragraph is regarded 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, in order not to affect the semantic coherence, it is allowed to exceed the maximum number of tokens and is regarded as a text block.

[0045] Vectorizing the divided text blocks to construct the vector knowledge base; Based on the embedding model, the text blocks are vectorized to form a vector knowledge base of power system dispatching regulations.

[0046] Keyword extraction, entity recognition and relationship extraction are performed on each segmented text block, and a knowledge graph is constructed based on the extracted entities and the relationships between them.

[0047] Keyword extraction, entity recognition, and relationship extraction are performed on each block. Based on the text content characteristics of the power system dispatching regulations and the requirements for building special terms and knowledge graphs in the power field, a large model prompt word template is designed for keyword extraction, entity recognition, and relationship extraction processing in blocks. The large model prompt words are constructed together with the text blocks to provide formatted entity and entity relationship extraction results to the large model output.

[0048] Based on the entities and relationships between entities extracted from text blocks, a knowledge graph for power system dispatching is constructed. The community structure in the knowledge graph is detected based on the Leiden algorithm (community discovery algorithm). Node groups with close connections are identified to establish communities, and community summaries are established based on community elements.

[0049] Through local movement, for each node in the network, we try to assign it to the community where the neighboring node is located. The change in modularity before and after the assignment is calculated, and the maximum modularity gain is recorded.

[0050] The modularity gain is as follows: ; In the formula, m is the number of edges in the graph, For the community c The number of internal edges, For the community c The sum of all interior degrees.

[0051] Based on the partitions obtained in the local movement phase, an aggregation network is created, in which each community becomes a node in the aggregation network, the weights between nodes in the community are converted to the ring weights of the new nodes, and the weights between communities are converted to the weights of the edges between the new nodes.

[0052] In the aggregated network, local movement is performed again to further optimize the modularity.

[0053] The refinement step improves the partitioning to prevent poor connectivity within communities. This step is achieved by periodically and randomly breaking up communities into smaller, well-connected communities.

[0054] The local movement and cohesion and improvement phases are repeated until modularity cannot be improved further.

[0055] Important features (such as keywords, topics, summaries, etc.) are extracted from each community node. Community-level features are extracted by aggregating the features of its member nodes, and summaries are generated based on the extracted community features.

[0056] In the distribution system fault recovery method based on large and small model collaboration of the present invention, the steps of decomposing the fault information recovery statement into a plurality of subtasks according to a predefined task decomposition prompt word template, and calling a small model corresponding to each subtask to execute the subtask specifically include: Pre-design the description text and matching prompt word template of each small model, wherein the description text represents the function of the small model, and the matching prompt word template represents the calling method of the small model; A corresponding small model is configured for each of the subtasks based on the description text, and the small model is called to execute the subtask based on the matching prompt word template.

[0057] Design explanatory text for each small model to clarify its function.

[0058] Specifically, the description text includes a text describing the function of the small model and an example describing a scenario suitable for applying the small model. An example of a description text is shown in Table 1 below: Table 1

[0059] 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 the real-time data of the distribution network into the simulation system. The fault recovery result evaluation model is used to evaluate the fault recovery result. Specifically, the fault recovery result evaluation scoring method is: ; In the formula, For important users, for its weight; The load recovery amount for non-important users. for its weight; is the number of switch actions, For its weight.

[0060] Furthermore, a matching prompt word template is designed to guide the generative large model to correctly call the small model.

[0061] Specifically, the matching prompt word template includes a text describing the function of the small model, an example, and an example describing the scene and parameters suitable for applying the small model. A specific matching prompt word template is shown in Table 2 below: Table 2

[0062] For each subtask, the description text is provided to the generative large model so that the large model can select the appropriate small model. Then the corresponding small model is provided to the large model with the prompt word template so that the large model can correctly call the corresponding small model to generate the result.

[0063] In the distribution system fault recovery method based on large and small model collaboration of the present invention, before the step of decomposing the fault information recovery statement into a plurality of subtasks according to a predefined task decomposition prompt word template, the method further includes: Taking text data containing fault information and a predefined task decomposition prompt word template as input, taking the task decomposition result of the text data containing fault information as output, designing sample pairs and constructing a task decomposition training set; The large model is fine-tuned based on the low-rank adaptive LoRA method on the task decomposition training set.

[0064] Based on the expert's operation steps for the fault recovery task, we design input-output sample pairs and the task decomposition training set.

[0065] 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 the large model to perform task decomposition work; the output is the task decomposition result in a standard format, which includes the subtasks that need to be completed to complete the complex task of fault recovery.

[0066] Optionally, for input-output sample pairs, synonym replacement and grammatical transformation methods are used to enrich the training set; a small number of input-output sample pairs of other tasks in the power system are added to increase the robustness of the system and obtain the final task decomposition training set.

[0067] In a specific implementation, examples of input-output sample pairs are shown in Table 3 below: Table 3

[0068] On the constructed task decomposition training set, a smaller learning rate is used and the LoRA (Low-Rank Adaptation) fine-tuning method is adopted to fine-tune the feedforward layer of the large model.

[0069] Among them, when fine-tuning the model, LoRA does not directly modify the weight matrix of the pre-trained model, but introduces two low-rank matrices (A and B) to approximate the update of the weight matrix. Based on the LoRA method, the large model is fine-tuned so that the fine-tuned large model can automatically decompose the received fault information recovery statement into multiple subtasks.

[0070] In the power distribution system fault recovery method based on large and 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 perform the subtask, it also includes: A small model dataset containing expert demonstration strategies is constructed based on the power system dispatch regulations text; The fault recovery small model is obtained by training the small model data set using the DQfD method.

[0071] The contingency plan strategies related to load transfer after grid fault recovery are extracted from the electronic and regularized text of the power system dispatch regulations. Based on the extracted contingency plan strategies, a series of grid operation sample data simulating grid faults are constructed in the grid fault recovery load transfer scenario to form a small model data set containing expert demonstration strategies.

[0072] Specifically, the corresponding fault scenarios are constructed according to the expert plans, and actions are taken based on the expert strategies, interacting with the simulation platform to form a small model dataset containing the expert demonstration strategies.

[0073] In this implementation, the state space of the small model data set includes power system node voltages, branch currents, and fault information, and the action space is all switches.

[0074] On this basis, a small model for fault recovery strategy generation is trained based on the DQfD model.

[0075] Specifically, the constructed small model data set is input into the DQfD fault recovery strategy generation small model for pre-training, the DQfD fault recovery strategy generation small model is interacted with the power system simulation environment, and random faults are set to train the DQfD reinforcement learning agent. Through continuous iterative training, the small model can learn the relevant knowledge of the load transfer strategy for power grid fault recovery, and has the ability to generate fault recovery strategies according to power grid fault conditions in practical applications.

[0076] In summary, a complete large model strategy generation and output process is as follows: Figure 2 shown.

[0077] The following describes the distribution system fault recovery device based on large and small model collaboration provided by the present invention. The distribution system fault recovery device based on large and small model collaboration described below and the distribution system fault recovery method based on large and small model collaboration described above can refer to each other.

[0078] like Figure 3 As shown, the distribution system fault recovery device based on large and small model collaboration includes an acquisition module 301, a calling module 302 and a generation module 303; An acquisition module 301 is used to search in a pre-built knowledge base based on the received fault information recovery statement to acquire a large model prompt word and a large model context; The received fault information recovery statement is a statement input by the user into the large model, and the fault information recovery statement contains basic information about the fault.

[0079] The big model searches a pre-built knowledge base based on the received fault information recovery statements, wherein the knowledge base is pre-built based on the power system dispatching procedure text. Therefore, the retrieved big model context represents the fault recovery strategy text corresponding to the received fault information. The big model prompt words are used to guide the big model to output formatted entities and entity relationship extraction results, which are used to generate power system recovery strategies.

[0080] A calling module 302 is used to decompose the fault information recovery statement into a plurality of subtasks according to a predefined task decomposition prompt word template, and call a small model corresponding to each subtask to perform the subtask, wherein at least one of the small models is trained using a demonstration-based deep Q learning DQfD method; The large model decomposes the received fault information recovery statement into several subtasks based on the pre-defined task decomposition prompt word template.

[0081] Pre-train small models corresponding to possible subtasks of the power system. After decomposing subtasks from the received fault information recovery statements, allocate corresponding small models for each subtask based on the specific content of the subtask, and the subtasks are executed by the small models.

[0082] Optionally, the subtasks may include tasks directly related to fault recovery, such as a fault recovery strategy generation task; the subtasks may also include tasks indirectly related to fault recovery, such as a fault recovery strategy accuracy assessment task.

[0083] Among them, at least one small model for executing the subtask is a fault recovery small model trained based on the DQfD (Deep Q-Learning from Demonstrations) method.

[0084] DQfD is a method that combines deep reinforcement learning and imitation learning. The core idea of ​​DQfD is to train the 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.

[0085] Based on the DQfD method, the problem-solving model is trained. In the early stage of the training phase, it relies more on expert demonstration data. As the training progresses, it gradually reduces its reliance on expert data and relies more on the agent's own exploration data. In other words, during the training process, through the agent's own exploration, the specific problem-solving ability of the learning model is strengthened, and the performance of the agent's fault recovery strategy generation is improved, so that it can be used to generate effective solution strategies for unknown faults.

[0086] A generation module 303 is used to generate a first recovery strategy based on the large model prompt word, the large model context and the fault information recovery statement, generate a second recovery strategy based on the output result of each of the small models, use the first recovery strategy and the second recovery strategy as output fault recovery strategies, and perform fault recovery on the power distribution system based on the fault recovery strategies.

[0087] The large model generates a first recovery strategy based on the large model prompt word, the large model context and the fault information recovery statement.

[0088] At the same time, a second recovery strategy is generated based on the output results of all small models.

[0089] Among them, when forming a fault recovery strategy, the large model regularizes the fault information and calls the reinforcement learning small model based on the matching prompt words. Based on the fault information, the distribution system is simulated in a given operating scenario, the reinforcement learning state space is constructed, and the fault recovery strategy is generated through the DQfD model and output by the large model.

[0090] It can be understood that the first recovery strategy represents the power system recovery strategy generated based on graph retrieval enhancement, and the second recovery strategy represents the power system recovery strategy obtained based on the reinforcement learning small model. For fault information in existing problem scenarios, the first recovery strategy can have a more standardized solution, and for fault information in unknown scenarios, the second recovery strategy can also provide a reasonable solution.

[0091] The large model uses the first recovery strategy and the second recovery strategy together as the fault recovery strategy for the output of the fault information recovery statement input by the user, so that the user can determine a more suitable fault recovery strategy from the first recovery strategy and / or the second recovery strategy based on actual conditions, thereby more accurately and quickly recovering the distribution system based on the selected fault recovery strategy.

[0092] The present invention adopts the method of coordinating large and small models, effectively draws on the excellent text semantic understanding and extraction capabilities of the large language model, overcomes the problem that a large amount of prior knowledge in the form of text in the power system is difficult to extract and use for the intelligent agent, and uses the specific problem-solving capabilities of the small model of reinforcement learning to improve the performance of the intelligent agent fault recovery strategy generation. Finally, a good distribution system fault recovery strategy generation capability is achieved with high stability.

[0093] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor (processor) 410, a communication interface (Communications Interface) 420, a memory (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 the logic instructions in the memory 430 to execute a distribution system fault recovery method based on the collaboration of large and small models, the method comprising: searching in a pre-built knowledge base based on the received fault information recovery statement to obtain a large model prompt word and a large model context; decomposing the fault information recovery statement into a number of subtasks according to a pre-defined task decomposition prompt word template, and calling a small model corresponding to each subtask to execute the subtask, 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 output fault recovery strategies, and performing fault recovery on the distribution system based on the fault recovery strategies.

[0094] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0095] On the other hand, the present invention also provides a computer program product, which includes a computer program, which 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 distribution system fault recovery method based on large and small model collaboration provided by the above methods, the method including: searching in a pre-built knowledge base based on the received fault information recovery statement to obtain a large model prompt word and a large model context; decomposing the fault information recovery statement into a number of subtasks according to a pre-defined task decomposition prompt word template, and calling a small model corresponding to each subtask to execute the subtask, 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 output fault recovery strategies, and performing fault recovery on the distribution system based on the fault recovery strategies.

[0096] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the distribution system fault recovery method based on large and small model collaboration provided by the above-mentioned methods, the method comprising: searching a pre-built knowledge base based on the received fault information recovery statement to obtain a large model prompt word and a large model context; decomposing the fault information recovery statement into a number of subtasks according to a pre-defined task decomposition prompt word template, and calling a small model corresponding to each subtask to execute the subtask, 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 output fault recovery strategies, and performing fault recovery on the distribution system based on the fault recovery strategies.

[0097] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0098] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A distribution system fault recovery method based on large and small model collaboration, characterized in that: Applicable to large models, including: Based on the received fault information recovery statement, a pre-built knowledge base is searched to obtain a large model prompt word and a large model context; Decomposing the fault information recovery statement into a plurality of subtasks according to a predefined task decomposition prompt word template, and calling a small model corresponding to each subtask to execute the subtask, wherein at least one of the small models is trained using a demonstration-based deep Q learning (DQfD) method; A first recovery strategy is generated based on the large model prompt word, the large model context and the fault information recovery statement, 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 output fault recovery strategies, and the distribution system is recovered based on the fault recovery strategies.

2. The method for power distribution system fault recovery based on large and 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 searching the pre-built knowledge base based on the received fault information recovery statement to obtain the large model prompt word and the large model context specifically includes: Extract the keywords of the fault information recovery sentence and search in the knowledge graph library to obtain the large model prompt words; After the fault information recovery statement is vectorized, similarity search is used to retrieve it in the vector knowledge base to obtain the large model context.

3. The power distribution system fault recovery method based on large and small model collaboration according to claim 2 is characterized in that: Before the step of retrieving the recovery statement based on the received fault information in the pre-built knowledge base, the method further includes: Divide the power system regulations into blocks according to content; Vectorizing the divided text blocks to construct the vector knowledge base; Keyword extraction, entity recognition and relationship extraction are performed on each segmented text block, and a knowledge graph is constructed based on the extracted entities and the relationships between them.

4. The method for power distribution system fault recovery based on large and small model collaboration according to claim 1, characterized in that: The steps of decomposing the fault information recovery statement into a plurality of subtasks according to a predefined task decomposition prompt word template, and calling a small model corresponding to each subtask to execute the subtask specifically include: Pre-design the description text and matching prompt word template of each small model, wherein the description text represents the function of the small model, and the matching prompt word template represents the calling method of the small model; A corresponding small model is configured for each of the subtasks based on the description text, and the small model is called to execute the subtask based on the matching prompt word template.

5. The method for power distribution system fault recovery based on large and small model collaboration according to claim 1, characterized in that: Before the step of decomposing the fault information recovery statement into a plurality of subtasks according to the predefined task decomposition prompt word template, the method further includes: Taking text data containing fault information and a predefined task decomposition prompt word template as input, taking the task decomposition result of the text data containing fault information as output, designing sample pairs and constructing a task decomposition training set; The large model is fine-tuned based on the low-rank adaptive LoRA method on the task decomposition training set.

6. The method for power distribution system fault recovery based on large and 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 step further includes: A small model dataset containing expert demonstration strategies is constructed based on the power system dispatch regulations text; The fault recovery small model is obtained by training the small model data set using the DQfD method.

7. A distribution system fault recovery device based on large and small model collaboration, comprising: An acquisition module, used for searching in a pre-built knowledge base based on the received fault information recovery statement, and acquiring a large model prompt word and a large model context; A calling module, used to decompose the fault information recovery statement into a plurality of subtasks according to a predefined task decomposition prompt word template, and call a small model corresponding to each subtask to perform the subtask, wherein at least one of the small models is trained using a demonstration-based deep Q learning (DQfD) method; A generation module is used to generate a first recovery strategy based on the large model prompt word, the large model context and the fault information recovery statement, generate a second recovery strategy based on the output result of each of the small models, use the first recovery strategy and the second recovery strategy as output fault recovery strategies, and perform fault recovery on the power distribution system based on the fault recovery strategies.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the distribution system fault recovery method based on size model collaboration as described in any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the distribution system fault recovery method based on size model collaboration as described in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the distribution system fault recovery method based on size model collaboration as described in any one of claims 1 to 6 is implemented.

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

  • LANGUAGE MODEL GENERATION DEVICE AND LANGUAGE MODEL GENERATION METHOD

    JP7442239B1

  • Semantic understanding method and device

    WO2025000856A1