Domain self-adaption-based intelligent enhancement and discrimination method for frequency stability of power system
Through the domain adaptive power system frequency stability intelligent enhancement discrimination method, the domain feature extraction network and frequency parameter prediction network are used, and combined with the timing causal convolution and probability sparse attention mechanism, the accuracy and adaptability of the grid frequency response prediction are solved. The problem is to achieve high accuracy and real-time prediction of the determination of grid frequency stability.
Patent Information
- Application Number
- CN202411486249.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-10-23
AI Technical Summary
The existing technology is difficult to accurately predict the frequency response of the power grid. Especially under the development of technologies such as large-scale renewable energy access and UHVDC transmission, the system equivalent inertia decreases, the frequency offset increases, and the coupling of frequency dynamic response and power angle oscillation intensifies. This leads to new challenges in frequency stability research and control.
Adopting a domain adaptive power system frequency stability intelligent enhanced discrimination method, by constructing a data set containing source domain and target domain data, using domain feature extraction network and frequency parameter prediction network, combining time sequence causal convolution and probability sparse attention mechanism , extract and predict frequency response model parameters to achieve adaptability to changes in the operating mode and topological structure of the power grid.
The accuracy and adaptability of the model to discriminate the grid frequency stability, ensure that the model trained based on source domain data can be effectively migrated to the target domain data set, and improve the online prediction capability of real-time response data of the power system.
Smart Images

Figure CN119397237A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of smart grids, and relates to an artificial intelligence technology for frequency stability judgment that can adapt to changes in power system operation, and in particular to an intelligent enhanced judgment method for power system frequency stability based on domain adaptation. Background Art
[0002] Frequency stability assessment is an important guarantee for power grid security. After the system is subjected to a large disturbance, rapid monitoring of the type and location of the disturbance and evaluation of the dynamic characteristics of the frequency can help operators take emergency control measures in a timely manner to reduce the impact. The dynamic process of the disturbed frequency response contains rich disturbance information. Quantitative analysis and predictive evaluation of these characteristics are the development trend of modern "double-high" power grids. With the development of technologies such as large-scale renewable energy access and UHVDC transmission, the system equivalent inertia is reduced, the frequency offset is increased, and the coupling between the dynamic frequency response and the power angle oscillation is intensified, which brings new challenges to frequency stability research and control.
[0003] The analysis of the transient characteristics of the frequency of the existing power system after disturbance mainly relies on physical models, including time domain simulation, equivalent model and linearization method. Time domain simulation solves the system frequency response through high-order nonlinear differential equations; the linearization method simplifies the system and calculates the dynamic frequency; the equivalent model law proposes models such as ASF and SFR. However, due to the diverse types of disturbances in high-proportion new energy systems and complex system parameters, it is difficult for traditional methods to accurately predict the frequency response, and the prediction error is large.
[0004] In recent years, frequency prediction based on machine learning has gradually emerged, which can mine the input-output relationship of the system from historical data, and deep learning methods have been applied to load frequency control. Although it has the potential to accurately fit nonlinear characteristics, the data-driven method lacks physical modeling, which reduces the credibility of the prediction results.
[0005] Combining physical models with data-driven methods can improve prediction accuracy and reliability. In the literature [Bellizio F, Cremer JL, Sun M, et al. A causality based feature selection approach for data-driven dynamic security assessment [J]. Electric Power Systems Research, 2021 (Dec.): 201], a study adopted a series mode to combine the two. Another study [Li Feng, Wang Qi, Hu Jianxiong, et al. Research progress of data and knowledge joint driving methods and prospects for their application in power systems [J]. Proceedings of the CSEE, 2021, 41 (13): 4377-4390] corrected physical model parameters through data-driven methods. However, these methods face challenges such as complexity and computational cost, and still need to be optimized and tuned.
[0006] At the same time, deep learning-based methods are highly dependent on the distribution of disturbed frequency response data, and in the field of power systems, the continuous changes in grid operation mode and topology will lead to significant differences in data distribution and characteristics. As a result, the model trained on the source domain cannot accurately reflect the characteristics of the target domain, which will affect the accuracy of the model trained on the source domain data in judging the frequency stability of the target domain. Summary of the invention
[0007] In order to overcome the shortcomings of the above-mentioned prior art, the purpose of the present invention is to provide an intelligent enhanced judgment method for power system frequency stability based on domain adaptation, in order to improve the adaptability of the model to changes in power grid operation mode and topology structure, ensure that the frequency response model parameter prediction network trained based on source domain data can be effectively migrated to the target domain data set, and ultimately improve the model's ability to perform online prediction of real-time response data of the power system.
[0008] In order to achieve the above object, the technical solution adopted by the present invention is:
[0009] A domain-adaptive intelligent enhanced judgment method for power system frequency stability includes the following steps:
[0010] Step 1, combining different fault types and operation modes of the two power grids, constructing a data set containing a number of uniformly mixed source domain data and target domain data, wherein the source domain data and the target domain data are both power grid frequency response samples, respectively coming from the two power grids;
[0011] Step 2: dividing each power grid frequency response sample into early disturbance frequency response data and late disturbance frequency response data according to the frequency deviation threshold;
[0012] Step 3, normalize the initial frequency response data of the disturbance to the interval [0,1];
[0013] Step 4: construct a domain feature extraction network, using the normalized result of step 3 as input to extract the features of the time series data;
[0014] Step 5, construct a frequency parameter prediction network, take the feature vector extracted by the domain feature extraction network as input, process it based on the attention mechanism, and obtain the frequency response model parameters;
[0015] Step 6: construct a domain classifier network, take the feature vector extracted by the domain feature extraction network as input, and obtain the sample label output, which indicates whether the sample belongs to the source domain or the target domain;
[0016] Step 7, construct the system loss function;
[0017] Step 8, calculating the frequency response curve prediction error according to the late frequency response data of the disturbance, and training using the gradient descent method until the model composed of each network converges;
[0018] Step 9, inputting the frequency response model parameters obtained in step 5 into the frequency response model, and predicting the frequency response curve after the input time window;
[0019] Step 10: If the lowest point of the predicted frequency response curve exceeds the frequency stability judgment threshold, the grid frequency is determined to be unstable; otherwise, the frequency is stable.
[0020] Compared with the prior art, the present invention adds temporal causal convolution and convolution expansion coefficient to the domain feature extraction network. It overcomes the problems of CNN network being sensitive to sparse data, information leakage when processing long time series, limited field of view, and difficulty in extracting all temporal features. The probabilistic sparse attention mechanism and distillation process are added to the frequency parameter prediction network, which reduces the computational complexity of attention, and reduces the number of model parameters and training time. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic diagram of an intelligent enhanced judgment method for power system frequency stability based on domain adaptation in an embodiment of the present invention.
[0022] Figure 2 It is a schematic diagram of a source domain data calculation model in an embodiment of the present invention.
[0023] Figure 3 Schematic diagram of the domain feature extraction network structure in an embodiment of the present invention.
[0024] Figure 4 Schematic diagram of temporal causal convolution of a domain feature extraction network in an embodiment of the present invention.
[0025] Figure 5 It is a schematic diagram of temporal causal convolution with the expansion coefficient introduced in an embodiment of the present invention.
[0026] Figure 6 Schematic diagram of the probabilistic sparse attention mechanism in the frequency parameter prediction network in an embodiment of the present invention.
[0027] Figure 7 Schematic diagram of a probabilistic sparse attention mechanism for introducing a distillation process into a frequency parameter prediction network in an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The embodiments of the present invention are described in detail below with reference to the accompanying drawings and examples.
[0029] According to the above, due to the continuous changes in the operation mode and topological structure of the power system in the field of power systems, significant differences will occur in data distribution and characteristics. The model trained on the source domain based on deep learning methods cannot accurately reflect the characteristics of the target domain, and the prediction model trained using offline generated frequency response samples cannot perform online predictions based on the real-time response data of the power system. The present invention introduces transfer learning into the judgment of power system stability, and proposes an intelligent enhanced judgment method for power system frequency stability based on domain adaptation. Cross-domain consistency features are extracted through adversarial training, supplemented by supervised learning in the source domain and unsupervised learning in the target domain, which effectively improves the adaptability of the model to changes in power grid operation modes and topological structures.
[0030] refer to Figure 1 The present invention provides a domain-adaptive intelligent enhanced identification method for power system frequency stability, comprising the following steps:
[0031] Step 1: Combine the different fault types and operation modes of the two power grids to construct a data set containing several uniformly mixed source domain data and target domain data, where the data type is power grid frequency response samples, and the source domain data and target domain data come from the two power grids respectively.
[0032] In the embodiment of the present invention, the two power grids have different numbers of nodes and different power supplies. Figure 2 The example model of low-frequency small nodes (102 nodes) with coexistence of new energy and conventional power sources is shown, and the obtained example is used as the source domain data. The target domain data is obtained from the standard test system of 10,000 nodes of high-proportion power electronic large power grid.
[0033] Specifically, in this embodiment, the source domain data is obtained from the calculation model of the coexistence of new energy and conventional power sources built by the present invention, using the PSD-BPA simulation software. By setting different load levels, adjusting the output of new energy units and other units, and adding machine cutting disturbances, a scenario in which new energy and conventional power sources fail through the tributary transmission system is constructed. In this embodiment, 8 types of machine cutting disturbances are added. The target domain data is obtained from a high-proportion power electronic large power grid 10,000-node standard test system, and different power grid fault types and operating modes are set. The source domain data and the target domain data are mixed in equal amounts to construct a data set X={x1,x2,…,x i ,…,x L}, where x i represents the ith grid frequency response sample, x i =(f i 1 ,f i 2 ,…,f i t ,…,f i T ), f i t Represents x i The frequency response at the tth moment in is the frequency response data corresponding to the node with the largest frequency deviation, T is x i The length of the sequence.
[0034] Step 2: Set the frequency deviation threshold γ sh , each power grid frequency response sample is divided into two parts: the frequency response data at the initial stage of disturbance and the frequency response data at the later stage of disturbance, which can be expressed as:
[0035] in, The initial frequency response data of the disturbance is used as input in the frequency parameter prediction task. The frequency response data of the later stage of disturbance is used to calculate the prediction error of the frequency response curve during the training process. The frequency response deviation does not exceed γ sh ,Right now Accordingly, the later frequency response data of the disturbance It is expressed as: in, Representation sequence The distribution of source domain samples is different from that of target domain samples, that is, S(x)≠T(x), where S(x) is the distribution function of source domain data samples and T(x) is the distribution function of target domain data samples.
[0036] Frequency deviation threshold γsh Based on experience and experiments, it should generally be smaller than the frequency stability judgment threshold. In this embodiment, the frequency stability judgment threshold is set to 0.7 Hz, then γ sh Should be less than 0.7Hz, the experimental part of this invention takes γ sh is 0.4Hz.
[0037] Step 3: Initial frequency response data of disturbance Normalized to the interval [0,1].
[0038] In this embodiment, the maximum-minimum normalization method is adopted. The purpose of normalization is to unify the data range. By mapping the data to the [0,1] interval, different data can have the same numerical range, avoiding the influence caused by the difference in data scale; eliminating the dimensional effect: the normalization operation can eliminate the dimensional effect of the data, making the comparison and analysis of data under different dimensions more accurate and reliable; improving the convergence speed of the model: normalizing the data can speed up the convergence speed of the model and improve the training efficiency and performance.
[0039] Step 4: Build a domain feature extraction network with model parameters θ f , taking the normalized result of step 3 as input, extract the features of time series data.
[0040] The domain feature extraction network of the present invention is based on the CNN network. Specifically, the CNN network is used as the feature extraction network for time series data, and a causal convolution expansion layer is introduced to overcome the information leakage and network depth problems of the traditional CNN network in processing time series data. The specific structure is as follows Figure 3 As shown in FIG. 1 , the present invention adopts a four-channel parallel convolution structure, with a total of four parallel causal expansion convolution branches. The convolution kernel of each branch has a different size. The convolution kernels of different sizes are used to achieve perception of different scales, thereby forming a multi-scale feature map. This enables the network to learn the local details and global relationships of the temporal input at the same time. Finally, the outputs of the four-channel parallel convolution are combined and the output of the domain feature extraction network is obtained through the average pooling layer, that is, the extracted feature vector, which is expressed as domain feature f=G f (x;θ f ), where G f represents the domain feature extraction network, x is the input, θ f Extract network parameters for domain features.
[0041] Figure 3 The network structure of the domain feature extraction network is set as follows:
[0042]
[0043] That is, the four parallel causal expansion convolution branches are:
[0044] The first branch is CD_ConvNet with a convolution kernel size of 1×1;
[0045] The second branch is a CD_ConvNet with a convolution kernel size of 1×1 and a CD_ConvNet with a convolution kernel size of 1×3 connected in sequence;
[0046] The third branch is a CD_ConvNet with a convolution kernel size of 1×1 and a CD_ConvNet with a convolution kernel size of 1×5 connected in sequence;
[0047] The fourth branch is a CD_ConvNet with a maximum pooling layer of a window size of 1×3 and a convolution kernel size of 1×1 connected in sequence.
[0048] The purpose of adding a 1×1 convolution kernel in the branch of the present invention is to reduce the dimension of the feature channel, reduce the number of parameters and the amount of calculation, and realize cross-channel information fusion and linear combination of information between different channels.
[0049] The temporal causal convolutional network processes time series data in chronological order and does not use future information to affect current predictions or output results, thus avoiding information leakage and unreasonable predictions. The specific implementation method is as follows: introduce zero padding in the convolution kernel and use F k =(w1,w2,...,w k ) represents a one-dimensional causal convolution sliding window of size K, w i Represents the learnable weight value in the convolution kernel. For a one-dimensional input sequence data X = {x1, x2, ..., x T}, then in x t The causal convolution at is calculated as The temporal causal convolution calculation process is as follows Figure 4 , the convolution kernel size of the causal convolution layer in the figure is 2. The temporal causal convolution network is constrained by the temporal relationship and predicts y t The network can only use the observation data {x1,x2…x t}, but cannot use the future time step data {x t+1 ,x t+2 ,...,x T The number of convolutional layers in the network determines the depth of historical information it can trace.
[0050] Like traditional convolution, the modeling length of time series in temporal causal convolution is limited by the size of the convolution kernel (sliding window). The calculation of its receptive field is performed layer by layer, and its recursive calculation is as follows: Where l n represents the receptive field size of the nth convolutional layer, ln-1 represents the receptive field of the n-1th layer, F n Indicates the size of the convolution kernel in the nth layer, s i Indicates the step size of the convolution kernel sliding in the i-th layer. Introducing the convolution expansion coefficient in the convolutional network can achieve flexible control of the receptive field size while keeping the number of network layers relatively small. The indirect sampling mechanism can ensure that the output of each convolution operation integrates a wider information dimension.
[0051] like Figure 5 The detailed definition of the dilated convolutional network is as follows: for a one-dimensional input sequence data X = {x1, x2, ..., x T}, in x t The causal convolution with a dilation coefficient of d is calculated as In the formula, F k =(w1,w2,...,w k ) represents a one-dimensional causal convolution sliding window of size K, w i Represents the learnable weight value in the convolution kernel. The causal dilation convolution of the present invention introduces a dilation coefficient into the temporal causal convolution network, and the calculation of its receptive field is as follows: In the formula, the size of each convolution kernel is fixed to K; the sliding step is fixed to 1; l n is the receptive field size of the nth convolutional layer; here, the expansion coefficient d of each layer is set as the number of network layers increases n The exponential growth of the basic expansion coefficient b of the network, that is, d n =b n ; When the input sequence length is T, if we want to achieve a receptive field covering all input data, that is, l n ≥T, the minimum number of layers n required can be solved as follows: Therefore, causal dilation convolution can reduce the number of convolutional network layers without sacrificing the size of the receptive field, alleviating the problems of overfitting and gradient disappearance in model training.
[0052] Step 5: Build a frequency parameter prediction network with the network parameter θ y , taking the feature vector extracted by the domain feature extraction network as input, it is processed based on the attention mechanism to obtain the frequency response model parameters.
[0053] The frequency parameter prediction network of the present invention includes a probability sparse attention layer, a distillation layer and an output layer connected in sequence. The probability sparse attention layer further includes a probability sparse attention mechanism and a feedforward neural network connected in sequence, and normalization is introduced in each layer output. The distillation layer further includes a one-dimensional convolution layer, a normalization layer, an activation function and a maximum pooling layer connected in sequence, so that the frequency parameter prediction network introduces position encoding to the input, passes through the probability sparse attention layer and the distillation layer in sequence, and finally obtains the predicted frequency response model parameters in the output layer.
[0054] The network structure of the frequency parameter prediction network is set as follows:
[0055]
[0056] Specifically, this step uses the Transformer attention network to predict the frequency parameters, and the input is the model G f The extracted feature vector is output as the frequency response model parameters, expressed as: Θ = {R, D, ΔP, H, F H , T R}; In the formula, R is the speed governor adjustment coefficient of the unit, D is the load frequency adjustment coefficient, ΔP is the disturbance power, H is the inertia time constant of the unit, F H is the power ratio of the high pressure cylinder, T R is the unit reheater time constant.
[0057] The core idea of the attention mechanism is to dynamically weight and aggregate information according to the importance of features in the input sequence. The frequency response data output by the domain feature extraction network has a fixed temporal relationship between the values. The attention mechanism does not explicitly model the order of the input sequence, so position encoding is introduced. The present invention uses the sine and cosine functions used in Transformer to generate periodic values as position encoding:
[0058]
[0059] Where: pos is the position number of each frequency feature in the domain feature extraction network output sequence, the position encoding of each feature is a vector, i represents the index of each element in this vector, d model is the position encoding vector dimension, which is equal to the embedding vector dimension. In this invention, d model = 512. The position encoding is added to the output sequence of the domain feature extraction network as the input of the attention mechanism module The time series and distance relationship of frequency characteristics can be characterized.
[0060] The Transformer model does not rely on a cyclic structure to process time series. Its attention mechanism can reduce the maximum length of the time series signal propagation path in the network to the theoretical minimum of O(1). However, the Transformer-based attention mechanism is not efficient for long sequence input and output operations. For a time series of length L, its computational time complexity is O(L 2 ·d emb ), where d emb is the encoding dimension of the input. When a long time series is input, the stacking of J attention mechanism network layers makes the memory usage O(J·L 2 ), high memory consumption and occupancy will limit the scalability of the model for long sequence inputs. The present invention introduces a probabilistic sparse attention mechanism (ProbSparse Attention) to reduce the computational complexity of attention. The standard attention mechanism needs to calculate the correlation between all sequence positions. The probabilistic sparse attention mechanism introduces probabilistic sparsity and only calculates the correlation between a part of the positions, reducing the time and space computational complexity to O(L log L). In addition, a distillation process is introduced into the Transformer-based attention mechanism to distill longer input sequences into shorter sequences, and then perform attention calculations on the shorter sequences. This approach can effectively reduce the computational complexity and storage requirements of each layer, while reducing the number of parameters and training time of the model.
[0061] The frequency parameter prediction network structure based on the probabilistic sparse attention mechanism is as follows Figure 6 In long time series prediction tasks, the dot product attention calculation results used by the attention mechanism follow a long-tail distribution. This distribution characteristic means that in the attention mechanism, only a small number of dot product results between queries and key values will have a significant impact on the final attention weight, while most elements have little impact. Focusing on a few query and key pairs that have an important impact on the attention weight can reduce the amount of calculation while ensuring model performance, speeding up model training and inference processes. The probabilistic sparse attention mechanism mines queries that are both critical and sparse, and only calculates attention weights for these queries to improve computational efficiency.
[0062] The probabilistic sparse attention mechanism is as follows: The input of the attention mechanism is a tuple (Q, K, V), where is the query vector (query), is the key vector (key), is the value vector (value), d model is the encoding dimension of the input. The result of dot-scaled attention calculation is as follows: q i ,k i ,vi are the i-th row of the Q, K, and V matrices respectively, and the attention of the i-th query is as follows In the formula, k(q i ,k j ) is the exponential kernel function, Using exponential kernels in the attention mechanism can enhance the model to capture long-range dependencies between different elements in the input sequence, but this calculation requires quadratic time complexity and O(L Q L K ). The distribution of attention probability is potentially sparse, and the attention scores form a long-tail distribution, that is, a small number of dot product pairs play a role in the main attention. The present invention introduces a probabilistic sparse attention mechanism, which limits the interaction between each element and other elements by introducing sparsity constraints, thereby reducing the computational complexity and memory usage.
[0063] The sparsity measure is defined as follows: the attention of the i-th query to the j-th key is the probability distribution p(k j |q i ), if the calculation of attention scores is mainly driven by certain dot product pairs, then these dot product pairs will make the attention distribution of the corresponding query uneven. j |q i ) is close to uniform distribution q(k j |q i )=1 / L K , which will cause the attention calculation result to become the sum of the value vector (V), and the output of the attention mechanism will lose its distinguishability and cannot effectively process the input data. Therefore, the present invention uses KL divergence to measure the attention distribution p(k j |q i ) and uniform distribution q(k j |q i )=1 / L K The similarity of
[0064]
[0065] Remove the constant ln L K After that, the sparsity measure of the i-th query is defined in the probabilistic sparse attention layer as follows:
[0066]
[0067] In the formula, q i represents the i-th row of the query vector Q, k j represents the jth row of the key vector K, d model Indicates q i and k jThe dimension of L K represents the number of query vectors and key vectors. i The calculated M(q i ,K) value is higher, and its attention distribution p(k j |q i ) will become more diverse and more likely to capture significant dot product pairs in the long-tail attention distribution. But the complexity of the dot product pair is O(L Q L K ), and the calculation has the risk of numerical instability, the following method is used to optimize the calculation M(q i ,K).
[0068] Random sampling u = c ln L Q dot product pairs, where c is a constant sampling factor, and the Q after random sampling is defined as At this time, the attention calculation formula becomes The time complexity and space complexity of the attention mechanism are reduced to O(L K l Q ). If the attention mechanism is extended to multiple attention heads, each attention head will get a different sparse query-key pair to avoid serious information loss.
[0069] Based on the empirical approximation method Replace the first term in the previous formula Because for every as well as All satisfied After random sampling of Q, M(q i ,K) has a maximum value of Such as:
[0070]
[0071] The input lengths of the query vector Query and the key vector key are the same in the attention mechanism calculation, i.e., L K =L Q =L, making the total time complexity and space complexity of the probabilistic sparse attention mechanism O(L ln L).
[0072] As the network deepens, the model can gradually learn more abstract and advanced feature representations, so that the sequence information can be expressed more concisely in subsequent layers. The present invention trims the time dimension of the input sequence before the next probabilistic sparse attention layer generates a feature map, so that the model focuses on high-level features that play a dominant role and discards redundant features, that is, introduces a distillation mechanism for the probabilistic sparse attention layer. The distillation process of the distillation layer of the present invention is: perform a one-dimensional convolution calculation on the feature map generated by the probabilistic sparse attention layer in the time dimension, set the sliding window size to 3, use the GELU activation function, and add a maximum pooling layer with a step size of 2 after the one-dimensional convolution layer. The calculation of the distillation process from the jth layer to the j+1th layer is shown in Formula Y j+1 =MaxPool(GELU(Conv1d([Y j ]))), where Y j is the output of the j-th probabilistic sparse attention layer, Conv1d(·) represents a one-dimensional convolution in the time dimension, and GELU(·) is an activation function based on the Gaussian error function. MaxPool(·) is a maximum pooling layer with a step size of 2, which is used to halve the length of the input sequence. The module structure of the probabilistic sparse attention mechanism added to the distillation process is as follows: Figure 7 .
[0073] In addition, the present invention adopts the GELU activation function in the frequency parameter prediction network. Compared with RELU, the GELU activation function has smoother nonlinear characteristics, which helps to reduce the gradient vanishing problem and improve the fitting ability of the model. In addition, the GELU activation function can also better handle negative inputs, improving the performance and stability of the model. The calculation of the GELU activation function is as follows: GELU(x)=x*P(X≤x)=x*Φ(x), where Φ(x) is the probability function of the normal distribution, using the standard normal distribution N(0, 1) or the parameterized normal distribution N(μ, σ), and then obtaining μ and σ through training. For GELU(x) assumed to be a standard normal distribution, the present invention uses an approximate calculation method for GELU(x), such as the formula In the formula, and 0.044715 are the two adjustment coefficients of the GELU function. The GELU activation function not only performs better in avoiding the gradient vanishing problem, but also alleviates the problem of neuron death when RELU is used as the activation function.
[0074] Step 6: Build a domain classifier network with the model parameters being the domain feature vector f=G obtained in step 4 f (x;θ f ), input the domain feature vector f obtained in step 4 into the network to obtain the sample label output G d (f,θ d), indicating that the sample belongs to the source domain or the target domain. d represents the domain classifier network, θ d is the domain classifier network parameter, and f is the feature vector extracted by the domain feature extraction network.
[0075] The domain classifier is a binary classification model. In this module, the present invention adopts a multi-layer perceptron structure (MLP) to calculate the classification error through the cross entropy loss function. The model structure of the domain classifier is as follows:
[0076] Layer Type Input Dimensions Output Dimensions Parameter quantity Linear-1 128 256 33024 BatchNorm 256 256 512 ReLU 256 256 0 Linear-2 256 256 65792 BatchNorm 256 256 512 ReLU 256 256 0 Linear-3 256 128 32896 BatchNorm 128 128 256 ReLU 128 128 0 Linear-4 128 2 258
[0077] Step 7, construct the system loss function:
[0078]
[0079] Among them, θ y The network parameters are predicted for the frequency parameters, L y (.,.) represents the loss of the frequency parameter prediction network, G y represents the frequency parameter prediction network; L d (.,.) represents the loss of the domain classifier; and and They represent the loss of the frequency parameter prediction corresponding to the i-th sample and the loss of the domain classifier, y i is the frequency parameter label of the i-th sample (source domain data); d i is the label of the i-th sample belonging to the source domain or the target domain. 0 means it belongs to the source domain, 1 means it belongs to the target domain, and λ is the weight parameter to balance the importance of the two items on the right side of the above formula. The domain feature extraction network extracts domain-invariant features that can be used to identify whether the sample belongs to the source domain or the target domain as much as possible. The domain classifier and feature extraction network perform adversarial learning to ensure that the domain feature extraction network can capture the common features between the source domain and the target domain, and the feature distribution of the source domain and the target domain after mapping is closer.
[0080] Step 8: Use the gradient descent method to obtain the saddle point of the following formula:
[0081]
[0082] in, Represent the parameters θ f ,θ y ,θ d The estimated value of .
[0083] The present invention uses a standard stochastic gradient solver (SGD) to perform saddle point search, and f ,θ y ,θ d The update formula is as follows: Where μ is the learning rate. f When the domain classifier is used, the gradient reversal mechanism is introduced. A gradient reversal layer is added between the domain classifier and the domain feature extraction network to reverse the gradient direction of the domain classifier to the domain feature extraction network during the back propagation process, while maintaining the same transformation during the forward propagation process. The mathematical expression of the gradient reversal layer is as follows: I is the gradient back-propagated from the domain classifier to the domain feature extraction network, which is multiplied by the dynamically changing parameter λ, and its expression is as follows: In the formula, p represents the relative value of the iteration number of the training process, that is, the ratio of the current iteration number to the total iteration number, and γ takes a constant value of 10. At the same time, the learning rate in domain adaptation also changes with the iteration number, as shown in the formula In the formula, μ0 is the initial learning rate, and the initial learning rate is set to 0.0001 in the present invention; p represents the relative value of the number of iterations in the training process; α and β are hyperparameters, and the present invention takes α = 10 and β = 0.75. Repeat steps 4 to 8 until the model converges;
[0084] Step 9: Input the frequency response model parameter θ obtained in step 5 into the frequency response model to predict the frequency response curve after the input time window.
[0085] In this step, the frequency response model SFR is used as the mechanism module, and the predicted frequency curve is obtained based on the parameter identification results. The SFR model uses the form of low-order differential equations to describe the change of system frequency over time, and is an important method for predicting the frequency response after disturbance. Based on the ASF model, the SFR model uses a simplified reheat turbine-governor link as the system equivalent prime mover-governor link. The model order does not change with the increase of system scale. It is suitable for the analysis and calculation of the frequency response process of large power grids and can quickly analyze the changing trend of system frequency. The SFR model of the equivalent single-machine system is a second-order system, and the frequency response expression is:
[0086]
[0087] In the formula, R is the speed governor adjustment coefficient of the unit, D is the load frequency adjustment coefficient, ΔP is the disturbance power, H is the inertia time constant of the unit, and F H is the power ratio of the high pressure cylinder, T R is the time constant of the unit reheater, and other coefficients are related to the above parameters. After knowing the corresponding parameters, the frequency response curve of the system after disturbance can be calculated. H 、T R The frequency response model parameters Θ, that is, Θ = {R, D, ΔP, H, F H 、T R}, which is the parameter predicted by the frequency parameter prediction model in this step. Km is the mechanical power gain coefficient, usually K m =1;ω n ,ω r are the natural frequency and damping frequency of the system calculated according to the frequency response model parameters; a and φ are the amplitude and angle parameters calculated according to the frequency response model parameters; ξ is the damping ratio, which is calculated as follows:
[0088]
[0089] This step uses the frequency parameter prediction model to predict Θ = {R, D, ΔP, H, F H , T R}, the frequency response curve of the system after disturbance is calculated according to the frequency response expression Δf(t).
[0090] Step 10, making an early judgment on the frequency stability according to whether the lowest point of the predicted frequency response curve exceeds a threshold value (reference national standard ±0.7 Hz).
[0091] In this step, the lowest point of the predicted frequency response curve is compared with the threshold, and the frequency stability is judged in advance based on whether the lowest point of the predicted frequency response curve exceeds the threshold. If the lowest point exceeds the threshold, that is, the frequency deviation is too large, it is judged in advance that the power grid frequency is unstable, that is, there is a problem with the frequency stability of the power grid, otherwise the frequency is stable. This early judgment can help relevant personnel take corresponding measures to prevent further deviation of the frequency and ensure the stable operation of the power grid.
[0092] Example Effect Description
[0093] In order to verify the actual performance of the present invention, three training modes are set under the premise of using the same data samples as the embodiment: source domain training mode, target domain training mode and domain adaptive training mode. In terms of model structure setting, both the source domain training mode and the target domain training mode remove the domain classifier, and only retain the domain feature extraction network and the frequency parameter prediction network for model training. In addition, in order to verify the influence of the causal expansion convolution network with multiple convolution channels used in the domain feature extraction network of the present invention and the probabilistic sparse attention mechanism used in the frequency parameter prediction network on the target domain parameter prediction performance, an ablation experiment is set to verify the advantages of the model structure of the present invention. The present invention uses two indicators, mean absolute error MAE (mean absolute error) and mean absolute percentage error MAPE (mean absolute percentage error), to evaluate the parameter prediction accuracy. The experimental results of all control models and the present invention on the test set are shown in the following table.
[0094] Table 1 MAE and MAPE indicators of parameter prediction under different training modes
[0095]
[0096] Table 1 compares the MAE and MAPE indicators of parameter prediction in the source domain training mode, the target domain training mode and the domain adaptation training mode. The domain adaptation method proposed in the present invention can significantly reduce the error of frequency parameter identification of the model migrated to the target domain.
[0097] Table 2 MAE and MAPE indicators of different model structures in the target domain under domain adaptive training mode
[0098]
[0099] Table 2 compares the MAE and MAPE indicators of different model structures in the target domain under the domain adaptation mode. The experimental results show that the causal expansion convolutional network has a stronger feature extraction ability for time series data, and the probabilistic sparse attention mechanism can effectively improve the model's ability to focus on key information.
[0100] The present invention uses the following stability discrimination quantitative index: classification accuracy r AR Indicates the proportion of all correctly identified samples to the total, and the stable sample misclassification rate r MR is the proportion of unstable samples in the actual stable samples, and the unstable sample recognition rate r LR is the proportion of unstable samples in actual unstable samples. Based on the frequency parameter identification and response curve prediction results, the present invention performs stability judgment on the test sets from and to the target domains. The specific results are shown in Table 3.
[0101] Table 3 Frequency stability judgment results of different methods
[0102]
[0103]
[0104] From Table 3, we can see that the classification accuracy of the domain adaptation method proposed in this invention in the target domain (Experiment 7) is r AR =96.83%, stable sample false alarm rate r MR =2.94%, unstable sample recognition rate r LR =96.78%. Compared with the optimal indicator of Experiment 5 (supervised training in the target domain), the classification accuracy is reduced by 1.43%, the false alarm rate of stable samples is increased by 0.98%, and the recognition rate of unstable samples is reduced by 1.52%. Despite the performance degradation, the domain adaptation method proposed in the present invention still shows effective transfer learning ability in the target domain; if the source domain is directly transferred to the target domain (Experiment 4), the classification accuracy is r AR =52.61%, stable sample false alarm rate rMR =98.04%, unstable sample recognition rate r LR =62.38%, it is not feasible to directly transfer the model to the target domain; by comparing experiments 3 and 6, it can be seen that the performance loss of the domain adaptation method proposed by the present invention is small in the source domain, and the classification accuracy rate r AR Reduced by 0.30%, stabilizing the sample false alarm rate r MR Increased by 1.72%, the recognition rate of unstable samples r LR No change.
[0105] Compared with the SFR model (physical model), the classification accuracy, stable sample false alarm rate and unstable sample recognition rate of the domain adaptation method in the source domain or target domain are better than the SFR model.
[0106] In summary, the present invention proposes a frequency stability judgment method based on domain adaptation. The method uses the initial frequency response data of the disturbance as input, predicts the frequency response model parameters and the frequency response curve after the disturbance, and finally performs stability judgment. The method proposed in the present invention designs a domain feature extraction network and uses a causal expansion convolutional network to extract and learn the shared features between the source domain and the target domain. A frequency parameter prediction network is designed, and a probabilistic sparse attention network is used to identify frequency parameters. In addition, a gradient reversal layer is introduced to realize adversarial training of domain classifiers, thereby improving the migration ability of the model in the target domain. It can ensure that the frequency parameter prediction network trained based on the source domain data can be effectively migrated to the target domain data set, effectively improving the adaptability of the model to changes in power grid operation mode and topology structure.
Claims
1. A domain-adaptive intelligent enhanced identification method for power system frequency stability, characterized in that: The steps include: Step 1, combining different fault types and operation modes of the two power grids, constructing a data set containing a number of uniformly mixed source domain data and target domain data, wherein the source domain data and the target domain data are both power grid frequency response samples, respectively coming from the two power grids; Step 2: dividing each power grid frequency response sample into early disturbance frequency response data and late disturbance frequency response data according to the frequency deviation threshold; Step 3, normalize the initial frequency response data of the disturbance to the interval [0,1]; Step 4: construct a domain feature extraction network, using the normalized result of step 3 as input to extract the features of the time series data; Step 5, construct a frequency parameter prediction network, take the feature vector extracted by the domain feature extraction network as input, process it based on the attention mechanism, and obtain the frequency response model parameters; Step 6: construct a domain classifier network, take the feature vector extracted by the domain feature extraction network as input, and obtain the sample label output, which indicates whether the sample belongs to the source domain or the target domain; Step 7, construct the system loss function; Step 8, calculating the frequency response curve prediction error according to the late frequency response data of the disturbance, and training using the gradient descent method until the model composed of each network converges; Step 9, inputting the frequency response model parameters obtained in step 5 into the frequency response model, and predicting the frequency response curve after the input time window; Step 10: If the lowest point of the predicted frequency response curve exceeds the frequency stability judgment threshold, the grid frequency is determined to be unstable; otherwise, the frequency is stable.
2. According to the domain adaptive intelligent enhanced judgment method for power system frequency stability according to claim 1, it is characterized in that: In step 1, the two power grids have different numbers of nodes and different power supplies; source domain data is obtained from a low-frequency example model in which new energy and conventional power supplies coexist, and PSD-BPA simulation software is used to set different load levels, adjust the unit output, and add machine cutting disturbances to build a scenario in which new energy and conventional power supplies fail through the tributary transmission system; target domain data is obtained from a high-proportion power electronic large power grid 10,000-node standard test system, and different power grid fault types and operating modes are set.
3. The intelligent enhanced judgment method for power system frequency stability based on domain adaptation according to claim 1 or 2 is characterized in that: In step 1, the source domain data and the target domain data are mixed in equal amounts to construct the data set, which is expressed as: X={x1,x2,…,x i ,…,x L } where x i represents the ith grid frequency response sample, x i =(f i 1 ,f i 2 ,…,f i t ,…,f i T ), f i t Represents x i The frequency response at the tth moment in is the frequency response data corresponding to the node with the largest frequency deviation, and T is x i The sequence length is , L is the number of samples; In step 2, the initial frequency response data of the disturbance is expressed as: The frequency response data after disturbance is expressed as: in, γ sh is the frequency deviation threshold, Representation sequence Wherein, the frequency deviation threshold is smaller than the frequency stability determination threshold.
4. According to the domain-adaptive intelligent enhanced identification method for power system frequency stability according to claim 1, it is characterized in that: In step 4, the domain feature extraction network is based on the CNN network and adopts a four-channel parallel convolution structure. There are four parallel causal expansion convolution branches. The convolution kernel of each branch has a different size. The convolution kernels of different sizes are used to achieve perception of different scales, thereby forming a multi-scale feature map. Finally, the outputs of the four-channel parallel convolution are combined and the extracted feature vector f=G is obtained through the average pooling layer. f (x;θ f ), where G f represents the domain feature extraction network, x is the input, θ f Extract network parameters for domain features.
5. According to the domain-adaptive intelligent enhanced judgment method for power system frequency stability according to claim 4, it is characterized in that: The four parallel causal dilation convolution branches are: The first branch is CD_ConvNet with a convolution kernel size of 1×1; The second branch is a CD_ConvNet with a convolution kernel size of 1×1 and a CD_ConvNet with a convolution kernel size of 1×3 connected in sequence; The third branch is a CD_ConvNet with a convolution kernel size of 1×1 and a CD_ConvNet with a convolution kernel size of 1×5 connected in sequence; The fourth branch is a CD_ConvNet with a maximum pooling layer of a window size of 1×3 and a convolution kernel size of 1×1 connected in sequence.
6. The method for intelligently enhancing the frequency stability of a power system based on domain adaptation according to claim 4 or 5, characterized in that: The causal dilation convolution introduces a dilation coefficient into the temporal causal convolutional network, and the calculation of its receptive field is as follows: In the formula, the size of each convolution kernel is fixed to K; the sliding step is fixed to 1; l n is the receptive field size of the nth convolutional layer; the basic expansion coefficient of the network is b, and as the number of network layers increases, the expansion coefficient of each layer increases. n Grow exponentially with b, that is, d n =b n ; When the input sequence length is T, the receptive field covers all input data, that is, l n ≥T, the minimum number of layers n required to solve is as follows:
7. According to the domain adaptive intelligent enhanced judgment method for power system frequency stability according to claim 1, it is characterized in that: In step 5, the frequency parameter prediction network includes a probability sparse attention layer, a distillation layer and an output layer connected in sequence; The probabilistic sparse attention layer includes a probabilistic sparse attention mechanism and a feedforward neural network connected in sequence, and normalization is introduced in the output of each layer. The distillation layer includes a one-dimensional convolution layer, a normalization layer, an activation function and a maximum pooling layer connected in sequence, and position encoding is introduced into the input for the frequency parameter prediction network, and the probabilistic sparse attention layer and the distillation layer are sequentially passed through, and finally the predicted frequency response model parameters are obtained in the output layer, which is expressed as: Θ={R、D、ΔP、H、F H 、T R } Among them, R is the speed governor adjustment coefficient of the unit, D is the load frequency adjustment coefficient, ΔP is the disturbance power, H is the inertia time constant of the unit, and F H is the power ratio of the high pressure cylinder, T R is the unit reheater time constant.
8. The method for intelligently enhancing the frequency stability of a power system based on domain adaptation according to claim 7 is characterized in that: In the probabilistic sparse attention layer, the sparsity measure of the i-th query is defined as follows: In the formula, q i represents the i-th row of the query vector Q, k j represents the jth row of the key vector K, d model Indicates q i and k j The dimension of L K Indicates the number of query vectors and key vectors; M(q i ,K) is calculated as follows: Random sampling u = c lnL Q dot product pairs, where c is a constant sampling factor, and the Q after random sampling is defined as Q; Based on the empirical approximation method replace After random sampling of Q, M(q i ,K) has a maximum value of as follows: The input length of the query vector and the key vector is the same in the attention mechanism calculation, that is, L K =L Q =L, so that the total time complexity and space complexity of the probabilistic sparse attention mechanism is O(LlnL); The distillation process of the distillation layer is as follows: one-dimensional convolution calculation is performed on the feature map generated by the probabilistic sparse attention layer in the time dimension, the sliding window size is set to 3, the GELU activation function is used, and a maximum pooling layer with a step size of 2 is added after the one-dimensional convolution layer. The calculation of the distillation process from the jth layer to the j+1th layer is as follows: AND j+1 =MaxPool(GELU(Conv1d([Y j ]))) Where Y j is the output of the j-th layer of probabilistic sparse attention, Conv1d(·) represents a one-dimensional convolution in the time dimension, GELU(·) is an activation function based on the Gaussian error function, and MaxPool(·) is a maximum pooling layer with a stride of 2, which is used to halve the length of the input sequence.
9. According to the domain adaptive intelligent enhanced judgment method for power system frequency stability according to claim 1, it is characterized in that: In step 6, the sample label output is expressed as: G d (f,θ d ) Among them, G d represents the domain classifier network, θ d is the domain classifier network parameter, f is the feature vector extracted by the domain feature extraction network; In step 7, the system loss function is expressed as: Among them, θ y The network parameters are predicted for the frequency parameters, L y (.,.) represents the loss of the frequency parameter prediction network, G y represents the frequency parameter prediction network; L d (.,.) represents the loss of the domain classifier; and They represent the loss of the frequency parameter prediction corresponding to the i-th sample and the loss of the domain classifier, y i is the frequency parameter label of the i-th source domain data sample; d i is the label of the i-th sample belonging to the source domain or the target domain. 0 means it belongs to the source domain, and 1 means it belongs to the target domain. λ is the weight parameter that balances the importance of the two items on the right side of the above formula.
10. The method for intelligently enhancing the frequency stability of a power system based on domain adaptation according to claim 1 is characterized in that: In step 8, the saddle point of the following formula is obtained by using the gradient descent method: in, Represent the parameters θ f ,θ y ,θ d Repeat steps 4 to 8 until the model converges.
Citation Information
Patent Citations
Electric power system dominant instability mode identification method and system based on transfer learning
CN114330571A
Multi-center power system fault prediction method and system based on transfer learning
CN115115131A
Power system transient stability evaluation method based on information entropy and spectrogram network
CN115513947A
Fault diagnosis method based on improved unsupervised domain adaptive network
CN116522118A
Power system frequency stability early warning method and system based on steady-state operation information
CN117154753A
Cited By
Data fusion mining method and system based on multi-modal power cross-domain
CN120123773A