A large model staged tuning training method for power supply recovery of a power distribution network
Patent Information
- Application Number
- CN202611066969.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-17
- Publication Date
- 2026-10-09
AI Technical Summary
[0003]针对现有技术存在的大语言模型在陌生拓扑场景下因缺乏显式物理约束而导致供电恢复决策可行性与泛化能力不足的问题,本申请通过一种用于配电网供电恢复的大模型分阶段调优训练方法,实现提升模型在非训练集拓扑场景下供电恢复决策的物理一致性与工程适用性
本申请提供的一种用于配电网供电恢复的大模型分阶段调优训练方法,通过在强化学习阶段构建动作级物理安全过滤与网络级可行性检查的双重约束机制,将物理约束从传统的后置惩罚前移至候选动作生成与处理环节。该机制能够在奖励计算之前即剔除针对单个开关的违规操作及整体网络的不可行状态,使模型优化过程始终限定在物理安全的动作空间内,从根本上避免了模型在无效或违规动作上的算力浪费,显著提升了生成方案的物理一致性与工程可实施性。同时,通过构建涵盖运行方式、源荷场景及故障位置的多维场景增强矩阵,并对各维度进行联合组合扩展,系统性地覆盖了配电网在不同拓扑结构、负荷水平及故障条件下的长尾场景与极端工况,有效缓解了训练样本场景覆盖不足的问题。二者协同作用,使得模型不仅能够在已知场景中保持稳定性能,更能在未见过的陌生拓扑场景下维持较高的可行解率与最优解率,解决了现有大语言模型方法在复杂配电网场景下泛化能力差、决策安全性不足的技术难题。
Smart Images

Figure CN122886712A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power supply restoration in distribution networks and fine-tuning of large-scale power artificial intelligence models, specifically to a phased optimization training method for large-scale models used in power supply restoration of distribution networks. Background Technology
[0002] Currently, in the field of power distribution network restoration, with the expansion of distributed power source integration, rapid isolation and power restoration after a fault have become crucial for ensuring system resilience. Existing technologies mainly rely on mechanistic methods such as mathematical optimization or heuristic search, which suffer from problems such as complex modeling, long solution time, and insufficient adaptability to changes in scenarios. In recent years, large language models have been introduced into this field due to their strong instruction understanding and task modeling capabilities. However, existing methods based on large language models typically rely only on supervised fine-tuning for surface pattern fitting, lacking explicit embedding of physical constraints. When the network topology in the test scenario differs significantly from that in the training scenario, the model is prone to generating invalid actions, loop operations, or solutions that violate electrical safety constraints. This leads to a significant decrease in the feasible and optimal solution rates in unfamiliar topology scenarios, making it difficult to meet the requirements of decision-making safety and generalization ability in practical engineering applications. Summary of the Invention
[0003] To address the problem that existing large language models lack explicit physical constraints in unfamiliar topology scenarios, resulting in insufficient feasibility and generalization ability of power restoration decisions, this application proposes a phased optimization training method for large models used in distribution network power restoration. This method improves the physical consistency and engineering applicability of the model in power restoration decisions in non-training set topology scenarios.
[0004] To achieve the above objectives, this application adopts the following technical solution: A phased optimization training method for a large-scale model for power restoration in distribution networks includes: acquiring power restoration training samples for distribution networks based on a multi-dimensional scenario enhancement matrix; inputting the power restoration training samples into an initial strategy model to generate multiple candidate action sequences for a target fault scenario; performing action-level physical security filtering on the multiple candidate action sequences to obtain filtered action sequences; performing network-level feasibility checks on the filtered action sequences to obtain network-level check results; constructing a reward signal based on the filtering results of the action-level physical security filtering, the network-level check results, and load restoration indicators; and updating the model parameters of the initial strategy model based on the reward signal to obtain a power restoration decision model for distribution networks.
[0005] The above scheme introduces a dual constraint mechanism of action-level physical safety filtering and network-level feasibility checking in the reinforcement learning stage. This moves the physical constraint from simple result penalty to the candidate action processing stage, so that the model optimization process is always carried out within the constrained action space. This effectively avoids the waste of ineffective search resources. In addition, it expands the coverage of training samples by combining a multi-dimensional scene enhancement matrix, thereby improving the model's decision feasibility and generalization ability in unfamiliar topological scenarios.
[0006] As one implementation method, action-level physical security filtering is performed on the plurality of candidate action sequences to obtain a filtered action sequence, including: for each candidate action sequence, performing the following legality checks on each switching action in the candidate action sequence in sequence: checking whether the branch affected by the switching action exists in the line set of the current distribution network topology; checking whether the branch belongs to the set of switchable branches that are allowed to perform switching operations; checking whether the switching action is a repeated operation in the candidate action sequence; checking whether the switching action performs a closing operation on a faulty branch; checking whether the switching action causes a change in the switching state of the branch; if the switching action passes the legality check, the switching action is retained; if it fails, the switching action is removed to generate the filtered action sequence.
[0007] This implementation defines five dimensions of action-level legality verification rules to intercept illegal operations on individual switches before reward calculation, eliminating low-level errors such as misoperation of non-switchable branches, repetitive actions, accidental closing of faulty branches, and no-operation from the source, thus reducing the invalid search space of reinforcement learning.
[0008] As one implementation method, the following legality checks are performed sequentially on each switching action in the candidate action sequence, including: for the m-th switching action in the candidate action sequence, calculating the acceptance indication variable for the m-th switching action based on the branch existence judgment factor, the switchability judgment factor, the duplicate action judgment factor, the faulty branch erroneous closing judgment factor, and the no-operation judgment factor; wherein, the branch existence judgment factor is used to characterize whether the normalized branch corresponding to the m-th switching action belongs to the line set; the switchability judgment factor is used to characterize whether the normalized branch belongs to the line set. The branch set is switched; the repeated action judgment factor is used to characterize whether the normalized branch has been operated in the first m-1 switching actions; the fault branch erroneous closing judgment factor is used to characterize whether the normalized branch is a faulty branch and the target state is closed; the no-operation judgment factor is used to characterize whether the target state is different from the initial state of the normalized branch; when the acceptance indication variable meets the preset acceptance condition, the m-th switching action is determined to pass the legality check; based on the switching actions that pass the legality check, the filtered action sequence and the corresponding final branch state vector are reconstructed.
[0009] This implementation transforms discrete verification rules into quantified acceptance indicator variable calculation logic, realizing the mathematical expression and state reconstruction of the action-level filtering process. It ensures a strict correspondence between the filtered action sequence and the final branch state vector, providing an accurate state input basis for subsequent network-level feasibility checks.
[0010] As one implementation method, the multi-dimensional scenario enhancement matrix includes an operating mode dimension, a source-load scenario dimension, and a fault location dimension. Obtaining the power distribution network restoration training samples constructed based on the multi-dimensional scenario enhancement matrix includes: obtaining basic power distribution network restoration samples; based on the multi-dimensional scenario enhancement matrix, jointly combining and expanding multiple network topology configurations corresponding to the operating mode dimension, multiple load operating conditions corresponding to the source-load scenario dimension, and multiple fault branch locations corresponding to the fault location dimension to generate an enhanced sample set; and using the enhanced sample set as the power distribution network restoration training samples.
[0011] This implementation method constructs a sample augmentation matrix that includes three dimensions: operating mode, source load scenario, and fault location. Instead of simply exhaustively listing a single dimension, it combines and expands each dimension. This systematically covers long-tail scenarios of distribution networks under different topologies, load levels, and fault conditions, thus solving the problem of limited model generalization ability caused by training in a single scenario.
[0012] As one implementation method, based on the multi-dimensional scenario enhancement matrix, multiple network topology configurations corresponding to the operation mode dimension, multiple load operation conditions corresponding to the source-load scenario dimension, and multiple fault branch locations corresponding to the fault location dimension are jointly combined and expanded. This includes: in the operation mode dimension, extracting multiple typical network topology configurations to expand the initial switch-on / off states; in the source-load scenario dimension, clustering based on historical load curves to extract typical load centers, and constructing multiple load operation conditions including high load, medium load, low load, and extreme heavy load scenarios in combination with load level stratification; in the fault location dimension, filtering distribution network branches to determine the multiple fault branch locations; and generating corresponding fault recovery samples for any network topology configuration, any load operation condition, and any fault branch location to obtain the enhancement sample set.
[0013] This implementation method further enhances the ability of the sample set to represent complex operating conditions and stress test scenarios by adopting specific expansion strategies in various dimensions, especially by introducing extreme heavy load scenarios and special period operating conditions in the source load scenario dimension, enabling the model to learn a wider range of recovery rules.
[0014] As one implementation method, a reward signal is constructed based on the filtering results of the action-level physical security filtering, the network-level inspection results, and the load recovery index. This includes: when the network-level inspection results indicate that the filtered action sequence does not meet strict feasibility, a basic reward signal is constructed based on fixed penalty items and constraint violation penalty items; wherein, the constraint violation penalty items are determined based on the proportion of invalid actions, the proportion of no-operation actions, fault isolation failure indication, loop formation indication, and repair dependency; when the network-level inspection results indicate that the filtered action sequence meets strict feasibility, the basic reward signal is constructed based on the load recovery rate, partial recovery penalty items, and full recovery reward items; a reference recovery rate upper bound is obtained, and the recovery gap between the actual recovery rate of the filtered action sequence and the reference recovery rate upper bound is calculated; based on the basic reward signal, the gap penalty items corresponding to the recovery gap, and the additional reward items when matching the reference recovery rate upper bound, the final reward signal is determined.
[0015] This implementation constructs reward signals by distinguishing between feasible and infeasible states, and introduces a reference upper bound for recovery rate to shape the gap in the feasible state. This ensures that the model strictly adheres to physical constraints and guides the model to approach the theoretically optimal recovery effect, avoiding the phenomenon that the model stops optimizing when satisfied with a local feasible solution.
[0016] As one implementation method, the power distribution network restoration training samples are input into an initial strategy model to generate multiple candidate action sequences for the target fault scenario. This includes: acquiring a pre-trained language model and loading low-rank adaptation parameters to construct the initial strategy model; converting the power distribution network restoration training samples into a dialogic sample structure containing a system instruction layer, a user input layer, and an assistant output layer, and performing supervised fine-tuning training on the initial strategy model; during the reinforcement learning phase, for a single power distribution network restoration training sample, a random sampling strategy is used to sample multiple times from the conditional distribution of the initial strategy model to generate original candidate text; extracting structured action sequences from the original candidate text, and performing deduplication based on the filtered action sequences to form a candidate pool, thereby obtaining the multiple candidate action sequences.
[0017] This implementation establishes the model's basic decision-making capabilities through a conversational sample structure and low-rank adaptation fine-tuning. In the reinforcement learning stage, it employs multi-round sampling and a deduplication mechanism based on the filtered structure, which ensures candidate diversity while avoiding redundant calculations caused by differences in expression forms, thereby improving training efficiency.
[0018] Furthermore, this application also provides an apparatus for a phased optimization training method for a large model of power distribution network restoration, comprising: a sample acquisition module for acquiring power distribution network restoration training samples constructed based on a multi-dimensional scenario enhancement matrix; a candidate generation module for inputting the power distribution network restoration training samples into an initial strategy model to generate multiple candidate action sequences for a target fault scenario; a dual-constraint filtering module for performing action-level physical safety filtering on the multiple candidate action sequences to obtain filtered action sequences; and performing network-level feasibility checks on the filtered action sequences to obtain network-level check results; a reward construction module for constructing a reward signal based on the filtering results of the action-level physical safety filtering, the network-level check results, and load restoration indicators; and a parameter update module for updating the model parameters of the initial strategy model based on the reward signal to obtain a power distribution network restoration decision model.
[0019] The aforementioned device implements the complete process of the aforementioned training method through a modular architecture. The functions of each module and the steps of the method are strictly corresponding, ensuring the feasibility of the technical solution at the system level.
[0020] In addition, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any of the above-mentioned embodiments.
[0021] In addition, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the above claims.
[0022] Beneficial effects: This application provides a phased optimization training method for large-scale models used in power restoration of distribution networks. By constructing a dual constraint mechanism of action-level physical safety filtering and network-level feasibility checking during the reinforcement learning phase, physical constraints are moved from traditional post-penalty to the candidate action generation and processing stage. This mechanism can eliminate illegal operations targeting individual switches and infeasible states of the entire network before reward calculation, ensuring that the model optimization process is always confined within a physically safe action space. This fundamentally avoids wasting computational resources on invalid or illegal actions, significantly improving the physical consistency and engineering feasibility of the generated solutions. Simultaneously, by constructing a multi-dimensional scenario enhancement matrix covering operating modes, source-load scenarios, and fault locations, and jointly combining and expanding each dimension, a systematic coverage of long-tail scenarios and extreme conditions of distribution networks under different topologies, load levels, and fault conditions is achieved, effectively alleviating the problem of insufficient scenario coverage in training samples. The synergistic effect of these two methods enables the model to maintain stable performance not only in known scenarios but also to maintain a high feasible solution rate and optimal solution rate in unfamiliar topology scenarios, solving the technical challenges of poor generalization ability and insufficient decision security in existing large-scale language model methods in complex distribution network scenarios. Attached Figure Description
[0023] Figure 1 This is a flowchart of the power distribution network restoration decision model training method according to an embodiment of this application; Figure 2 This is a schematic diagram of the training sample structure for power distribution network restoration according to an embodiment of this application. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application 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 application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
[0026] Example 1: like Figure 1 As shown in the embodiments of this application, a phased optimization training method for a large model used in power distribution network restoration is provided. This method aims to improve the model's decision-making feasibility and generalization ability in unfamiliar topology scenarios by integrating sample augmentation, dual physical constraints, and reinforcement learning mechanisms. The training method mainly includes the following steps: Step S100: Obtain power supply restoration training samples for the distribution network based on the multi-dimensional scenario enhancement matrix.
[0027] Specifically, this step does not simply read historical data from the database, but rather systematically combines and expands the basic samples through a pre-defined multi-dimensional scenario enhancement matrix. For example, this multi-dimensional scenario enhancement matrix can cover multiple key dimensions such as operating mode, source load scenario, and fault location. By orthogonally combining or jointly sampling these dimensions, an enhanced sample set covering various operating conditions is generated. This construction method ensures that the training samples not only include normal operating states but also fully represent extreme heavy loads, special topologies, and various long-tail fault scenarios, thus providing a highly diverse and representative data foundation for subsequent model training and effectively alleviating the problem of limited model generalization ability caused by a single sample.
[0028] Step S200: Input the power supply restoration training samples of the distribution network into the initial strategy model to generate multiple candidate action sequences for the target fault scenario.
[0029] The initial policy model can be a pre-trained language model that has undergone supervised fine-tuning, possessing basic capabilities for understanding power distribution network tasks and generating actions. In this embodiment, for the target fault scenario corresponding to the same training sample, the model does not output only a single deterministic result, but generates multiple different candidate action sequences through random sampling or multi-round inference strategies. This "one-to-many" generation mechanism provides the necessary exploration space for the reinforcement learning stage, allowing the model to compare and select the best among multiple potential solutions, avoiding getting trapped in local optima or mode collapse.
[0030] Step S300: Perform action-level physical security filtering on multiple candidate action sequences to obtain filtered action sequences.
[0031] Specifically, this step constitutes the first line of defense in this application's dual constraint mechanism. Before the candidate action sequence enters the complex network-level verification, a fine-grained legality screening is performed on each switching action in the sequence. For example, it checks whether the action acts on a valid branch, whether there is duplicate operation, and whether it violates basic electrical safety rules. Through this pre-filtering step, invalid actions that obviously violate physical common sense or operating specifications can be quickly eliminated, significantly reducing the load on subsequent calculation steps. It should be understood that action-level physical safety filtering focuses on the compliance of the individual action itself. Its processing granularity is fine and its computational overhead is small, aiming to purify the candidate action space from the source.
[0032] Step S400: Perform a network-level feasibility check on the filtered action sequence to obtain the network-level check results.
[0033] This step constitutes the second layer of defense in the dual-constraint mechanism, following action-level filtering. Unlike action-level filtering, network-level feasibility checking focuses on the global network state after the entire action sequence is executed. For example, it verifies whether the restored distribution network maintains a radial structure, whether loops exist, whether the voltage at each node and the power flow in branches exceed limits, and whether the fault area is correctly isolated. Only candidate solutions that pass both action-level filtering and network-level checking are considered physically feasible. This hierarchical constraint design logic moves physical constraints from the traditional "post-event punishment" to the "action processing stage," ensuring that the model optimization process always takes place within a safe and feasible solution space.
[0034] Step S500: Based on the filtering results of action-level physical security filtering, network-level inspection results, and load recovery indicators, construct a reward signal.
[0035] Specifically, the construction of the reward signal is a complex decision-making process, rather than a linear mapping of a single indicator. This reward signal comprehensively considers both constraint satisfaction and task completion quality: on the one hand, it quantifies the model's adherence to physical rules based on information such as the proportion of actions eliminated in action-level filtering and the types of violations in network-level checks; on the other hand, it evaluates the actual effectiveness of power restoration by combining indicators such as load recovery rate and restored power volume. Furthermore, a reference upper bound for the recovery rate can be introduced to shape the gap, guiding the model towards the theoretical optimal solution. This complex reward mechanism can transmit multi-dimensional feedback information to the model, enabling it to internalize physical constraint requirements while learning restoration strategies.
[0036] Step S600: Update the model parameters of the initial strategy model based on the reward signal to obtain the power supply restoration decision model of the distribution network.
[0037] In this step, the constructed reward signal is used as the optimization objective, and a reinforcement learning algorithm is employed to iteratively update the parameters of the initial policy model. For example, the relative advantage can be calculated by comparing the reward values of different candidate action sequences under the same sample, thereby adjusting the probability of the model generating high-reward actions. After multiple rounds of training iterations, the model gradually learns to generate power restoration schemes with high recovery rates while satisfying dual physical constraints, ultimately resulting in a power restoration decision model for distribution networks with strong generalization ability and high engineering practicality.
[0038] Through the above process, this embodiment establishes a complete training closed loop of "sample augmentation - candidate generation - dual-constraint filtering - composite reward - parameter update". In particular, by linking action-level physical safety filtering and network-level feasibility checking before reward calculation, it fundamentally changes the existing approach of only applying soft constraints to the loss function, providing a clear logical anchor and higher-level boundary for the specific technical implementation of subsequent embodiments.
[0039] Example 2: Building upon Example 1, this example further refines the specific implementation logic of action-level physical security filtering. For each candidate action sequence among multiple candidate action sequences, a legality check is performed on each switching action in that candidate action sequence in sequence. Specifically, this includes: checking whether the branch affected by the switching action exists in the current distribution network topology's line set; checking whether the branch belongs to the set of switchable branches that are allowed to perform switching operations; checking whether the switching action is a repeated operation in the candidate action sequence; checking whether the switching action performs a closing operation on a faulty branch; and checking whether the switching action causes a change in the switching state of the branch. If the switching action passes the above legality checks, the switching action is retained; if it fails, the switching action is discarded to generate a filtered action sequence.
[0040] Specifically, this process is not a simple rule matching, but rather transforms discrete physical constraints into computable quantifiable logic. For the m-th switching action in the candidate action sequence, based on the branch existence judgment factor, switchability judgment factor, repetitive action judgment factor, faulty branch erroneous closing judgment factor, and no-operation judgment factor, the acceptance indicator variable for the m-th switching action is calculated. This acceptance indicator variable characterizes whether the current action simultaneously satisfies all physical safety constraints, and its calculation logic can be expressed as follows: in, This represents the indicator variable for the m-th switch action. When the action is accepted, it indicates that the action is accepted. This indicates that the action has been filtered out. The branch existence judgment factor is used to characterize whether the normalized branch corresponding to the m-th switch action belongs to the line set. Its function is to prevent the large language model from generating illusions and generating virtual line operations that do not actually exist in the distribution network. It serves as a switchability judgment factor, used to characterize whether a standardized branch belongs to the set of switchable branches. It aims to distinguish between controllable branches with switching equipment and fixed branches that only serve as electrical connections, thereby avoiding issuing incorrect commands to uncontrollable components such as transformer windings and bus connections. This is a repetitive action judgment factor used to characterize whether a normalized branch has been operated in the first m-1 switching actions. If the same branch is operated multiple times in the same recovery scheme, it is not only meaningless in actual engineering, but also leads to invalid redundancy in the state space. This factor can effectively intercept such logical errors. This is a fault branch erroneous closing judgment factor, used to characterize whether a standardized branch is a fault branch and the target state is closed. This is the bottom line constraint to ensure the safety of power supply restoration, and it is strictly forbidden to perform power supply operation on fault lines that have not yet been repaired. This is a no-operation judgment factor used to characterize whether the target state is different from the initial state of the normalized branch. If the model generates an action that closes a closed switch again or opens an open switch again, it is an invalid no-operation. This factor can ensure that every retained action can bring about a substantial topological change.
[0041] When the received indicator variable meets the preset acceptance condition, the m-th switch action is determined to have passed the validity check. In this embodiment, the preset acceptance condition is... This means that all five judgment factors mentioned above are true. Based on the switching actions that have passed the legality check, the filtered action sequence and the corresponding final branch state vectors are reconstructed. It should be noted that reconstructing the final branch state vectors is a crucial step in this process. Since some original actions have been removed, the execution timing and preceding states of the remaining actions may change. Therefore, it is necessary to re-deduce the final state of each branch based on the filtered action sequence, rather than directly using the original predicted states. Only the reconstructed branch state vectors can accurately reflect the actual network topology after the filtered action sequence has been executed, thus providing a correct input benchmark for subsequent network-level feasibility checks.
[0042] From a technical perspective, the action-level physical safety filtering mechanism constructed in this embodiment essentially establishes a "syntax check" defense before the reward calculation in reinforcement learning. In contrast, if this step is omitted and the original candidate actions generated by the model are directly sent to network-level feasibility checks (such as power flow calculation or topology connectivity analysis), the large language model is prone to generating a large number of low-quality samples containing fictitious branches, repetitive operations, or obvious violations in the early stages of exploration. These samples not only consume enormous computing resources when entering complex numerical calculation stages but also generate a large number of zero-reward feedbacks without gradients, making policy optimization difficult to converge. Through the quantization filtering logic of this embodiment, physical common sense can be hard-coded into preprocessing constraints of the action space, allowing the model to explore only within a legal and meaningful action subspace, significantly improving training efficiency and the engineering usability of the decision-making scheme. It should be understood that although this embodiment lists five specific judgment factors, in other implementations, verification dimensions can be added or adjusted according to the specific operating procedures of the distribution network, such as adding grounding switch interlock verification or operation sequence priority verification, as long as they follow the technical concept of screening individual actions for compliance before reward calculation, they should be covered within the scope of protection of this application.
[0043] Example 3: Building upon Example 1, this example further refines the construction and joint expansion mechanism of the multi-dimensional scenario enhancement matrix. As one implementation method, the multi-dimensional scenario enhancement matrix includes an operating mode dimension, a source-load scenario dimension, and a fault location dimension. The process of obtaining power supply restoration training samples for the distribution network based on the multi-dimensional scenario enhancement matrix is not a simple superposition of single-dimensional data, but rather a systematic expansion of the scenario through orthogonal combination. Specifically, this process includes: obtaining basic distribution network power supply restoration samples; based on the multi-dimensional scenario enhancement matrix, jointly combining and expanding multiple network topology configurations corresponding to the operating mode dimension, multiple load operating conditions corresponding to the source-load scenario dimension, and multiple fault branch locations corresponding to the fault location dimension to generate an enhanced sample set; and using the enhanced sample set as training samples for distribution network power supply restoration. The core of this joint combination expansion mechanism lies in "orthogonality" and "full coverage." For example, for any selected network topology configuration, it is necessary to traverse all possible combinations of load operating conditions and fault branch locations to form a three-dimensional sample space. Compared to traditional expansion methods that only add fault types under a single operating mode or adjust load levels only under a fixed topology, the joint expansion in this embodiment can capture the coupling effects between different dimensions. For example, a certain high-load condition may not lead to voltage exceedances under a conventional topology, but it may become a key bottleneck restricting recovery in a weak-loop network topology after the tie switch state has changed. Only through this cross-combination of all dimensions can the model learn the complex and ever-changing operating rules of the distribution network, thereby effectively improving its generalization ability in unfamiliar topology scenarios.
[0044] Furthermore, to ensure the effectiveness and relevance of the joint expansion, this embodiment has refined the specific expansion strategies for each dimension. The specific steps for joint combination expansion based on the multi-dimensional scene enhancement matrix include: Step S101: In terms of operating mode, extract multiple typical network topology configurations to expand the initial switch switching states. In actual operation, the opening and closing states of tie switches and sectionalizing switches in the distribution network dynamically adjust according to maintenance plans, seasonal changes, or load transfer demands, forming multiple typical operating modes. This embodiment does not rely solely on a single topology in the standard example, but extracts multiple representative network topology configurations from historical dispatch records or simulation systems. Each topology configuration represents a specific set of initial switch switching states, directly determining the electrical islanding and potential power supply paths after a fault occurs. By expanding this dimension, the model can adapt to decision-making needs under different network connectivity conditions, avoiding model failure when facing non-standard operating modes due to a single training data topology structure.
[0045] Step S102: In the source-load scenario dimension, typical load centers are extracted by clustering based on historical load curves, and multiple load operation conditions including high load, medium load, low load, and extreme heavy load scenarios are constructed by combining load level stratification. This is a key step in this embodiment to demonstrate the non-obviousness of sample construction. If only random sampling or uniform distribution is used to generate load data, it is often difficult to reflect the clustering characteristics and extreme risks of the spatiotemporal distribution of loads in the real power grid. Therefore, this embodiment first uses clustering algorithms (such as K-Means or DBSCAN) to analyze massive historical load curves and extract several representative typical load centers. These load centers reflect the inherent patterns of user electricity consumption behavior in the region. On this basis, a load level stratification strategy is further combined to map each typical load center to three conventional load levels: high, medium, and low, to cover the fluctuation range of daily operation. More importantly, this embodiment specifically introduces extreme heavy load scenarios, that is, simulating extreme operating conditions during special periods such as summer peak, cold wave heating, or sudden drop in distributed power generation output. Although these scenarios occur infrequently in historical data, they serve as a "litmus test" for evaluating the safety margin of power restoration schemes. By combining "typical patterns extracted by clustering" with "layered load levels" and "artificially introduced extreme scenarios," the source-load scenario dimension not only possesses statistical representativeness but also robustness verification value for engineering applications.
[0046] Step S103 involves filtering the distribution network branches to determine the locations of multiple faulty branches at the fault location level. While theoretically all branches could be exhaustively configured for faults, in practical engineering, the probability of faults occurring in some branches (such as extremely short connecting lines, pure cable sections, or dedicated lines with existing robust protection and isolation) is extremely low, or their consequences are not valuable for research. Therefore, this embodiment employs a filtering principle to determine fault locations, such as prioritizing branches on both sides of the main line sectionalizing switch, branches where tie switches are located, and older lines with historically high fault rates. This selective filtering strategy avoids wasting training resources on invalid samples and ensures that the generated samples are concentrated in the most challenging and discriminative key locations for power restoration decisions.
[0047] Step S104: For any network topology configuration, any load operating condition, and any fault branch location, generate corresponding fault recovery samples to obtain an augmented sample set. Through the joint combination of the above three dimensions, the final generated augmented sample set can reach tens of thousands or even more. It should be understood that the value of such a large-scale sample lies not only in the increase in quantity, but also in its deep coverage of long-tail scenarios. In traditional supervised fine-tuning training, the model often can only learn the patterns of high-frequency "head" scenarios, and performs poorly when facing low-frequency but high-risk "long-tail" scenarios (such as multiple faults under extreme heavy load and special topology). This embodiment, through systematic matrix expansion, forcibly generates a large number of samples covering various boundary conditions and extreme combinations, enabling the model to fully "see" and learn recovery strategies under these complex scenarios during the training phase. This improvement in generalization ability brought about by sample construction cannot be replaced by simply adjusting model parameters or optimizing the loss function, and is the essence that distinguishes the technical solution of this application from conventional data augmentation methods.
[0048] Example 4: Building upon Examples 1 to 3, this example further refines the construction logic of the reward signal. As one implementation method, based on the filtering results of action-level physical security filtering, network-level inspection results, and load recovery indicators, the process of constructing the reward signal is designed as a composite decision-making mechanism. Specifically, it includes: when the network-level inspection results indicate that the filtered action sequence does not meet strict feasibility, a basic reward signal is constructed based on fixed penalty items and constraint violation penalty items; wherein, the constraint violation penalty items are determined based on the proportion of invalid actions, the proportion of no-operation actions, fault isolation failure indications, loop formation indications, and repair dependency; when the network-level inspection results indicate that the filtered action sequence meets strict feasibility, a basic reward signal is constructed based on the load recovery rate, partial recovery penalty items, and full recovery reward items; a reference recovery rate upper bound is obtained, and the recovery gap between the actual recovery rate of the filtered action sequence and the reference recovery rate upper bound is calculated; based on the basic reward signal, the gap penalty items corresponding to the recovery gap, and the additional reward items when matching the reference recovery rate upper bound, the final reward signal is determined.
[0049] Specifically, the core of this composite construction mechanism lies in switching the reward calculation mode based on whether the solution possesses "strict feasibility" in a physical sense, thereby avoiding invalid relative comparisons of superiority and inferiority within the infeasible solution space. When the filtered action sequence fails the network-level feasibility check (e.g., due to loops, voltage exceeding limits, or failure to isolate faults), the system determines the solution as infeasible. At this point, the construction of the basic reward signal is dominated by "punishment." First, a fixed penalty term is applied as a baseline negative feedback to explicitly inform the model that the path is unacceptable. On this basis, constraint violation penalty terms are further superimposed to perform fine-grained quantification of specific violation types. For example, the invalid action ratio reflects the proportion of actions removed by the action-level filter in the model output; the higher this ratio, the more the original strategy generated by the model deviates from physical common sense. The no-operation ratio characterizes how many redundant instructions the model generates that do not change the branch state. The fault isolation failure indicator is a binary variable used to severely punish high-risk behaviors that fail to correctly isolate fault areas. The loop formation indicator punishes topological errors that violate the radial operation constraints of the distribution network. It is particularly important to explain the "fix dependency" metric, which characterizes the degree to which the current candidate solution depends on the preceding action-level physical security filtering layer. If the original action sequence generated by the model contains a large number of illegal operations, but after being corrected by the filter, it barely becomes a "seemingly" normal sequence (although it may still fail the network-level check), this "corrected solution" should not receive a higher rating than the "natively compliant solution." By introducing fix dependency as a penalty factor, we can force the model to improve its ability to generate legal actions, rather than simply relying on external error correction mechanisms.
[0050] Conversely, when the filtered action sequence passes the network-level feasibility check and is determined to be a valid solution that meets strict feasibility requirements, the reward construction mode switches to an incentive-driven approach. At this point, the basic reward signal primarily depends on the core business metric of load recovery rate. To prevent the model from settling for a conservative strategy of only restoring a small amount of non-critical load, this embodiment introduces a partial recovery penalty term to moderately suppress feasible solutions whose recovery rates do not reach the expected threshold; simultaneously, a full recovery reward term is set to provide additional positive incentives for high-quality solutions that achieve full recovery of lost loads or reach extremely high recovery rates. This segmented incentive structure effectively guides the model to continue exploring better solutions within the feasible region, rather than stagnating at locally feasible solutions.
[0051] More importantly, to further enhance the model's ability to approximate the theoretical optimal solution, this embodiment introduces a "gap shaping" strategy. During reinforcement learning training, relying solely on the aforementioned basic reward signals often makes it difficult to distinguish the superiority of two equally feasible solutions with similar recovery rates, especially in the later stages of training, where the model is prone to performance bottlenecks. Therefore, this embodiment constructs a dynamic optimization objective by obtaining a reference upper bound for the recovery rate. This reference upper bound can be obtained in advance through small-scale enumeration search, traditional mechanistic optimization algorithms, or expert experience rules, representing the theoretically best recovery effect achievable under the current fault scenario. Based on this upper bound, the recovery gap between the actual recovery rate of the filtered action sequence and the reference upper bound is calculated. In the synthesis of the final reward signal, on the one hand, a gap penalty term proportional to the recovery gap is applied; that is, the further the actual effect deviates from the theoretical upper limit, the greater the penalty, thus creating continuous optimization pressure. On the other hand, when the gap between the actual recovery rate and the reference upper bound is less than a preset tolerance threshold, an additional reward term is triggered, providing the model with significant positive feedback. This mechanism is equivalent to setting up a dynamically moving "bullseye" for the reinforcement learning process, upgrading the model's optimization objective from the static "recover more load" to the dynamic "approach the theoretical optimum," effectively solving the problem of gradient vanishing or fuzzy guidance in the later stages of training of traditional reward functions.
[0052] It should be understood that although this embodiment describes the logical structure of each penalty and reward item in detail, in actual implementation, the specific weight coefficients of each item can be adaptively adjusted or manually tuned according to the operating characteristics and safety requirements of the distribution network. For example, in core urban power grids with extremely high requirements for power supply reliability, the penalty weights for fault isolation failure indications and loop formation indications can be significantly increased; while in areas with high distributed power penetration, the penalty intensity for power quality-related violations such as voltage exceeding limits can be appropriately increased. In addition, the method for obtaining the upper bound of the reference recovery rate is not limited to the methods listed above; any technical means that can provide a benchmark value for the recovery effect in the current scenario can be applied to the gap shaping strategy of this embodiment. Through this composite reward construction mechanism, this application not only ensures the physical security and engineering feasibility of the model output scheme, but also gives the model an intrinsic driving force to continuously pursue excellent recovery effects, significantly improving the comprehensive performance of the distribution network power supply recovery decision model in complex and ever-changing scenarios.
[0053] Example 5: Building upon Examples 1 to 4, this example further refines the construction of the initial strategy model and the candidate action generation strategy. As one implementation method, the process of inputting distribution network power restoration training samples into the initial strategy model to generate multiple candidate action sequences for the target fault scenario specifically includes: acquiring a pre-trained language model and loading low-rank adaptation parameters to construct the initial strategy model; converting the distribution network power restoration training samples into a dialogic sample structure containing a system instruction layer, a user input layer, and an assistant output layer, and performing supervised fine-tuning training on the initial strategy model; during the reinforcement learning phase, for a single distribution network power restoration training sample, employing a random sampling strategy to perform multiple rounds of sampling from the conditional distribution of the initial strategy model to generate original candidate text; extracting structured action sequences from the original candidate text, and performing deduplication based on the filtered action sequences to form a candidate pool, thereby obtaining multiple candidate action sequences.
[0054] Specifically, the initial policy model was constructed using a parameter-efficient fine-tuning technique. This embodiment selects a pre-trained language model with strong general semantic understanding capabilities as the base, and constructs the initial policy model by loading low-rank adaptation (LoRA) parameters. Compared to full fine-tuning, LoRA technology can freeze most parameters of the base model while training only a small number of low-rank decomposition matrices. This significantly reduces memory usage and training costs, and effectively preserves the original general language capabilities of the base model, avoiding severe catastrophic forgetting during fine-tuning in vertical domains. Furthermore, continuous learning strategies can be introduced, such as adding regularization terms to the loss function or using elastic weight consolidation algorithms, to further balance the relationship between learning new knowledge and retaining old knowledge, ensuring that the model, while mastering professional skills in power distribution network restoration, still possesses basic logical reasoning and instruction following capabilities.
[0055] like Figure 2As shown, to enable the pre-trained language model to accurately understand and process power restoration tasks in the distribution network, this embodiment designs a dedicated conversational sample structure. This structure strictly follows the interaction paradigm of large language models and includes three core layers: the system instruction layer, the user input layer, and the assistant output layer. The system instruction layer defines the model's role, task background, and output format specifications. For example, it explicitly tells the model, "You are a distribution network dispatching expert. Please generate a power restoration plan that conforms to physical constraints based on the given fault scenario and output it in JSON format." The user input layer carries specific scenario information, including structured data such as network topology connection tables, node load data, power capacity limitations, and current fault branch identifiers. This data is usually organized in the form of tables or key-value pairs for accurate model parsing. The assistant output layer is the standard answer that the model expects to generate, typically a JSON object containing a success status identifier, an action sequence, and a supplied_loads list of restored loads. By converting training samples into this standardized dialogue structure, the model can efficiently learn the mapping relationship between "scene input and decision output" during the supervised fine-tuning stage, and establish a structured generation capability that conforms to engineering specifications.
[0056] After entering the reinforcement learning phase, in order to obtain diverse candidate solutions for policy optimization, this embodiment employs a random sampling strategy to sample multiple times from the conditional distribution of the initial policy model for the power supply restoration training samples of a single distribution network, generating original candidate text. Specifically, the randomness and diversity of the generated text can be controlled by adjusting the sampling temperature and the kernel sampling threshold (top-p). For example, the sampling temperature can be set to 1.0, and the top-p to 0.9. This parameter combination ensures that the model does not overly concentrate on high-probability conservative solutions, while also avoiding the generation of a large amount of completely grammatically incorrect noisy text due to excessive randomness. By performing multiple rounds of sampling (e.g., generating K candidates per round, for a total of R rounds), an original candidate set containing multiple potential solutions can be constructed for the same training sample. This provides a necessary benchmark for subsequent calculation of relative advantages within groups and updating policy parameters.
[0057] However, the original candidate texts obtained directly from model sampling often contain redundancy in their expression. For example, for the same physically equivalent recovery scheme, the model may generate multiple text variations such as "close switch A and then close switch B" or "first close B and then close A". If deduplication is performed only based on the original text strings, these semantically identical but literally different candidates will be treated as different samples and retained, resulting in a large number of substantially duplicate schemes in the candidate pool. This not only wastes the computational power of subsequent physical verification and reward calculation but also dilutes the gradient contribution of effective samples. To address this, this embodiment proposes a deduplication mechanism based on filtered structured candidates. Specifically, a structured action sequence is first extracted from each original candidate text, and then processed using the action-level physical safety filtering logic described in the previous embodiment to obtain a filtered action sequence. Since physical safety filtering is deterministic and normative, all physically equivalent action sequences will converge to a unique standard form after filtering and normalization. Therefore, this embodiment performs deduplication based on the filtered action sequence; that is, if two candidate schemes have completely identical action sequences after filtering, they are determined to be duplicate samples, and only one is retained. This deduplication strategy fundamentally eliminates semantic redundancy caused by differences in natural language expressions, ensuring that each element in the candidate pool represents a unique physical operation scheme, thereby significantly improving sample utilization efficiency and training convergence speed in the reinforcement learning phase. It should be understood that although this embodiment uses LoRA fine-tuning and specific sampling parameters as examples, other efficient parameter fine-tuning methods (such as Prefix Tuning, Adapter, etc.) or different sampling strategies can be used in other embodiments. As long as they can achieve the function of constructing an initial policy model and generating diverse candidate action sequences, they should all be covered within the scope of this application.
[0058] Example 6: like Figure 2 As shown in the figure, this application provides a training device for a power distribution network restoration decision model. This device adopts a modular architecture to implement the complete process of the aforementioned training method, ensuring the feasibility and independence of the technical solution at the system level. The training device includes a sample acquisition module, a candidate generation module, a dual-constraint filtering module, a reward construction module, and a parameter update module.
[0059] The sample acquisition module is used to acquire training samples for power distribution network restoration based on a multi-dimensional scenario enhancement matrix. Specifically, this module is not a simple data storage or retrieval interface, but a functional unit integrating multi-dimensional scenario extension logic. During operation, the sample acquisition module automatically calls topology configuration, load conditions, and fault location data from the basic sample library according to a preset enhancement matrix strategy, and generates enhanced sample sets covering various long-tail scenarios in real time through an orthogonal combination algorithm. This design allows the device to dynamically adapt to the diverse sample requirements of different training stages, avoiding model generalization bottlenecks caused by static datasets, and providing a high-quality data input foundation for subsequent modules.
[0060] The candidate generation module is used to input power restoration training samples from the distribution network into the initial policy model and generate multiple candidate action sequences for the target fault scenario. Internally, this module encapsulates a supervised, fine-tuned pre-trained language model and its inference engine. During operation, the candidate generation module first converts the received training samples into a conversational structure adapted to the large language model. Then, by adjusting parameters such as sampling temperature and kernel sampling threshold, it performs multiple rounds of random sampling from the model's conditional probability distribution. In this way, the module can output a set of differentiated original candidate texts for the same fault scenario and parse out structured action sequences from them, thus providing necessary exploration space and comparison benchmarks for reinforcement learning.
[0061] A dual-constraint filtering module performs action-level physical safety filtering on multiple candidate action sequences to obtain a filtered action sequence. It then performs a network-level feasibility check on the filtered action sequence to obtain a network-level check result. This module is the core processing unit of the device in this application, integrating an action-level filtering subunit and a network-level checking subunit, which are strictly cascaded in data processing. Specifically, candidate action sequences first enter the action-level filtering subunit. This subunit calculates the acceptance indicator variable for each action based on five legality verification factors, including branch existence, switchability, and anti-duplication operation. It quickly eliminates invalid operations that violate basic physical principles and outputs the purified filtered action sequence. Subsequently, this sequence is seamlessly passed to the network-level checking subunit for global state evaluation, including radial topology verification, power flow violation checks, and fault isolation verification. This design, which encapsulates two layers of constraints within the same module, ensures that physical safety verification is an inseparable pre-processing step, effectively preventing the propagation of illegal actions to downstream reward calculation stages and significantly reducing the system's unnecessary computational power consumption.
[0062] The reward construction module is used to construct reward signals based on the filtering results of action-level physical safety filtering, network-level inspection results, and load recovery indicators. This module receives status feedback from the dual-constraint filtering module and external load recovery data, and generates scalar reward values through a built-in composite reward calculation engine. In implementation, this module automatically switches calculation modes based on the feasibility indicators of the network-level inspection results: for infeasible solutions, it superimposes fixed penalties and various constraint violation penalties; for feasible solutions, it performs gap shaping calculations by combining the load recovery rate with the upper bound of the reference recovery rate. This integrated reward construction mechanism enables the device to transmit multi-dimensional feedback signals that balance safety and optimality to the model, guiding the strategy to continuously approach the theoretically optimal solution.
[0063] The parameter update module is used to update the model parameters of the initial strategy model based on the reward signal, thereby obtaining the power supply restoration decision model for the distribution network. This module acts as the execution terminal of the training loop, using the reward signal output by the reward construction module to calculate the relative advantage within each candidate scheme under the same sample, and accordingly employing a reinforcement learning algorithm to iteratively adjust the model parameters in the candidate generation module. Through repeated execution of the "generation-filtering-evaluation-update" data flow process, the parameter update module drives the model to gradually internalize the dual physical constraints, ultimately outputting a power supply restoration decision model for the distribution network with high generalization ability and engineering practicality. It should be understood that the above modules can be implemented by independent hardware circuits or stored in a processor as software functional units for execution; as long as they can achieve corresponding data interaction and functional collaboration, they fall within the protection scope of this application.
[0064] Example 7: This application also provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the training method for the power distribution network power restoration decision model described in any of the above embodiments.
[0065] Specifically, the computer device is the physical entity that carries and runs the aforementioned training method. The memory and processor are interconnected via a system bus or other communication interface to achieve high-speed transmission of data and control signals. The memory may include volatile memory, such as random access memory (RAM), used to temporarily cache intermediate data such as training samples, candidate action sequences, and model parameter gradients during training; or it may include non-volatile memory, such as read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or disk storage devices, used to persistently store the operating system, database, and computer program code implementing the method of this application. Considering that the training of the power distribution network restoration decision model involves large-scale matrix operations and deep learning inference, the processor preferably uses a graphics processing unit (GPU), a neural network processor (NPU), or a multi-core central processing unit (CPU), or a heterogeneous computing cluster composed of the above processors to provide sufficient parallel computing power support. When the processor reads and executes the computer program from memory, its internal circuitry is configured to sequentially perform operations such as sample acquisition, candidate generation, dual-constraint filtering, reward construction, and parameter updating, thereby transforming the abstract process into a specific electrical signal processing procedure, turning the general-purpose computing device into a dedicated intelligent decision-making training platform for power distribution networks.
[0066] Furthermore, embodiments of this application also provide a computer-readable storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, it implements the steps of the training method for the power distribution network power restoration decision model described in any of the above embodiments.
[0067] It should be understood that the computer-readable storage medium in this embodiment specifically refers to a non-transient tangible medium, excluding transient forms such as carrier waves and propagating signals. The specific form of this storage medium can be diverse, such as a USB flash drive, external hard drive, optical disc, magnetic tape, solid-state drive (SSD), or storage array in a cloud storage server. As an independent carrier of the software product, this storage medium records a set of instructions used to control computer devices to execute the training method of this application. In practical applications, this storage medium can be sold, distributed, or downloaded via the network, enabling different users to load and run the same training logic in their respective computing environments. This implementation ensures that the technical solution not only exists as a method but can also be circulated and protected in the form of a software product, effectively covering the boundaries of rights in various commercial application scenarios such as software licensing and cloud service subscriptions. Through the implementation of the aforementioned device and medium, the technical solution of this application can move beyond the purely theoretical level of algorithms and be realized as a manufacturable and marketable industrial product, providing standardized hardware and software infrastructure support for the intelligent upgrading of power distribution network restoration.
[0068] Example 8: To verify the effectiveness of the power distribution network restoration decision model training method provided in the aforementioned embodiments in practical applications, particularly its generalization ability for unfamiliar topology scenarios, this embodiment constructs a test and evaluation application example for non-training set topologies. In this application, the power distribution network restoration decision model obtained through the complete training process of embodiments 1 to 5 is used as the test object, and it is deployed in a simulation test environment for performance evaluation.
[0069] Specifically, the construction of test scenarios follows the principle of "separation of training and testing distribution" to ensure that the evaluation results can truly reflect the model's generalization performance. For example, IEEE 33-node or IEEE 69-node standard distribution systems are selected as the base network. By changing the position of tie switches, adjusting the configuration of sectionalizing switches, and simulating line modifications, several unfamiliar topology variants with significantly different topological connections from the training set are generated. Simultaneously, the extreme heavy load conditions and multiple fault settings described in the aforementioned embodiments are superimposed on these unfamiliar topologies to form an unfamiliar topology test set containing hundreds of test samples. This test set construction method can effectively verify whether the model has truly learned the physical essence of power restoration in the distribution network, rather than merely memorizing specific topology patterns from the training samples.
[0070] During the evaluation process, a multi-dimensional indicator system was used to comprehensively and quantitatively evaluate the model output. Core evaluation indicators include format accuracy, feasible solution ratio, optimal solution ratio, and fault isolation success rate. Format accuracy measures whether the model output conforms to the predefined JSON structured specification, reflecting the model's basic instruction-following ability. The feasible solution ratio refers to the proportion of generated recovery schemes that simultaneously meet radial operation constraints, branch capacity constraints, node voltage constraints, and fault isolation requirements; this indicator directly reflects the engineering safety and physical consistency of the model's decisions. The optimal solution ratio refers to the proportion of feasible solutions whose load recovery rate reaches the theoretical reference upper limit or is within the preset tolerance range; it is used to evaluate the model's recovery efficiency under safe conditions. The fault isolation success rate specifically targets the accuracy of handling faulty branches and is a key indicator for ensuring the safety baseline of power restoration.
[0071] By conducting large-scale inference tests on this unfamiliar topology test set and comparing the results with traditional methods relying solely on supervised fine-tuning and conventional reinforcement learning methods without action-level physical safety filtering, significant performance differences can be observed. Test data shows that under the same unfamiliar topology test conditions, the feasible solution ratio of traditional supervised fine-tuning methods is typically only 55% to 65%, and it is prone to generating non-compliant solutions containing loops or voltage exceedances when facing complex topology changes. While the feasible solution ratio of conventional reinforcement learning methods without action-level filtering is improved (approximately 70% to 80%), the convergence of the optimal solution ratio is slow and fluctuates significantly due to the large amount of computational power consumed in exploring and penalizing invalid actions. In contrast, the distribution network power restoration decision model obtained using the training method of this application maintains a stable format accuracy of over 99% on the unfamiliar topology test set, increases the feasible solution ratio to the 95% to 98% range, achieves an optimal solution ratio of over 85%, and has a fault isolation success rate approaching 100%.
[0072] The superior performance described above is essentially attributable to the synergistic effect of the dual constraint mechanism and the multi-dimensional sample enhancement matrix in the technical solution of this application. On the one hand, the multi-dimensional scenario enhancement matrix, by forcibly covering the joint combination space of operating mode, source load scenario, and fault location during the training phase, enables the model to pre-learn the intrinsic representations for various topology variations and extreme operating conditions, thus maintaining stable feature extraction and decision mapping capabilities even when facing unfamiliar topologies. On the other hand, the dual constraint mechanism consisting of action-level physical security filtering and network-level feasibility checks intercepts violations caused by topology cognitive biases in real time during the inference phase, ensuring that even if the model generates some erroneous attempts in unfamiliar environments, these errors will be corrected or eliminated immediately, preventing them from evolving into infeasible solutions. This technical architecture of "broad coverage during training and strict constraints during inference" fundamentally solves the industry problem of poor generalization ability and low safety margin of large language models in the vertical field of power distribution networks.
[0073] It should be understood that the IEEE standard node systems, specific test index values, and comparison methods listed in this embodiment are merely illustrative examples and do not constitute a limitation on the scope of protection of this application. In practical engineering applications, the test scenario can be a real regional distribution network of any scale or its digital twin model, and the evaluation index can also be adjusted according to specific business needs by adding dimensions such as action execution time and economic weight of switching operation frequency. As long as the model obtained based on the aforementioned training method is used and its performance is verified and evaluated in a non-training set topology scenario, it falls within the application scope of the technical solution of this application. The verification through this embodiment fully demonstrates that the training method provided by this application can effectively improve the practicality and reliability of the distribution network power supply restoration decision model under complex and variable actual working conditions.
[0074] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A phased optimization and training method for a large model used in power supply restoration of distribution networks, characterized in that, include: Obtain training samples for power supply restoration of the distribution network based on a multi-dimensional scenario enhancement matrix; The power supply restoration training samples of the power distribution network are input into the initial strategy model to generate multiple candidate action sequences for the target fault scenario; Perform action-level physical security filtering on the multiple candidate action sequences to obtain the filtered action sequences; Perform a network-level feasibility check on the filtered action sequence to obtain the network-level check results; Based on the filtering results of the action-level physical security filtering, the network-level inspection results, and the load recovery indicators, a reward signal is constructed. The model parameters of the initial strategy model are updated based on the reward signal to obtain the power distribution network restoration decision model.
2. The method according to claim 1, characterized in that, The step of performing action-level physical security filtering on the multiple candidate action sequences to obtain filtered action sequences includes: For each of the plurality of candidate action sequences, the following validity checks are performed sequentially on each switch action in the candidate action sequence: Verify whether the branch affected by the switch action exists in the line set of the current distribution network topology; Verify whether the branch belongs to the set of switchable branches that are allowed to perform switching operations; Verify whether the switching action is a repeated operation in the candidate action sequence; Verify whether the switch action closes the faulty branch; Verify whether the switch action causes a change in the switch state of the branch; If the switching action passes the validity check, the switching action is retained; if it fails, the switching action is discarded to generate the filtered action sequence.
3. The method according to claim 2, characterized in that, The following validity checks are performed sequentially on each switch action in the candidate action sequence, including: For the first of the candidate action sequences The first switching action, based on the branch existence judgment factor, switchability judgment factor, repetitive action judgment factor, faulty branch erroneous closing judgment factor, and no-operation judgment factor, calculates the first... The variable that receives the indication of a switch action; Wherein, the branch existence judgment factor is used to characterize the first Whether the standardized branch corresponding to each switching action belongs to the circuit set; the switchability judgment factor is used to characterize whether the standardized branch belongs to the switchable branch set; the repeating action judgment factor is used to characterize whether the standardized branch has already been... The switch is operated in a single operation; the fault branch misclosing judgment factor is used to characterize whether the normalized branch is a fault branch and the target state is closed; the no-operation judgment factor is used to characterize whether the target state is different from the initial state of the normalized branch; When the acceptance indicator variable meets the preset acceptance condition, the first... Each switch action passes the aforementioned legality verification; Based on the switching actions that pass the validity check, the filtered action sequence and the corresponding final branch state vector are reconstructed.
4. The method according to claim 1, characterized in that, The multi-dimensional scenario enhancement matrix includes the operation mode dimension, source load scenario dimension, and fault location dimension; The acquisition of power supply restoration training samples for the distribution network constructed based on a multi-dimensional scene enhancement matrix includes: Obtain power restoration samples from the basic power distribution network; Based on the multi-dimensional scenario enhancement matrix, multiple network topology configurations corresponding to the operation mode dimension, multiple load operation conditions corresponding to the source-load scenario dimension, and multiple fault branch locations corresponding to the fault location dimension are jointly combined and expanded to generate an enhanced sample set. The enhanced sample set will be used as the training sample for power supply restoration of the power distribution network.
5. The method according to claim 4, characterized in that, The step of jointly combining and expanding multiple network topology configurations corresponding to the operation mode dimension, multiple load operation conditions corresponding to the source-load scenario dimension, and multiple fault branch locations corresponding to the fault location dimension based on the multi-dimensional scenario enhancement matrix includes: In the operational mode dimension, multiple typical network topology configurations are extracted to expand the initial switch-on / off states; In the source load scenario dimension, typical load centers are extracted by clustering based on historical load curves, and multiple load operation conditions including high load, medium load, low load and extreme heavy load scenarios are constructed by combining load level hierarchies. In the fault location dimension, the distribution network branches are filtered to determine the locations of the plurality of fault branches; For any of the aforementioned network topology configurations, any of the aforementioned load operating conditions, and any of the aforementioned fault branch locations, corresponding fault recovery samples are generated to obtain the enhanced sample set.
6. The method according to claim 1, characterized in that, Based on the filtering results of the action-level physical security filtering, the network-level inspection results, and the load recovery indicators, a reward signal is constructed, including: When the network-level inspection results indicate that the filtered action sequence does not meet the strict feasibility requirement, a basic reward signal is constructed based on fixed penalty items and constraint violation penalty items; wherein, the constraint violation penalty items are determined based on the proportion of invalid actions, the proportion of no-operation, the fault isolation failure indication, the loop formation indication, and the repair dependency. When the network-level inspection results indicate that the filtered action sequence meets strict feasibility, the basic reward signal is constructed based on the load recovery rate, partial recovery penalty, and full recovery reward. Obtain a reference upper bound for the recovery rate, and calculate the recovery gap between the actual recovery rate of the filtered action sequence and the reference upper bound for the recovery rate; The final reward signal is determined based on the basic reward signal, the gap penalty term corresponding to the recovery gap, and the additional reward term when matching the upper bound of the reference recovery rate.
7. The method according to claim 1, characterized in that, The power supply restoration training samples of the distribution network are input into the initial strategy model to generate multiple candidate action sequences for the target fault scenario, including: Obtain a pre-trained language model and load low-rank adaptation parameters to construct the initial policy model; The power distribution network restoration training samples are converted into a dialogic sample structure containing a system instruction layer, a user input layer, and an assistant output layer, and supervised fine-tuning training is performed on the initial strategy model. During the reinforcement learning phase, for a single training sample of power supply restoration of the distribution network, a random sampling strategy is used to sample multiple times from the conditional distribution of the initial strategy model to generate original candidate text; Structured action sequences are extracted from the original candidate text, and deduplication is performed based on the filtered action sequences to form a candidate pool, thereby obtaining the multiple candidate action sequences.
8. An apparatus for a phased optimization training method for a large model of power supply restoration in a distribution network, characterized in that, include: The sample acquisition module is used to acquire power distribution network restoration training samples based on a multi-dimensional scenario enhancement matrix. The candidate generation module is used to input the power supply restoration training samples of the distribution network into the initial strategy model to generate multiple candidate action sequences for the target fault scenario; A dual-constraint filtering module is used to perform action-level physical security filtering on the multiple candidate action sequences to obtain filtered action sequences. A network-level feasibility check is then performed on the filtered action sequence to obtain the network-level check results. The reward construction module constructs a reward signal based on the filtering results of the action-level physical security filtering, the network-level inspection results, and the load recovery indicators. The parameter update module updates the model parameters of the initial strategy model based on the reward signal to obtain the power distribution network restoration decision model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.