Method, device and equipment for adjusting power grid in abnormal operation

Through the deep reinforcement learning network D3QN, the pre-trained trend and frequency adjustment model is used to adjust the grid status in real time, solving the complex operation of the power system after the high proportion of new energy is connected, and the flexibility and stability of the power grid operation are achieved.

CN119518780APending Publication Date: 2025-02-25WUHAN UNIV +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411398696.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

High proportion of new energy access leads to complex operation of power systems, and the existing technology is difficult to adapt to the constraints of optimized operation of power systems, and the regulation strategies are not highly adaptable to changes in the grid structure and new elements.

Method used

The deep reinforcement learning network D3QN is adopted to obtain grid status parameters in real time through pre-trained trend adjustment models and frequency adjustment models, predict the trend or frequency adjustment actions at the next moment, and adjust the grid status to restore normal operation.

Benefits of technology

The optimized operation of the power system under the situation of high proportion of renewable energy consumption is achieved, adapting to the changes in the grid structure and new elements, and improving the flexibility and stability of the grid operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119518780A_ABST
    Figure CN119518780A_ABST
Patent Text Reader

Abstract

The invention provides a method, a device and equipment for adjusting a power grid in abnormal operation. The method comprises the following steps: acquiring a state parameter of a target power grid at a current moment; wherein the state parameters comprise load active power, generator active power and transmission line active power associated with the power flow; inputting the state parameters of the target power grid into a pre-trained power flow adjustment model to obtain a parameter value corresponding to a power flow adjustment action at the next moment output by the pre-trained power flow adjustment model; wherein the power flow adjustment action at least comprises generator active power adjustment; and adjusting the state of the target power grid by using the parameter value corresponding to the power flow adjustment action at the next moment, so that the target power grid recovers normal operation. Wherein the pre-trained power flow adjustment model comprises a deep reinforcement learning network D3QN. By using the method provided by the embodiment of the invention, the target power grid can be restored to normal operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of power system operation and maintenance, and in particular to a method, device, electronic device, non-transitory computer-readable storage medium, and computer program product for adjusting an abnormally operating power grid. Background Art

[0002] Wind power generation has been widely used around the world due to its advantages of superior environmental benefits, recyclability, flexible installed capacity, and low operation and maintenance costs. In recent years, the development and utilization of new energy in my country has continued to expand rapidly, which means that in the future power system, wind power and photovoltaic power will be the main energy sources, while thermal power will be the auxiliary energy source.

[0003] However, the access of a high proportion of renewable energy makes the operation characteristics of the power system complicated, and the power system power flow adjustment and optimization work faces unprecedented difficulties and challenges. In particular, for the power flow calculation and frequency deviation problems of unbalanced active power in the power grid, the existing technical solutions, on the one hand, cannot adapt to the constraints of the power system optimization operation under the situation of high proportion of renewable energy consumption; on the other hand, the corresponding control strategy also has strong limitations and is not adaptable to changes in the power grid structure and new elements. Summary of the invention

[0004] The present disclosure provides a method, an apparatus, an electronic device, a non-transitory computer-readable storage medium, and a computer program product for adjusting an abnormally operating power grid, so as to solve the technical defects in the prior art.

[0005] The present disclosure provides a method for adjusting an abnormally operating power grid, comprising:

[0006] Acquire the state parameters of the target power grid at the current moment; wherein the state parameters include load active power, generator active power and transmission line active power associated with the power flow;

[0007] Inputting the state parameters of the target power grid into a pre-trained power flow adjustment model to obtain a parameter value corresponding to a power flow adjustment action at the next moment output by the pre-trained power flow adjustment model; wherein the power flow adjustment action at least includes active power adjustment of a generator;

[0008] Using the parameter value corresponding to the power flow adjustment action at the next moment, adjusting the state of the target power grid so that the target power grid resumes normal operation;

[0009] The pre-trained power flow adjustment model includes a deep reinforcement learning network D3QN, and the D3QN includes an evaluation network and a target network; the pre-trained power flow adjustment model is trained using sample data associated with the power flow of the power grid.

[0010] The present disclosure also provides a method for adjusting an abnormally operating power grid, comprising:

[0011] Acquire state parameters of the target power grid at the current moment; wherein the target power grid is a power grid after power flow adjustment is performed using the method for adjusting an abnormally operating power grid described in the present disclosure; the state parameters include the generator active power, reactive power, voltage, phase angle, frequency deviation and active power of the load associated with the frequency;

[0012] Inputting the state parameters of the target power grid into a pre-trained frequency adjustment model to obtain a parameter value corresponding to a frequency adjustment action at the next moment output by the pre-trained frequency adjustment model; wherein the frequency adjustment action includes machine shedding and load shedding;

[0013] Using the parameter value corresponding to the frequency adjustment action at the next moment, adjusting the state of the target power grid so that the target power grid resumes normal operation;

[0014] The pre-trained frequency adjustment model includes a deep reinforcement learning network D3QN, and the D3QN includes an evaluation network and a target network; the pre-trained frequency adjustment model is trained using sample data associated with the frequency of the power grid.

[0015] The present disclosure also provides a device for adjusting an abnormally operating power grid, comprising:

[0016] The power flow parameter acquisition module is configured to: acquire the state parameters of the target power grid at the current moment; wherein the state parameters include the load active power, the generator active power and the transmission line active power associated with the power flow;

[0017] The power flow adjustment prediction module is configured to: input the state parameters of the target power grid into a pre-trained power flow adjustment model to obtain a parameter value corresponding to the power flow adjustment action at the next moment output by the pre-trained power flow adjustment model; wherein the power flow adjustment action at least includes active power adjustment of the generator;

[0018] The power flow adjustment execution module is configured to: adjust the state of the target power grid by using the parameter value corresponding to the power flow adjustment action at the next moment, so that the target power grid resumes normal operation;

[0019] Among them, the pre-trained power flow adjustment model includes a deep reinforcement learning network D3QN, and the D3QN includes a power flow evaluation network and a power flow target network; the pre-trained power flow adjustment model is trained using sample data associated with the power flow of the power grid.

[0020] The present disclosure also provides a device for adjusting an abnormally operating power grid, comprising:

[0021] The frequency parameter acquisition module is configured to: acquire the state parameters of the target power grid at the current moment; wherein the target power grid is a power grid after the power flow adjustment is performed using the method for adjusting the abnormally operating power grid; the state parameters include the generator active power, reactive power, voltage, phase angle, frequency deviation and active power of the load associated with the frequency;

[0022] The frequency adjustment prediction module is configured to: input the state parameters of the target power grid into a pre-trained frequency adjustment model to obtain a parameter value corresponding to a frequency adjustment action at a next moment output by the pre-trained frequency adjustment model; wherein the frequency adjustment action includes machine shedding and load shedding;

[0023] The frequency adjustment execution module is configured to: adjust the state of the target power grid by using the parameter value corresponding to the frequency adjustment action at the next moment, so that the target power grid resumes normal operation;

[0024] Among them, the pre-trained frequency adjustment model includes a deep reinforcement learning network D3QN, and the D3QN includes a frequency assessment network and a frequency target network; the pre-trained frequency adjustment model is trained using sample data associated with the frequency of the power grid.

[0025] The present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for adjusting an abnormally operating power grid as described in any one of the above methods is implemented.

[0026] The present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for adjusting an abnormally operating power grid as described in any one of the above methods is implemented.

[0027] The present disclosure further provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above methods for adjusting an abnormally operating power grid.

[0028] As described above, by utilizing the method for adjusting an abnormally operating power grid provided by an embodiment of the present disclosure, the state parameters of the target power grid can be acquired in real time, and then the power flow adjustment action at the next moment can be predicted with the help of a pre-trained power flow adjustment model, thereby adjusting the state of the target power grid; therefore, the method of the embodiment of the present disclosure does not rely on a given deterministic numerical value, can perform real-time state calculations, is less affected by parameter accuracy, and can obtain sufficient and comprehensive information about the system power flow, and therefore can, to a certain extent, adapt to the constraints of optimized operation of the power system under the condition of a high proportion of renewable energy consumption; and thus the target power grid can be restored to normal operation. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0030] Figure 1 It is a flow chart of a method (power flow adjustment) for adjusting an abnormally operating power grid provided by an embodiment of the present disclosure;

[0031] Figure 2 It is one of the flowcharts of the training method of the pre-trained power flow adjustment model provided in the embodiment of the present disclosure;

[0032] Figure 3 This is the second flowchart of the training method of the pre-trained power flow adjustment model provided in the embodiment of the present disclosure;

[0033] Figure 4 is a flow chart of a method (frequency adjustment) for adjusting an abnormally operating power grid provided by an embodiment of the present disclosure;

[0034] Figure 5 is a flowchart of a training method for the pre-trained frequency adjustment model provided in an embodiment of the present disclosure;

[0035] Figure 6 It is a structural schematic diagram of a device for adjusting an abnormally operating power grid (power flow adjustment) provided in an embodiment of the present disclosure;

[0036] Figure 7 It is a structural schematic diagram of a device (frequency adjustment) for adjusting an abnormally operating power grid provided by an embodiment of the present disclosure;

[0037] Figure 8 It is a schematic diagram of the structure of an electronic device provided by the present disclosure. DETAILED DESCRIPTION

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

[0039] Summary of the invention concept:

[0040] After repeated research, the inventors of the present disclosure have found that the reasons for the problems in the prior art are: on the one hand, the traditional power system flow adjustment and optimization method relies on given deterministic values, which is only a state calculation of a single section. It is greatly affected by the accuracy of parameters and it is difficult to obtain sufficient and comprehensive information about the system flow. Therefore, it cannot adapt to the constraints of the optimized operation of the power system under the situation of high proportion of renewable energy consumption. On the other hand, the traditional method analyzes the best location and control strategy for cutting the machine and shedding the load based on the physical characteristics of the power grid. However, the physical model has strong limitations, which leads to poor adaptability to changes in the power grid structure and new elements, and cannot meet the development needs of the power grid.

[0041] In view of this, the inventors of the present disclosure further studied and found that the adjustment of the convergence of the power flow calculation is to first act on the power flow parameters, then get feedback based on the power flow state after the action, and then decide the next action. This is a typical Markov decision process and can be solved by reinforcement learning. Reinforcement learning is a semi-supervised learning. Unlike general supervised learning, it guides behavior by interacting with the environment to obtain rewards. The greater the reward, the greater the possibility of action.

[0042] Therefore, in order to solve the complex problems of power grid operation (especially the power flow calculation and frequency deviation problems caused by unbalanced active power in the power grid), combining power grid physics theory with reinforcement learning methods can become a feasible solution to power grid decision-making and control.

[0043] Based on this, the inventors of the present disclosure proposed a solution for adjusting an abnormally operating power grid as provided in the following embodiment, which can use a data-driven method to analyze the power grid operating environment information and quickly provide a control solution based on different operating modes and power grid operating states.

[0044] Embodiment 1:

[0045] The following describes the scheme for adjusting an abnormally operating power grid (for power flow control) disclosed in the present invention in conjunction with the accompanying drawings.

[0046] Figure 11 is a flow chart of a method for adjusting an abnormally operating power grid provided by an exemplary embodiment of the present disclosure. This embodiment can be applied to electronic devices (for example, servers or cloud computing platforms), such as Figure 1 As shown, the method for adjusting an abnormally operating power grid includes the following steps:

[0047] S110: Obtain state parameters of the target power grid at the current moment.

[0048] The state parameters include load active power, generator active power and transmission line active power associated with the power flow.

[0049] The target power grid may be a power grid having a problem of difficulty in converging and adjusting power flow.

[0050] Among them, the reasons that make it difficult to converge and adjust the power flow may include: 1. The power flow calculation does not converge; 2. The nonlinearity of the power grid increases, making it difficult to adjust and optimize the power flow; 3. The uncertain power flow makes the traditional adjustment and optimization methods no longer applicable.

[0051] S120: Input the state parameters of the target power grid into a pre-trained power flow adjustment model to obtain parameter values ​​corresponding to the power flow adjustment action at the next moment output by the pre-trained power flow adjustment model.

[0052] Wherein, the power flow adjustment action at least includes generator active power adjustment.

[0053] Optionally, the power flow adjustment action may also include switching on and off a parallel capacitor reactor.

[0054] Among them, refer to Figure 2 , the pre-trained power flow adjustment model includes a deep reinforcement learning network D3QN (ie, Figure 2 The D3QN-based reinforcement learning architecture in the embodiment of the present invention comprises an evaluation network and a target network. The pre-trained power flow adjustment model is trained using sample data associated with the power flow of the power grid.

[0055] S130. Using the parameter value corresponding to the power flow adjustment action at the next moment, adjust the state of the target power grid so that the target power grid resumes normal operation.

[0056] Here, “enabling the target power grid to resume normal operation” may mean enabling the power grid to resume normal operation in a dimension where the power flow is difficult to converge and adjust.

[0057] As described above, by using the method for adjusting an abnormally operating power grid provided by the embodiment of the present disclosure, the state parameters of the target power grid can be acquired in real time (although step S110 acquires the state parameters at the current moment, as long as steps S110 to S130 are executed in a rolling manner, the scheme of acquisition, prediction, and adjustment can be implemented), and then the power flow adjustment action at the next moment can be predicted with the help of a pre-trained power flow adjustment model, so as to adjust the state of the target power grid; therefore, the method of the embodiment of the present disclosure does not rely on a given deterministic numerical value, can perform real-time state calculations, is less affected by parameter accuracy, and can obtain sufficient and comprehensive information about the system power flow, so that to a certain extent it can adapt to the constraints of optimized operation of the power system under the condition of a high proportion of renewable energy consumption; and thus the target power grid can be restored to normal operation.

[0058] Based on Example 1, as an optional implementation manner, the training process of the pre-trained power flow adjustment model includes:

[0059] Step 1) Create a training dataset.

[0060] Among them, the training data set includes multiple groups of flow scenario training data about the target time, each group of flow scenario training data includes power abnormal values ​​of different generators, power abnormal values ​​of different loads and active power abnormal values ​​of different transmission lines, and the active power abnormal values ​​of the generators, the active power abnormal values ​​of the loads, and the active power abnormal values ​​of the transmission lines make the flow calculation results not converge or exceed the limit.

[0061] As an alternative example, refer to Figure 3 , training data can be created in the following way: first, based on the initial converged power flow of the existing power grid system, random abnormal values ​​can be added to part of the new energy generator power and part of the load power to obtain the abnormal value of the generator power and the abnormal value of the load power, and the corresponding power flow calculation can be performed. Then, the power flow calculation results are judged. If the power flow calculation results do not converge, the abnormal value of the generator power and the abnormal value of the load power can be used as training data and added to the training data set.

[0062] Step 2) Construct the power flow adjustment model to be trained, where Figure 2 The power flow adjustment model to be trained may include a power flow evaluation network to be trained (i.e. Figure 2 The evaluation network) and the power flow target network to be trained (i.e. Figure 2 target network).

[0063] Preferably, the power flow adjustment model to be trained is a dual-Q deep competitive reinforcement learning network D3QN, which can execute a dual learning algorithm.

[0064] Among them, the power flow assessment network is used as the main network, and the power flow target network is used to estimate the output action of the power flow assessment network.

[0065] Step 3) Use the multiple sets of training data as the initial state parameters of the simulated power grid at the target time, input them into the power flow adjustment model to be trained, and obtain the evaluation parameter values ​​corresponding to all power flow adjustment actions at the next moment adjacent to the target time output by the power flow evaluation network to be trained, and the target parameter values ​​corresponding to all power flow adjustment actions at the next moment adjacent to the target time output by the power flow target network to be trained.

[0066] Step 4) Based on the evaluation parameter values ​​corresponding to all the power flow adjustment actions at the next moment, determine the power flow adjustment action corresponding to the maximum evaluation parameter value as the final power flow adjustment action at the next moment.

[0067] It should be noted that step 4) can be executed by the power flow evaluation network to be trained. If the current time is t, the power flow evaluation network to be trained can select the action with the largest evaluation parameter value (Q value) as the optimal action at time t+1 (i.e., the above-mentioned final power flow adjustment action).

[0068] Step 5) Based on the final power flow adjustment action at the next moment, the state of the simulated power grid is adjusted to obtain the state parameters of the adjusted simulated power grid as the model input for the next iterative training round.

[0069] As an alternative example, refer to Figure 3 , in order to solve the problem of active power imbalance, step 5 may include:

[0070] Step 51) using the final power flow adjustment action to modify the calculation file;

[0071] Step 52) calling the power system analysis software package (PSASP) to perform power flow calculation and obtain a result file;

[0072] Step 53) reading the result file, and in response to the power flow calculation result represented by the result file not converging or exceeding the limit, obtaining the adjusted state parameters of the simulated power grid as the model input for the next iterative training round.

[0073] Step 6) Establishing a reward function using the adjusted state parameters of the simulated power grid.

[0074] The adjusted state parameters of the simulated power grid may include: adjusted load active power, generator active power and transmission line active power associated with power flow.

[0075] It should be noted that, as an optional example, refer to Figure 3 , the process of power flow adjustment can be modeled as a Markov decision process (MDP). Among them, the state space, action space and reward function need to be designed according to the power grid environment, as follows:

[0076] First, considering the unbalanced active power, the power flow adjustment requires that the generator and load power are balanced and the transmission line does not exceed the limit. t As follows:

[0077] s t =[P Gen,t , P Load,t , P Line,t ]

[0078] Among them, P Gen,t represents the active power of the generator at time t, P Load,t Represents the active power of the load at time t, P Line,t represents the active power of the transmission line at time t.

[0079] Second, in the embodiment of the present disclosure, only the power adjustment of the generator is considered in the power flow adjustment action. However, since the power of the generator is a continuous quantity, in order to reduce the size of the action space and make training easier, the action space needs to be discretized. The action space A at time t t As follows:

[0080] A t =[ΔP G1 , ΔP G2 , ..., ΔP GN , -ΔP G1 , -ΔP G2 , ..., -ΔP GN ]

[0081] Where ΔP G Indicates the size of the active power adjusted on the generator in each action, which is a fixed value; ±ΔP Gi This means that the active power of generator i is increased or decreased by ΔP G .

[0082] Each time a power flow adjustment action is selected, according to the results of the reinforcement learning algorithm, a generator is selected for adjustment each time, and its active power is increased or decreased by ΔP G It should be noted that, in the actual adjustment process, the adjusted generator power should not exceed the power limit of the generator itself.

[0083] Third, the reward function is divided into three parts, including the judgment of the results of the power flow calculation, whether the generator power exceeds the limit, and whether the active power of the transmission line exceeds the limit.

[0084] There are only two results of power flow calculation: convergence and non-convergence. When convergence occurs, the agent should receive a positive reward value, otherwise it will receive a negative reward value.

[0085] A. Considering the results of power flow calculation, the reward function R1 can be as follows:

[0086]

[0087] Among them, r c represents the reward value at convergence, r nc Represents the reward value when it has not converged.

[0088] B. Considering whether the generator power exceeds the limit, the reward function R2 can be as follows:

[0089] R2=-(max{P G -P G,max ,0}+max{P G,min -P G ,0})

[0090] Among them, P G,max Indicates the upper limit of the generator active power; P G,min It indicates the lower limit of the active power of the generator; when the generator power is between the upper and lower limits, R2 is 0, and when it exceeds the upper and lower limits, R2 is a negative number of the active power exceeding or below that part.

[0091] C. Considering the power constraint of the transmission line, the reward function R3 can be expressed as follows:

[0092] R3=-max{P line -P line,max ,0}

[0093] Among them, P line,max Indicates the active power limit transmitted by the transmission line.

[0094] Finally, the total reward value R obtained is: R=R1+R2+R3.

[0095] Step 7) Establish a loss function based on the maximum evaluation parameter value and the corresponding target parameter value.

[0096] As an optional example, the loss function in step 7) can be determined by the following calculation formula:

[0097]

[0098]

[0099]

[0100] Q(s,a|θ)≈Q(s,a)

[0101]

[0102] Among them, L(θ) represents the loss function; Represents experience pool The expected reward value obtained from the data (s, a, R) in; Represents experience pool The expected reward value obtained by the data (s, a, Y) in ; R represents the total reward value; Q represents the total evaluation parameter value output by the power flow evaluation network to be trained; Y represents the total target parameter value output by the target adjustment network to be trained; r represents the reward function; r t+1 represents the reward value at time t+1; α represents the learning rate; γ represents the discount factor; s t represents the power grid environment status at time t; s t+1 Indicates the power grid environment status at time t+1; a t represents the final power flow adjustment action at time t; a t+1 represents the final power flow adjustment action at time t+1; θ represents the network parameters of the evaluation network to be trained; θ′ represents the network parameters of the target network to be evaluated; θ t Represents the network parameters of the evaluation network to be trained at time t; θ′ t represents the network parameters of the target network to be evaluated at time t; Y t DoubleQ Y represents the target parameter value of the target adjustment network output to be trained at time t; t represents the target parameter value output by the target adjustment network to be trained at time t; s represents the environmental state of the power grid at any time; a represents the final power flow adjustment action at any time.

[0103] Step 8) transmitting the function value of the loss function back to the power flow adjustment model to be trained;

[0104] Step 9) taking the maximum function value of the reward function as the optimization target, the power flow adjustment model to be trained adjusts the model parameters according to the function value of the loss function;

[0105] Step 10) Iteratively execute steps 3) to 9) until the preset training end condition is met, and the pre-trained power flow adjustment model is obtained from the power flow adjustment model to be trained; wherein the preset training end condition is that the number of iterations is greater than a preset iteration number threshold, or the power flow calculation results based on the state parameters of the simulated power grid converge and do not exceed the limit.

[0106] As described above, in this embodiment, reference Figure 2 as well as Figure 3 ,Considering the complex distribution network environment, since the state information and data contain many ,features, a complex network is needed to extract the features.,The Dual-Q Deep Competition Reinforcement Learning Network (D3QN) was selected as the ,main reinforcement learning framework to solve the complex distribution network fault recovery ,problem.

[0107] Based on Example 1 and the above implementation modes, as an optional implementation mode, the training process of the pre-trained power flow adjustment model further includes:

[0108] In response to the function value of the reward function of the current iterative training round being greater than the function value of the reward function of the previous iterative training round, the adjusted state parameters of the simulated power grid and the evaluation parameter values ​​corresponding to the current iterative training round are stored in the experience pool.

[0109] It is understandable that the experience storage can be used to perform priority experience playback in subsequent training processes to improve training efficiency.

[0110] Based on Example 1 and the above implementation modes, as an optional implementation mode, step S130 "adjusting the state of the target power grid by using the parameter value corresponding to the power flow adjustment action at the next moment so that the target power grid resumes normal operation" may include the following steps:

[0111] Step a, based on the parameter value corresponding to the power flow adjustment action at the next moment, determine the power flow adjustment action corresponding to the parameter value as the final power flow adjustment action; step b, using the final power flow adjustment action, select the target generator that needs to be adjusted by the target power grid at the next moment and the active power adjustment amount of the target generator; step c, use the active power adjustment amount to adjust the active power of the target generator.

[0112] As an optional example, in step b, only the power adjustment of the generator is considered in the power flow adjustment action. However, since the power of the generator is a continuous quantity, in order to reduce the size of the action space and make training easier, the action space needs to be discretized. The action space A at time t t As follows:

[0113] A t =[ΔP G1 , ΔP G2 , ..., ΔP GN , -ΔP G1 , -ΔP G2 , ..., -ΔP GN ]

[0114] Where ΔP G Indicates the size of the active power adjusted on the generator in each action, that is, the active power adjustment amount, which is a fixed value; ±ΔP Gi This means increasing or decreasing the active power of the generator / by ΔP G .

[0115] Each time a power flow adjustment action is selected, according to the results of the reinforcement learning algorithm, a generator is selected for adjustment each time, and its active power is increased or decreased by ΔP G It should be noted that, in the actual adjustment process, the adjusted generator power should not exceed the power limit of the generator itself.

[0116] As described above, by using the method for adjusting an abnormally operating power grid provided by the embodiment of the present disclosure, the state parameters of the target power grid can be acquired in real time (although step S110 acquires the state parameters at the current moment, as long as steps S110 to S130 are executed in a rolling manner, the scheme of acquisition, prediction, and adjustment can be implemented), and then the power flow adjustment action at the next moment can be predicted with the help of a pre-trained power flow adjustment model, so as to adjust the state of the target power grid; therefore, the method of the embodiment of the present disclosure does not rely on a given deterministic numerical value, can perform real-time state calculations, is less affected by parameter accuracy, and can obtain sufficient and comprehensive information about the system power flow, so that to a certain extent it can adapt to the constraints of optimized operation of the power system under the condition of a high proportion of renewable energy consumption; and thus the target power grid can be restored to normal operation.

[0117] Embodiment 2:

[0118] The following describes the scheme for adjusting an abnormally operating power grid (for rate control) disclosed in the present invention in conjunction with the accompanying drawings.

[0119] Figure 4 1 is a flow chart of a method for adjusting an abnormally operating power grid provided by an exemplary embodiment of the present disclosure. This embodiment can be applied to electronic devices (for example, servers or cloud computing platforms), such as Figure 4 As shown, the method for adjusting an abnormally operating power grid includes the following steps:

[0120] S410: Obtain state parameters of the target power grid at the current moment.

[0121] The target power grid is a power grid after power flow adjustment using the method described in the above-mentioned embodiment 1; the state parameters include the generator active power, reactive power, voltage, phase angle, frequency deviation and active power of the load associated with the frequency.

[0122] S420: Input the state parameters of the target power grid into a pre-trained frequency adjustment model to obtain parameter values ​​corresponding to the frequency adjustment action at the next moment output by the pre-trained frequency adjustment model.

[0123] The frequency adjustment action may include machine shedding and load shedding.

[0124] The pre-trained frequency adjustment model may include a deep reinforcement learning network D3QN, wherein the D3QN includes an evaluation network and a target network. The pre-trained frequency adjustment model is trained using sample data associated with the frequency of the power grid.

[0125] S430: Use the parameter value corresponding to the frequency adjustment action at the next moment to adjust the state of the target power grid so that the target power grid resumes normal operation.

[0126] Here, “restoring the target power grid to normal operation” may mean restoring the power grid to normal in the dimension where the frequency deviation exists.

[0127] As described above, by using the method for adjusting an abnormally operating power grid provided by the embodiment of the present disclosure, the state parameters of the target power grid can be obtained in real time (although step S410 obtains the state parameters at the current moment, as long as steps S410 to S430 are executed in a rolling manner, the scheme of obtaining, predicting, and adjusting can be implemented in real time), and then the frequency adjustment action at the next moment can be predicted with the help of a pre-trained frequency adjustment model, thereby adjusting the state of the target power grid. Therefore, the method of the embodiment of the present disclosure combines the physical theory of the power grid with the reinforcement learning method for the complex problems of power grid operation (especially the frequency deviation problem of unbalanced active power of the power grid), and can use data-driven methods to analyze the power grid operation environment information, and quickly provide control solutions according to different operation modes and power grid operation states. Therefore, it has strong adaptability to changes in the power grid structure and new elements, and can meet the development needs of the power grid to a certain extent.

[0128] Based on Example 2, as an optional implementation, when the pre-trained power flow adjustment model described in Example 1 is trained, the training process of the pre-trained frequency adjustment model includes:

[0129] Step 1: Create a training dataset.

[0130] The training data set includes multiple sets of training data about the target time, and each set of training data includes frequency-related temporary stability data of different generators and loads. The temporary stability data includes abnormal active power values, abnormal reactive power values, abnormal voltage values, abnormal phase angle values, and abnormal frequency deviation values.

[0131] As an optional example, the temporary stable data is determined based on the corresponding power flow scenario when the pre-trained power flow adjustment model is trained. Specifically, it can be achieved through the following steps:

[0132] Step 11, calling the ST.S12 application in the power system analysis integrated program PSASP (Power System Analysis Software Package), and randomly adding temporary stability faults according to a preset file format to the power flow scenario corresponding to the pre-trained power flow adjustment model after training;

[0133] Step 12, calling the ST.SME application in the power system analysis integrated program PSASP (Power System Analysis Software Package), and adding observation variables to the power flow scenario corresponding to the pre-trained power flow adjustment model after training;

[0134] Step 13, calling the STCalc application in the power system analysis software package PSASP (Power System Analysis Software Package) to perform temporary stability calculations on the power flow scenarios to which temporary stability faults and observed variables have been added in steps 11 to 12;

[0135] Step 14: Repeat the above steps 11 to 13 several times to obtain a set of temporary stable data.

[0136] Step 2: Build a frequency adjustment model to be trained.

[0137] The frequency adjustment model to be trained includes a frequency evaluation network to be trained and a frequency target network to be trained.

[0138] As an optional example, the structure of the frequency evaluation network to be trained can be the same as the structure of the power flow evaluation network to be trained; similarly, the structure of the frequency target network to be trained can be the same as the structure of the power flow target network to be trained; and the subsequent training process is also similar. The difference is that the training data is different, which leads to different model parameters after training.

[0139] Step 3: Use the multiple sets of training data as the initial state parameters of the simulated power grid at the target time, input them into the frequency adjustment model to be trained, obtain the evaluation parameter values ​​corresponding to all frequency adjustment actions at the next moment adjacent to the target time output by the frequency evaluation network to be trained, and obtain the target parameter values ​​corresponding to all frequency adjustment actions at the next moment adjacent to the target time output by the frequency target network to be trained.

[0140] Step 4: Based on the evaluation parameter values ​​corresponding to all the frequency adjustment actions at the next moment, determine the frequency adjustment action corresponding to the maximum evaluation parameter value as the final frequency adjustment action at the next moment.

[0141] It should be noted that step 4 can be performed by the frequency evaluation network to be trained. If the current time is t, the frequency evaluation network to be trained can select the action with the largest evaluation parameter value (Q value) as the optimal action at time t+1 (i.e., the above-mentioned final frequency adjustment action).

[0142] Step 5: Based on the final frequency adjustment action at the next moment, the state of the simulated power grid is adjusted to obtain the state parameters of the adjusted simulated power grid as the model input for the next iterative training round.

[0143] As an alternative example, refer to Figure 5 , in order to solve the problem of active power imbalance, step 5 may include:

[0144] Step 51 uses the final frequency adjustment action to modify the calculation file;

[0145] Step 52 calls the power system analysis software package (PSASP) to perform temporary stability calculations and obtain result files.

[0146] Step 53 reads the result file, and in response to the frequency calculation result represented by the result file being unstable, obtains the adjusted state parameters of the simulated power grid as the model input for the next iterative training round.

[0147] Step 6: Establish a reward function using the adjusted state parameters of the simulated power grid.

[0148] The specific implementation of step 6 is similar to the aforementioned step 6), so reference may be made to part of the content of step 6) in the aforementioned embodiment 1, which will not be repeated here.

[0149] Step 7: Establish a loss function based on the maximum evaluation parameter value and the corresponding target parameter value.

[0150] The specific implementation of step 7 is similar to the aforementioned step 7), so reference may be made to part of the content of step 7) in the aforementioned embodiment 1, which will not be repeated here.

[0151] Step 8: Return the function value of the loss function to the frequency adjustment model to be trained;

[0152] Step 9: Taking the maximum function value of the reward function as the optimization target, the frequency adjustment model to be trained adjusts the model parameters according to the function value of the loss function;

[0153] Step 10, iteratively execute steps 3 to 9 until the preset training end condition is met, and the pre-trained frequency adjustment model is obtained from the frequency adjustment model to be trained; wherein the preset training end condition is that the number of iterations is greater than the preset iteration number threshold, or the frequency calculation result based on the state parameter of the simulated power grid is stable. Figure 5 , when the frequency calculation result is judged to be stable, the training can be ended.

[0154] As described above, in this embodiment, reference Figure 5 ,Considering the complex distribution network environment, since the state information and data contain many ,features, a complex network is needed to extract the features.,The Dual-Q Deep Competition Reinforcement Learning Network (D3QN) was selected as the ,main reinforcement learning framework to solve the complex distribution network fault recovery ,problem.

[0155] Specifically, as the number of iterative training rounds increases, a series of frequency adjustment actions will gradually accumulate, refer to Figure 5 , the first iterative training can obtain action 1, corresponding to the execution of temporary stable calculation 1; then, the second iterative training can obtain action 2, corresponding to the execution of temporary stable calculation 2; then, the third iterative training can obtain action 3, corresponding to the execution of temporary stable calculation 3;...; and so on, the iterative training can obtain action you, corresponding to the execution of temporary stable calculation.

[0156] Based on Example 2 and the above implementation modes, as an optional implementation mode, step S430 "adjusting the state of the target power grid by using the parameter value corresponding to the frequency adjustment action at the next moment so that the target power grid resumes normal operation" may include the following steps:

[0157] Step I: based on the parameter value corresponding to the frequency adjustment action at the next moment, determine the frequency adjustment action corresponding to the parameter value as the final frequency adjustment action; Step II: using the final frequency adjustment action, select the target generator that needs to be adjusted by the target power grid at the next moment and the machine cutting adjustment amount of the target generator, or select the target load that needs to be adjusted by the target power grid at the next moment and the load cutting adjustment amount of the target load; Step III: use the machine cutting adjustment amount to adjust the target generator, or use the load cutting adjustment amount to adjust the target load.

[0158] As described above, by using the method for adjusting an abnormally operating power grid provided by the embodiment of the present disclosure, the state parameters of the target power grid can be obtained in real time (although step S410 obtains the state parameters at the current moment, as long as steps S410 to S430 are executed in a rolling manner, the scheme of obtaining, predicting, and adjusting can be implemented in real time), and then the frequency adjustment action at the next moment can be predicted with the help of a pre-trained frequency adjustment model, thereby adjusting the state of the target power grid. Therefore, the method of the embodiment of the present disclosure combines the physical theory of the power grid with the reinforcement learning method for the complex problems of power grid operation (especially the frequency deviation problem of unbalanced active power of the power grid), and can use data-driven methods to analyze the power grid operation environment information, and quickly provide control solutions according to different operation modes and power grid operation states. Therefore, it has strong adaptability to changes in the power grid structure and new elements, and can meet the development needs of the power grid to a certain extent.

[0159] Device Example:

[0160] The following is a description of the device for adjusting an abnormally operating power grid (for power flow adjustment) provided by the present disclosure. The device for adjusting an abnormally operating power grid (for power flow adjustment) described below and the method for adjusting an abnormally operating power grid (for power flow adjustment) described above can be referenced to each other.

[0161] Figure 6 FIG. 1 is a schematic diagram of a device structure for adjusting an abnormally operating power grid provided by an exemplary embodiment of the present disclosure. Figure 6 As shown, the device for adjusting the abnormally operating power grid includes:

[0162] The power flow parameter acquisition module 610 is configured to: obtain the state parameters of the target power grid at the current moment; wherein the state parameters include the load active power, generator active power and transmission line active power associated with the power flow; the power flow adjustment prediction module 620 is configured to: input the state parameters of the target power grid into a pre-trained power flow adjustment model to obtain the parameter values ​​corresponding to the power flow adjustment action at the next moment output by the pre-trained power flow adjustment model; wherein the power flow adjustment action at least includes the generator active power adjustment; the power flow adjustment execution module 630 is configured to: use the parameter values ​​corresponding to the power flow adjustment action at the next moment to adjust the state of the target power grid so that the target power grid resumes normal operation; wherein the pre-trained power flow adjustment model includes a deep reinforcement learning network D3QN, and the D3QN includes a power flow evaluation network and a power flow target network; the pre-trained power flow adjustment model is trained using sample data associated with the power grid power flow.

[0163] The following is a description of the device for adjusting an abnormally operating power grid (for frequency adjustment) provided by the present disclosure. The device for adjusting an abnormally operating power grid (for frequency adjustment) described below and the method for adjusting an abnormally operating power grid (for frequency adjustment) described above can be referenced to each other.

[0164] Figure 7 FIG. 1 is a schematic diagram of a device structure for adjusting an abnormally operating power grid provided by an exemplary embodiment of the present disclosure. Figure 7 As shown, the device for adjusting the abnormally operating power grid includes:

[0165] The frequency parameter acquisition module 710 is configured to: obtain the state parameters of the target power grid at the current moment; wherein the target power grid is a power grid after the power flow adjustment is performed using the method described in claims 1 to 4; the state parameters include the active power, reactive power, voltage, phase angle, frequency deviation and active power of the load of the generator associated with the frequency; the frequency adjustment prediction module 720 is configured to: input the state parameters of the target power grid into a pre-trained frequency adjustment model to obtain the parameter values ​​corresponding to the frequency adjustment action at the next moment output by the pre-trained frequency adjustment model; wherein the frequency adjustment action includes machine cutting and load cutting; the frequency adjustment execution module 730 is configured to: use the parameter values ​​corresponding to the frequency adjustment action at the next moment to adjust the state of the target power grid so that the target power grid resumes normal operation; wherein the pre-trained frequency adjustment model includes a deep reinforcement learning network D3QN, and the D3QN includes a frequency evaluation network and a frequency target network; the pre-trained frequency adjustment model is trained using sample data associated with the frequency of the power grid.

[0166] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8As shown, the electronic device may include: a processor (processor) 810, a communication interface (Communications Interface) 820, a memory (memory) 830 and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call the logic instructions in the memory 830 to execute a method for adjusting an abnormally operating power grid, the method comprising: obtaining the state parameters of the target power grid at the current moment; wherein the state parameters include the load active power, the generator active power and the transmission line active power associated with the power flow; inputting the state parameters of the target power grid into a pre-trained power flow adjustment model to obtain the parameter values ​​corresponding to the power flow adjustment action at the next moment output by the pre-trained power flow adjustment model; wherein the power flow adjustment action at least includes the generator active power adjustment; using the parameter values ​​corresponding to the power flow adjustment action at the next moment, adjusting the state of the target power grid so that the target power grid resumes normal operation; wherein the pre-trained power flow adjustment model includes a deep reinforcement learning network D3QN, and the D3QN includes an evaluation network and a target network; the pre-trained power flow adjustment model is trained using sample data associated with the power grid's power flow.

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

[0168] On the other hand, the present disclosure also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the method provided by the above-mentioned methods for adjusting an abnormally operating power grid, the method including: obtaining the state parameters of the target power grid at the current moment; wherein the state parameters include the load active power, the generator active power and the transmission line active power associated with the flow; inputting the state parameters of the target power grid into a pre-trained flow adjustment model to obtain the parameter values ​​corresponding to the flow adjustment action at the next moment output by the pre-trained flow adjustment model; wherein the flow adjustment action at least includes the generator active power adjustment; using the parameter values ​​corresponding to the flow adjustment action at the next moment, adjusting the state of the target power grid so that the target power grid resumes normal operation; wherein the pre-trained flow adjustment model includes a deep reinforcement learning network D3QN, and the D3QN includes an evaluation network and a target network; the pre-trained flow adjustment model is trained using sample data associated with the flow of the power grid.

[0169] On the other hand, the present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the method for adjusting an abnormally operating power grid provided by the above-mentioned methods, the method comprising: obtaining state parameters of the target power grid at the current moment; wherein the state parameters include load active power, generator active power and transmission line active power associated with the flow; inputting the state parameters of the target power grid into a pre-trained flow adjustment model to obtain parameter values ​​corresponding to the flow adjustment action at the next moment output by the pre-trained flow adjustment model; wherein the flow adjustment action at least includes generator active power adjustment; using the parameter values ​​corresponding to the flow adjustment action at the next moment, adjusting the state of the target power grid so that the target power grid resumes normal operation; wherein the pre-trained flow adjustment model includes a deep reinforcement learning network D3QN, and the D3QN includes an evaluation network and a target network; the pre-trained flow adjustment model is trained using sample data associated with the flow of the power grid.

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

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

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

Claims

1. A method for adjusting an abnormally operating power grid, comprising: Acquire the state parameters of the target power grid at the current moment; wherein the state parameters include load active power, generator active power and transmission line active power associated with the power flow; Inputting the state parameters of the target power grid into a pre-trained power flow adjustment model to obtain a parameter value corresponding to a power flow adjustment action at the next moment output by the pre-trained power flow adjustment model; wherein the power flow adjustment action at least includes active power adjustment of a generator; Using the parameter value corresponding to the power flow adjustment action at the next moment, adjusting the state of the target power grid so that the target power grid resumes normal operation; The pre-trained power flow adjustment model includes a deep reinforcement learning network D3QN, and the D3QN includes an evaluation network and a target network; the pre-trained power flow adjustment model is trained using sample data associated with the power flow of the power grid.

2. The method according to claim 1, characterized in that The training process of the pre-trained power flow adjustment model includes: Step 1) Create a training data set; The training data set includes multiple groups of power flow scenario training data about the target time, each group of power flow scenario training data includes power abnormal values ​​of different generators, power abnormal values ​​of different loads and active power abnormal values ​​of different transmission lines, and the active power abnormal values ​​of the generators, the active power abnormal values ​​of the loads, and the active power abnormal values ​​of the transmission lines make the power flow calculation results not converge or exceed the limit; Step 2) constructing a power flow adjustment model to be trained, wherein the power flow adjustment model to be trained includes a power flow evaluation network to be trained and a power flow target network to be trained; Step 3) using the multiple sets of training data as the initial state parameters of the simulated power grid at the target time, inputting the power flow adjustment model to be trained, obtaining the evaluation parameter values ​​corresponding to all power flow adjustment actions at the next moment adjacent to the target time output by the power flow evaluation network to be trained, and the target parameter values ​​corresponding to all power flow adjustment actions at the next moment adjacent to the target time output by the power flow target network to be trained; Step 4) based on the evaluation parameter values ​​corresponding to all the power flow adjustment actions at the next moment, determine the power flow adjustment action corresponding to the maximum evaluation parameter value as the final power flow adjustment action at the next moment; Step 5) Based on the final power flow adjustment action at the next moment, the state of the simulated power grid is adjusted to obtain the adjusted state parameters of the simulated power grid as the model input for the next iterative training round; Step 6) using the adjusted state parameters of the simulated power grid to establish a reward function; Step 7) establishing a loss function based on the maximum evaluation parameter value and the corresponding target parameter value; Step 8) transmitting the function value of the loss function back to the power flow adjustment model to be trained; Step 9) taking the maximum function value of the reward function as the optimization target, the power flow adjustment model to be trained adjusts the model parameters according to the function value of the loss function; Step 10) Iteratively execute steps 3) to 9) until the preset training end condition is met, and the pre-trained power flow adjustment model is obtained from the power flow adjustment model to be trained; wherein the preset training end condition is that the number of iterations is greater than a preset iteration number threshold, or the power flow calculation results based on the state parameters of the simulated power grid converge and do not exceed the limit.

3. The method according to claim 2, characterized in that The training process of the pre-trained power flow adjustment model also includes: In response to the function value of the reward function of the current iterative training round being greater than the function value of the reward function of the previous iterative training round, the adjusted state parameters of the simulated power grid and the evaluation parameter values ​​corresponding to the current iterative training round are stored in the experience pool.

4. The method according to claim 1, characterized in that: Using the parameter value corresponding to the power flow adjustment action at the next moment to adjust the state of the target power grid so that the target power grid resumes normal operation, including: Based on the parameter value corresponding to the power flow adjustment action at the next moment, determining the power flow adjustment action corresponding to the parameter value as the final power flow adjustment action; By using the final power flow adjustment action, a target generator that needs to be adjusted by the target power grid at the next moment and an active power adjustment amount of the target generator are selected; The active power adjustment amount is used to adjust the active power of the target generator.

5. A method for adjusting an abnormally operating power grid, comprising: Obtaining the state parameters of the target power grid at the current moment; wherein the target power grid is a power grid after power flow adjustment is performed using the method described in claims 1 to 4; the state parameters include the generator active power, reactive power, voltage, phase angle, frequency deviation and active power of the load associated with the frequency; Inputting the state parameters of the target power grid into a pre-trained frequency adjustment model to obtain a parameter value corresponding to a frequency adjustment action at the next moment output by the pre-trained frequency adjustment model; wherein the frequency adjustment action includes machine shedding and load shedding; Using the parameter value corresponding to the frequency adjustment action at the next moment, adjusting the state of the target power grid so that the target power grid resumes normal operation; The pre-trained frequency adjustment model includes a deep reinforcement learning network D3QN, and the D3QN includes an evaluation network and a target network; the pre-trained frequency adjustment model is trained using sample data associated with the frequency of the power grid.

6. The method according to claim 5, characterized in that When the pre-trained power flow adjustment model according to any one of claims 1 to 4 is trained, the training process of the pre-trained frequency adjustment model includes: Step 1: Create a training data set; The training data set includes multiple sets of training data about the target time, each set of training data includes temporary stable data related to the frequency of different generators and loads; the temporary stable data includes abnormal active power values, abnormal reactive power values, abnormal voltage values, abnormal phase angle values, and abnormal frequency deviation values; the temporary stable data is determined based on the corresponding power flow scenario when the pre-trained power flow adjustment model is trained; Step 2: constructing a frequency adjustment model to be trained, wherein the frequency adjustment model to be trained includes a frequency evaluation network to be trained and a frequency target network to be trained; Step 3: using the multiple sets of training data as initial state parameters of the simulated power grid at the target time, inputting the frequency adjustment model to be trained, obtaining evaluation parameter values ​​corresponding to all frequency adjustment actions at the next moment adjacent to the target time output by the frequency evaluation network to be trained, and target parameter values ​​corresponding to all frequency adjustment actions at the next moment adjacent to the target time output by the frequency target network to be trained; Step 4: Based on the evaluation parameter values ​​corresponding to all the frequency adjustment actions at the next moment, determine the frequency adjustment action corresponding to the maximum evaluation parameter value as the final frequency adjustment action at the next moment; Step 5: Based on the final frequency adjustment action at the next moment, the state of the simulated power grid is adjusted to obtain the adjusted state parameters of the simulated power grid as the model input for the next iterative training round; Step 6: Using the adjusted state parameters of the simulated power grid, establish a reward function; Step 7: Establish a loss function based on the maximum evaluation parameter value and the corresponding target parameter value; Step 8: Return the function value of the loss function to the frequency adjustment model to be trained; Step 9: Taking the maximum function value of the reward function as the optimization target, the frequency adjustment model to be trained adjusts the model parameters according to the function value of the loss function; Step 10, iteratively execute steps 3 to 9 until the preset training end condition is met, and the pre-trained frequency adjustment model is obtained from the frequency adjustment model to be trained; wherein the preset training end condition is that the number of iterations is greater than a preset iteration number threshold, or the frequency calculation result based on the state parameters of the simulated power grid is stable.

7. The method according to claim 1, characterized in that Using the parameter value corresponding to the frequency adjustment action at the next moment to adjust the state of the target power grid so that the target power grid resumes normal operation, including: Based on the parameter value corresponding to the frequency adjustment action at the next moment, determining the frequency adjustment action corresponding to the parameter value as the final frequency adjustment action; By using the final frequency adjustment action, a target generator that needs to be adjusted by the target power grid at the next moment and a generator shedding adjustment amount of the target generator are selected, or a target load that needs to be adjusted by the target power grid at the next moment and a load shedding adjustment amount of the target load are selected; The target generator is regulated by using the generator shedding adjustment amount, or the target load is regulated by using the load shedding adjustment amount.

8. A device for adjusting an abnormally operating power grid, comprising: The power flow parameter acquisition module is configured to: acquire the state parameters of the target power grid at the current moment; wherein the state parameters include the load active power, the generator active power and the transmission line active power associated with the power flow; The power flow adjustment prediction module is configured to: input the state parameters of the target power grid into a pre-trained power flow adjustment model to obtain a parameter value corresponding to the power flow adjustment action at the next moment output by the pre-trained power flow adjustment model; wherein the power flow adjustment action at least includes active power adjustment of the generator; The power flow adjustment execution module is configured to: adjust the state of the target power grid by using the parameter value corresponding to the power flow adjustment action at the next moment, so that the target power grid resumes normal operation; Among them, the pre-trained power flow adjustment model includes a deep reinforcement learning network D3QN, and the D3QN includes a power flow evaluation network and a power flow target network; the pre-trained power flow adjustment model is trained using sample data associated with the power flow of the power grid.

9. A device for adjusting an abnormally operating power grid, comprising: A frequency parameter acquisition module, configured to: acquire state parameters of a target power grid at a current moment; wherein the target power grid is a power grid after power flow adjustment is performed using the method of claims 1 to 4; the state parameters include the generator active power, reactive power, voltage, phase angle, frequency deviation and active power of the load associated with the frequency; The frequency adjustment prediction module is configured to: input the state parameters of the target power grid into a pre-trained frequency adjustment model to obtain a parameter value corresponding to a frequency adjustment action at a next moment output by the pre-trained frequency adjustment model; wherein the frequency adjustment action includes machine shedding and load shedding; The frequency adjustment execution module is configured to: adjust the state of the target power grid by using the parameter value corresponding to the frequency adjustment action at the next moment, so that the target power grid resumes normal operation; Among them, the pre-trained frequency adjustment model includes a deep reinforcement learning network D3QN, and the D3QN includes a frequency assessment network and a frequency target network; the pre-trained frequency adjustment model is trained using sample data associated with the frequency of the power grid.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for adjusting an abnormally operating power grid according to any one of claims 1 to 7 is implemented.