Transient stability preventive control method and device based on agent model

Through the deep learning neural network and integral gradient algorithm based on the Transformer architecture, a transient stability preventive control method with multi-channel feature extraction and supervised contrastive learning is constructed, which solves the problems of high parallelism and sample requirements of traditional models in new power systems and realizes more efficient transient stability preventive control of power systems.

CN119513754BActive Publication Date: 2025-10-03ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411454684.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-10-03
Estimated Expiration
2044-10-17

AI Technical Summary

Technical Problem

The transient stability analysis model implemented by traditional neural networks in existing technologies has poor parallelism in new power systems, high sample requirements, and cannot meet online control needs, resulting in the power system transient stability prevention control strategy being unable to adapt to the engineering needs of new power systems.

Method used

A deep learning neural network based on the Transformer architecture is used in combination with the integral gradient algorithm to adjust the active output of the generator. A transient stability prevention control method is constructed, and multi-channel feature extraction and supervised comparative learning optimization model are used to calculate the sensitivity of the generator and determine the adjustment strategy.

Benefits of technology

It improves the accuracy and efficiency of transient stability analysis and preventive control of power systems, enhances the learning and generalization capabilities of the model, reduces overfitting, and improves the safe and stable operation capabilities of power systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513754B_ABST
    Figure CN119513754B_ABST
Patent Text Reader

Abstract

The present invention provides a transient stability prevention and control method and device based on an agent model, the method comprising: inputting multiple operating data of an electric power system into a pre-built transient stability analysis model, obtaining transient stability analysis results of each operating data output by the transient stability analysis model, wherein each operating data includes the initial active power of a generator; determining transient instability operating data based on the transient stability analysis results, and calculating the sensitivity of each generator in the transient instability operating data by an integral gradient algorithm; and determining an adjustment strategy for the initial active power of each generator based on the sensitivity; the present invention provides a feasible solution to problems such as monitoring the stability status of the electric power system and control decision-making after instability, further improving the safe and stable operation capability of the electric power system, and providing support for preventing large-scale accidents in the power grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power system transient stability, and in particular to a transient stability preventive control method and device based on an agent model. Background Art

[0002] Power system transient stability analysis can be divided into two categories: one is to predict transient stability based on the system trajectory at the time of a fault or under a predicted fault, and the other is to establish a relationship between the post-fault transient stability and the pre-fault power flow distribution before the system fails.

[0003] Power system transient stability preventive control refers to changing the system's power flow operation mode by adjusting the generator's active output, parallel reactive compensation, etc. before a potential power system fault occurs, so that the system can continue to operate safely and stably.

[0004] In response to the engineering requirements of new power system transient stability preventive control, traditional neural network transient stability analysis models suffer from limitations such as poor parallelism, high sample requirements, and inability to meet online control requirements. To overcome these difficulties in transient stability preventive control using traditional neural networks, a new generation of transient stability analysis models is being used.

[0005] In view of the new generation of transient stability analysis models, it is urgent to adjust the existing power system transient stability prevention and control strategies. Summary of the Invention

[0006] The present invention provides a transient stability preventive control method and device based on an agent model, which is used to solve the defect that the transient stability preventive control strategy of the power system in the existing technology cannot adapt to the engineering requirements of the transient stability preventive control of the new power system. The preventive control strategy is generated by adjusting the active output of the generator.

[0007] The present invention provides a transient stability preventive control method based on an agent model, comprising the following steps:

[0008] Inputting a plurality of operating data of the power system into a pre-built transient stability analysis model to obtain a transient stability analysis result of each operating data output by the transient stability analysis model, wherein each operating data includes an initial active power of a generator;

[0009] Determining transient instability operation data according to the transient stability analysis results, and calculating the sensitivity of each generator in the transient instability operation data using an integral gradient algorithm;

[0010] Based on the sensitivity, an adjustment strategy for the initial active power of each of the generators is determined.

[0011] According to the transient stability preventive control method based on the agent model provided by the present invention, the transient stability analysis model is obtained by training a deep learning neural network of the Transformer architecture based on sample data with transient stability and sample data with transient instability.

[0012] According to the transient stability preventive control method based on the agent model provided by the present invention, the transient stability analysis model includes multiple encoders of the Transformer architecture and a decoder;

[0013] Each of the transformer architecture encoders is used to extract features from the power system operation data grouped according to physical attributes to obtain feature vectors of each of the operation data; and to perform feature concatenation on the feature vectors; each of the transformer architecture encoders is trained using a supervised contrastive learning algorithm;

[0014] The decoder is used to process the feature vector after feature splicing and output the transient stability analysis result of the power system.

[0015] According to the transient stability preventive control method based on the agent model provided by the present invention, the step of calculating the sensitivity of each generator in the transient instability operation data by using the integral gradient algorithm specifically includes:

[0016] Select the transient stable operating point in the sample space where the difference between the initial active power of the generator and the transient instability sample point is the smallest as the reference point;

[0017] Based on the reference point, calculating an integral value of a gradient between each of the transient instability sample points and the reference point;

[0018] The integral value is used as the sensitivity of each generator in the transient instability operation data.

[0019] According to the transient stability preventive control method based on the agent model provided by the present invention, the formula for calculating the integral value of the gradient between each sample point and the reference point is:

[0020] ;

[0021] in, represents the reference point sample; Represents the current input state of the neural network; Indicates from arrive A path where , ; Represents a neural network model; No. input features; Indicates the total number of input features; Indicates the path right The derivative of Represents a neural network model exist Input gradient.

[0022] According to the transient stability preventive control method based on the agent model provided by the present invention, the step of determining the adjustment strategy for the initial active power of each generator based on the sensitivity specifically includes:

[0023] Sort the generators in descending order of the absolute value of sensitivity;

[0024] Select multiple engines with larger absolute values ​​as control engines, and select multiple engines with smaller absolute values ​​as balance engines;

[0025] Determining the adjustment amount of the initial active power of each of the control engines and each of the balancing engines according to the sensitivity calculated by the integral gradient and the upper and lower limits of the generator output;

[0026] Adjusting each of the control engines and each of the balancing engines according to each of the adjustment amounts to obtain a new active output of the generator;

[0027] The new generator active output is verified. If the verification fails, the adjustment values ​​are updated and the verification is repeated until the verification passes, thereby obtaining the final adjustment value.

[0028] The present invention also provides a transient stability preventive control device based on an agent model, comprising the following modules:

[0029] an analysis module, configured to input a plurality of operating data of the power system into a pre-built transient stability analysis model, and obtain a transient stability analysis result of each operating data output by the transient stability analysis model, wherein each operating data includes an initial active power of a generator;

[0030] a sensitivity calculation module, configured to determine transient instability operation data based on the transient stability analysis result, and calculate the sensitivity of each generator in the transient instability operation data using an integral gradient algorithm;

[0031] An adjustment module is used to determine an adjustment strategy for the initial active power of each generator based on the sensitivity.

[0032] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the transient stability preventive control method based on the agent model as described above is implemented.

[0033] The present invention also provides a non-transient computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for transient stability prevention and control based on an agent model as described above is implemented.

[0034] The present invention also 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-mentioned transient stability preventive control methods based on the agent model.

[0035] The present invention provides a transient stability prevention and control method and device based on an agent model, which obtains transient stability analysis results of each operating data output by the transient stability analysis model by inputting multiple operating data of the power system into a pre-built transient stability analysis model, wherein each operating data includes the initial active power of the generator; according to the transient stability analysis results, the transient instability operating data is determined, and the sensitivity of each generator in the transient instability operating data is calculated by an integral gradient algorithm; based on the sensitivity, the adjustment strategy for the initial active power of each generator is determined. The present invention uses a transient stability analysis model to analyze and predict the transient stability of the power system, and further uses artificial intelligence technology to assist in the generation of transient stability prevention and control strategies for the power system, providing feasible solutions to problems such as monitoring the stability of the power system and control decisions after instability, further improving the safe and stable operation capabilities of the power system, and providing support for preventing large-scale power grid accidents. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0037] Figure 1 It is a flow chart of the transient stability preventive control method based on the agent model provided by the present invention.

[0038] Figure 2 A schematic diagram of the structure of a transient stability analysis model based on the Transformer architecture provided in an embodiment of the present invention.

[0039] Figure 3A schematic diagram of the structure of an encoder provided in an embodiment of the present invention.

[0040] Figure 4 A schematic structural diagram of a decoder provided in an embodiment of the present invention.

[0041] Figure 5 A structural comparison diagram of the model before and after using the multi-channel feature extraction method provided by the embodiment of the present invention.

[0042] Figure 6 A schematic diagram of the structure of a feature extractor provided in an embodiment of the present invention that is individually trained.

[0043] Figure 7 A diagram of the encoder pre-training process provided by an embodiment of the present invention.

[0044] Figure 8 A schematic diagram of fine-tuning a model provided in an embodiment of the present invention.

[0045] Figure 9 Schematic diagram of the overall process of preventive control provided by an embodiment of the present invention

[0046] Figure 10 A schematic diagram of a power angle curve of a sample provided in an embodiment of the present invention.

[0047] Figure 11 A schematic diagram of a voltage curve of a sample provided by an embodiment of the present invention.

[0048] Figure 12 A schematic diagram of an active power curve of a sample provided in an embodiment of the present invention.

[0049] Figure 13 A graph showing the change in the loss function of the improved model provided in an embodiment of the present invention.

[0050] Figure 14 This is the power angle curve of the sample i1 before adjustment provided by the embodiment of the present invention.

[0051] Figure 15 This is the power angle curve of the adjusted sample i1 provided in an embodiment of the present invention.

[0052] Figure 16 This is the power angle curve of the sample i2 before adjustment provided by the embodiment of the present invention.

[0053] Figure 17 This is the power angle curve of the adjusted sample i2 provided in an embodiment of the present invention.

[0054] Figure 18 It is a structural schematic diagram of the transient stability preventive control device based on the agent model provided by the present invention.

[0055] Figure 19It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0056] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0057] The present invention is described in detail below with reference to the accompanying drawings. The specific operating methods in the method embodiments can also be applied to device embodiments or system embodiments. In the description of the present invention, unless otherwise specified, "at least one" includes one or more. "Multiple" refers to two or more. For example, at least one of A, B, and C includes: A exists alone, B exists alone, A and B exist at the same time, A and C exist at the same time, B and C exist at the same time, and A, B, and C exist at the same time. In the present invention, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0058] The present invention will be described in detail below with reference to specific embodiments.

[0059] In some specific embodiments of the present invention, Figure 1 As shown in FIG, this scheme provides a transient stability preventive control method based on an agent model, which includes the following steps:

[0060] Step 100: Input multiple operating data of the power system into a pre-built transient stability analysis model to obtain transient stability analysis results of each operating data output by the transient stability analysis model, wherein each operating data includes the initial active power of the generator;

[0061] Step 200: Determine transient instability operation data based on the transient stability analysis result, and calculate the sensitivity of each generator in the transient instability operation data using an integral gradient algorithm;

[0062] Step 300: Determine an adjustment strategy for the initial active power of each generator based on the sensitivity.

[0063] It should be noted that the existing transient stability prevention and control schemes cannot adapt to the engineering requirements of transient stability prevention and control of new power systems. Under the engineering requirements of transient stability prevention and control of new power systems, the transient stability analysis model implemented by traditional neural networks has shortcomings such as poor parallelism, high sample requirements and failure to meet online control requirements.

[0064] Therefore, the present invention applies the transient stability analysis model to the transient stability analysis and preventive control of the power system, and then calculates the sensitivity of the generator active output corresponding to the system stability according to the integral gradient algorithm, guides the adjustment of the generator active output, and thus realizes transient stability preventive control.

[0065] Specifically, the direct method for solving the power system transient stability preventive control algorithm alternates between transient stability analysis and operating point updates until a new operating point that satisfies transient stability constraints is obtained. The operating point update process is primarily based on sensitivity metrics. Compared to traditional analysis methods, artificial intelligence technologies such as deep learning offer speed advantages in power system transient stability preventive control. Therefore, the present invention utilizes a pre-built improved transient stability analysis model to formulate preventive control solutions.

[0066] In some possible implementations of the present invention, the transient stability analysis model is obtained by training a deep learning neural network with a Transformer architecture based on sample data with transient stability and sample data with transient instability.

[0067] Specifically, this embodiment provides an implementation method of a transient stability analysis model, using a new generation of Transformer model for transient stability analysis and preventive control of power systems, overcoming the difficulties of traditional neural networks in transient stability analysis and transient stability preventive control.

[0068] Specifically, traditional transient stability analysis methods, such as time-domain simulation, while highly accurate, are computationally intensive and therefore difficult to meet real-time or near-real-time analysis requirements. Neural networks, due to their excellent nonlinear mapping capabilities and fast computational speed, are increasingly being used to construct transient stability assessment models, enabling rapid and accurate stability assessments.

[0069] Therefore, the transient stability analysis model in this embodiment focuses on the transient stability analysis problem under the concept of stability domain, combines the encoder-decoder architecture and attention mechanism of the Transformer model, and constructs a neural network model for analyzing the transient stability of the power system.

[0070] It is understandable that an important application of neural network models is classification, and transient stability analysis is to determine whether a power system operation sample is stable, so this can be regarded as a binary classification problem.

[0071] In a possible embodiment, Figure 2 As shown, Figure 2 The overall structure of the transient stability analysis model based on the Transformer architecture, the encoder-decoder architecture and the multi-head self-attention mechanism based on the Transformer model are shown. This embodiment constructs a transient stability analysis model, which is also divided into two parts: an encoder and a decoder. The encoder part is a feature extractor whose purpose is to extract and represent the input dynamic features of the power system and project them into a high-dimensional stable feature space, thereby strengthening the representation of features that are more closely related to the transient stability of the power system; the decoder part is a classifier implemented by a multi-layer perceptron. The purpose is to transform each feature in the high-dimensional stable feature space through nonlinear transformations of multiple hidden layers and finally reach the output layer for binary classification operations, thereby obtaining a transient stability assessment.

[0072] Specifically, the input of the model is Represented as n, where n is the dimension of the input feature and T is the length of the input feature. First, a linear embedding layer is used to transform the input into , Represents the dimension of the model vector. The main purpose of the linear embedding layer is to ensure that the model can perform normalized preprocessing on input data of various shapes and improve the application range of the model.

[0073] While the multi-head attention mechanism in the Transformer model can extract dependencies between nodes in the input data, it cannot extract the absolute or relative positions of nodes in time series data. If the order of keys and values ​​is disrupted, the attention results remain unchanged, which hinders the ability to capture information from time series data such as power system input feature trajectories. Therefore, to address this issue, positional encoding is added to preserve time series information. This is achieved by numbering each position in the input feature, representing each number as a vector, and adding this vector to the feature data at the corresponding position, thereby introducing time series information.

[0074] The multi-head attention sublayer is a core component of the Transformer model. It allows the model to learn information in parallel in different representation subspaces, which can increase the model's ability to process different types of information and improve the model's expressive power.

[0075] The Position-wise Feed-Forward Networks (FFN) in the encoder layer implements nonlinear activation. It consists of two fully connected layers and a Reluctant Luminance (ReLU) activation function. The FFN layer introduces nonlinearity through the Reluctant Luminance (ReLU) activation function, enhancing the model's nonlinear expressiveness and helping it learn complex data patterns.

[0076] To increase the model's expressiveness, residual connections and layer normalization are performed after each sublayer. Residual connections address network degradation and prevent issues like vanishing or exploding gradients. Layer normalization stabilizes the network training process, unifies the distribution of different features, and improves the model's generalization capabilities.

[0077] A complete Transformer encoder is constructed by stacking n such encoder layers. The calculation formula is as follows:

[0078] (1)

[0079] in, (·) represents a Transformer encoder with n encoder layers stacked, represents the input after the linear embedding layer changes the dimension, PE represents the position encoding, Represents the output of the Transformer encoder, and there is .

[0080] Adding a pooling layer after the Transformer encoder output aims to reduce dimensionality, allowing the model to focus more on the global information of features and facilitating subsequent classifier calculations. Common pooling methods include maximum pooling and average pooling. Here, average pooling is chosen along the input's length dimension.

[0081] The structure of the entire model encoder is as follows Figure 3 shown.

[0082] The encoder encodes the model's input and outputs it. The encoder can be expressed as follows:

[0083] (2)

[0084] in Represents the input of the encoder, that is, the input of the entire model, Encoder(·) represents the encoder, represents the output of the encoder. And , .

[0085] The decoder of the model consists of a multi-layer perceptron with an MLP as the classifier. The features encoded by the encoder are transformed through multiple hidden layers of nonlinearity and finally reach the output layer for binary classification, thereby obtaining an assessment of transient stability.

[0086] In a possible embodiment, the decoder is structured as follows Figure 4 As shown, the input and output of each neuron in the MLP network satisfy the following relationship:

[0087] (3)

[0088] in: are weights and biases respectively, is a non-linear activation function.

[0089] The MLP network has two hidden layers with dimensions of 128 and 64 respectively. The dimension of the input layer is the same as the dimension of the encoder output, that is, , the dimension of the output layer is 2, which is a binary classification result considering whether the output is transient stable or not. Represents the probability of classification category 0, i.e. transient stability, Represents the probability of classification category 1, that is, transient instability, and there is .Pick and The larger one between the two is taken as the prediction result of transient stability, or it is determined according to the result of binary classification. In this case, there are:

[0090] (4)

[0091] The entire decoder can be expressed as follows:

[0092] (5)

[0093] in, represents the output of the decoder, Describes the decoder, Represents the input of the decoder, which is also the output of the encoder.

[0094] When training the transient stability analysis model, the supervised learning method is used, and the Adam (Adaptive Moment Estimation) optimization algorithm is applied to update the parameters of the neural network by backpropagating the error, thereby gradually reducing the error.

[0095] For all N samples of input , all the above operations are performed, which is regarded as one training step. Until the maximum number of training steps is reached or the loss function has dropped to a certain range, the model is considered to have completed training.

[0096] In some possible implementations of the present invention, the transient stability analysis model includes multiple Transformer architecture encoders and a decoder;

[0097] Each of the transformer architecture encoders is used to extract features from the power system operation data grouped according to physical attributes to obtain feature vectors of each of the operation data; and to perform feature concatenation on the feature vectors; each of the transformer architecture encoders is trained using a supervised contrastive learning algorithm;

[0098] The decoder is used to process the feature vector after feature splicing and output the transient stability analysis result of the power system.

[0099] Specifically, this embodiment provides a specific implementation of a transient stability analysis model. This model is constructed based on a self-attention mechanism and an encoder-decoder architecture. The model is optimized by building a multi-channel feature extraction framework and employing supervised contrastive learning. The resulting improved model boasts enhanced performance and learning capabilities.

[0100] It is understandable that a neural network power system transient stability analysis model constructed by combining the encoder-decoder architecture and attention mechanism of the Transformer model has demonstrated good learning ability on the dataset, but it still has the problem of overfitting, and performance indicators such as the model's accuracy, false positive rate, and missed positive rate still have much room for improvement.

[0101] Therefore, this embodiment focuses on optimizing the architecture design and training method of the transient stability analysis model in order to enhance the model's expressiveness and generalization capabilities, alleviate overfitting, and improve model performance.

[0102] Specifically, this embodiment adopts multi-channel feature extraction. According to physical properties, the operating characteristics of the power system can be divided into multiple attributes. For example, the generator power angle, node voltage amplitude and active transmission power of the line selected when constructing the data set in the previous embodiment. Different types of features have different impacts on the stability of the power system. Therefore, the encoder constructed in this embodiment uses the same Transformer encoder to extract features from different types of input features, which is not perfect. Here, the multi-channel feature extraction method is used to replace the method of using a single encoder for feature extraction in the model constructed in the previous embodiment. Considering the different impacts of different types of features, a Transformer encoder is constructed to perform feature extraction, thereby improving the learning efficiency of the model.

[0103] The mathematical description of the multi-channel feature extraction method is as follows:

[0104] For a given set of power system characteristics , where the feature subset Represents the feature of the i-th type, and there are M different types of feature subsets that constitute the feature set The problem of transient stability analysis of power system based on neural network with multi-channel feature extraction can be expressed as follows:

[0105] (6)

[0106] in, There are M features that describe the characteristics of the power system, which belong to the feature subsets . It is the model's prediction value of whether the system is transiently stable or not. Represents the feature extractor constructed for the i-th type of feature, Represents the parameters corresponding to the i-th feature extractor. It is a network that uses all the features extracted by the feature extractor to predict transient stability. The corresponding parameters are .

[0107] The structure comparison between the transient stability analysis model using multi-channel feature extraction and the original model is shown in Figure 2. Figure 5 As shown, Represents the feature vector obtained by projecting the i-th type of feature into a high-dimensional stable feature space. TransformerEncoder #i represents the Transformer encoder constructed for the i-th type of feature, i.e., the feature extractor.

[0108] During the training process, the output of each feature extractor A separate MLP is also used for training to enhance the semantic features of S that are strongly related to transient stability classification. The training process is as follows Figure 6 As shown in the figure, after each feature extractor is trained, the features extracted by different feature extractors are concatenated as input to the model's MLP to obtain transient stability prediction results. The information obtained by different feature extractors forms a complementary relationship, which helps reduce the complexity of model parameters and improve model learning efficiency.

[0109] In a possible embodiment, a supervised contrastive loss is used to expand the number of positive pairs for sample i. Here, all samples with the same label as sample i are considered positive pairs. Therefore, the meaning of supervised contrastive loss is that the distance between all samples belonging to the same class as sample i is as small as possible, while the distance between samples belonging to different classes is as large as possible.

[0110] Therefore, using supervised contrast loss during transient stability analysis model training can narrow the distance between all stable samples and the distance between all unstable samples. This will separate stable and unstable samples as much as possible in the high-dimensional stability feature space, making classification easier.

[0111] During supervised contrastive learning training, a pre-training-fine-tuning framework is used. First, the encoder is pre-trained. A supervised contrastive loss is used during pre-training to maximize the separation between stable and unstable samples in the high-dimensional stable feature space generated by the encoder. The fully pre-trained encoder is then connected to the classifier and trained using the cross-entropy loss function. This primarily involves training the classifier's parameters, while the encoder only requires fine-tuning to achieve good classification results in conjunction with the classifier.

[0112] The training process using supervised contrastive learning is as follows Figure 7 As shown in Figure 8 shown.

[0113] On this basis, the transient stability preventive control problem can generally be transformed into the transient stability constrained optimal power flow (TSCOPF) problem for solution. The TSCOPF model can be described by the following formula:

[0114]

[0115]

[0116]

[0117]

[0118]

[0119] (7)

[0120] Where: represents the objective function of the optimization problem; and represent the state variables and algebraic variables of the power system respectively; and Indicates the initial value; and They represent the relevant equality constraints and inequality constraints that need to be satisfied for the operation of the power system; Represents the dynamic response process of the system; is the initial value constraint; Represents the relevant transient stability index.

[0121] In some possible implementations of the present invention, the step of calculating the sensitivity of each generator in the transient instability operation data by using an integrated gradient algorithm specifically includes:

[0122] Select the transient stable operating point in the sample space where the difference between the initial active power of the generator and the transient instability sample point is the smallest as the reference point;

[0123] Based on the reference point, calculating an integral value of a gradient between each of the transient instability sample points and the reference point;

[0124] The integral value is used as the sensitivity of each generator in the transient instability operation data.

[0125] Specifically, this embodiment provides an implementation method for calculating the sensitivity of the active power of each generator in the transient instability sample data, by obtaining the reference point for integral gradient calculation in the sample space, and obtaining the sensitivity of the active power of each generator based on the integral value of the gradient between each sample point and the reference point.

[0126] Specifically, neural network interpretability refers to understanding and describing how neural networks make decisions. For example, transient stability preventive control and generator active output adjustment require understanding the importance of generator active output.

[0127] Gradient attribution is a commonly used interpretability algorithm. Neural networks can calculate gradients using the following formula:

[0128] (8)

[0129] However, using the above method is equivalent to solving only the derivative value of a certain point. However, for nonlinear functions such as neural networks, the gradient value of a point cannot represent the impact of the overall input on the output. Therefore, the direct gradient method shown in formula (7) has certain shortcomings.

[0130] Different from traditional gradient methods, integrated gradient solves the problem of gradient saturation or vanishing by integrating the gradient between the input feature and a reference point.

[0131] In some possible implementations of the present invention, the formula for calculating the integral value of the gradient between each sample point and the reference point is:

[0132] (9)

[0133] in, represents the reference point sample; Represents the current input state of the neural network; Indicates from arrive A path where , ; Represents a neural network model; No. input features; Indicates the total number of input features; Indicates the path right The derivative of Represents a neural network model exist Input gradient.

[0134] Specifically, this embodiment provides an implementation method for calculating the integral value of the gradient between the sample point and the reference point. By solving the integral value of the gradient between the input and the reference point, the overall impact of the input on the output is obtained.

[0135] The above formula obtains the overall impact of the input on the output by solving the integral value of the gradient between the input and the reference point, and the absolute value of each component represents the importance of the input component on the output, as shown in formula (10):

[0136] (10)

[0137] in, Indicates the The integrated gradient of the input features.

[0138] In some possible implementations of the present invention, the step of determining an adjustment strategy for the initial active power of each generator based on the sensitivity specifically includes:

[0139] Sort the generators in descending order of the absolute value of sensitivity;

[0140] Select multiple engines with larger absolute values ​​as control engines, and select multiple engines with smaller absolute values ​​as balancing engines;

[0141] Determining the adjustment amount of the initial active power of each of the control engines and each of the balancing engines according to the sensitivity calculated by the integral gradient and the upper and lower limits of the generator output;

[0142] Adjusting each of the control engines and each of the balancing engines according to the adjustment amounts to obtain a new active output of the generator;

[0143] The new generator active output is verified. If the verification fails, the adjustment values ​​are updated and the verification is repeated until the verification passes, thereby obtaining the final adjustment value.

[0144] Specifically, this embodiment provides an implementation method for determining the active power adjustment strategy of each generator, by sorting the generators according to sensitivity, and then selecting generators that implement control functions and generators that implement balancing functions according to the size of the sensitivity, and determining the final active power adjustment amount based on the verification results of the adjusted generator active output.

[0145] Regarding the calculation of sensitivity, the impact of the generator's initial active power on system stability can be specifically defined as the integral gradient value of the generator's initial active power, that is, the sensitivity index of each generator's active power.

[0146] Specifically, for a transient instability sample operating point, a reference point must be found within the generated sample space to calculate the integrated gradient. This reference point should be a transiently stable operating point whose difference between the initial generator active power and the sample point is minimal. This embodiment defines the Euclidean distance as a quantitative indicator of this difference, and then uses the integrated gradient algorithm to solve for the sensitivity of each generator's active power.

[0147] For the selection of control generators, the control variables can be determined based on the sensitivity calculated by the integral gradient algorithm. Some generators with larger absolute values ​​of sensitivity are selected as control objects. The changes in the active output corresponding to these generators are more effective in improving the stability of the system. The generators are sorted according to the size of the sensitivity. The first generator is selected first. If the sensitivity is invalid, the second generator is changed, and so on.

[0148] Furthermore, for balanced generator selection, to maintain power balance, when the active power of the controlled generator changes, the active power of other generators should be adjusted in the opposite direction. These generators are called balanced generators. The selection of balanced generators is also determined by the sensitivity of the transient stability assessment index. Generators with a very small absolute sensitivity are less sensitive to stability and are therefore selected as balanced generators.

[0149] In a possible embodiment, Figure 9 As shown, Figure 9The overall flow diagram of the preventive control provided by the embodiment of the present invention first considers the transient stability of the input samples under the expected fault. For the operating point that is transiently unstable after the fault scan, the sensitivity is calculated by the integral gradient algorithm to obtain the target selection of the control generator and the balance generator. Then, the adjustment amount of the active output of each generator is determined according to the sensitivity calculated by the integral gradient and the upper and lower limits of the generator output. After obtaining the new active output of the generator, the PSOPS simulation tool is connected to perform simulation verification on the adjusted method, including power flow verification and stability verification. For non-convergent power flows, the adjustment amount needs to be changed. After passing the power flow verification, the stability verification is performed. If the stability verification fails, the adjustment amount needs to be increased and recalculated. Until the final transient stability preventive control strategy has passed the power flow verification and stability verification.

[0150] On the basis of the above embodiments, the effect of the transient stability prevention and control method based on the agent model provided by the present invention is further verified in combination with specific example tests and analysis processes.

[0151] In a possible embodiment, for the construction of a transient stability analysis model data set, the open source Py-PSOPS simulation tool is used as a simulation program to generate samples required for model training on an IEEE-39 standard test system. The Py-PSOPS simulation tool is a power system transient simulator that can solve power flows using the Newton-Raphson method and perform transient simulation using the implicit gradient method. Samples are generated using its sample generation function. Initial topology changes are considered, including the original topology, N-1, and N-2 topologies. Under normal operating conditions, the device status is randomly sampled, that is, within the upper and lower limits of active and reactive loads, node voltages, and active power generation. The expected fault is a three-phase short circuit fault, and the fault clearing time is randomly selected between 0.08s and 0.20s. The model input curve is a disturbed curve with a length of 0.15s from the occurrence of the fault to the removal of the fault, and the length of each curve is 31. The input curves include 5 comprehensive analysis curves, 10 generator power angle curves, 39 node voltage curves, and 34 transmission line active power curves, for a total of 88 curves. This results in a highly uncertain dataset for learning, taking into account topology changes, power flow distribution changes, fault location changes, and fault duration changes. Initially, 10,000 sets of transient simulation results were generated, of which 5,000 simulated transient stability and 5,000 simulated transient instability. 80% of these were used as the training set, and 20% as the test set. In subsequent experiments, a dataset of 800,000 samples was used for training and testing, of which 600,000 simulated transient stability and 200,000 simulated transient instability, in order to further improve model performance.

[0152] The power angle curve, voltage curve and active power curve of one sample x are as follows: Figure 10 、 11 , as shown in 12.

[0153] Furthermore, in terms of stability criterion and marking, this embodiment selects the generator power angle based on The transient stability index (TSI) describes the stability of the system. As a criterion for system stability, the index is defined as follows:

[0154] (11)

[0155] Where: is the maximum power angle difference between any two generators. When , the system is transiently stable; otherwise, the system is unstable. In this paper, in order to ensure a certain transient stability margin, it is determined that When , that is, the maximum power angle difference between any two generators is less than 180°, the system is transiently stable.

[0156] When constructing the data set, the power angle curves of each generator in the system are obtained through simulation, and the The value of the indicator, for The sample is marked with a label of 0, which means it is a transient stable sample. The sample is labeled as 1, which means transient instability.

[0157] On this basis, a supervised comparative algorithm was used to train a transient stability analysis model based on the Transformer architecture. A dataset of 800,000 samples was used, which was increased to 4 million samples after data augmentation. The crop length was 21, the masking rate was 0.5, the translation was 5, and the noise ratio was 0.1. During pre-training, a training step size of 50 was selected, with an initial learning rate of 0.001. A fixed-step learning rate decay strategy was used, with the learning rate multiplied by a factor of 0.9 every five training steps. During fine-tuning, the training epoch size was 100, with each batch containing 128 samples. The initial learning rate was 0.00008, with a fixed-step learning rate decay strategy, with the learning rate multiplied by a factor of 0.9 every ten training steps. Other hyperparameters were not modified.

[0158] After adopting the multi-channel feature extraction and supervised contrastive learning method, the loss function of the improved model obtained during the training process on the training set and the test set changes as follows: Figure 13 shown.

[0159] Judging from the change in the loss function, after 100 training steps, the model's losses on both the training and test sets decreased and converged to a certain range, indicating that the model was fully trained. Furthermore, overfitting on the test set was significantly alleviated. This demonstrates that the model's generalization ability has been significantly improved by adopting multi-channel feature extraction and supervised contrastive learning.

[0160] The confusion matrix and performance indicators of the improved model after sufficient training are shown in Table 1. As can be seen, the model performs better than the original model in terms of accuracy, false positive rate, and false negative rate, indicating that the performance of the model has been greatly improved after adopting the multi-channel feature extraction and supervised contrastive learning methods.

[0161] Table 1

[0162]

[0163] This embodiment focuses on optimizing the architecture design and training methods of the transient stability analysis model. By constructing a multi-channel feature extraction framework and optimizing the model using a supervised comparative learning method, the performance of the improved model is enhanced and the learning ability is stronger.

[0164] In a possible embodiment, for the construction of a transient stability prevention control data set, this embodiment also uses the open source Py-PSOPS simulation tool as a simulation program to generate samples required for model training on the IEEE-39 standard test system. A three-phase short-circuit fault is added to bus No. 12 of the system, and the fault clearing time is selected as 0.10s. The model input curve is a disturbed curve with a length of 0.15s from the occurrence of the fault to the removal, and the length of each curve is 31. The types of input curves include transmission line active power, node voltage amplitude, generator rotor angle, generator active power and comprehensive analysis curves. These five trajectories contain 34, 39, 10, 10 and 5 curves respectively, for a total of 98 curves. Initially, 5000 sets of transient simulation results are generated, of which 2500 sets simulate transient stability and 2500 sets simulate transient instability.

[0165] On this basis, the improved transient stability analysis model is trained for the constructed data set. After solving the integral gradient, preventive control adjustment is performed to adjust the active power of the generator. Two unstable samples are selected to demonstrate the preventive control adjustment strategy. The power angle curve of one of the unstable samples i1 is as follows: Figure 14 As shown, Figure 14 The power angle curve of the transient instability sample data i1 before adjustment provided by the embodiment of the present invention is as follows: Figure 14 It can be seen that sample i1 is a typical transient instability sample.

[0166] Furthermore, the calculated initial active power and adjustment amount of each generator sensitivity are shown in Table 2:

[0167] Table 2

[0168]

[0169] As shown in Table 2, the sensitivity of this transient instability sample under the predicted fault is calculated. The sensitivity clearly indicates which generators should be adjusted first. After four iterations, the following preventive control strategy is obtained: Generator 8's active output is increased by 0.38 pu, while Generator 9's active output is reduced by 0.24 pu. Consequently, the active output of balancing generator 7 is reduced by 0.38 pu, while that of balancing generator 2 is increased by 0.24 pu.

[0170] The transient simulation of the sample after the preventive control strategy is generated, the power angle curve under the expected fault is as follows: Figure 15 As shown in Figure 2, after power flow and transient stability verification, the adjusted system can maintain transient stability under the expected fault, proving that the preventive control strategy is effective.

[0171] The power angle curve before adjustment, the power angle curve after adjustment and the preventive control strategy of the unstable sample i2 are as follows: Figure 16 , Figure 17 See Table 3.

[0172] Table 3

[0173]

[0174] This embodiment addresses the problem of preventive control of transient stability in power systems by adopting a direct solution approach. The integral gradient algorithm is applied to the transient stability analysis model. The sensitivity of the model's stability judgment output to the generator's active power is calculated. Control generators and balancing generators are selected based on sensitivity ranking, and active power adjustments are calculated. Finally, transient stability verification is performed through simulation to complete the generation of a preventive control strategy.

[0175] The transient stability preventive control device based on an agent model provided by the present invention is described below. The transient stability preventive control device based on an agent model described below and the transient stability preventive control method based on an agent model described above can be referred to in correspondence with each other.

[0176] In some specific embodiments of the present invention, a transient stability preventive control device based on an agent model is provided, the device comprising:

[0177] An analysis module 1801 is configured to input a plurality of operating data of the power system into a pre-built transient stability analysis model, and obtain a transient stability analysis result of each operating data output by the transient stability analysis model, wherein each operating data includes an initial active power of a generator;

[0178] a sensitivity calculation module 1802 for determining transient instability operation data based on the transient stability analysis results, and calculating the sensitivity of each generator in the transient instability operation data using an integral gradient algorithm;

[0179] The adjustment module 1803 is configured to determine an adjustment strategy for the initial active power of each generator based on the sensitivity.

[0180] The transient stability prevention and control device provided in an embodiment of the present invention has an implementation principle and beneficial effects similar to the implementation principle and beneficial effects of the transient stability prevention and control method shown in the above embodiment. Please refer to the implementation principle and beneficial effects of the transient stability prevention and control method shown in the above embodiment, and no further details will be given here.

[0181] Figure 19 An example of a physical structure diagram of an electronic device is shown below. Figure 19 As shown, the electronic device may include: a processor 1910, a communications interface 1920, a memory 1930, and a communications bus 1940, wherein the processor 1910, the communications interface 1920, and the memory 1930 communicate with each other via the communications bus 1940. The processor 1910 may call logic instructions in the memory 1930 to execute a transient stability preventive control method based on an agent model. The method includes: inputting multiple operating data of the power system into a pre-built transient stability analysis model to obtain transient stability analysis results for each operating data output by the transient stability analysis model, wherein each operating data includes the initial active power of a generator; determining transient instability operating data based on the transient stability analysis results, calculating the sensitivity of each generator in the transient instability operating data using an integral gradient algorithm; and determining an adjustment strategy for the initial active power of each generator based on the sensitivity.

[0182] Furthermore, the logic instructions in the aforementioned memory 1930 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0183] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transient computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the transient stability prevention and control method based on the agent model provided by the above methods. The method includes: inputting multiple operating data of the power system into a pre-built transient stability analysis model to obtain a transient stability analysis result of each operating data output by the transient stability analysis model, wherein each operating data includes the initial active power of the generator; determining transient instability operating data based on the transient stability analysis result, and calculating the sensitivity of each generator in the transient instability operating data by an integral gradient algorithm; and determining an adjustment strategy for the initial active power of each generator based on the sensitivity.

[0184] On the other hand, the present invention also provides a non-transient computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the transient stability prevention and control method based on the agent model provided by the above-mentioned methods, the method comprising: inputting multiple operating data of the power system into a pre-built transient stability analysis model, obtaining a transient stability analysis result of each operating data output by the transient stability analysis model, wherein each of the operating data includes the initial active power of the generator; determining transient instability operating data based on the transient stability analysis result, and calculating the sensitivity of each generator in the transient instability operating data by an integral gradient algorithm; and determining an adjustment strategy for the initial active power of each generator based on the sensitivity.

[0185] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0186] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

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

Claims

1. A transient stability preventive control method based on an agent model, characterized in that: include: Inputting a plurality of operating data of the power system into a pre-built transient stability analysis model to obtain a transient stability analysis result of each operating data output by the transient stability analysis model, wherein each operating data includes an initial active power of a generator; Determining transient instability operation data according to the transient stability analysis results, and calculating the sensitivity of each generator in the transient instability operation data using an integral gradient algorithm; Based on the sensitivity, determining an adjustment strategy for the initial active power of each of the generators; The step of calculating the sensitivity of each generator in the transient instability operation data by using an integrated gradient algorithm specifically includes: Select the transient stable operating point in the sample space where the difference between the initial active power of the generator and the transient instability sample point is the smallest as the reference point; Based on the reference point, calculating an integral value of a gradient between each of the transient instability sample points and the reference point; Using the integral value as the sensitivity of each generator in the transient instability operation data; The formula for calculating the integral value of the gradient between each sample point and the reference point is: Among them, x ′ represents the reference point sample; x represents the current input state of the neural network; γ(α) represents the ′ A path to x, where γ(0) = x ′ , γ(1)=x; f() represents the neural network model; i represents the i-th input feature; N represents the total number of input features; γ ′ (α) represents the derivative of the path γ(α) with respect to α; Represents the gradient of the neural network model f() at γ(α) to the input γ(α).

2. The transient stability preventive control method based on agent model according to claim 1 is characterized in that: The transient stability analysis model is obtained by training a deep learning neural network of a Transformer architecture based on sample data with transient stability and sample data with transient instability.

3. The transient stability preventive control method based on agent model according to claim 2, characterized in that: The transient stability analysis model includes multiple Transformer architecture encoders and a decoder; The encoders of each Transformer architecture are used to extract features from the power system operation data grouped according to physical attributes to obtain feature vectors of each operation data; and perform feature splicing on the feature vectors; The encoder of each Transformer architecture is trained by a supervised contrastive learning algorithm; The decoder is used to process the feature vector after feature splicing and output the transient stability analysis result of the power system.

4. The transient stability preventive control method based on an agent model according to any one of claims 1 to 3, characterized in that: The step of determining an adjustment strategy for the initial active power of each generator based on the sensitivity specifically includes: Sort the generators in descending order of the absolute value of sensitivity; Select multiple engines with larger absolute values ​​as control engines, and select multiple engines with smaller absolute values ​​as balance engines; Determining the adjustment amount of the initial active power of each of the control engines and each of the balancing engines according to the sensitivity calculated by the integral gradient and the upper and lower limits of the generator output; Adjusting each of the control engines and each of the balancing engines according to each of the adjustment amounts to obtain a new active output of the generator; The new generator active output is verified. If the verification fails, the adjustment values ​​are updated and the verification is repeated until the verification passes, thereby obtaining the final adjustment value.

5. A transient stability preventive control device based on an agent model, characterized in that: include: an analysis module, configured to input a plurality of operating data of the power system into a pre-built transient stability analysis model, and obtain a transient stability analysis result of each operating data output by the transient stability analysis model, wherein each operating data includes an initial active power of a generator; a sensitivity calculation module, configured to determine transient instability operation data based on the transient stability analysis result, and calculate the sensitivity of each generator in the transient instability operation data using an integral gradient algorithm; an adjustment module, configured to determine an adjustment strategy for the initial active power of each of the generators based on the sensitivity; The step of calculating the sensitivity of each generator in the transient instability operation data by using an integrated gradient algorithm specifically includes: Select the transient stable operating point in the sample space where the difference between the initial active power of the generator and the transient instability sample point is the smallest as the reference point; Based on the reference point, calculating an integral value of a gradient between each of the transient instability sample points and the reference point; Using the integral value as the sensitivity of each generator in the transient instability operation data; The formula for calculating the integral value of the gradient between each sample point and the reference point is: Among them, x ′ represents the reference point sample; x represents the current input state of the neural network; γ(α) represents the ′ A path to x, where γ(0) = x ′ , γ(1)=x; f() represents the neural network model; i represents the i-th input feature; N represents the total number of input features; γ ′ (α) represents the derivative of the path γ(α) with respect to α; Represents the gradient of the neural network model f() at γ(α) to the input γ(α).

6. 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 computer program, the transient stability preventive control method based on the agent model according to any one of claims 1 to 4 is implemented.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the transient stability preventive control method based on an agent model according to any one of claims 1 to 4 is implemented.

8. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the transient stability preventive control method based on an agent model according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Active power correction control method based on quasi-steady-state sensitivity analysis

    CN108270248A

  • Photovoltaic power station performance monitoring and analyzing method

    CN118032124A