Power system forced oscillation source positioning method based on hybrid CGAN
By generating high-fidelity oscillation data through hybrid CGAN and combining it with energy flow theory, the positioning accuracy and robustness issues of data-driven methods in power systems are solved, achieving high-precision oscillation source positioning in complex power grid scenarios.
Patent Information
- Application Number
- CN202511184406.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-22
- Publication Date
- 2025-12-12
AI Technical Summary
Existing forced oscillation source localization methods in power systems face problems such as limited dataset size, data imbalance, and high acquisition costs in nonlinear power grids with a high proportion of renewable energy integration, resulting in reduced localization accuracy and poor generalization ability.
A hybrid CGAN-based approach is adopted, which generates high-fidelity forced oscillation data by fusing convolutional neural networks (CNN), bidirectional long short-term memory networks (BiLSTM), and attention mechanisms. The oscillation source is located by combining energy flow theory, and a classifier is trained using the hybrid dataset to improve the localization accuracy.
It significantly improves the accuracy and robustness of oscillation source localization in complex power grid scenarios, especially in cases of multi-source coupling, high noise, and PMU data loss, where the localization accuracy is significantly improved, and the quality and stability of generated data are enhanced.
Smart Images

Figure CN121117699A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of power system safety, and particularly relates to a forced oscillation source positioning method for a power system based on a hybrid CGAN. BACKGROUND
[0002] Forced oscillation (FO) is a sustained power oscillation phenomenon caused by periodic disturbances (such as wind turbine mechanical torque fluctuations, controller defects) in a power system. When the disturbance frequency is close to the system natural frequency, resonance effect will be caused, leading to harmonic amplification, and even power grid splitting accidents in severe cases. Precise positioning of the oscillation source is a prerequisite for implementing oscillation suppression measures. Existing FO source positioning methods are divided into two categories. The first category is the traditional model-driven method (such as energy flow analysis, controller torque analysis), but this method relies on ideal assumptions (such as grid parameter symmetry, linearization). When new power systems exhibit strong nonlinear characteristics caused by high proportions of new energy access, the model simplification condition fails, resulting in inaccurate criteria. The second category is the data-driven method (such as deep learning). With the continuous growth of power grid data, this method can be applied to complex power grid scenarios using data collected by the Wide Area Measurement System (Phasor Measurement Unit, PMU) to solve the FO source positioning problem.
[0003] At present, the data-driven deep learning method for forced oscillation source positioning in the power system is faced with the problems of limited training data set size, serious data class imbalance and high data acquisition cost, which leads to poor generalization ability and reduced accuracy of oscillation source positioning due to insufficient data quantity and quality based on deep learning. SUMMARY
[0004] In order to solve the above problems existing in the prior art, the application provides a forced oscillation source positioning method for a power system based on a hybrid CGAN.
[0005] The technical problems to be solved by the application are solved by the following technical solutions: In a first aspect, the application provides a forced oscillation source positioning method for a power system based on a hybrid CGAN, which comprises: inputting the data to be identified into a trained CNN classifier to obtain an oscillation source identification result; wherein the CNN classifier is trained according to a hybrid data set; the hybrid data set is constructed according to FO generated data and real data generated by a trained hybrid CGAN; the FO generated data is false forced oscillation data; each set of real data includes active power, reactive power, voltage amplitude and voltage phase angle; and the hybrid CGAN is obtained according to CNN, BiLSTM and attention mechanism.
[0006] Optionally, the training process of the generator in the hybrid CGAN comprises: sequentially performing standardization and principal component analysis dimension reduction on the real data to obtain preprocessed real data; inputting the preprocessed real data into the discriminator in the hybrid CGAN to obtain a discrimination output; training the generator using the discrimination output, a noise data set, a pre-constructed composite loss function and a spectral consistency loss function to obtain the trained generator; wherein the noise data set comprises noise vectors and label embeddings corresponding to real data; the labels are used to constrain and guide the data generated by the generator.
[0007] Optionally, the training process of the discriminator comprises: obtaining the FO generated data according to the trained generator; training the discriminator using the FO generated data, the real data and a preset total loss function to obtain the trained discriminator; wherein each set of real data comprises active power, reactive power, voltage amplitude and voltage phase angle.
[0008] Optionally, before training the discriminator using the FO generated data, the real data and the preset total loss function to obtain the trained discriminator, the method further comprises: obtaining a training step number ratio between the generator and the discriminator according to the loss values of the composite loss function and the spectral consistency loss function and the loss value of the preset total loss function; adjusting the training times of the generator and the discriminator according to the step number ratio, respectively.
[0009] Optionally, the training step number ratio is represented as follows: ; wherein, represents the training step number of the discriminator, represents the training step number of the generator, represents the loss value of the normalized composite loss function and the spectral consistency loss function, represents the loss value of the normalized preset total loss function.
[0010] Optionally, the pre-constructed composite loss function is represented as follows: ; wherein, represents the pre-constructed composite loss function, represents the discriminator, denotes the generator, is the noise vector, denotes the real data, is a dynamic weight coefficient, is the total number of training rounds, is the intermediate feature function of the discriminator, is a fixed weight, denotes the mean vector of the real data, denotes the mean vector of the FO generated data, denotes the standard deviation vector of the real data, denotes the standard deviation vector of the FO generated data.
[0011] Optionally, the spectral consistency loss function is represented as follows: ; wherein, denotes the spectral consistency loss function, is the number of FFT sampling points; denotes the amplitude spectrum of the real data after FFT, denotes the amplitude spectrum of the FO generated data after FFT.
[0012] In a second aspect, the application provides a power system forced oscillation source positioning device based on a hybrid CGAN, and the device comprises: An oscillation source positioning module is configured to input to-be-identified data into a trained CNN classifier to obtain an oscillation source identification result; wherein the CNN classifier is trained according to a hybrid data set; the hybrid data set is constructed according to FO generated data and real data generated by a trained hybrid CGAN; the FO generated data is false forced oscillation data; each group of the real data comprises active power, reactive power, voltage amplitude and voltage phase angle; and the hybrid CGAN is obtained according to a CNN, a BiLSTM and an attention mechanism.
[0013] The technical scheme provided by the embodiments of the application can have the following beneficial effects: In the above technical scheme, by fusing a convolutional neural network (CNN), a bidirectional long short-term memory network (BiLSTM) and an attention mechanism into the generator and the discriminator of the CGAN, the similarity between the FO generated data and the real data is improved, and the FO generated data and the real data are applied for training, so that the accuracy of forced oscillation source positioning can be effectively improved.
[0014] The application will be described in further detail below with reference to the drawings and embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0015] Figure 1 is a structural schematic diagram of a CGAN provided by an embodiment of the application; Figure 2 is a schematic diagram of dissipated energy flow of a generator provided by an embodiment of the application; Figure 3 is a flowchart of a hybrid CGAN-based power system forced oscillation source positioning method provided by an embodiment of the application; Figure 4 is a model overall workflow diagram provided by an embodiment of the application; Figure 5 is a hybrid CGAN-based power system forced oscillation source positioning device provided by an embodiment of the application. DETAILED DESCRIPTION
[0016] In order to facilitate understanding of the application scheme, first, the related situation of the prior art and the inventive concept of the application are briefly described.
[0017] At present, there are many researches on FO positioning based on data-driven methods, and a large number of excellent research results have emerged. The most similar existing implementation schemes to the present application are as follows. Some scholars use shallow artificial neural network (ANN) to classify forced oscillation and natural oscillation, and improve the small sample training efficiency through stochastic conjugate gradient (SCSG) algorithm. This method uses voltage phase angle difference and frequency trend as input features, inputs double hidden layer network after Welch power spectrum preprocessing, and has high anti-non-Gaussian noise ability. Some scholars combine dissipating energy flow (DEF) features and Transformer architecture to realize branch-level positioning of FO. In terms of input features, they fuse original PMU measurements (active / reactive power), oscillation frequency and DEF energy flow direction to construct a space-time feature vector. And the model design adopts the structure of Transformer encoder, captures the global dependence relationship of oscillation propagation through multi-head attention mechanism, solves the gradient disappearance problem through residual connection, has the advantages of realizing multi-source simultaneous positioning and not needing retraining when the topology changes. Some scholars generate synthetic oscillation data through Transformer-BiLSTM-CGAN architecture, and jointly train the classifier to locate the oscillation source. In the generator structure, the Transformer encoder extracts the time sequence features, and the bidirectional long short-term memory network (BiLSTM) decodes to generate labeled voltage phase angle data; in the design of discriminator, the multi-head attention mechanism is fused, and the data authenticity is judged and the oscillation source position is output at the same time. This method has high positioning accuracy in mixed fault scenes (such as three-phase short circuit + FO), and the performance is greatly improved compared with the traditional graph convolution network (GCN).
[0018] Research on existing methods reveals that mainstream approaches either rely on single features (such as simplified inputs of ANNs) or focus on a single dimension (such as global temporal modeling of Transformers), failing to collaboratively capture local spatial correlations (such as high-frequency transient features) and long-range temporal dependencies (such as bidirectional propagation paths) in oscillation propagation, resulting in insufficient localization accuracy in multi-source coupled scenarios. Existing CGAN generation schemes for FO data rely on single temporal modeling modules (such as Transformers or BiLSTMs), unable to collaboratively extract spatial local features and bidirectional temporal dynamics, leading to significant deviations between the synthesized data and the spatiotemporal distribution of real oscillations. Furthermore, the training process is prone to mode collapse and instability, further reducing the reliability of generated data. Existing FO source localization techniques, unable to simultaneously collaboratively extract spatial local features and bidirectional temporal dynamics and integrate dynamic feature weighting capabilities, exhibit significant performance degradation in complex scenarios such as multi-source coupled oscillations, high noise (>30dB), and severe PMU data loss (>50%). Therefore, this invention proposes a hybrid CGAN-based method for localizing forced oscillation sources in power systems to address this technical problem.
[0019] Figure 1 This is a schematic diagram of the structure of a CGAN provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the core architecture of CGAN consists of a generator. With discriminator It consists of two adversarial networks. The generator uses a noise vector... and conditional tags As joint input, generate data samples that satisfy the conditional constraints. The goal is to learn the distribution of real data. The mapping relationship makes the generated samples difficult to distinguish from real data under given conditions. The discriminator, on the other hand, receives real data simultaneously. and generating data and their corresponding conditional tags The goal is to determine the authenticity of the data and whether it meets the matching criteria of the discriminator. .
[0020] During training, the generator and discriminator optimize the objective function through a mini-maximum game. Specifically, the discriminator aims to maximize the true data. Discriminant probability (That is, the probability of judging a real sample as true approaches 1), while minimizing the generated data. Discriminant probability (That is, the probability of judging the generated sample as false approaches 1); and the generator's objective is to minimize (That is, successfully fooling the discriminator, causing it to judge the generated sample as real).
[0021] By iteratively updating the network parameters through backpropagation, the generator and discriminator continuously optimize in a dynamic game until a Nash equilibrium is reached. At this point, the generator can output high-fidelity samples that meet the constraints. The training objective function of CGAN can be expressed as:
[0022] ; in, It is a discriminator and generator The value function measures the performance of both sides in the process of confrontation. This indicates that this is a minimax game: generator Attempt to minimize (That is, making it difficult for the discriminator to distinguish between generated data and real data). Discriminator Try to maximize (That is, accurately distinguishing between real data and generated data). The formula consists of two parts: Part 1: For real data Discriminator Output ,express In the condition label Below is the true probability. The discriminator aims to maximize this term (i.e., output a high probability for the true data). Part Two: For the generated data Discriminator output This indicates that the generated data is under certain conditions. The following is the true probability. The discriminator aims to output a low probability for the generated data (i.e., (close to 1), therefore maximize The generator aims to minimize this term (i.e., make...). (When the value is close to 1, the discriminator cannot distinguish between generated data and real data).
[0023] The forced oscillation source can be located using the following process: Using the IEEE 39-bus power system as the test grid, and since generator 1 is the equivalent of the external power system, its power angle is used as the reference value for other generators. Therefore, oscillation tests are performed on the remaining 9 generators. If generators 6 and 7 are the oscillation sources, the label is y=[0,0,0,0,1,1,0,0,0]. The electrical quantities acquired by the PMU are all discrete signals, so the dissipated energy flow of the generators in discrete space can be expressed as: ; in, To measure the number of discrete sampling points for information, The sampling interval is... For generator The initial value of dissipated energy, and These are the power grid branches labeled j. The changes in active power and reactive power in the th The value at each discrete sampling point For generator The frequency change in the first The value at each discrete sampling point For generator The logarithmic change in voltage amplitude on the 1st The value at each discrete sampling point.
[0024] Based on the calculated energy dissipation of each generator during the forced oscillation period The changing trend can accurately pinpoint the source of forced oscillation: the energy dissipated by the generator during forced oscillation. If all values are negative and the trend is continuously downward, it indicates that the generator is continuously injecting energy into the grid, making it a forced oscillation source; if the generator dissipates energy during forced oscillation... If all values are positive and the trend is continuously upward, it indicates that the generator is continuously absorbing the oscillation energy of the power grid and is a non-forced oscillation source; if the generator dissipates energy during forced oscillation... If all values are 0, then it is also a non-oscillating source. It should be noted that the positive direction of dissipated energy flow defined in this paper is defined as dissipated energy flowing into the generator. Figure 2 This is a schematic diagram of the dissipated energy flow of a generator provided in an embodiment of the present invention, as shown below. Figure 2 As shown, generators No. 6 and No. 7 were identified as oscillation sources.
[0025] Figure 3 This is a flowchart of a power system forced oscillation source localization method based on hybrid CGAN provided in an embodiment of the present invention, as follows: Figure 3 As shown, the method may include the following steps: S301. Input the data to be identified into the trained CNN classifier to obtain the oscillation source identification result; wherein, the CNN classifier is trained based on the hybrid dataset; the hybrid dataset is constructed based on the FO generated data and real data generated by the trained hybrid CGAN; the FO generated data is fake forced oscillation data; each set of real data includes active power, reactive power, voltage amplitude and voltage phase angle; the hybrid CGAN is obtained based on CNN, BiLSTM and attention mechanism.
[0026] It can be understood that by synergistically integrating the three models of CNN, BiLSTM and attention mechanism in the structural design of the generator and the discriminator, the adaptability in the complex oscillation data environment can be effectively enhanced, so that each module can work synergistically and complement each other's advantages.
[0027] It can be understood that, Figure 4 is a model overall workflow diagram provided by the embodiment of the application, as Figure 4 shown, the workflow of the generator can be summarized by the following steps: first, the generator receives the spliced input (640 dimensions) of the noise vector (512 dimensions) and the label embedding (128 dimensions), and then performs feature expansion and dimension transformation through two layers of fully connected network (Dense module) in Figure 4 . Subsequently, LayerNorm stabilizes the feature distribution, accelerates convergence and enhances the generalization ability. The normalized output is converted into a three-dimensional tensor ([batch=256, 512, seq_length=4]) through Unflatten dimension reshaping, serving as the input of the spatio-temporal feature extraction. The Time_Conv (that is, the CNN module in Figure 4 ) module captures the local spatio-temporal pattern through two layers of one-dimensional convolution (channel number 512→256→128), and each layer is followed by LayerNorm and LeakyReLU activation. The convolution output is adjusted to sequence format ([batch, seq_length, 128]) through dimension permutation (permute), and the BiLSTM layer is input to model the long-term sequence dependence, and the 256-dimensional features are formed by splicing the bidirectional hidden states. The ChannelAttention layer calculates the feature weight based on the BiLSTM output, and generates an attention mask through a fully connected layer and a Sigmoid activation to focus on key features. Finally, the ResidualOutput layer adds the attention weighted features and the initial convolution output processed by the 1x1 convolution, and maps it to the target dimension ([batch, seq_length, 30]) through the fully connected layer. After flattening, the synthesized data is generated. The mathematical form of the multi-modal fusion architecture of the generator can be expressed as:
[0028] ; wherein, denotes the vector splicing operation, InitNet corresponds to the fully connected layer and shape transformation. TimeConv corresponds to two one-dimensional convolution layers. BiLSTM corresponds to the bidirectional LSTM layer. ChannelAttn corresponds to the channel attention module. ResidualOutput corresponds to the last linear layer and the residual connection.
[0029] To form technical symmetry with the generator architecture, the discriminator architecture also integrates CNN, BiLSTM, and multi-head attention mechanism in combination with spatiotemporal feature modeling and stability design. The discriminator adopts a feature pyramid structure, which is mathematically defined as: ; wherein, denotes a shape reshaping operation on the input data , corresponds to a one-dimensional convolutional layer, corresponds to a BiLSTM layer, denotes a multi-head attention mechanism with 8 heads, represents a fully connected output layer with dual branch classification function.
[0030] Specifically, referring to Figure 4 , the workflow of the discriminator can be summarized as follows. First, input reorganization is performed to reshape the received flattened two-dimensional vector data into a three-dimensional tensor ([batch=256, seq-length=4, feature_dim=30]), which is adjusted to the convolutional format ([batch, feature_dim, seq-length]) through dimension permutation. Subsequently, local feature extraction is performed through the CNN module, which adopts two layers of 1D temporal convolution (channel number 30→64→128), uses spectral normalization (spectral_norm) to constrain the weight amplitude, and enhances the training stability, outputting feature maps , wherein, is the batch size, is the channel number, is the sequence length. Temporal dependency modeling is performed through the BiLSTM module, and the output dimension after concatenating the bidirectional hidden states is 2H=128, forming the temporal enhanced feature . Dynamic feature weighting is performed through the multi-head attention mechanism, and the query-key-value pair is calculated to learn the feature importance weight, with each head having a dimension , which is mapped to 8 subspaces in parallel, outputting the weighted feature . Finally, the output layer for dual branch classification is performed, the main branch performs global average pooling on the attention output, constructs the discriminant function through the fully connected layer (Dense) (2H→64→1), adopts LeakyReLU activation and Sigmoid normalization to output the binary decision probability , which serves as the dynamic weight for adversarial training. The auxiliary branch performs the FO source multi-classification task through an independent fully connected layer and Softmax normalization, uses cross-entropy loss to supervise multi-class pattern learning, and improves the model's ability to model fine-grained data distribution.
[0031] Optionally, the training process of the generator in the hybrid CGAN comprises: The real data is sequentially standardized and principal component analysis dimensionality reduced to obtain preprocessed real data; The preprocessed real data is input into the discriminator in the hybrid CGAN to obtain a discrimination output; The discrimination output, a noise data set, a pre-constructed compound loss function and a spectral consistency loss function are used to train the generator to obtain a trained generator; wherein the noise data set comprises noise vectors and label embeddings corresponding to the real data; the labels are used to constrain and guide the data generated by the generator.
[0032] Optionally, the training process of the discriminator comprises: FO generation data is obtained according to the trained generator; The FO generation data, the real data and a preset total loss function are used to train the discriminator to obtain a trained discriminator.
[0033] It can be understood that, in order to realize an efficient and stable CGAN training process for generating FO data sets of higher quality and better fitting degree, the gradient-penalized Wasserstein distance metric, the generation-discrimination dynamic balance algorithm and the multi-objective optimization can be integrated into the training strategy. Experimental results show that the training strategy effectively improves the quality and diversity of the generated data, and provides strong support for the stability and performance improvement of GAN in practical applications. The following is a detailed expansion of the mathematical principles, function implementations and action mechanisms of the key components.
[0034] In view of the distribution non-overlapping gradient disappearance problem caused by the JS divergence metric adopted by the traditional generative adversarial network (GAN), an optimization system based on the Wasserstein-1 distance (Earth-Mover distance) is constructed, which is mathematically defined as: ; Wherein, represents the Wasserstein-1 distance between the real data distribution and the generated data distribution , represents is a joint distribution, whose marginal distributions are and , is a sample from the real data distribution , is a sample from the generated data distribution , represents the joint distribution The sample pair The expectation value of the distance between And .
[0035] The distance metric effectively overcomes the gradient vanishing defect of traditional GAN when the distribution support set is separated by calculating the minimum cost of probability mass transmission. Its core advantage lies in the continuous and derivable characteristics of non-overlapping distributions on low-dimensional manifolds, providing a stable gradient propagation path for the generator.
[0036] In terms of implementation, the present application converts the Lipschitz continuity constraint into a calculable gradient penalty term through Lagrange duality theory. Specifically, a regularization term is introduced into the loss function of the discriminator: ; Wherein, is an interpolated sample, and the generation mode is , Wherein is a sample from the real data distribution , is a penalty coefficient, Indicates that the expectation calculation is carried out on the interpolated sample According to the distribution , Indicates the gradient of the discriminator Regarding the interpolated sample .
[0037] This design can ensure that the penalty term acts on the key transition area between the real data distribution And the generated distribution . By calculating the gradient norm through the PyTorch automatic differentiation mechanism, the network capacity compression problem caused by weight clipping is avoided, and the 1-Lipschitz continuity of the function space is accurately constrained. Through the dynamic interpolation strategy, the discrimination ability of the discriminator to the intermediate sample is enhanced, and the training stability is also greatly increased.
[0038] The total loss function of the discriminator can be expressed as: ; Wherein, The approximate value of the calculation is expressed as follows: ; Wherein, is the statistical discriminator collaborative loss, which is expressed as follows: ; Optionally, before training the discriminator by using the FO generated data and the preset total loss function to obtain the trained discriminator, the method further comprises: According to the loss values of the composite loss function and the spectrum consistency loss function and the loss value of the preset total loss function, a training step number ratio between the generator and the discriminator is obtained; According to the step number ratio, the training times of the generator and the discriminator are respectively adjusted.
[0039] It can be understood that the dynamic balance function is defined as , the input is the discriminator loss of the last 10 batches and the generator loss , and the output is the training step number ratio of the discriminator and the generator . The training step number ratio is represented as follows: ; Wherein, represents the training step number of the discriminator, represents the training step number of the generator, represents the loss value of the normalized pre-constructed composite loss function and spectrum consistency loss function, represents the loss value of the normalized preset total loss function. When , it means that the discriminator has too strong discrimination ability, and at this time, the generator update times are increased to avoid the gradient disappearance of the generator. When , it means that the generator may fall into local optimum, and by increasing the discriminator training, a stronger gradient signal is introduced. Under the default ratio, an alternating gradual update is adopted, and a warmup+cosine annealing learning rate adjustment strategy is used to ensure the dynamic balance and efficient convergence of the parameter space.
[0040] Under the dynamic balance framework, the pre-constructed composite loss function is represented as follows: ; Wherein, represents the pre-constructed composite loss function, represents the discriminator, represents the generator, is a noise vector, represents real data, is a dynamic weight coefficient, , is the total training round number, is the intermediate feature function of the discriminator, containing spatial convolution and BiLSTM feature, is a fixed weight used to balance the alignment strength of the mean and standard deviation, represents the mean vector of the real data, represents the mean vector of the FO generated data, represents the standard deviation vector of the real data, represents the standard deviation vector of the FO generated data.
[0041] The spectral consistency loss is achieved by the amplitude difference of the fast Fourier transform (FFT), i.e., the spectral consistency loss function is represented as follows: wherein, represents the spectral consistency loss function, is the number of FFT sampling points; represents the amplitude spectrum of the real data after FFT, and the absolute value is calculated to obtain the spectral energy distribution, represents the amplitude spectrum of the FO generated data after FFT, which is constrained to be aligned with the frequency domain characteristics of the real data. The multi-objective loss function promotes the improvement of the KL divergence index on the generated data, while maintaining the stable decline of the Wasserstein distance. By comprehensively constraining the distribution characteristics of the generated data, the generated data can be highly consistent with the real data in the time domain, frequency domain and statistical characteristics.
[0042] The training process of the generator and the discriminator can be referred to as follows: in combination with the design of the above-mentioned enhanced generator and discriminator and the innovative training strategy, the training process of the CNN-BiLSTM-Attention CGAN model is as follows. First, load the original data and preprocess it by standardization and principal component analysis (PCA) dimension reduction, and prepare the corresponding cleaned labels. Subsequently, initialize the generator G, the double-branch discriminator D-C and the statistical discriminator D-stat (multi-layer perceptron (MLP) structure), and configure RAdam optimizers for them respectively. Then, the discriminator is pre-trained, the real data and the generated data are mixed in a 1:1 data strategy, and the gradient penalty (λ=10) is introduced to enhance the Lipschitz constraint, so that the discriminator D establishes the initial feature discrimination ability, and avoids the pattern collapse problem caused by the weak discriminator in the early stage of main training. In the main training loop, the learning rate is dynamically adjusted by cosine annealing, and the dynamic step size (L) is calculated according to the training history. In the generator training stage, the noise and the label embedding are connected and input into G to generate false data. A comprehensive loss function is calculated, which includes adversarial loss, feature matching, statistical moment constraint and spectral consistency. Then the parameters of G are updated by back propagation. The discriminator training stage includes two steps: first, process the real data to calculate , which includes adversarial loss, classification loss and statistical loss; then, process the mixture of real data and generated data, and calculate after adding the gradient penalty term. Both steps update the parameters of D-C and D-stat. After each round of GAN training, the training is monitored by key indicators: real-time calculation of Dynamic Time Warping (DTW) distance to evaluate sequence similarity, and record of Wasserstein distance to reflect the balance of the adversarial state. After the end of GAN training, PCA and Uniform Manifold Approximation and Projection (UMAP) are used to visualize the distribution of generated data to ensure its similarity to the distribution of real data, and the trained generator is saved. Finally, the trained generator is used to generate FO generated data for data augmentation, and a deep learning model (using CNN as the classification model) for classification is trained using both real data and generated data, and the results of the classification model are used to evaluate the performance improvement of FO source localization using the proposed method for data augmentation.
[0043] In an embodiment, the application has the advantages of strong spatio-temporal feature extraction capability and high oscillation source positioning accuracy. The CNN layer explicitly extracts spatial correlation, the BiLSTM layer captures bidirectional time dynamics, and the attention mechanism adaptively weights key spatio-temporal features. In the WECC-179 node system, the F1-Score of the application is 96.0% (80% PMU packet loss rate), which is better than the 91.48% of the prior art Transformer-BiLSTM-CGAN (mixed fault scenario). Especially in the multi-source coupled oscillation scenario, the ratio of oscillation source samples to multi-oscillation source samples is 1:1, the F1-Score is 91.3%, which is 9.8% higher than the baseline model; and the application is robust in extreme scenarios and has outstanding anti-interference ability, in the 80% PMU random packet loss scenario, the positioning accuracy only decreases by 3.27% (F1-Score 96.35% vs. original 99.62%), in the 40dB strong noise interference, the F1-Score remains 94% (the same noise of the prior art decreases by >10% on average), in the extreme sample imbalance (non-oscillation / oscillation sample ratio 40:1), the F1-Score increases by 30.9%; and the training efficiency and stability of the generator and discriminator of the application are excellent, and the engineering applicability is strong, the generation-discrimination dynamic balance strategy adaptively adjusts the training frequency, avoids the gradient disappearance caused by the over-strength of the discriminator, the residual connection design alleviates the degradation problem of deep network, so that the training convergence speed is improved, and the quality of synthetic data is better.
[0044] The application generates high-fidelity oscillation data by fusing the space-time features of the CNN-BiLSTM-Attention CGAN, thereby performing data enhancement, solving the problems of actual data scarcity and class imbalance, and then combining the energy flow theory to construct a classification model, realizing accurate positioning of the oscillation source under multiple scenes (multi-source coupling, high noise, PMU data loss, and data imbalance); and the convolutional neural network (CNN), bidirectional long short-term memory network (BiLSTM) and attention mechanism are synergistically integrated, and the combination structure and parameter interaction mechanism of the model design are particularly key to processing the space-time dynamic characteristics of the power system forced oscillation; the application also proposes a triple joint training strategy, which is gradient penalty Wasserstein distance, generation-discrimination dynamic balance and multi-objective optimization algorithm, and the mathematical modeling and implementation mechanism of the training strategy are also key Figure 5 The application provides a power system forced oscillation source positioning device based on a hybrid CGAN, as shown in the accompanying drawings. Figure 5 The device 500 can include: The oscillation source positioning module 501 is configured to input the to-be-identified data into the trained CNN classifier to obtain an oscillation source identification result; wherein the CNN classifier is trained according to a hybrid data set; the hybrid data set is constructed according to FO generated data and real data generated by the trained hybrid CGAN; the FO generated data is false forced oscillation data; each set of real data includes active power, reactive power, voltage amplitude and voltage phase angle; and the hybrid CGAN is obtained according to the CNN, BiLSTM and attention mechanism.
[0045] The application fuses the convolutional neural network (CNN), bidirectional long short-term memory network (BiLSTM) and attention mechanism into the generator and discriminator of the CGAN, improves the similarity between the FO generated data and the real data, and applies the FO generated data and the real data for training, so as to effectively improve the accuracy of the forced oscillation source positioning.
[0046] It should be noted that the terms "first", "second", and the like are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the application. Rather, they are merely examples of devices and methods consistent with some aspects of the application.
[0047] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" etc. means that the specific features or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in the specification.
[0048] Although the present application is described herein in conjunction with various embodiments, those skilled in the art, with the benefit of the drawings and the disclosure, can understand and implement other variations of the disclosed embodiments in the implementation of the claimed application. In the description of the present application, the word "comprising" does not exclude other components or steps, "a" or "one" does not exclude a plurality, and "plurality" means two or more, unless otherwise expressly specified. In addition, some measures are described in different embodiments, but this does not mean that these measures cannot be combined to produce good results.
[0049] The above is a further detailed description of the present application in conjunction with specific preferred embodiments, and cannot be considered as limiting the specific implementation of the present application to these descriptions. For those skilled in the art, without departing from the concept of the present application, a number of simple deductions or substitutions can be made, which should be considered as falling within the scope of protection of the present application.
Claims
1. A method for locating forced oscillation sources in power systems based on hybrid CGAN, characterized in that, The method includes: The data to be identified is input into a trained CNN classifier to obtain the oscillation source identification result; wherein, the CNN classifier is trained based on a hybrid dataset; the hybrid dataset is constructed based on FO generated data and real data generated by a trained hybrid CGAN; the FO generated data is fake forced oscillation data; each set of real data includes active power, reactive power, voltage amplitude and voltage phase angle; the hybrid CGAN is obtained based on CNN, BiLSTM and attention mechanism.
2. The method for locating forced oscillation sources in power systems based on hybrid CGAN according to claim 1, characterized in that, The training process for the generator in the hybrid CGAN includes: The real data is then standardized and subjected to principal component analysis for dimensionality reduction to obtain the preprocessed real data. The preprocessed real data is input into the discriminator in the hybrid CGAN to obtain the discriminant output; The generator is trained using the discriminant output, the noise dataset, the pre-constructed composite loss function, and the spectral consistency loss function to obtain the trained generator; wherein, the noise dataset includes noise vectors and label embeddings corresponding to the real data; the labels are used to constrain and guide the data generated by the generator.
3. The method for locating forced oscillation sources in power systems based on hybrid CGAN according to claim 2, characterized in that, The training process of the discriminator includes: The FO generated data is obtained based on the trained generator; The discriminator is trained using the FO-generated data, the real data, and a preset total loss function to obtain the trained discriminator.
4. The method for locating forced oscillation sources in power systems based on hybrid CGAN according to claim 3, characterized in that, Before training the discriminator using the FO-generated data, the real data, and the preset total loss function to obtain the trained discriminator, the method further includes: The ratio of training steps between the generator and the discriminator is obtained based on the loss values of the composite loss function, the spectral consistency loss function, and the loss value of the preset total loss function. The training times for the generator and the discriminator are adjusted according to the step ratio.
5. The method for locating forced oscillation sources in power systems based on hybrid CGAN according to claim 4, characterized in that, The training step ratio is expressed as follows: ; in, This indicates the number of training steps for the discriminator. This represents the number of training steps for the generator. This represents the loss value of the normalized composite loss function and the spectral consistency loss function. This represents the loss value of the preset total loss function after normalization.
6. The method for locating forced oscillation sources in power systems based on hybrid CGAN according to claim 5, characterized in that, The pre-constructed composite loss function is expressed as follows: ; in, This represents the pre-constructed composite loss function. This refers to the discriminator. This refers to the generator. The noise vector, This represents the actual data. For dynamic weighting coefficients, The total number of training rounds. The intermediate feature function of the discriminator. For fixed weights, This represents the mean vector of the actual data. This represents the mean vector of the data generated by FO. This represents the standard deviation vector of the actual data. This represents the standard deviation vector of the data generated by the FO.
7. The method for locating forced oscillation sources in power systems based on hybrid CGAN according to claim 6, characterized in that, The spectrum consistency loss function is expressed as follows: ; in, This represents the spectrum consistency loss function. This represents the number of FFT sampling points; This represents the amplitude spectrum of the real data after undergoing FFT. This indicates the amplitude spectrum of the FO-generated data after undergoing FFT.
8. A power system forced oscillation source location device based on hybrid CGAN, characterized in that, The device includes: An oscillation source localization module is used to input the data to be identified into a trained CNN classifier to obtain the oscillation source identification result. The CNN classifier is trained based on a hybrid dataset. The hybrid dataset is constructed from FO-generated data and real data generated by a trained hybrid CGAN. The FO-generated data consists of spurious forced oscillation data. Each set of real data includes active power, reactive power, voltage amplitude, and voltage phase angle. The hybrid CGAN is derived from CNN, BiLSTM, and an attention mechanism.
Citation Information
Cited By
Power system frequency safety assessment method and system based on improved GAN and Transformer
CN121353019A
