A Power Grid Fault Prediction and Automated Handling System Based on Digital Twin and Reinforcement Learning

By constructing a digital twin of the power grid and a course learning mechanism, and combining reinforcement learning to train a fault handling strategy network, the technical challenges of power grid fault prediction and automatic handling were solved, achieving efficient and safe automatic handling of power grid faults and improving fault response speed and strategy optimization capabilities.

CN123121541APending Publication Date: 2026-11-17WEIHAI POWER SUPPLY COMPANY OF STATE GRID SHANDONG ELECTRIC POWER COMPANY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611275383.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-21
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing technologies lack the ability to organically integrate the high-fidelity simulation capabilities of digital twin environments with the policy optimization capabilities of reinforcement learning, making it impossible to achieve a complete technical solution for power grid fault prediction and automatic handling, especially in terms of fault scenario coverage and policy generation and execution.

Method used

A digital twin of the power grid is constructed as a virtual environment for reinforcement learning training. A course learning mechanism is adopted to train the fault handling strategy network in stages. Combined with the fault scenario generation module, fault pre-drilling and strategy verification module, and automatic handling execution module, a closed loop of the whole process of real-time fault perception, online strategy generation and security verification is realized.

Benefits of technology

By training the strategy network with high-fidelity simulation, the convergence speed and quality of fault handling strategies are improved, ensuring the real-time performance and safety and reliability of the handling plan, shortening the fault response time, and improving the automation level of power grid fault handling.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

A power grid fault prediction and automatic handling system based on digital twins and reinforcement learning belongs to the field of power system automation and artificial intelligence technology. It includes a digital twin modeling module, a fault scenario generation module, a reinforcement learning training module, a fault prediction and strategy verification module, and an automatic handling execution module. The digital twin modeling module constructs a digital twin of the power grid that evolves synchronously with the physical power grid. The fault scenario generation module generates a set of fault scenarios covering multiple fault types. The reinforcement learning training module uses the digital twin as an interactive environment and employs a course learning mechanism to train the fault handling strategy network in stages according to increasing complexity, achieving parameter transfer across stages. The fault prediction and strategy verification module performs multi-branch deduction and combines it with the strategy network to generate the optimal handling solution. The automatic handling execution module automatically executes the system after security verification. This invention realizes the transformation of power grid fault handling from being driven by manual experience to being driven by both data and models, significantly improving handling speed and strategy quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a power grid fault prediction and automatic handling system based on digital twins and reinforcement learning, belonging to the fields of power system automation and artificial intelligence technology. Background Technology

[0002] With the continuous development of the social economy, the power grid is expanding in scale and becoming increasingly complex, characterized by AC / DC hybrid operation, high proportion of new energy integration, and widespread application of power electronic equipment. Power grid operation modes are highly variable, and fault patterns exhibit diversity, cascading effects, and uncertainty. The risk of a single fault triggering a chain reaction of faults or even widespread blackouts remains. Traditional power grid fault handling relies primarily on the experience of dispatching personnel and offline contingency plans, relying on manual judgment and operation when a fault occurs. This approach suffers from slow response times, suboptimal handling solutions, and difficulty in adapting to complex cascading fault scenarios.

[0003] In existing fault handling technologies, offline contingency planning analysis typically involves power flow calculations and stability analysis based on typical operating modes. The resulting contingency plans have limited coverage and struggle to enumerate all possible fault combinations in actual operation. While online dynamic safety analysis systems can assess real-time operating conditions, their primary function is safety warning rather than automatic generation of handling strategies. Fault handling methods based on expert systems rely on the completeness of the rule base and lack adaptability to novel fault scenarios not covered by the rule base. Fault handling strategy generation methods based on traditional optimization algorithms often simplify the problem to a linear or convex optimization model, making it difficult to accurately describe the nonlinear dynamic characteristics and temporal constraints in the power grid fault handling process.

[0004] Digital twin technology is a rapidly developing cutting-edge technology in recent years. Its core idea is to construct a high-fidelity digital mapping of physical entities in virtual space, achieving synchronous evolution between the physical and virtual systems through real-time data interaction. In the power grid sector, digital twin technology provides a new technical path for achieving refined management and intelligent operation throughout the entire power grid lifecycle. However, existing power grid digital twin applications mainly focus on equipment status monitoring, operational visualization, and training simulation, and have not yet fully explored the potential of digital twins in fault prediction and response strategy verification.

[0005] Reinforcement learning, as an important branch of machine learning, autonomously learns optimal strategies through continuous interaction between an agent and its environment, aiming to maximize cumulative rewards, demonstrating powerful capabilities in complex sequential decision-making problems. Applying reinforcement learning to power grid fault handling holds promise for shifting from "human experience-driven" to "data and model-driven" approaches. However, in practical applications, reinforcement learning agents require a large number of interaction samples for training; direct trial-and-error training on real power grids is neither realistic nor acceptable. Furthermore, power grid fault handling involves a mixed action space of discrete switching operations and continuous power regulation; the diversity of fault scenarios and variations in operating modes pose significant challenges to the construction of the training environment.

[0006] In summary, existing technologies lack a complete technical solution that can organically integrate the high-fidelity simulation capabilities of digital twin environments with the policy optimization capabilities of reinforcement learning, thereby achieving power grid fault prediction, automatic generation of response strategies, and closed-loop execution. How to efficiently train reinforcement learning agents in a digital twin environment, how to effectively cover diverse fault scenarios during training, and how to achieve safe and reliable automatic execution after policy generation are pressing technical problems that need to be solved in this field. Summary of the Invention

[0007] To achieve the above objectives, the present invention provides the following technical solution:

[0008] The purpose of this invention is to address the shortcomings of existing technologies by providing a power grid fault prediction and automatic handling system based on digital twins and reinforcement learning. By constructing a power grid digital twin as a virtual environment for reinforcement learning training and fault prediction, the system gradually increases the complexity of fault scenarios through a course learning mechanism to train the handling strategy network. On this basis, a closed-loop process is achieved, encompassing real-time fault perception, online strategy generation, safety verification of handling plans, and automatic execution.

[0009] To achieve the above objectives, the present invention adopts the following technical solution.

[0010] A power grid fault prediction and automatic handling system based on digital twin and reinforcement learning includes:

[0011] The digital twin modeling module is used to acquire the topology data, equipment parameter data, real-time measurement data and historical operation data of the power grid, and construct a digital twin of the power grid that evolves synchronously with the physical power grid. The digital twin of the power grid includes a steady-state simulation engine, a dynamic simulation engine and a fault simulation engine, which can simulate the evolution of the power grid's operating state under normal operating conditions, disturbance operating conditions and fault operating conditions.

[0012] The fault scenario generation module is used to generate a set of fault scenarios covering multiple fault types and combinations based on historical fault records of the power grid, equipment defect data, and operational risk analysis results. Each fault scenario in the set of fault scenarios includes fault location, fault type, fault sequence, and equipment action constraint information.

[0013] The reinforcement learning training module is used to train the fault handling strategy network in stages using the power grid digital twin as the interactive environment and the fault handling strategy network as the intelligent agent, and adopts a course learning mechanism. The course learning mechanism trains the fault handling strategy network in stages according to the fault scenario complexity from low to high, on single fault scenario set, multi-fault scenario set and cascading fault scenario set. After the training of each stage is completed, the strategy network parameters are transferred to the next stage as initial parameters.

[0014] The fault simulation and strategy verification module is used to perform multi-branch simulation of the current fault scenario in the power grid digital twin when an actual fault is detected in the power grid or a simulation instruction is received, to evaluate the effect of different candidate handling strategies, and to perform comprehensive optimization by combining the recommended handling strategies output by the fault handling strategy network to generate the optimal handling solution.

[0015] The automatic handling execution module is used to perform safety verification on the optimal handling plan. After the verification is passed, the module automatically issues control commands through the power grid dispatch control system according to the operation sequence in the optimal handling plan, and performs real-time tracking and effect evaluation of the execution process.

[0016] Preferably, in the digital twin modeling module, the steady-state simulation engine is used to calculate the power flow distribution of the power grid under a given operating mode, the dynamic simulation engine is used to simulate the electromechanical transient process and medium-to-long-term dynamic process of the power grid after disturbance, and the fault simulation engine is used to simulate the transient process of short-circuit faults, open-circuit faults, and equipment malfunctions or failures to operate; the power grid digital twin performs rolling correction of its internal state through real-time measurement data to keep the operating state of the virtual power grid synchronized with the actual power grid.

[0017] Preferably, in the fault scenario generation module, the generation process of the fault scenario set is as follows: first, fault mode features are extracted from historical fault records of the power grid, and the fault probability distribution is determined by combining equipment defect data and operation risk analysis results; then, an initial fault scenario set is generated by Monte Carlo sampling; finally, the initial fault scenario set is clustered to remove duplicates and the boundary is filtered to form a fault scenario set for training.

[0018] Preferably, in the reinforcement learning training module, the fault handling strategy network adopts an actor-commentator architecture, wherein the actor network is used to output the probability distribution of fault handling actions, and the commentator network is used to estimate the state-action value function; the input states of the fault handling strategy network include the grid topology connection state, node voltage amplitude and phase angle, line active and reactive power, generator output, load level, fault signal and protection action signal; the output actions include circuit breaker opening and closing operations, disconnector opening and closing operations, transformer tap adjustment, reactive power compensation device switching, generator output adjustment and load shedding operations.

[0019] Preferably, in the reinforcement learning training module, the specific implementation of the course learning mechanism is as follows:

[0020] In the first training phase, the fault handling strategy network is trained on a subset of fault scenarios containing only a single fault type, namely, a three-phase short-circuit fault, a single-phase ground fault, or a transformer fault. The training objective is to restore the power grid to a safe and stable operating state after the fault.

[0021] In the second training phase, the policy network parameters trained in the first phase are used as initial parameters to continue training on a subset of fault scenarios that include multiple faults occurring simultaneously or sequentially. The multiple fault scenarios include multiple line faults within the same substation and associated faults between different substations.

[0022] In the third training phase, the policy network parameters trained in the second phase are used as initial parameters to train on a subset of fault scenarios that include the cascading fault evolution process. The cascading fault scenarios include power flow shifts, equipment overloads, and subsequent fault cascading caused by the initial fault triggering protection actions.

[0023] Preferably, in the reinforcement learning training module, the reward function is designed to comprehensively consider power grid safety indicators and economic indicators. The safety indicators include the degree of node voltage exceeding limits, the degree of line overload, system frequency deviation, load loss, and equipment damage risk. The economic indicators include load shedding costs, power generation adjustment costs, and equipment operation costs. When the actions output by the fault handling strategy network lead to a deterioration of the power grid state, a negative reward is given; when the fault is effectively eliminated and the power grid returns to safe and stable operation, a positive reward is given.

[0024] Preferably, in the fault prediction and strategy verification module, the multi-branch deduction is implemented as follows: taking the current actual operating state of the power grid as the initial state, deduction is performed in the power grid digital twin along different fault evolution paths. The fault evolution paths include the natural fault development path, the development path with a conservative handling strategy, and the development path with an aggressive handling strategy. Each deduction path records the power grid state evolution trajectory, protection action sequence, and stress level borne by the equipment, which are used to evaluate the safety and stability of the power grid under that path.

[0025] Preferably, in the automatic handling execution module, the security verification includes static security verification and dynamic security verification; the static security verification includes thermal stability verification and voltage security verification of the power flow distribution of the power grid after the optimal handling scheme is executed; the dynamic security verification includes time-domain simulation verification of the transient stability of the power grid during the execution of the optimal handling scheme; the security verification is completed in the power grid digital twin, and execution can only be issued after the verification is passed.

[0026] Preferably, the system further includes an online model update module, which is used to periodically or event-triggeredly calibrate the parameters of the power grid digital twin using the latest operating data and fault handling records, and incrementally retrain the fault handling strategy network using newly added successful fault handling cases; the event triggering conditions include significant changes in the power grid topology, commissioning of new equipment, and the deviation of the strategy execution effect from expectations exceeding a preset threshold.

[0027] Preferably, the automatic processing execution module adopts a mechanism that combines step-by-step execution and step-by-step confirmation during the execution process. That is, each operation step is executed sequentially according to the operation sequence. After each step is executed, the power grid status is verified in the power grid digital twin to see if it meets the expectations. If it meets the expectations, the next step is executed. If it deviates from the expectations by more than the preset tolerance, the execution is paused and a re-rehearsal is triggered.

[0028] A method for power grid fault prediction and automatic handling based on digital twins and reinforcement learning includes the following steps:

[0029] Step 1: Construct a digital twin of the power grid: acquire the topology data, equipment parameter data, real-time measurement data and historical operation data of the power grid, construct a steady-state simulation engine, a dynamic simulation engine and a fault simulation engine, and form a digital twin of the power grid that evolves synchronously with the physical power grid;

[0030] Step 2: Generate a set of fault scenarios: Based on historical power grid fault records, equipment defect data, and operational risk analysis results, generate a set of fault scenarios covering multiple fault types and combinations through Monte Carlo sampling and clustering screening.

[0031] Step 3, phased training of course learning: Using the power grid digital twin as the interactive environment, the course learning mechanism is adopted to train the fault handling strategy network in phases on the single fault scenario subset, the multi-fault scenario subset, and the cascading fault scenario subset. In each phase, the strategy network parameters trained in the previous phase are used as the initial parameters for transfer.

[0032] Step 4, Real-time Fault Detection and Prediction: Monitor the power grid operation status in real time. When a fault is detected or a prediction instruction is received, use the current actual operation status of the power grid as the initial state and perform multi-branch fault simulation in the power grid digital twin.

[0033] Step 5, generation and optimization of handling strategies: Input the state information of the current fault scenario into the trained fault handling strategy network to obtain recommended handling strategies; compare the recommended handling strategies with the multi-branch inference results to generate the optimal handling solution;

[0034] Step 6, Security Verification and Automatic Execution: The optimal solution is subjected to static and dynamic security verification in the digital twin. After the verification is passed, the control system automatically issues control commands to execute step by step and tracks and verifies the execution effect.

[0035] The beneficial effects of this invention are:

[0036] 1. This invention solves the problem that reinforcement learning agents cannot be trained on real power grids by constructing a high-fidelity digital twin of the power grid as a virtual environment for reinforcement learning training and fault simulation. At the same time, it makes full use of the high-fidelity simulation capability of the digital twin, so that the trained strategy can be effectively transferred to real power grid scenarios.

[0037] 2. This invention employs a course learning mechanism to train the fault handling strategy network in stages, gradually transitioning from simple single-fault scenarios to complex cascading fault scenarios. This significantly improves the convergence speed of the strategy network and the quality of the final strategy, avoiding the training instability and strategy degradation problems that may occur when training directly on complex fault scenarios.

[0038] 3. This invention organically combines fault prediction with reinforcement learning strategy generation. When a fault occurs, it uses a digital twin to perform multi-branch deduction to predict the consequences of different handling paths, and uses a trained policy network to quickly generate recommended handling schemes, thus taking into account both the real-time nature of the handling and the optimality of the strategy.

[0039] 4. This invention sets up a strict security verification and step-by-step execution mechanism to ensure that the automatically generated disposal plan undergoes full simulation verification before formal execution, compares the expected effect in real time during execution, and has the ability to safely interrupt, effectively ensuring the safety and reliability of automatic disposal. Detailed Implementation

[0040] Example 1

[0041] This embodiment provides a specific implementation scheme for a power grid fault prediction and automatic handling system based on digital twins and reinforcement learning. The system is deployed in the regional power grid dispatch and control center and interacts with the existing dispatch automation system and energy management system.

[0042] Specific implementation of the digital twin modeling module

[0043] The digital twin modeling module acquires network topology and equipment parameter data from the power grid energy management system. Topology data includes substation wiring configurations, busbar connections, line corridor information, and transformer parameters. Equipment parameter data includes generator rated capacity and dynamic parameters, line impedance and thermal stability limits, transformer tap positions and impedance parameters, reactive power compensation device capacity, and load static characteristic parameters.

[0044] Real-time measurement data is acquired through a data acquisition and monitoring control system, including voltage amplitude and phase angle at each node, active and reactive power of each line, tap position of each transformer, position status of each circuit breaker and disconnector, active and reactive power output of each generator, and active and reactive power demand at each load point. The measurement data refresh cycle is on the order of seconds, which can meet the requirements of digital twin status synchronization.

[0045] Historical operational data includes power grid operation logs, fault records, protection action records, maintenance records, and equipment defect records from the past few years, which are used for parameter identification and model calibration of the digital twin.

[0046] The core of the power grid digital twin consists of three simulation engines. The steady-state simulation engine uses the Newton-Raphson method or the fast decomposition method for power flow calculation, solving for the voltage and power distribution of the power grid under given injected power and topology. The dynamic simulation engine uses time-domain simulation methods to establish differential equation models of generators and their excitation systems, speed control systems, power system stabilizers, and the dynamic characteristics of loads, solving for the electromechanical transient processes of the power grid after disturbances through numerical integration. The fault simulation engine can simulate various types of short-circuit and open-circuit faults, including three-phase short circuits, two-phase short circuits, two-phase-to-ground short circuits, single-phase-to-ground short circuits, and single-phase and two-phase open circuits. Fault simulation is achieved by introducing fault impedance at the fault point or changing the network topology.

[0047] The synchronization mechanism between the digital twin and the physical power grid comprises two layers. The first layer is state synchronization, which involves periodically correcting the state variables in the digital twin using real-time measurement data and employing a weighted least squares state estimation method to eliminate the impact of measurement errors. The second layer is event synchronization, which means that when events such as switch changes, protection actions, and equipment switching are detected in the power grid, the corresponding states are immediately updated synchronously in the digital twin. Through this two-layer synchronization mechanism, the digital twin can maintain a high degree of consistency with the physical power grid.

[0048] Specific implementation of the fault scenario generation module

[0049] The fault scenario generation module first extracts fault mode features from historical fault records of the power grid. After cleaning and structuring, the extracted features include fault component type, fault phase, fault duration, operating mode characteristics at the time of the fault, load level before the fault, protection actions after the fault, and secondary faults caused by the fault. Using association rule mining methods, the module analyzes the correlation and causal relationships between different faults to form a fault association graph.

[0050] Equipment defect data comes from the equipment management system and online monitoring system, including equipment health status scores, defect levels, historical failure counts, and years of operation. Operational risk analysis results are obtained through risk assessment of the current power grid operation mode, including failure probability estimates for each component, risk of exceeding limits at critical sections, and voltage instability risk.

[0051] Based on the above information, a fault probability distribution model is constructed. For line components, the fault probability is related to factors such as line length, service life, health status score, and corridor environmental conditions. For substation equipment such as transformers and busbars, the fault probability is related to factors such as equipment health status, load rate, and operating environment. Based on the fault probability distribution, an initial set of fault scenarios is generated using Monte Carlo sampling. Each fault scenario defines specific faulty components, fault types, fault occurrence time, fault clearing methods, and whether it is accompanied by protection malfunctions or failures to operate.

[0052] Clustering and deduplication are performed on the initial set of fault scenarios. A feature vector-based clustering method is used, where the feature vectors include fault location, fault type, and operating mode characteristics. Scenarios that are too close together are merged into representative scenarios. After removing redundant scenarios, the scenario set is divided into three levels according to fault complexity: single-fault scenario subsets, multi-fault scenario subsets, and cascading fault scenario subsets. The single-fault scenario subset contains scenarios where a single component in the power grid experiences a single fault; the multi-fault scenario subset contains scenarios where two or more faults occur simultaneously or sequentially within a short period; the cascading fault scenario subset contains complex scenarios where an initial fault triggers a series of protection actions and power flow transfers, leading to subsequent cascading faults.

[0053] Specific implementation of the reinforcement learning training module

[0054] The fault handling strategy network adopts an actor-commentator architecture. The actor network is a multilayer perceptron structure. The input layer receives the grid state vector, and after passing through several hidden layers, the output layer outputs the probability distribution of each discrete action and the mean and variance of continuous actions. The commentator network also adopts a multilayer perceptron structure, taking the state vector and action vector as inputs and outputting the estimated value of the state-action value function. The state vector includes the grid topology connection state, the voltage amplitude and phase angle of each node, the active and reactive power of each line, the output of each generator, the load level, fault signals, and protection action signals. The action space includes two categories: discrete actions and continuous actions. Discrete actions include circuit breaker opening and closing operations and disconnector opening and closing operations, while continuous actions include transformer tap adjustment, reactive power compensation device switching, generator output adjustment, and load shedding.

[0055] The specific process of phased training in the course is as follows.

[0056] The first phase of training is conducted on a subset of single-fault scenarios. During training, a fault scenario is randomly selected from the subset each time, and the corresponding fault conditions are set in the digital twin. The interaction begins with the power grid state at the moment the fault occurs as the initial state. After observing the state, the policy network outputs a response action. The digital twin executes the action, updates the state, and calculates the reward. This process is repeated until a preset maximum number of interaction steps is reached or the power grid returns to a safe and stable operating state. The first phase of training is considered complete when the cumulative reward stabilizes and the policy network's success rate on the validation set reaches a preset threshold.

[0057] The second phase of training is conducted on a subset of multi-fault scenarios. The policy network parameters trained in the first phase are directly used as the initial parameters for the second phase. The training method for multi-fault scenarios is similar to that in the first phase, but the scenario complexity is significantly increased. The policy network needs to reasonably allocate resources for handling multiple faults and learn the correlations between faults. Since the initial parameters already have the ability to handle single faults, the second phase of training can converge to a policy capable of handling multiple faults in a relatively short time.

[0058] The third phase of training is conducted on a subset of cascading failure scenarios. The dynamic evolution of cascading failure scenarios is more complex, requiring the policy network to learn to select appropriate intervention timing and methods during the failure cascading process to prevent further spread of the failure. After the third phase of training, the failure handling policy network possesses the ability to generate effective handling strategies in complex failure scenarios.

[0059] The reward function design considers both the safety and economy of power grid operation. The reward consists of three parts: a basic safety reward, a handling effect reward, and an economic penalty. The basic safety reward is determined based on whether the power grid is within a safe operating range. A positive basic reward is given when all node voltages are within the allowable deviation range of their rated values, all line load rates are below the thermal stability limit, and the system frequency is within the allowable range. When there are voltage exceedances, line overloads, or frequency deviations, negative penalties are given according to the degree of exceedance. The handling effect reward is determined based on whether the fault was successfully cleared and the number of time steps required for the power grid to return to safe and stable operation. The economic penalty is calculated based on factors such as load shedding, generator output adjustment, and the number of equipment operations.

[0060] Experience replay and target network techniques are employed during training to improve training stability. Experience samples generated from interactions between the agent and the digital twin are stored in an experience replay buffer. During training, mini-batch samples are randomly drawn from the buffer for gradient updates. The target network is a delayed-update copy of the critic network, used to calculate the temporal difference target value. Parameters from the critic network are copied to the target network at regular intervals.

[0061] Specific implementation of the fault prediction and strategy verification module

[0062] When an actual fault occurs in the power grid, the fault detection system quickly senses the fault through methods such as protection action signals, switch change signals, and electrical quantity change detection. After receiving the fault information, the fault simulation and strategy verification module first obtains the complete operating state of the current power grid from the digital twin as the initial state for the simulation.

[0063] Multi-branch simulations are conducted in parallel on a digital twin. The first branch represents the natural progression path of the fault, allowing it to evolve naturally according to physical laws without any human intervention, observing the potential chain reactions and most severe consequences. The second branch represents the development path employing a conservative response strategy, assuming dispatchers act according to existing emergency plans, evaluating the effectiveness and shortcomings of traditional methods. The third branch represents the development path employing an aggressive response strategy, assuming more proactive measures are taken, assessing the potential additional risks and benefits of such a strategy. Each simulation path continues until the power grid stabilizes or the preset simulation duration limit is reached.

[0064] Detailed evolution trajectory data was recorded during the simulation, including information such as the power grid status, protection action sequence, and equipment stress level at each time step. By comparing and analyzing the results of different simulation branches, the differences in consequences of different handling strategies can be intuitively understood, providing a basis for strategy optimization.

[0065] Simultaneously, the current fault scenario's state information is input into the trained fault handling strategy network to obtain recommended handling strategies. These strategies include specific operation sequences and suggested execution times for each operation. The recommended strategies are then comprehensively compared with the results of multi-branch deductions. If the expected performance of the recommended strategy is better than that of each deduction branch, the recommended strategy is adopted; if a particular deduction branch performs better, the differences between that branch's strategy and the recommended strategy are analyzed, and an improved strategy is generated by combining the advantages of both. The final optimal handling solution includes a complete operation sequence, execution conditions for each operation, and expected results.

[0066] Specific implementation of the automatic processing execution module

[0067] After the optimal mitigation plan is generated, a safety verification is first performed in the digital twin. Static safety verification calculates power flow based on the expected grid state after the mitigation plan is implemented, checking whether the load rate of each line is below the thermal stability limit, whether the voltage of each node is within the allowable range, and whether each transformer is overloaded. Dynamic safety verification uses time-domain simulation to simulate the transient response of the grid during the implementation of the mitigation plan, checking whether the system maintains transient stability, whether there is a risk of loss of synchronization, and whether there is a risk of voltage collapse.

[0068] After the safety verification is passed, the automatic handling execution module converts the operation sequence in the optimal handling plan into a control command format that the dispatch control system can recognize, and issues them sequentially according to the operation sequence. Execution adopts a combination of step-by-step execution and step-by-step confirmation: after each operation is executed, the system waits for the grid status to be updated, retrieves the post-execution grid status from the digital twin, and compares it with the expected effect. If the actual state and the expected state are within the preset tolerance range, the next step is executed; if the deviation exceeds the tolerance, execution is paused, and a re-enactment is performed in the digital twin to adjust the subsequent operation sequence.

[0069] During execution, continuous effectiveness evaluation is conducted, recording the actual effect of each operation, the degree of improvement in grid status, and the cumulative recovery time. After all operations are completed, the entire handling process is summarized and evaluated, a handling report is generated, and the complete data of this handling is stored in the case library as the data basis for subsequent model updates and strategy optimization.

[0070] Specific implementation of the online model update module

[0071] The online model update module employs two mechanisms: periodic updates and event-triggered updates. Periodic updates are performed monthly, using the most recent month's new operational data and fault handling records to calibrate the equipment parameters and load model in the digital twin. Event-triggered updates are initiated under the following circumstances: significant changes in the power grid topology (such as the commissioning of a new substation, the commissioning or decommissioning of an important transmission line), the integration of new types of equipment, and policy execution results deviating from expectations by more than a preset threshold.

[0072] The parameter calibration of the digital twin employs a sensitivity-based parameter identification method, aiming to reduce the deviation between simulation results and actual measurement data by adjusting key parameters in the model. Incremental retraining of the fault handling strategy network utilizes newly added successful fault handling cases as demonstration data, combined with continuous interactive training within the digital twin, enabling the strategy network to gradually adapt to changes in the power grid structure and operating mode.

[0073] Example 2

[0074] This embodiment takes a regional power grid as an example to further illustrate the practical application effect of the present invention.

[0075] The regional power grid comprises 210 nodes, 320 lines, 45 generator units, and 68 substations, with voltage levels covering 500 kV, 220 kV, and 110 kV. The constructed digital twin maintains near-second synchronization with the regional power grid's operational data.

[0076] The fault scenario generation module extracted typical fault modes from historical fault records over the past five years, including line lightning tripping, transformer internal faults, bus faults, circuit breaker malfunctions, and protection maloperations. Combined with equipment defect data, it generated a training scenario set containing 8,500 fault scenarios. Among them, there are approximately 4,200 single fault scenarios, approximately 3,000 multi-fault scenarios, and approximately 1,300 cascading fault scenarios.

[0077] After three stages of training via a course, the fault handling policy network achieved a single fault success rate of over 97%, a multi-fault success rate of over 91%, and a cascading fault success rate of over 83% on the validation set. Compared to policy networks trained directly on all fault scenarios without a course, the policy network trained via a course improved training convergence speed by approximately 42% and achieved a success rate of approximately 18 percentage points higher in cascading fault scenarios.

[0078] In an actual three-phase short-circuit fault on a 500 kV line, the system completed fault detection and status acquisition within approximately 1.8 seconds of the fault occurring. Multi-branch deduction within the digital twin took approximately 3 seconds, and the strategy network generated recommended handling strategies in approximately 0.3 seconds. The optimal handling plan was then formed after comprehensive optimization. The handling plan was automatically executed after safety verification, including operations such as disconnecting the faulty line, adjusting the power flow distribution of adjacent lines, adjusting generator output, and activating reactive power compensation devices. The entire handling process, from fault occurrence to the grid's restoration to a safe and stable operating state, took approximately 4.5 seconds, reducing the time required by traditional manual handling methods by about 70%. No secondary problems such as voltage exceeding limits or line overload occurred during the handling process, and the load shedding amount was significantly lower than the estimated load shedding amount in traditional contingency plans.

[0079] Example 3

[0080] This embodiment illustrates the application of the present invention in power grid fault pre-simulation training and emergency drills.

[0081] During non-faulty periods, operators can use this system to conduct fault simulations and emergency drills. Operators can set hypothetical fault scenarios or select typical fault scenarios from the historical fault case library through the human-machine interface. The system will reproduce the complete evolution process of the fault scenario in a digital twin. Operators can choose manual handling mode, human-machine collaborative handling mode, or fully automatic handling mode.

[0082] In manual response mode, operators issue control commands through a user interface, and the digital twin calculates and displays changes in the power grid status in real time, allowing operators to intuitively see the consequences of each action. In human-machine collaborative response mode, the fault handling strategy network provides real-time handling suggestions for operators' reference, who can choose to adopt, modify, or reject the suggestions. In fully automated response mode, the system independently completes the entire process from fault detection to response execution.

[0083] After each exercise, the system automatically generates an evaluation report, including indicators such as response time, rationality of response path, correctness of operation steps, and quality of power grid status restoration. The report is then compared and analyzed with the recommended strategies from the fault handling strategy network to help operators identify shortcomings in their own response approaches and improve their emergency response capabilities.

[0084] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Those skilled in the art should understand that various modifications and equivalent substitutions can be made to the present invention without departing from its spirit and scope, and all such modifications and substitutions should be covered within the protection scope of the present invention.

Claims

1. A power grid fault pre-play and automatic handling system based on digital twin and reinforcement learning, characterized in that, include: The digital twin modeling module is used to acquire the topology data, equipment parameter data, real-time measurement data and historical operation data of the power grid, and construct a digital twin of the power grid that evolves synchronously with the physical power grid. The digital twin of the power grid includes a steady-state simulation engine, a dynamic simulation engine and a fault simulation engine, which are used to simulate the evolution of the power grid's operating state under normal operating conditions, disturbance operating conditions and fault operating conditions. The fault scenario generation module is used to generate a set of fault scenarios covering multiple fault types and fault combinations based on historical fault records of the power grid, equipment defect data, and operational risk analysis results. The reinforcement learning training module is used to train the fault handling strategy network in stages using the power grid digital twin as the interactive environment and the fault handling strategy network as the intelligent agent, and adopts a course learning mechanism. The course learning mechanism performs stage training in stages according to the fault scenario complexity from low to high, on single fault scenario set, multi-fault scenario set and cascading fault scenario set. After the training of each stage is completed, the strategy network parameters are transferred to the next stage as initial parameters. The fault simulation and strategy verification module is used to perform multi-branch simulation of the current fault scenario in the power grid digital twin when an actual fault is detected in the power grid or a simulation instruction is received, to evaluate the effect of different candidate handling strategies, and to perform comprehensive optimization by combining the recommended handling strategies output by the fault handling strategy network to generate the optimal handling solution. The automatic handling execution module is used to perform safety verification on the optimal handling plan. After the verification is passed, the module automatically issues control commands through the power grid dispatch control system and tracks and evaluates the execution process in real time.

2. The power grid fault pre-play and automatic handling system based on digital twin and reinforcement learning according to claim 1, characterized in that, In the digital twin modeling module, the steady-state simulation engine is used to calculate the power flow distribution of the power grid under a given operating mode; the dynamic simulation engine is used to simulate the electromechanical transient process and medium-to-long-term dynamic process of the power grid after disturbance; and the fault simulation engine is used to simulate the transient process of short-circuit faults, open-circuit faults, and equipment malfunctions or failures to operate. The power grid digital twin performs rolling correction of its internal state through real-time measurement data to keep the operating state of the virtual power grid synchronized with that of the actual power grid.

3. The power grid fault prediction and automatic handling system based on digital twin and reinforcement learning according to claim 1, characterized in that, In the fault scenario generation module, the process of generating the fault scenario set is as follows: extracting fault mode features from historical fault records of the power grid, determining the fault probability distribution by combining equipment defect data and operational risk analysis results; and generating an initial fault scenario set through Monte Carlo sampling. The initial set of fault scenarios is clustered, deduplicated, and filtered by boundaries to form a set of fault scenarios for training.

4. The power grid fault prediction and automatic handling system based on digital twin and reinforcement learning according to claim 1, characterized in that, The fault handling strategy network adopts an actor-commentator architecture, where the actor network is used to output the probability distribution of fault handling actions, and the commentator network is used to estimate the state action value function. The input states of the fault handling strategy network include the grid topology connection state, node voltage amplitude and phase angle, line active and reactive power, generator output, load level, fault signal and protection action signal. The output actions include circuit breaker opening and closing operations, disconnector opening and closing operations, transformer tap adjustment, reactive power compensation device switching, generator output adjustment and load shedding operations.

5. The power grid fault prediction and automatic handling system based on digital twin and reinforcement learning according to claim 1, characterized in that, The specific implementation of the course learning mechanism is as follows: In the first training phase, the fault handling strategy network is trained on a subset of fault scenarios containing only a single fault type. The training objective is to restore the power grid to a safe and stable operating state after the fault. In the second training phase, the policy network parameters trained in the first phase are used as initial parameters to continue training on a subset of fault scenarios that include multiple faults occurring simultaneously or sequentially. In the third training phase, the policy network parameters trained in the second phase are used as initial parameters to train on a subset of fault scenarios that include the cascading failure evolution process.

6. The power grid fault prediction and automatic handling system based on digital twin and reinforcement learning according to claim 1, characterized in that, In the reinforcement learning training module, the reward function comprehensively considers power grid safety indicators and economic indicators. The safety indicators include the degree of node voltage exceeding the limit, the degree of line overload, the system frequency deviation, the amount of load loss and the risk of equipment damage. The economic indicators include the cost of load shedding, the cost of power generation adjustment and the cost of equipment operation. A negative reward is given when the actions output by the fault handling strategy network cause the power grid condition to deteriorate, and a positive reward is given when the fault is effectively eliminated and the power grid returns to safe and stable operation.

7. A power grid fault prediction and automatic handling system based on digital twin and reinforcement learning according to claim 1, characterized in that, In the fault prediction and strategy verification module, the multi-branch deduction is as follows: taking the current actual operating state of the power grid as the initial state, deduction is performed in the power grid digital twin along different fault evolution paths. The fault evolution paths include the natural fault development path, the development path of adopting a conservative disposal strategy, and the development path of adopting an aggressive disposal strategy. Each simulation path records the power grid state evolution trajectory, protection action sequence, and stress level borne by the equipment.

8. A power grid fault prediction and automatic handling system based on digital twin and reinforcement learning according to claim 1, characterized in that, In the automatic handling execution module, the safety verification includes static safety verification and dynamic safety verification; the static safety verification includes thermal stability verification and voltage safety verification of the power grid flow distribution after the optimal handling scheme is executed. The dynamic security verification includes time-domain simulation verification of the transient stability of the power grid during the execution of the optimal handling scheme; the security verification is completed in the power grid digital twin.

9. A power grid fault prediction and automatic handling system based on digital twin and reinforcement learning according to claim 1, characterized in that, It also includes an online model update module, which is used to periodically or event-triggeredly calibrate the parameters of the power grid digital twin using the latest operating data and fault handling records, and incrementally retrain the fault handling strategy network using newly added successful fault handling cases; the event triggering conditions include significant changes in the power grid topology, commissioning of new equipment, and the deviation of the strategy execution effect from expectations exceeding a preset threshold.

10. A method for power grid fault prediction and automatic handling based on digital twins and reinforcement learning, characterized in that, Includes the following steps: Construct a digital twin of the power grid, including a steady-state simulation engine, a dynamic simulation engine, and a fault simulation engine, and keep the state synchronized with the physical power grid; A set of failure scenarios is generated based on historical failure records, equipment defect data, and operational risk analysis results. Using the power grid digital twin as the interactive environment, and adopting a course learning mechanism, the fault handling strategy network is trained in stages on single fault scenario subsets, multi-fault scenario subsets, and cascading fault scenario subsets, with strategy network parameter transfer between each stage. Real-time monitoring of power grid operation status; when a fault is detected, multi-branch deduction is performed in the digital twin with the current state as the initial state. The current fault scenario state is input into the trained fault handling strategy network to obtain the recommended handling strategy. After comprehensive comparison with the multi-branch inference results, the optimal handling solution is generated. The optimal handling solution is then subjected to safety verification. After the verification is passed, control commands are automatically issued and executed step by step. After each step is executed, the actual effect is verified in the digital twin to see if it meets the expectations.