Intelligent agent training method and pre-setting method for emergency machine-cutting control measures setting
Through the agent training method, the composite neural network and ε-greedy strategy are used to independently decide on the machine control set, which solves the time-consuming and labor-intensive problem of setting emergency machine control measures, achieves efficient generation of machine control measures, and reduces the need for Reliance on expert experience improves the transient stability of the power system.
Patent Information
- Application Number
- CN202210589334.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-26
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2042-05-26
AI Technical Summary
The pre-decision-making process of emergency shutdown control measures is time-consuming, inefficient, and highly dependent on expert experience, making it difficult to quickly set effective shutdown control measures in large-scale interconnected complex power systems.
Using the agent training method, through a composite neural network composed of graph convolutional neural network, convolutional neural network and fully connected neural network, combined with ε-greedy strategy and invalid action constraints, autonomous decision-making machine control set, and through transient simulation The data and reward mechanism update network parameters to improve the setting efficiency of machine control measures.
It greatly improves the setting efficiency of emergency shutdown control measures, reduces the dependence on power grid technical experts, can quickly generate effective shutdown control measures, reduces the amount of transient simulation calculations, and improves the transient stability of the power system.
Smart Images

Figure CN114967649B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of emergency control measure setting of power systems, and more specifically, relates to an intelligent agent training method for emergency machine-cutting control measure setting, an intelligent pre-setting method for emergency machine-cutting control measures, and a computer-readable storage medium. Background Art
[0002] As the second line of defense for the safe and stable operation of my country's power system, emergency control is an indispensable and important measure to maintain the transient safety and stability of the system after a serious fault or disturbance occurs. At present, emergency machine disconnection control is the most effective and most commonly used control measure for transient instability of power systems. The most common mode of emergency machine disconnection control is: offline pre-decision matching with real-time conditions. In order to avoid a serious mismatch between the real-time operating conditions and the operating conditions when the control measures are set, resulting in under- or over-control problems in the disconnection control, the possible operating conditions and serious faults of the power system will be considered as much as possible in the pre-decision stage of the emergency machine disconnection control measures.
[0003] The offline pre-decision of emergency machine-cutting control measures is generally performed by power grid operation technical experts. They analyze transient simulation results based on domain knowledge and operation experience, and obtain effective emergency machine-cutting control measures for corresponding fault scenarios through continuous trial and error and adjustment. However, due to the large number of typical operating conditions and transient instability faults in modern large-scale interconnected and complex power systems, the manual offline pre-setting working mode has become very time-consuming and labor-intensive. At the same time, the manual setting of machine-cutting control measures is too dependent on expert experience. On the other hand, when there are many controllable generator nodes in the power system, the huge search space of the method of automatically searching for emergency machine-cutting control measures will lead to a sharp increase in the amount of transient simulation calculations, and the efficiency of setting control measures is not high. Summary of the invention
[0004] In view of the above defects or improvement needs of the prior art, the present invention provides an intelligent agent training method for emergency machine-cutting control measure setting, an intelligent pre-setting method for emergency machine-cutting control measures and a computer-readable storage medium, which aims to solve the technical problem that the setting of emergency machine-cutting control measures in power systems is time-consuming, labor-intensive and inefficient.
[0005] To achieve the above object, according to one aspect of the present invention, there is provided an agent training method for emergency machine-cutting control measure setting, comprising:
[0006] Step S11: setting agent training parameters and initializing the agent's network parameters;
[0007] Step S12: randomly selecting a new transient instability scenario, simulating to obtain transient instability simulation data of a non-cut control set, and inputting the transient instability simulation data as an initial input into the intelligent agent;
[0008] Step S13: using the intelligent agent to make decisions and obtain a machine cutting control set;
[0009] Step S14: verify the validity of the current machine-cutting control set by simulation, record transient simulation data and calculate rewards. If the machine-cutting control set is invalid and the number of decisions does not reach the decision-making number threshold, the current transient simulation data is input into the agent as input, and the process returns to step S13. If the machine-cutting control set is valid or the number of decisions reaches the decision-making number threshold, step S15 is executed.
[0010] Step S15: using transient instability simulation data in the current transient instability scenario, the machine switching control set of each decision, and the corresponding transient simulation data and rewards as experience samples to train and update the network parameters of the agent;
[0011] Step S16: Determine whether the agent has reached the training round threshold. If not, return to step S12; if so, save and output the trained agent model.
[0012] In one embodiment, the input quantity currently input to the intelligent agent includes the generator cutting control set obtained by the last decision, the power system topology structure under the effect of the last generator cutting control set, the bus voltage amplitude, and the relative power angle of the generator.
[0013] In one embodiment, the decision network of the intelligent agent adopts a composite neural network consisting of a graph convolutional neural network, a convolutional neural network and a fully connected neural network, wherein the graph convolutional neural network is used to extract the coupling characteristics of the bus voltage amplitude and the topological structure of the power system, the convolutional neural network is used to extract the relative power angle of the generator, and the fully connected neural network is used to extract the above-mentioned machine control set.
[0014] In one of the embodiments, the intelligent agent adopts a linear decision space strategy. When making a decision, the intelligent agent adopting the linear decision space strategy only adjusts the off-load amount of one generator node relative to the previous decision in one decision, and the off-load amounts of other generator nodes remain unchanged, so that the dimension of the neurons in the output layer of the intelligent agent is h*m, where m is the number of generator nodes and h is the number of off-load amount options for each generator node.
[0015] In one embodiment,
[0016] In step S14, when the machine-cutting control set is invalid and the number of decisions has not reached the decision-making number threshold, the following is performed: storing the current machine-cutting control set as a repeated control set in the invalid action set; and comparing the transient power angle instability moment of the power system under the current decision and the previous decision. When the transient power angle instability moment of the power system under the current decision is advanced, the generator node whose machine-cutting amount has changed compared with that in the previous decision and the corresponding erroneous machine-cutting amount are obtained, and the obtained generator node greater than or equal to the erroneous machine-cutting amount is stored as an erroneous action in the invalid action set;
[0017] In step S13, when the agent makes a decision, the agent shields the repeated control sets and erroneous actions in the current invalid action set and obtains the corresponding machine-cutting control set.
[0018] In one of the embodiments, in step S13, the agent uses an ε-greedy strategy to determine the current machine switching control set in the decision space after masking repeated control sets and erroneous actions in the current invalid action set.
[0019] In one of the embodiments, in step S14, the validity of the current machine cutting control set is judged according to the relative power angle of the generator nodes in the system at the end of the simulation. If the relative power angle between any two generator nodes is greater than or equal to 180°, it is determined that the power system is unstable and the current machine cutting control set is invalid; if the relative power angle between any two generator nodes is less than 180°, it is determined that the power system is stable and the current machine cutting control set is valid.
[0020] In one embodiment, in step S14, the formula for calculating the reward based on the transient simulation data is:
[0021]
[0022]
[0023] Among them, r k represents the reward corresponding to the Kth decision, λ1 is the penalty coefficient for power loss caused by machine switching, ΔA k is the incremental amount of power cuts in the Kth decision compared to the K-1th decision, λ2 is the reward coefficient for the control measures that can maintain the transient stability of the power system, It is a stable sign. When the current switch control set is valid, Take 1, when the current switch control set is invalid, Take 0; m is the number of generator nodes, represents the amount of power cuts of the i-th generator node in the K-th decision, It represents the amount of power cut of the i-th generator node in the K-1-th decision.
[0024] According to another aspect of the present invention, there is provided an intelligent pre-setting method for emergency machine trip control measures, comprising:
[0025] Step S21: determining a new transient instability scenario, simulating to obtain transient instability simulation data of a non-cutting control set, and using the transient instability simulation data as an initial input to input a trained intelligent agent, wherein the intelligent agent is obtained by training using the above method;
[0026] Step S22: using the trained intelligent agent to make decisions and obtain a machine switching control set;
[0027] Step S23: Simulate and verify the validity of the current machine cutting control set, record transient simulation data, if the machine cutting control set is invalid and the number of decisions does not reach the decision number threshold, then input the current transient simulation data as input to the intelligent agent, and return to step S22; if the machine cutting control set is invalid and the number of decisions exceeds the decision number threshold, it is prompted that effective machine cutting control cannot be obtained under the instability scenario; if the machine cutting control set is valid, then output the machine cutting control set.
[0028] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0029] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:
[0030] The present invention proposes an intelligent agent training method for emergency machine-cutting control measures setting, and an intelligent pre-setting method for emergency machine-cutting control measures using a trained intelligent agent. The intelligent agent training includes two stages, namely, the experience sample acquisition stage and the network parameter training stage. Among them, the experience sample acquisition stage includes: randomly selecting a transient instability scenario with a fault and inputting the transient instability simulation data obtained through simulation into the intelligent agent. The intelligent agent adjusts and outputs the machine-cutting control set in the decision space based on its input characteristics, that is, the machine-cutting control measures, and verifies the effectiveness of the machine-cutting control measures through transient simulation. When the simulation finds that this measure cannot effectively maintain transient stability, it is considered an invalid measure. The simulation data obtained under the invalid measure is used as new input data to input the intelligent agent. The intelligent agent adjusts the machine-cutting control measures according to the last transient simulation verification result and outputs the machine-cutting control set. After multiple tuning rounds, until the setting number threshold is reached or an effective machine-cutting control measure is obtained, an experience sample is output. The experience sample includes the transient instability scenario, the machine-cutting control set output by the intelligent agent in all tuning rounds under the transient instability scenario, and the simulation results under each machine-cutting control set. After obtaining the experience sample, the network parameter training stage is entered, that is, the intelligent agent learns and adjusts the network parameters according to the experience of the machine-cutting control measures adjusted in the previous stage to improve the speed of finding the best output result. After multiple trainings, a converged intelligent agent model can be obtained. After obtaining a trained intelligent agent, when faced with a new transient instability scenario, as long as the corresponding transient instability simulation data is input into the intelligent agent, and the process of the above-mentioned experience sample acquisition stage is referred to, the machine-cutting control measures under the corresponding transient instability scenario can be output. The setting process no longer relies on manual completion, which can free power grid technical experts from the heavy work of emergency control measures setting, greatly improving the efficiency of pre-setting. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A flowchart of the steps of an intelligent agent training method for emergency machine-cutting control measure setting according to an embodiment;
[0032] Figure 2 A schematic diagram of a linear decision space design principle for an intelligent agent according to an embodiment;
[0033] Figure 3 A load decision network and knowledge fusion framework of an intelligent agent in one embodiment;
[0034] Figure 4 A schematic diagram of the total number of successful tuning scenarios during an agent performance test in one embodiment;
[0035] Figure 5 A schematic diagram of the total reward for setting during the performance test of an intelligent agent in one embodiment;
[0036] Figure 6A schematic diagram of the total number of adjustments during the performance test of an intelligent agent according to an embodiment. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0038] like Figure 1 As shown, in one embodiment, the agent training method for emergency machine-cutting control measures setting includes the following steps:
[0039] Step S110: Set the agent training parameters and initialize the agent's network parameters.
[0040] Among them, the agent training parameters include: total training rounds, training sample batch size, learning rate, greed coefficient, discount factor, upper limit of decision times, and agent decision network scale and size; network parameters include: weights and biases of fully connected neural networks, convolution kernels and pooling parameters of convolutional neural networks.
[0041] Step S120: randomly selecting a new transient instability scenario, simulating to obtain transient instability simulation data of a non-cut control set, and inputting the transient instability simulation data as initial input into the intelligent agent.
[0042] When a serious fault occurs in the power system, the power system will experience a transient instability scenario consisting of power flow conditions and fault information, and the transient instability simulation data of the scenario without the use of control measures will be obtained as the state input data required for the intelligent agent to decide on the machine cutting control measures.
[0043] In one embodiment, the state input data input to the intelligent agent each time includes: the topological structure of the power system after the fault, the bus voltage amplitude, the relative power angle of the generator node, and the amount of the current machine cutting control measures. This multi-source heterogeneous feature quantity is conducive to a more comprehensive analysis of the transient instability characteristics of the power system.
[0044] In one embodiment, in the state input data of the intelligent agent, for the transient simulation data V k , δ k After data preprocessing, it is input into the agent, where:
[0045] (1) Bus voltage amplitude V k : The voltage amplitudes of each monitored bus within the observation time window are gathered into the following two-dimensional matrix:
[0046]
[0047] represents the voltage amplitude of bus N at the Ωth simulation sampling time. N represents the number of monitored buses. t0 represents the time when transient simulation starts, and t3 represents the end time of the agent observation window during transient simulation. Ω is the last sampling time in the observation time window. Ω=f s *(t3-t0), where f s is the sampling frequency of transient simulation.
[0048] (2) Generator node relative power angle δ k : The relative power angles of each controlled generator node within the observation time window are collected into the following two-dimensional matrix:
[0049]
[0050] In the formula, represents the relative power angle of the generator node m at the Ωth simulation sampling moment. Unlike the voltage amplitude, when the transient power angle is unstable, the relative power angle of the generator node will be much larger than 2π. In order not to affect the training of the strategy network, it is necessary to first k Normalization preprocessing is required before inputting the convolutional neural network channel of the policy network. k The preprocessing of each element is as follows:
[0051]
[0052] Step S130: Use the intelligent agent to make decisions and obtain a machine switching control set.
[0053] The machine cutting control set is the machine cutting control measure. The power system is connected to m generator nodes, and each generator node is connected to h identical generators, that is, each node has h machine cutting options. The so-called machine cutting control is to cut off a number of generators in the transient instability scenario after a fault occurs, so as to restore the stability of the power system. That is, in the current transient instability scenario, the agent makes the Kth decision output of each generator node, where: It represents the amount of machine cuts of the i-th generator node in the K-th decision. When the generator node cuts off 0 generators, the corresponding machine cut amount is 0. When the generator node cuts off h generators, the corresponding machine cut amount is 100%. When the generator node cuts off f generators, the corresponding machine cut amount is (f / h)*100%.
[0054] In one embodiment, after the generator nodes in the power system and the power cutoff options of each node are determined, the scope of the decision space is determined. At this time, it is necessary to select an appropriate decision space strategy. When there are m controllable generator nodes in the power system and each generator node has h power cutoff options, such as Figure 2 As shown in the figure, in traditional technology, the exponential decision space strategy is usually used. For the exponential decision space, theoretically, only one decision round is needed to obtain an approximate optimal solution. However, the dimension of its neuron is h. m . In this embodiment, a linear decision space strategy is adopted. When making a decision, the agent designed with the linear decision space can only adjust the off-machine amount of one generator node relative to the previous decision. Except for the generator node of this decision, the off-machine amounts of the remaining generator nodes will remain unchanged. Therefore, in the linear decision space, the dimension of the neurons in the output layer of the agent is h*m. For the linear decision space, the agent can also obtain the same approximate optimal solution, but at least K * decision rounds, where 1≤K * ≤m. In other words, the minimum number of decision iterations K required by the agent in the linear decision space * It depends on how many generator nodes are required to participate in the effective generator cutting scheme (GRS). In essence, the linear decision space sacrifices a limited number of decision rounds in exchange for a significant reduction in the difficulty of agent training, which is necessary for power systems with a large number of controllable generator nodes.
[0055] In one embodiment, if Figure 3 As shown in the figure, the decision network of the intelligent agent adopts a composite neural network composed of a graph convolutional neural network (GCN), a convolutional neural network (CNN) and a fully connected neural network (FCN) to extract the multi-source heterogeneous state characteristics of the transient simulation data of the power system. Among them, the graph convolutional neural network can effectively extract the bus voltage amplitude V k With grid topology G k The convolutional neural network can effectively extract the relative power angle δ of the generator node. k The fully connected neural network (FCN) is used to extract the machine switching control set a corresponding to the current transient simulation verification data. k-1 , the features extracted by different networks will be spliced and fed to the output layer. The neurons in the output layer are used to estimate the Q value of each action in the linear decision space. The composite neural network structure can greatly improve the intelligent agent's ability to characterize and extract features of transient simulation data of the power system, which is conducive to improving the setting efficiency and setting quality of emergency machine-cutting control measures. In a specific embodiment, both the GCN and CNN networks include two convolutional layers and one pooling layer.
[0056] In one embodiment, in this step, when using the agent to make decisions, an invalid action set constraint is also introduced, and the invalid action set is continuously updated with the decision rounds, and different transient instability scenarios correspond to different invalid action sets. The details of this content can be seen in the following introduction.
[0057] In one embodiment, each time the intelligent agent makes a decision, after considering the invalid action set constraints to shield the invalid actions, according to the ε-greedy principle, in the decision space after shielding the invalid actions, it adjusts the current machine cutting control measures with reference to the Q values of the remaining actions.
[0058] Among them, when the agent adjusts the cutting control measures in the linear decision space according to the ε-greedy strategy, the action adjustment expression is as follows:
[0059]
[0060]
[0061] In the formula, ε k Represents the greedy coefficient at the kth decision round. represents the cutting decision action of the agent's decision neuron x in the linear decision space at the kth decision round, It represents the decision with the largest Q value among the h*m decisions in the kth decision round, P is the probability, s k represents the input amount at the kth decision round, Indicates an invalid action set.
[0062] Step S140: Simulate and verify the validity of the current machine cutting control set, record transient simulation data and calculate rewards. If the machine cutting control set is invalid and the number of decisions does not reach the decision number threshold, the current transient simulation data is input into the intelligent agent as input and returns to step S130; if the machine cutting control set is valid or the number of decisions reaches the decision number threshold, execute step S150.
[0063] The process of verifying the effectiveness of control measures through time-domain transient simulation calculations includes operations such as setting severe faults, isolating faults by relay protection devices, and implementing emergency machine-cutting control measures.
[0064] During the simulation, set the critical fault, the relay protection device to isolate the fault, and the emergency machine disconnection control measures in sequence. For example, the transient simulation starts at t0=0s, a critical fault occurs at t1, the fault line is disconnected at t2, the machine disconnection control measures are put into effect at t3, and the transient simulation starts at t1=0s. f The simulation ends when the state observation window is set to [t0,t s ], where t3<t s ≤t f . Since [t3,t s] varies depending on the control measures, which allows the agent to adjust the control measures according to the different states of transient simulation verification feedback.
[0065] In one embodiment, transient stability (i.e., the effectiveness of the generator control measures) can be judged based on the relative power angle data at the end of the simulation, and whether the power system maintains transient stability can be judged based on the relative power angle of the generator nodes in the system at the end of the simulation. If the power system suffers from transient power angle instability, the simulation time when the maximum relative power angle difference of the system exceeds 180 degrees is calculated based on the simulation data.
[0066] Specifically, Indicates the stability mark, representing the transient stability of the power system. A value of 0 indicates that the transient power angle is unstable, and a value of 1 indicates that the transient power angle is stable, which satisfies:
[0067]
[0068] In the formula, represents the machine switching control set a at the kth decision k The relative power angle difference between generator nodes i and j at the end of the transient simulation.
[0069] In one embodiment, a decision-making end flag is also provided. A flag indicating whether the kth decision round is terminated. When the machine-cutting control measures set by the agent can maintain the transient stability of the power system or the number of decision iterations reaches the preset upper limit, True, execute step S150; otherwise If it is false, return to step S130. It can be expressed as:
[0070]
[0071] Where N L Indicates the decision number threshold for a failure scenario.
[0072] After obtaining the transient simulation data, it is also necessary to calculate the reward of the current machine-cutting control measure. Specifically, the reward of the Kth decision round is set to r k , also written as r k (s k ,a k ), the reward value depends on a k Stability mark of transient simulation verification Its expression is:
[0073]
[0074]
[0075] Where λ1 is the penalty coefficient for power loss caused by machine disconnection, ΔA k is a k The incremental amount of machine cutting brought by λ2 is the reward coefficient for the control measures that can maintain the transient stability of the power system. The purpose of introducing the machine cutting penalty in the reward is to obtain effective and economical emergency machine cutting control measures.
[0076] In one embodiment, an invalid action set constraint is also introduced, and the invalid action set is updated in step S140. Specifically, the invalid action set includes a repetition control set and an error action.
[0077] Repeat control set (repeat action), store the emergency machine cutting control measures adjusted by the agent for the scene into the repeat control set, and constrain the agent to no longer adjust the same control measures when adjusting the control measures next time.
[0078] Specifically, a list of measures is used to store the machine switching control set made by the agent at each decision since the beginning of the tuning process. k The definition is as follows:
[0079] L k ={a1,...,a τ ,...,a k},1≤τ≤k
[0080] Whenever the agent makes a decision and outputs the control measure a for the kth decision round k After that, the repeated control set that may appear in the k+1th decision round Updated as follows:
[0081]
[0082] In the formula, a τ Indicates the list of measures L k Historical control measures stored in . The action that causes the control measure in the k+1 decision round to be the same as the historical control measure that was previously decided and verified to be invalid. Yes all Obviously, The shedding capacity option of each generator node will be shielded to varying degrees.
[0083] The error action set stores the emergency cutting control measures that are found in advance when the transient power angle of the power system is unstable during the simulation verification, as well as the control measures that cut the generator node more than the current one into the error action set. When the control measures are adjusted next time, the constraint agent will no longer adjust the over-controlled cutting measures or cut off the inappropriate generator nodes.
[0084] Specifically, according to the design idea of linear decision space, for a k+1 A collection of wrong actions It is expressed as follows:
[0085]
[0086] In the formula, represents the decision action of the generator node corresponding to neuron y in the kth decision round, and x comes from the wrong action adjusted in the kth decision round The corresponding neuron number, the neuron number corresponds to the number of each generator in the generator node. It can be found that Not only does it include It also contains other ratios of generator node i For example, when deciding on generator node i, if its shedding amount is 20%, the system's transient power angle instability moment is advanced compared to the previous decision, and it is considered that the shedding amount of motor node i cannot be greater than or equal to 20%. In the subsequent decision rounds, it is necessary to screen out the erroneous action of the shedding amount of motor node i being greater than or equal to 20%.
[0087] When returning to step S130 to make a new decision, the above updated invalid action set is used for constraint. In this embodiment, the knowledge rules for setting emergency control measures of the power system are applied to the decision-making process of the intelligent agent in the form of invalid action constraints, which can effectively guide the intelligent agent to avoid repeated or wrong actions, that is, not wasting setting times and transient simulation computing resources on control measures that cannot maintain transient stability of the system, thereby improving the efficiency of the intelligent agent in setting emergency machine-cutting control measures.
[0088] Step S150: using the transient instability simulation data in the current transient instability scenario, the machine switching control set for each decision, and the corresponding transient simulation data and rewards as experience samples to train and update the network parameters of the intelligent agent.
[0089] The experience samples generated during the process of setting the above process measures are stored, including transient instability data, machine cutting control measures, transient simulation data after the measures are put into use, rewards and end marks. The experience sample data is stored in the training sample library for training the network parameters of the intelligent agent.
[0090] Specifically, the training process of the agent that integrates knowledge and deep reinforcement learning is to update the policy network parameters to minimize the time difference error, as shown below:
[0091]
[0092] In the formula, Q and Q′ represent the policy network and the target network respectively, θ j and θ′j Respectively represent the network parameters of the policy network and the target network at the jth learning. Φ represents the number of samples extracted from the experience sample pool through the experience replay mechanism during training. γ represents the discount factor. Therefore, the parameters of the policy network after this learning are updated as follows, and α represents the learning rate:
[0093]
[0094] Step S160: Determine whether the agent has reached the training round threshold, if not, return to step S120; if yes, save and output the trained agent model.
[0095] Among them, when the set training round threshold is not reached, jump to step S120, reselect a new transient instability scenario, and repeat the above process for the new transient instability scenario until the agent reaches the training round threshold, thereby outputting the trained agent model. Since the transient instability scenarios used in training are derived from different initial power flow conditions and serious faults, the data diversity can be increased, and the generalization ability of the trained agent to set emergency machine trip control measures is guaranteed when facing new transient instability scenarios.
[0096] The above embodiments integrate the knowledge rules related to emergency control of power systems and deep reinforcement learning algorithms. Combined with time-domain transient simulation calculations, the intelligent agent can autonomously adjust the emergency machine-cutting control measures for transient instability scenarios. Specifically, the adjustment method is based on the dual deep Q network (DBQN) algorithm. According to the simulation data under different transient instability scenarios, the state input information is observed. The intelligent agent evaluates the Q value of each machine-cutting measure. Under the constraint of the invalid action set, the ε-greedy strategy is used to determine the machine-cutting control measures. The effectiveness of the adjusted machine-cutting control measures is verified by time-domain transient simulation. Then, according to the simulation verification results, the next state input information function of the system is observed, the corresponding reward is formulated, and the end mark of the measure adjustment process for the transient instability scenario is updated. The intelligent agent continuously adjusts the adjusted emergency machine-cutting control measures until the transient stability of the power system after the fault can be maintained. The experience samples in the process of measure adjustment are stored, and quantitative samples are regularly extracted from the sample library to train and update the policy network parameters of the intelligent agent, so as to obtain an intelligent agent that can efficiently adjust effective machine-cutting control measures for different transient instability scenarios.
[0097] The above embodiment uses an intelligent agent that integrates knowledge and the DBQN algorithm. After training, it can set effective emergency machine trip control measures in different transient instability scenarios. The process of setting measures can be completed autonomously without relying on manual work. Figure 2 The linear decision space design shown in effectively reduces the parameters of the agent and reduces the difficulty of training the agent. Figure 3The composite decision network shown is used to extract the multi-source heterogeneous state characteristics in the power system. The composite decision network improves the representation ability of the intelligent agent, which is conducive to accelerating the convergence speed of the ability training process, improving the quality and efficiency of the setting of measures. Finally, the intelligent agent adopts a knowledge fusion framework to integrate repeated actions and invalid action sets, and acts on the intelligent agent decision process in the form of invalid action set constraints, so as to avoid the intelligent agent setting the machine-cutting control measures that cannot maintain the transient stability of the power system and waste the setting times, thereby improving the setting efficiency of the intelligent agent.
[0098] The present invention also relates to an intelligent pre-setting method for emergency machine trip control measures, which comprises:
[0099] Step S210: determine a new transient instability scenario, simulate to obtain transient instability simulation data of a non-cut control set, and input the transient instability simulation data as initial input into the trained intelligent agent.
[0100] Among them, the intelligent agent is trained by any of the above methods.
[0101] Step S220: Use the trained intelligent agent to make decisions and obtain a machine switching control set.
[0102] Step S230: Simulate and verify the validity of the current machine cutting control set, record transient simulation data, if the machine cutting control set is invalid and the number of decisions does not reach the decision number threshold, then input the current transient simulation data into the intelligent agent as the input, and return to step S220; if the machine cutting control set is invalid and the number of decisions exceeds the decision number threshold, it is prompted that effective machine cutting control cannot be obtained in the unstable scenario; if the machine cutting control set is valid, then output the machine cutting control set.
[0103] In one embodiment, the above-mentioned intelligent pre-setting method also introduces an invalid action set constraint, that is, in step S230, the invalid action set is updated with reference to the above description, and in step S220, a decision is made based on the invalid action set constraint. The process is referred to the above description and will not be repeated here.
[0104] By using the above-mentioned offline trained intelligent agent, when faced with new transient instability scenarios, it is also possible to set emergency machine tripping control measures based on transient instability data, and autonomously adjust control measures based on transient simulation calculation verification results until effective control measures are obtained to maintain the transient stability of the power system after a serious fault.
[0105] In one embodiment, during the pre-tuning process using a trained intelligent agent, new experience samples obtained during the pre-tuning process can be stored in an experience sample library, and a certain amount of samples can be periodically extracted from the sample library to further train and update the policy network parameters of the intelligent agent, thereby obtaining an intelligent agent that can efficiently tune effective machine-cutting control measures for different transient instability scenarios. Experience samples under different transient instability conditions are stored, and training allows the parameters of the intelligent agent to be updated, thereby improving the decision-making quality and efficiency of the intelligent agent, that is, the intelligent agent can obtain emergency machine-cutting control measures that effectively maintain the transient stability of the system with fewer tuning times, and the amount of machine-cutting is as small as possible. At the same time, the knowledge fusion mechanism of the invalid action set constraint can effectively reduce the proportion of invalid action samples stored in the experience sample library, thereby accelerating the convergence speed of the intelligent agent training process.
[0106] Accordingly, the present invention also relates to a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above methods are implemented. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0107] A specific embodiment is described below.
[0108] For example, in the IEEE standard New England 10-machine 39-bus system, the simulation scenario settings are shown in Table 1. During the simulation process, the time parameters are set as follows: t0 = 0s, t1 = 1s, t2 = 1.1s, t3 = 1.3s or t3 = 1.35s, t s =6s, t f =10s. The sampling frequency is f s =20Hz. A total of 595 transient power angle instability scenarios were obtained, of which 100 scenarios were randomly selected as test scenarios, and the remaining 495 scenarios were used for the agent training process.
[0109] Table 1 Transient stability simulation scenario settings
[0110]
[0111] The method for intelligently setting emergency power system tripping control measures provided in this embodiment includes the following process:
[0112] (1) Both the GCN and CNN networks contain two convolutional layers and one pooling layer. The number of output neurons for all three channels is set to 100. The switch count for each of the 9 generator nodes is set to [0, 0.1, …, 1.0], for a total of 11 choices. Therefore, the dimension of the linear decision space is set to 99. The hyperparameters for network training are set as follows: training round threshold N T =30000, experience sample pool capacity D = 10000, training batch sample capacity Φ = 128, target network parameter update interval f t =20, discount factor γ = 0.1, learning rate α = 0.0001, initial value of greed coefficient ε0 = 0.9, attenuation per round Δε = 0.0001, final stable value ε f =0.05, decision number threshold N L =50, the machine cutting penalty coefficient is λ1=1, and the reward for effective decision is λ2=10.
[0113] (2) Randomly select transient instability scenarios and obtain transient instability simulation data without control measures as the state input data required for the intelligent agent to decide on the generator cutting control measures. The state input data includes: the topological structure of the power system after the fault, the bus voltage amplitude, the relative power angle of the generator node, and the amount of generator cutting control measures currently put into use;
[0114] (3) Setting the machine-cutting control measures according to the transient instability data and the invalid action set constraints; which include:
[0115] (3-1) The intelligent agent calculates the Q value corresponding to different machine cutting control measures based on the state input data of transient instability;
[0116] (3-2) The agent is constrained by the invalid action set and Shield ineffective machine-cutting control measures from the decision space;
[0117] (3-3) According to the ε-greedy principle, the intelligent agent adjusts the current machine-cutting control measures by referring to the Q-values of the remaining actions in the decision space after shielding invalid actions;
[0118] (4) Through time-domain transient simulation, verify whether the power system can maintain transient stability after the intelligent agent-set cutting control measures are put into use under the power flow and fault of the selected instability scenario. If it can maintain transient stability, it means that the current cutting control measures are effective. If not, it means that the current cutting control measures are ineffective. This includes:
[0119] (4-1) Observe the transient simulation data of the power system after the current generator cutting control measures are put into use, and use it as the input state for the next decision, formulate a reward signal, and update the end mark of the decision round;
[0120] (4-2) Update the invalid action set according to the current machine-cutting control measures and transient stability, and use it as the action constraint for the next control measure setting. and
[0121] (5) Determine whether the transient stable state reaches the first termination condition;
[0122] (51) If the power system is transiently stable, the first termination condition is met, the process of setting measures for the instability scenario is completed, and the emergency generator control measures set by the intelligent agent are output;
[0123] If the power system is transiently unstable and the number of decisions exceeds 50, the first termination condition is met, the measure setting process for the instability scenario ends, and the output is "no effective generator tripping control measures can be obtained under this fault scenario";
[0124] (52) If the power system is transiently unstable and the number of decisions does not exceed 50, the first termination condition is not met, and the process goes to (3) to continue the process of setting the control measures for the instability scenario;
[0125] (6) Store experience samples and regularly train and update the agent parameters through the experience replay mechanism; the process includes:
[0126] (6-1) Storing the experience samples generated during the process of setting the current measures, including transient instability data, machine-cutting control measures, transient simulation data after the measures are put into use, rewards and end marks, and storing the experience sample data in the training sample library;
[0127] (6-2) Periodically extract a batch of experience samples of machine control measures from the training sample library to train and update the parameters of the intelligent agent decision network;
[0128] (7) Determine whether the number of iterations for updating the parameters of the training model is 30,000. If not, continue to execute step (2) and randomly select a transient instability scenario from the training scenario set to continue the training process. If the number of iterations reaches 30,000, output the intelligent agent model with the best decision-making performance during the training process.
[0129] (8) For the 100 transient instability scenarios in the test set, refer to the above-mentioned intelligent agent setting measure performance test process. During the training process, a performance test is performed using the test scenario every 200 training rounds. Compare the decision-making performance of 5 intelligent agents with different degrees of knowledge fusion and feature fusion. The 5 intelligent agents are: fusion of voltage + topology features, fusion of deduplication knowledge + error avoidance knowledge, fusion of voltage + topology + deduplication knowledge, fusion of voltage + deduplication knowledge + error avoidance knowledge, and fusion of voltage + topology + deduplication knowledge + error avoidance knowledge.
[0130] (9) The training process of each agent is repeated 5 times, and the performance evaluation results of each agent during the training process are counted. The performance includes: the total number of successful tuning scenarios, the total tuning reward, and the total number of tuning times, respectively. Figure 4 , Figure 5 , Figure 6 As shown in the figure, the greater the total number of successful tuning scenarios, the more transient instability scenarios the intelligent agent can cope with and the stronger its ability; the greater the total tuning reward, the smaller the amount of machine cutting of the machine cutting control measures tuned by the intelligent agent and the better the economy; the fewer the total number of tuning times, the fewer transient simulation calculation verification times the intelligent agent needs to tune the machine cutting control measures and the higher the tuning efficiency.
[0131] Depend on Figure 4 , Figure 5 , Figure 6 It can be seen that, on the one hand, repeated action shielding can prevent the agent from repeating invalid decisions, and the saved number of iterations can be used to explore other possible effective machine-cutting measures. Therefore, the number of test scenarios in which the agent that incorporates deduplication knowledge successfully formulates effective GRSs has increased significantly; wrong action shielding avoids continuing to make decisions in the wrong direction, and also avoids saving the memory of wrong decisions in the experience sample pool, thereby further improving the quality of experience samples in the early stage of training. Therefore, the decision-making performance of the agent that integrates deduplication + error avoidance knowledge is better than that of the agent that only integrates deduplication knowledge in the early stage of training, and converges faster.
[0132] On the other hand, the decision-making performance of the agent that integrates voltage and uses CNN to extract bus voltage amplitude features is significantly improved. This is because the bus voltage amplitude can reflect the stability characteristics of the power system during transient simulation, and can also reflect the internal connection relationship of the bus to a certain extent. However, since the voltage amplitude is represented in a matrix form and cannot intuitively reflect the topological characteristics, the information that can be mined by the feature extraction ability of CNN alone is relatively limited. In contrast, for the agent that integrates voltage + topological features, the GCN in the policy network can extract the features of bus voltage and topology at the same time. This means that the policy network of this agent has a stronger representation learning ability than the policy network that uses CNN to extract voltage amplitude features.
[0133] Therefore, the training convergence speed of the fused knowledge and deep reinforcement learning agent proposed in this method is faster and the decision-making performance is better.
[0134] It will be easily understood by those skilled in the art that the above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An agent training method for emergency machine-cutting control measures setting, characterized in that: include: Step S11: setting agent training parameters and initializing the agent's network parameters; Step S12: randomly selecting a new transient instability scenario, simulating to obtain transient instability simulation data of a non-cut control set, and inputting the transient instability simulation data as an initial input into the intelligent agent; Step S13: using the intelligent agent to make decisions and obtain a machine cutting control set; Step S14: verify the validity of the current machine-cutting control set by simulation, record transient simulation data and calculate rewards. If the machine-cutting control set is invalid and the number of decisions does not reach the decision-making number threshold, the current transient simulation data is input into the agent as input, and the process returns to step S13. If the machine-cutting control set is valid or the number of decisions reaches the decision-making number threshold, step S15 is executed. Step S15: using transient instability simulation data in the current transient instability scenario, the machine switching control set of each decision, and the corresponding transient simulation data and rewards as experience samples to train and update the network parameters of the agent; Step S16: Determine whether the agent reaches the training round threshold, if not, return to step S12; if yes, save and output the trained agent model; The input quantity of the intelligent agent includes the machine cutting control set obtained by the last decision, the power system topology structure under the effect of the last machine cutting control set, the bus voltage amplitude, and the relative power angle of the generator; The decision network of the intelligent agent adopts a composite neural network composed of a graph convolutional neural network, a convolutional neural network and a fully connected neural network, wherein the graph convolutional neural network is used to extract the coupling characteristics of the bus voltage amplitude and the topological structure of the power system, the convolutional neural network is used to extract the characteristics of the relative power angle of the generator, and the fully connected neural network is used to extract the characteristics of the above-mentioned machine control set; In step S14, when the machine-cutting control set is invalid and the number of decisions has not reached the decision-making number threshold, the following is performed: storing the current machine-cutting control set as a repeated control set in the invalid action set; and comparing the transient power angle instability moment of the power system under the current decision and the previous decision. When the transient power angle instability moment of the power system under the current decision is advanced, the generator node whose machine-cutting amount has changed compared with that in the previous decision and the corresponding erroneous machine-cutting amount are obtained, and the obtained generator node greater than or equal to the erroneous machine-cutting amount is stored as an erroneous action in the invalid action set; In step S13, when the agent makes a decision, the agent shields the repeated control sets and erroneous actions in the current invalid action set and obtains the corresponding machine-cutting control set.
2. The agent training method according to claim 1, characterized in that: The intelligent agent adopts a linear decision space strategy. When making a decision, the intelligent agent adopting the linear decision space strategy only adjusts the off-machine amount of one generator node relative to the previous decision, and the off-machine amounts of other generator nodes remain unchanged, so that the dimension of the output layer neurons of the intelligent agent is h*m, where m is the number of generator nodes and h is the number of off-machine amount options for each generator node.
3. The agent training method according to claim 1, characterized in that: In step S13, the agent uses an ε-greedy strategy to determine the current machine switching control set in the decision space after shielding the repeated control sets and erroneous actions in the current invalid action set.
4. The agent training method according to claim 1, characterized in that: In step S14, the validity of the current machine cutting control set is judged according to the relative power angle of the generator nodes in the system at the end of the simulation. If the relative power angle between any two generator nodes is greater than or equal to 180°, it is determined that the power system is unstable and the current machine cutting control set is invalid; if the relative power angle between any two generator nodes is less than 180°, it is determined that the power system is stable and the current machine cutting control set is valid.
5. The agent training method according to claim 1, characterized in that: In step S14, the formula for calculating the reward based on the transient simulation data is: Among them, r k represents the reward corresponding to the Kth decision, λ1 is the penalty coefficient for power loss caused by machine switching, ΔA k is the incremental amount of power cuts in the Kth decision compared to the K-1th decision, λ2 is the reward coefficient for the control measures that can maintain the transient stability of the power system, It is a stable sign. When the current switch control set is valid, Take 1, when the current switch control set is invalid, Take 0; m is the number of generator nodes, represents the amount of power cuts of the i-th generator node in the K-th decision, It represents the amount of power cut of the i-th generator node in the K-1-th decision.
6. An intelligent pre-setting method for emergency machine trip control measures, characterized in that: include: Step S21: determining a new transient instability scenario, simulating to obtain transient instability simulation data of a non-cutting machine control set, and using the transient instability simulation data as an initial input to input a trained intelligent agent, wherein the intelligent agent is trained by the method according to any one of claims 1 to 5; Step S22: using the trained intelligent agent to make decisions and obtain a machine switching control set; Step S23: Simulate and verify the validity of the current machine cutting control set, record transient simulation data, if the machine cutting control set is invalid and the number of decisions does not reach the decision number threshold, then input the current transient simulation data as input to the intelligent agent, and return to step S22; if the machine cutting control set is invalid and the number of decisions exceeds the decision number threshold, it is prompted that effective machine cutting control cannot be obtained under the instability scenario; if the machine cutting control set is valid, then output the machine cutting control set.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
