Power system transient power angle stability evaluation method based on improved Swinin-Transform model
Through the improved Swin-Transformer model and GAF algorithm, transient work angle timing data is converted into two-dimensional images, combining window shift and cross-window connection mechanisms, the traditional method has solved the lack of computing efficiency and accuracy, and achieved efficient and accurate work angle stability evaluation and key generator recognition of large-scale power systems.
Patent Information
- Application Number
- CN202510411530.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-08-12
AI Technical Summary
The existing transient stability evaluation methods for power systems have insufficient computational efficiency and accuracy, especially in large-scale power grids, which are difficult to achieve fast and accurate power angle stability evaluation. Traditional methods cannot effectively utilize the deep characteristics of high-dimensional timing data, and the computing resources are consumed too much.
The improved Swin-Transformer model is used, and the transient work angle timing data is mapped into two-dimensional images in combination with the GAF algorithm. By adjusting the position encoding and window size, combining window shifting and cross-window connection mechanisms, the image data set is constructed and offline training is performed, and finally used for real-time transient work angle stable state evaluation and key generator recognition.
While maintaining the spatial and temporal correlation, the accuracy and calculation efficiency of transient power angle stability evaluation are improved, and efficient and accurate power angle stability evaluation can be achieved in large-scale power systems. It has excellent real-time and robustness, and is suitable for real-time power system monitoring and early warning.
Smart Images

Figure CN120472182A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of power system transient power angle stability assessment, and specifically relates to a power system transient power angle stability assessment method based on an improved Swin-Transformer model. Background Art
[0002] Power system transient stability assessment is a key component in ensuring the safe operation of power grids. Its core task is to determine whether the generators can maintain synchronous operation and maintain stable power angle and frequency after a major disturbance. With the large-scale integration of new energy sources and the increasing complexity of power grid structures, transient stability issues are becoming more dynamic and multidimensional. The development of fast and accurate assessment methods is of great practical significance for preventing cascading failures and optimizing control strategies.
[0003] Traditional assessment methods are primarily categorized into two types: time-domain simulation and direct methods. The former simulates system dynamics through numerical integration, offering high accuracy but requiring significant computational time, making it difficult to meet the demands of online, real-time assessment. While the latter (such as the energy function method) offers computational efficiency advantages, its idealized mathematical model struggles to adapt to the volatile operating scenarios of modern power grids. With the large-scale deployment of wide-area measurement systems (WAMS) and synchronized phasor measurement units (PMUs), data-driven approaches have become a research hotspot. Traditional machine learning methods, such as support vector machines (SVMs), achieve rapid assessment by mapping historical data to steady-state states. However, their feature engineering relies heavily on empirical experience, limiting their ability to extract deep features from high-dimensional time series data. Deep learning, however, significantly improves model performance by automatically mining data features through multi-level nonlinear transformations. Convolutional neural networks (CNNs), with their local connectivity and weight sharing, excel in processing image-based time series data. However, their shift-invariance assumption can overlook the global spatiotemporal correlations within power system dynamics, and their local perception characteristics make it difficult to capture long-range dependencies. The Transformer architecture achieves global spatiotemporal dependency modeling through the self-attention mechanism, and shows significant advantages in the contextual association analysis of transient processes such as power angle swing and power angle drop. However, its computational complexity is proportional to the square of the sequence length (O(N 2 )) is positively correlated. When faced with long sequence data generated by the high sampling rate of PMU, computing resource consumption becomes a bottleneck in practical applications.
[0004] It is noteworthy that the efficient representation of power grid transient time series data remains a core challenge that urgently needs to be overcome. Traditional heat mapping methods convert one-dimensional time series signals into two-dimensional images through color gradient mapping. Although this method can intuitively display numerical fluctuation trends, the two-dimensional reconstruction process destroys the temporal continuity of the original data, leading to the decoupling of temporal dynamic features and spatial correlation information. This feature distortion phenomenon seriously restricts the accuracy of subsequent models in extracting key transient features such as power angle instability and frequency oscillation, becoming a key factor restricting the engineering application of data-driven methods. Summary of the Invention
[0005] The purpose of this invention is to address the problem that existing intelligent monitoring and control systems cannot reasonably and efficiently utilize resources. A method for evaluating the transient power angle stability of a power system based on an improved Swin-Transformer model is proposed, which includes:
[0006] S1. Obtain the initial data set and perform normalization processing, combine the GAF algorithm to generate images and construct an image data set;
[0007] S2. Labeling images based on the image dataset and dividing the dataset into a stable dataset and an unstable dataset, and dividing the dataset into a training set, a validation set, and a test set according to a certain ratio;
[0008] S3. By adjusting the position encoding, window size and stride, and combining the window shift and cross-window connection mechanism to extract features, an improved Swin-Transformer model is constructed and trained offline to obtain the optimal improved Swin-Transformer model for offline training.
[0009] S4. Based on the offline trained optimal improved Swin-Transfomer model, the real-time stability state of transient power angle is evaluated, and the key unstable generators are identified.
[0010] Preferably, the S1 specifically includes:
[0011] S11. Obtain historical online data through online recording of synchronized phasor measurement devices, then perform simulation calculations based on power system simulation software, obtain power angle data of simulation nodes and construct an initial data set by setting different operating modes and fault modes;
[0012] S12. Based on the initial data set, normalize the power angle time series of each node;
[0013] S13, converting the normalized power angle time series into polar coordinates;
[0014] S14, using the GAF algorithm to convert the polar coordinates into a two-dimensional image and construct a two-dimensional image set;
[0015] S15. Based on the two-dimensional image set, vertically splice the two-dimensional images to construct an image data set.
[0016] Preferably, the S2 specifically includes: dividing the image data into a stable data set and an unstable data set according to a TSI index.
[0017] Preferably, the TSI index is specifically shown in the following formula:
[0018]
[0019] Where: Δδ max is the maximum relative power angle difference between any two generators after the disturbance. Transient power angle stability assessment is a binary classification problem. It can be labeled based on the TSI in the above equation to determine system stability. That is, when TSI > 0, the system transient power angle is stable, and the sample label is 0; when TSI < 0, the system transient power angle is unstable, and the sample label is 1.
[0020] Preferably, in S3, adjusting the position coding, window size and stride specifically includes: based on the image data set, obtaining a new position coding through interpolation and adjusting it through bilinear interpolation; adjusting the attention feature extraction window size of the Swin-Transformer model based on the principle of consistency between the local window of the input image and the local feature extraction window of the model; at the same time, the model feature extraction stride is adjusted according to the size of the spliced image, and offline training is performed with the training set as input, and the test set and the test set are used for verification to obtain the improved Swin-Transfomer model that is optimal for offline training.
[0021] Preferably, the combined window shifting and cross-window connection mechanism specifically includes:
[0022] For adjacent windows, the original window boundaries are broken by window shifting;
[0023] For non-adjacent windows, a cross-window connection mechanism is adopted by calculating the attention scores between windows and performing weighted aggregation.
[0024] Preferably, the S4 specifically includes:
[0025] S41, collecting power grid dynamic data in real time based on a synchronized phasor measurement device, and constructing an initial data set using the method of S11 to obtain an image data set;
[0026] S42: Input the image data set into the optimally trained Swin-Transformer model to perform real-time transient power angle stability assessment, and output a determination result.
[0027] Preferably, the determination result includes stability or instability, wherein, if the determination result is instability, the generator instability impact factor is calculated through the spatiotemporal attention fusion mechanism, and then the key generator is located through the key generator determination criterion.
[0028] Preferably, the power angle instability influencing factor is specifically expressed as follows:
[0029]
[0030] in, is the attention weight of the h-th attention head in layer L to generator i at time t; is the temporal average attention strength of generator i on the hth attention head; ω h represents the learnable attention head fusion weight; γh∈R is the trainable scalar parameter corresponding to the h-th attention head; H is the number of attention heads, and T is the length of the transient process sampling time window.
[0031] Preferably, the key generator determination criterion is specifically expressed as:
[0032]
[0033] Among them, λ is the dynamic threshold parameter, taking λ = 1.28, σ and μ β are the standard deviation and mean of the generator power angle influence factor βi, N is the total number of generators, and i represents the i-th generator.
[0034] Beneficial effects of the present invention:
[0035] 1. This solution maps transient power angle time series data into a two-dimensional image using the GAF algorithm, enhancing the separability of sample features while maintaining the spatiotemporal correlation of the original sequence. Subsequently, based on the shifted window attention and cross-window attention coordination mechanisms of the improved Swin Transformer model, the computational complexity of self-attention is reduced from quadratic to linear, while achieving precise capture of local transient features and modeling of global dynamic associations. This method effectively addresses the common issues of traditional heat map time series information loss, CNN local perception bias, and Transformer computational resource overload, improving the accuracy of transient power angle stability assessment in high-noise and data-missing scenarios.
[0036] 2. This solution uses cross-window attention to enable the model to directly capture long-range global dependencies, avoiding the problem of information isolation in local windows and enhancing the model's understanding of global structure. However, this approach comes with high computational complexity. Combining the window-shift attention mechanism with the cross-window attention mechanism, using the window-shift attention mechanism for adjacent windows and the cross-window attention mechanism for non-adjacent windows, offers the following advantages: efficient utilization of local and global information, improving model expressiveness; balancing computational complexity and performance, making it suitable for large-scale tasks; and reducing information redundancy and improving computational efficiency.
[0037] 3. This solution constructs an initial sample set by collecting historical online data and simulation data of the power system. The Gram angle field and vertical image stitching method are used to convert multivariate time series data into a two-dimensional integrated image that retains time features. Then, an unstable or stable label is generated for each sample image, and the training set, validation set and test set are randomly divided according to a certain proportion; an improved Swin-Transformer model is built to extract multi-scale spatiotemporal features through shift window attention and cross-window attention mechanisms. The optimal transient power angle stability assessment model is obtained through offline training. The optimal model is deployed in the online assessment system to monitor transient power angle data in real time and perform stability assessment. When the power system is unstable, the model can also locate key generators; compared with traditional methods, the present invention can achieve efficient and accurate power angle stability assessment in large-scale power systems, has excellent real-time and robustness, and is suitable for real-time power system monitoring and early warning. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 Schematic diagram of the parallel multi-dimensional attention mechanism of the present invention;
[0039] Figure 2 Schematic diagram of the MBI-IPMDA-PBISA model structure of the present invention;
[0040] Figure 3 This is a schematic diagram of a curve showing changes in data containing missing values according to the present invention;
[0041] Figure 4 This is a structural diagram of the improved Swin-Transformer model of the present invention;
[0042] Figure 5 This is a heat map of the influencing factors of the generator power angle instability under different power angle instability scenarios of the present invention. DETAILED DESCRIPTION
[0043] Example 1: Figure 1 As shown in FIG, the transient power angle stability assessment method of the power system based on the improved Swin-Transformer model includes:
[0044] Step 1: This step is a GAF image conversion method that considers power system node power angle data. By normalizing the power system node power angle time series and converting it into polar coordinates, the GAF algorithm is used to generate images, thereby extracting the spatiotemporal features between nodes. Subsequently, by splicing GAF images of multiple node power angles, an integrated image dataset is formed, which helps improve feature expression capabilities. Finally, each sample image is labeled as unstable or stable and then randomly divided into training and test sets according to a certain ratio.
[0045] Step 1-1: Obtain the initial data set. Obtain historical online data through PMU online recording. Then, perform simulation calculations using power system simulation software such as PSASP. By setting different operating modes and fault modes, obtain the power angle data of the simulation nodes to form the initial data set.
[0046] Step 1-2: Transient power angle time series δ i (t) is normalized. Assume that the power angle time series of the i-th node in the power system is where δ i (t) represents the power angle value of the i-th node at time t, and T is the length of the time series. For each node’s power angle time series δ i Normalized, normalized time series for:
[0047]
[0048] Among them, min(δ i ) and max(δ i ) represent the power angle time series δ i The minimum and maximum values of .
[0049] Step 1-3: Convert the normalized power angle time series Convert to polar coordinates. In this step, the amplitude of the normalized power angle signal is encoded as the angle cosine, and the time axis is encoded as the radius, obtaining the radius and angle of each data point.
[0050] The time series Mapped to radius r i (t), that is:
[0051]
[0052] Where t is the time point and T is the total length of the time series.
[0053] Encode the magnitude as an angle θ i (t), that is:
[0054]
[0055] Power angle data points is converted into corresponding polar coordinate data (ρ i (t),θ i (t)).
[0056] Step 1-4: Use the GAF algorithm to transform the polar coordinate data (ρ i (t),θ i (t)) is converted into a two-dimensional image. In GAF, the value of each pixel of the image is calculated by the following formula:
[0057] Gij=cos(θi(t)+θj(t)),for i,j,...,T(4)
[0058] Among them, Gij represents the cosine value of the angle difference between the i-th and j-th moments, which is an element in the GAF image.
[0059] Step 1-5: Generate spliced image data. For multiple nodes i = 1, 2, ..., N, generate a GAF image Gi for each node. Finally, vertically splice the GAF images of all nodes to form an integrated image:
[0060]
[0061] Among them, G integrated To integrate the images, the splicing method is to arrange the images in rows. Each Gi is the GAF image of the i-th node.
[0062] Steps 1-6: Generate an unstable or stable label for each sample image using the TSI indicator, and divide the image into training, validation, and test sets according to a certain ratio. The TSI indicator is:
[0063]
[0064] Where: Δδ max is the maximum relative power angle difference between any two generators after the disturbance. Transient power angle stability assessment is a binary classification problem. It can be labeled based on the TSI in the above equation to determine system stability. That is, when TSI > 0, the system transient power angle is stable, and the sample label is 0; when TSI < 0, the system transient power angle is unstable, and the sample label is 1.
[0065] Step 2: By adjusting position encoding, window size and stride, window shift and cross-window connection, and multi-scale feature extraction, the feature extraction capability of the spliced image can be effectively improved.
[0066] Step 2-1: Adjust the model's position encoding. Stitching images requires adjusting the position encoding to accommodate the size of the resulting image. The position information of the original image is typically represented by a two-dimensional position encoding matrix. In the stitched image, the position encoding is adjusted through interpolation to ensure that each position in the stitched image correctly corresponds to the spatial information of the original image.
[0067] Assume that the original image has a height of Horig and a width of Worig, and the stitched image has a height of Hnew and a width of Wnew. Adjustment is performed through bilinear interpolation (Interp):
[0068] PE new =Interp(PE orig ,H new ,W new ) (7)
[0069] The original position code is Where d is the dimension of the position code, after interpolation, the new position code This adjustment method ensures that the stitched image can retain the position information of the original image.
[0070] Step 2-2: Adjust the size and stride of the attention window. In the Swin-Transformer, the image is divided into multiple windows for local self-attention calculation. To adapt to the stitched image, the size and stride of the attention window need to be adjusted.
[0071] Window resizing:
[0072] Assuming the original window size is Wsize,orig, the size of the stitched image window Wsize,new should be consistent with the original window size (the window before stitching):
[0073]
[0074] Among them, H orig is the original image height, iH is the height of the stitched image, and round means rounding.
[0075] Stride adjustment:
[0076] The original stride Sorig should be adjusted according to the size of the stitched image:
[0077]
[0078] Among them, S orig is the original stride, S new is the adjusted stride, H originOriginal image height, H new The height of the image after vertical stitching. By adjusting the stride, the sliding window can adapt to the new image size and avoid information loss due to an inappropriate stride.
[0079] Step 2-3: Fusion of Window Shift and Cross-Window Connection Mechanism: In order to efficiently utilize local and global information and balance computational complexity and performance, the present invention combines window shift and cross-window connection mechanisms.
[0080] Window shifting: Window shifting breaks the original window boundaries between adjacent windows, allowing adjacent windows to share information. Assuming the window shift step is ΔH and ΔW, the shifted window is expressed as:
[0081] W shifted =Shift(W orig ,ΔH,ΔW)(10)
[0082] Among them, W orig is the original window, Shift represents the serial port shift operation, ΔH and ΔW are the shift steps in height and width respectively, W shifted is the shifted window.
[0083] When performing self-attention calculation within the shifted window, adjacent windows can indirectly exchange information to capture the details and context of the local area, which is computationally efficient because attention is still calculated based on the local window.
[0084] Cross-window connection: For two non-adjacent windows w i and w j , adopting a cross-window connection mechanism, by calculating the attention scores between windows and performing weighted aggregation, to promote information interaction:
[0085]
[0086] Among them, Aij represents the attention score between window wi and window wj, Q i and K j are the query (Query, Q) and key (Key, K) matrices of window wi and window wj respectively.
[0087]
[0088] Among them, Oi is the output of window Wi, and Vj is the value of window Wj (Value, V).
[0089] Through cross-window attention, the model can directly capture long-range global dependencies, avoiding the problem of information isolation in local windows and enhancing the model's understanding of global structure. However, this comes at the cost of high computational complexity. Combining the window-shift attention mechanism with the cross-window attention mechanism—using the window-shift attention mechanism for adjacent windows and the cross-window attention mechanism for non-adjacent windows—has the following advantages: efficient use of local and global information improves model expressiveness; a balanced computational complexity and performance makes it suitable for large-scale tasks; and reduced information redundancy improves computational efficiency.
[0090] Step 3: Based on the transient power angle stability assessment GAF-SwT model obtained in step 2, perform offline training, save the optimal model and apply it to the online transient power angle real-time stability state assessment, and identify the key unstable generators. The specific steps are as follows:
[0091] Step 3-1: Model offline training and optimization.
[0092] During model training, a K=5-fold cross-validation strategy was used to divide the original dataset, allocating the data to the training set, validation set, and test set in a ratio of 7:2:1 to ensure the rationality of data utilization and the objectivity of the evaluation. In the specific process, the dataset was divided into five subsets for each round of training, one of which was selected as the validation set, and the remaining four subsets were used for model training: During the training phase, the loss function value was calculated through forward propagation, and the network weights were updated using the backpropagation algorithm to optimize the model parameters; during the validation phase, the retained validation subset was used to evaluate model performance, and core indicators such as accuracy and F1 score were monitored in real time, and the training strategy was dynamically adjusted. By cyclically switching the roles of subsets, this cross-validation mechanism effectively alleviated the overfitting problem and significantly improved the model's generalization ability for unknown data, laying the foundation for stable performance on subsequent test sets.
[0093] During the model optimization process, AdamW optimizer was used to balance the parameter update efficiency and overfitting suppression, where the initial learning rate was set to 3×10 -4 , adaptive learning rate and weight decay coefficient 0.05; at the same time, the learning rate is dynamically adjusted through the cosine annealing learning rate scheduler, and its formula is:
[0094]
[0095] Among them, η max and η min are the maximum and minimum values of the learning rate, T cur and T maxRepresents the current number of iterations and the total number of iterations. This strategy takes into account the needs of rapid convergence in the early stages of training and fine-tuning in the later stages. In terms of hyperparameter settings, the batch size is set to 64 based on the GPU memory limit. In addition, a dual regularization strategy of random depth (with a probability of 0.2) and label smoothing (with a probability of 0.1) is introduced to further suppress overfitting and improve the model's robustness to noisy data. To ensure model performance, early stopping is adopted: if the validation set loss does not decrease for 5 consecutive epochs, training is terminated to avoid overfitting. At the same time, validation set indicators are continuously tracked, and only the model weights with the best performance are saved to ensure the stability and generalization ability of the final deployed model.
[0096] Training was performed on a computer equipped with a 2.9GHz Intel Core i5-9400F CPU and 32GB of RAM. An NVIDIA RTX-2080 GPU was configured to support efficient deep learning in Python. A full training cycle of approximately 100-200 epochs took 2.5 hours, and the final model achieved 99.23% accuracy on the test set, a 4.1% improvement over the baseline model.
[0097] Step 3-2: Online transient process dynamic evaluation.
[0098] Grid dynamic data is collected in real time using synchronized phasor measurement units (PMUs). After standardized preprocessing according to the process described in Step 1, it is input into the iteratively optimized GAF-SwT assessment model. Using its unique hierarchical feature extraction architecture, the model determines transient stability within 20 milliseconds and outputs a binary classification result: "stable / instable."
[0099] Step 3-2: Positioning of critical generators under unstable conditions.
[0100] When the model determines that the system is in an unstable state, the feature tracing module based on the attention mechanism is automatically triggered. Assume that the attention weight matrix output by the last layer of the Swin Transformer network is A(L)∈RN×H×T, where N is the total number of generators, H is the number of attention heads, and T is the length of the transient process sampling time window. The influence factor of power angle instability is calculated through the spatiotemporal attention fusion mechanism:
[0101]
[0102] in, The attention weight of the h-th attention head in layer L on generator i at time t.
[0103] The temporal average attention strength of generator i on the h-th attention head.
[0104] ω h : represents the learnable attention head fusion weight.
[0105] γh∈R: The trainable scalar parameter corresponding to the hth attention head. The normalized power angle instability factor of generator i satisfies
[0106] The criteria for determining key generators are as follows:
[0107]
[0108] The dynamic threshold parameter is set to λ = 1.28, which corresponds to a 90% confidence interval, and the noise interference is suppressed by the standard deviation weighting mechanism, σ is the standard deviation, μ β By screening the dynamic threshold criterion, the set C of key source generators that dominate system instability is obtained, among which the generators with higher βi values contribute more to transient instability.
[0109] Example 2: This example verifies the model's effectiveness in a 36-node standard test system and an IEEE 2383-node real-world system at a research institute. The CEPRI-36 system consists of 36 busbars, 8 generators (G1-G8), 10 transformers, 24 transmission lines, and 6 load nodes; the IEEE-2383 system consists of 2383 busbars, 327 generators, 2896 transmission lines, and 1561 load nodes. Time-domain simulations were conducted using PSASP7 software. Load levels were adjusted incrementally from 0% to 120% in 2% steps based on the initial value, while generator output was dynamically adjusted to maintain system power balance. The fault setting was: a three-phase ground fault was applied at 1 second, with fault points located at the line headend and at 25%, 50%, and 75% of the line headend. The duration varied in 0.05-second steps from [0.05 to 0.25] seconds, and the total simulation duration was set to 10 seconds. After iterating through parameter combinations, the CEPRI-36 system generated 10,315 samples, and the IEEE-2383 system obtained 24,840 samples. The experimental environment used the PyTorch deep learning framework (Python 3.8) and the hardware configuration consisted of an Intel Core i7-10750H processor (2.6GHz), 16GB of RAM, and an NVIDIA RTX-2060 graphics card.
[0110] When a fault occurs in the power system, the PMU records and transmits data online. After image processing, it is fed into the optimal model at the control center. Based on the set parameters, the transient stability of the power system is continuously assessed, and operators implement emergency control measures promptly based on the assessment results. This paper measures the model's performance using the following four indicators, as shown in the following formula.
[0111]
[0112] r ecall =TN / (TN+FP) (19)
[0113] p recision =TN / (TN+FN) (20)
[0114] Among them, TP and FN are the number of samples evaluated as stable and unstable respectively, and FP and TN are the number of samples evaluated as stable and unstable respectively. ecall and precision p recision Represents the proportion of correctly predicted unstable samples in actual unstable samples and predicted unstable samples; A c Reflects the overall accuracy of the evaluation model; F1 is the harmonic mean of recall and precision.
[0115] To validate the advantages of the proposed GAF-SwT model, we divided the sample into training, validation, and test sets at an 8:2 ratio. We then compared the performance of commonly used data-driven power system transient stability assessment models, including SVM, CNN, ResNet, and ViT. The test results for the different models on the two systems are shown in Tables 1 and 2.
[0116] Table 1 Comparison of model performance in a 36-node system
[0117]
[0118]
[0119] As shown in Figure 1, the experimental data shows that the GAF-SwT model performs best in comprehensive evaluation indicators. Its 99.23% accuracy and 98.57% F1 score are an average increase of 1.7-3.2 percentage points over the baseline model, demonstrating significant classification performance advantages and effectively supporting online decision-making of emergency control strategies after power system failures.
[0120] Table 2 Comparison of model performance in 2383-node system
[0121]
[0122] As shown in Table 2, when the system scale is expanded to 2383 nodes, each model experiences varying degrees of performance degradation, but GAF-SwT still maintains the best performance level, with an accuracy of 98.88% and an F1 score of 98.19%, verifying the model's strong adaptability to large-scale complex systems.
[0123] Figure 5A heat map of the influencing factors of generator power angle instability under different power angle instability scenarios is presented. The larger the impact factor value corresponding to a node in the map, the brighter the corresponding heat map area, indicating a higher risk of power angle collapse during system instability. Therefore, emergency power angle control measures should be prioritized in that area.
[0124] Table 3 Performance of all test systems under PMU data loss and noise
[0125]
[0126]
[0127] As shown in Table 3, although the evaluation metrics show systematic degradation with increasing noise intensity, the proposed method maintains over 93% accuracy under extreme noise conditions. Furthermore, even at a 15% loss rate, the proposed method maintains an F1 score of 93.24%, demonstrating its fault tolerance. This feature significantly enhances the robustness of power system transient stability assessment in complex electromagnetic environments, effectively addressing the dual interference of PMU measurement noise and communication link data loss.
Claims
1. A method for evaluating the transient power angle stability of a power system based on an improved Swin-Transformer model, characterized in that: The steps include: S1. Obtain the initial data set and perform normalization processing, combine the GAF algorithm to generate images and construct an image data set; S2. Labeling images based on the image dataset and dividing the dataset into a stable dataset and an unstable dataset, and dividing the dataset into a training set, a validation set, and a test set according to a certain ratio; S3. By adjusting the position encoding, window size and stride, and combining the window shift and cross-window connection mechanism to extract features, an improved Swin-Transformer model is constructed and trained offline to obtain the optimal improved Swin-Transformer model for offline training. S4. Based on the offline trained optimal improved Swin-Transfomer model, the real-time stability state of transient power angle is evaluated, and the key unstable generators are identified.
2. The method for evaluating transient power angle stability of a power system based on an improved Swin-Transformer model according to claim 1, characterized in that: Said S1 specifically includes: S11. Obtain historical online data through online recording of a synchronized phasor measurement device, and then perform simulation calculations based on power system simulation software. By setting different operating modes and fault modes, obtain power angle data of the simulated generator and construct an initial data set; S12. Based on the initial data set, normalize the power angle time series of each node; S13, converting the normalized power angle time series into polar coordinates; S14, using the GAF algorithm to convert the polar coordinates into a two-dimensional image and construct a two-dimensional image set; S15. Based on the two-dimensional image set, vertically splice the two-dimensional images to construct an image data set.
3. The method for evaluating transient power angle stability of a power system based on an improved Swin-Transformer model according to claim 1, characterized in that: The S2 specifically includes: judging whether the image is stable by the TSI indicator, generating an unstable or stable label for each image, and randomly dividing the processed image data into a training set, a validation set, and a test set according to a certain ratio.
4. The method for evaluating transient power angle stability of a power system based on an improved Swin-Transformer model according to claim 3 is characterized in that: The TSI index is specifically shown in the following formula: Among them, Δδ max is the maximum relative power angle difference between any two generators after the disturbance.
5. The method for evaluating transient power angle stability of a power system based on an improved Swin-Transformer model according to claim 1, characterized in that: In the S3, adjusting the position coding, window size and stride specifically includes: based on the image data set, obtaining a new position coding through interpolation and adjusting it through bilinear interpolation; adjusting the attention feature extraction window size of the Swin-Transformer model based on the principle that the size of the local window of the input image and the local feature extraction window of the model are consistent; at the same time, the model feature extraction stride is adjusted according to the size of the spliced image, and offline training is performed with the training set as input, and the test set and the test set are used for verification, so as to obtain the improved Swin-Transfomer model that is optimal for offline training.
6. The method for evaluating transient power angle stability of a power system based on an improved Swin-Transformer model according to claim 5, characterized in that: The combined window shifting and cross-window connection mechanism specifically includes: For adjacent windows, the original window boundaries are broken by window shifting; For non-adjacent windows, a cross-window connection mechanism is adopted by calculating the attention scores between windows and performing weighted aggregation.
7. The method for evaluating transient power angle stability of a power system based on an improved Swin-Transformer model according to claim 1, characterized in that: The S4 specifically includes: S41, collecting power grid dynamic data in real time based on a synchronized phasor measurement device, and constructing an initial data set using the method of S11 to obtain an image data set; S42: Input the image data set into the offline optimally trained Swin-Transformer model to perform real-time transient power angle stability assessment, and output a determination result.
8. The method for evaluating transient power angle stability of a power system based on an improved Swin-Transformer model according to claim 7, characterized in that: The determination result includes stability or instability. If the determination result is instability, the generator instability impact factor is calculated through the spatiotemporal attention fusion mechanism, and then the key generator is located through the key generator determination criterion.
9. The method for evaluating transient power angle stability of a power system based on an improved Swin-Transformer model according to claim 8, characterized in that: The power angle instability influencing factor is specifically expressed as follows: in, is the attention weight of the h-th attention head in layer L to generator i at time t; is the temporal average attention strength of generator i on the hth attention head; ω h represents the learnable attention head fusion weight; γh∈R is the trainable scalar parameter corresponding to the h-th attention head; H is the number of attention heads, and T is the length of the transient process sampling time window.
10. The method for evaluating transient power angle stability of a power system based on an improved Swin-Transformer model according to claim 9, characterized in that: The key generator determination criteria are specifically expressed as follows: Among them, λ is the dynamic threshold parameter, taking λ = 1.28, σ and μ β Generator power angle influence factor β i The standard deviation and mean of , N is the total number of generators, and i represents the i-th generator.
Citation Information
Patent Citations
Power system transient stability evaluation method and system based on imaging data driving
CN115311509A
Swin-Transform-based numerical control turning tool wear state classification method and device under variable working conditions
CN117972476A
Power transmission line fault transient waveform identification method, storage medium and equipment
CN118864928A
Power system transient voltage stability assessment method based on gain-swin transformer
CN120782296A