A method and device for determining transient stability of a power system
Patent Information
- Application Number
- CN202611416886.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-14
- Publication Date
- 2026-10-16
AI Technical Summary
[0012]为了解决现有技术中的人工判稳方法效率低下,难以应对批量分析需求,主观性强,判定标准难以统一,以及规则固化困难,难以适应定制化需求;现有的自动化判稳方法采用数值矩阵灰度编码并依赖特征降维,导致图像尺寸随电网规模变化、曲线形态信息丢失;针对单一判稳物理量建模而无法实现发电机功角、母线电压、系统频率三类曲线全覆盖;固定冻结主干网络导致跨区域适配性能恢复有限;判决门限固定而无法定量约束漏判率;输出仅为二分类标签而无法指出失稳时段;以及未统一输入时间基准与图像生成过程而无法跨计算平台泛化的技术问题,本发明提供一种电力系统暂态稳定性判定方法及装置
[0018]表1
Smart Images

Figure CN122926154A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system planning and operation technology, and more specifically, to a method and apparatus for determining the transient stability of a power system. Background Technology
[0002] In the field of power system planning and operation, time-domain simulation is a core method for evaluating the transient stability (including power angle stability, voltage stability, and frequency stability) of a system after experiencing large disturbances (such as short-circuit faults, large-capacity unit tripping, or line interruptions). By solving the system's differential-algebraic equations through numerical integration, time-domain simulation can generate dynamic response curves for key electrical quantities such as generator power angle, bus voltage, and system frequency after the fault is cleared. Manual stability assessment, as the mainstream method in current engineering practice, relies on engineers observing simulation curves and making stability judgments based on empirical rules. For example: Power angle stability determination: Check whether the power angle difference between each generator and the rotor continues to increase and exceeds the critical threshold (e.g., 500°). Voltage stability assessment: Monitor whether the voltage of key busbars has recovered to a safe level (e.g., above 0.8 pu); Frequency stability determination: Verify whether the system frequency fluctuates within a reasonable range (e.g., 49.5-50.5 Hz).
[0003] This method is widely used in the verification of anticipated accident sets during the power grid planning phase, the calculation of safety boundaries in the formulation of operating modes, and accident inversion analysis. Especially in complex scenarios such as AC / DC hybrid power grids and high-proportion renewable energy integration, time-domain simulation remains an indispensable analytical tool due to its high model accuracy and good physical process reproduction.
[0004] Although time-domain simulation provides detailed dynamic process data, traditional manual stability assessment methods have significant drawbacks, mainly manifested in low efficiency, difficulty in meeting the needs of batch analysis, strong subjectivity, difficulty in unifying judgment criteria, and difficulty in solidifying rules, making it difficult to adapt to customized needs.
[0005] To overcome the bottleneck of manual stability assessment, existing technologies have successively proposed automated methods based on traditional machine learning / rule engines, methods that use convolutional neural networks to evaluate transient stability after visualizing time-domain data, and methods that utilize transfer learning to improve the adaptive ability of the evaluation model. However, the above-mentioned existing technologies still have the following technical problems: Firstly, existing image-based solutions arrange multidimensional electrical features into a two-dimensional numerical matrix along both the "time" and "feature" directions. Then, based on the magnitude of the matrix elements, corresponding grayscale values are assigned to each element to form an image. Essentially, this is a visual encoding of the numerical matrix, not a drawing of the curve trajectory itself. The dimensions of such images are equal to the product of the feature dimension and the number of time nodes, and they increase dramatically with the number of generators, buses, and lines in the power grid. Once the power grid scale, measurement configuration, or sampling window changes, the image size changes accordingly, rendering the trained model unusable. To control the input dimension, such solutions must also introduce feature dimensionality reduction steps such as two-dimensional principal component analysis. However, this dimensionality reduction process loses crucial morphological information for identifying complex instability modes, such as the curve's oscillation envelope, over-limit duration, and multiple swing patterns. Furthermore, the projection matrix itself depends on the statistical characteristics of the training sample set, requiring recalculation when used across different power grids.
[0006] Secondly, existing image-based and transfer learning schemes both model a single stability-determining physical quantity (usually the generator power angle): either by synthesizing multidimensional features containing various electrical quantities into a single image and then training a single model, or by manually defining geometric features such as centroid, dispersion, upper and lower envelopes, and curvature from the power angle trajectory cluster after fault clearance to form a feature matrix. This type of input representation is strongly coupled to the dimensions and physical meaning of the specific stability-determining physical quantity and cannot be transferred to bus voltage and system frequency. Therefore, feature extraction methods must be designed separately for each type of stability-determining physical quantity, and models must be trained separately, significantly increasing the development cost, deployment resource consumption, and subsequent maintenance costs.
[0007] Third, existing transfer learning schemes, when adapting to new scenarios, freeze all convolutional, pooling, and fully connected layer parameters of the pre-trained model, only randomly initializing and retraining the classification layer. The feature extraction parameters of the backbone network cannot be adjusted for the data distribution in the new scenario. When the new scenario differs significantly from the source scenario in terms of operating mode, topology, or the region to which the power grid belongs, the recovery of model performance is limited.
[0008] Fourth, when dealing with an imbalance between the number of stable and unstable samples, the existing solution only reduces the tendency for unstable samples to be misclassified as stable samples by introducing a fixed class weight coefficient in the cross-entropy loss function. The model output layer still gives the judgment result according to the class with the highest probability. The judgment threshold remains unchanged, which cannot quantitatively constrain the false alarm rate in accordance with the safety requirement of "better to make a false alarm than a false alarm" in the power system. It also cannot distinguish and prompt critical samples near the judgment boundary.
[0009] Fifth, the output of the existing solution is only a binary label of "stable / unstable", which cannot indicate the time period when the instability process occurs. When reviewing the data, the scheduling and analysis personnel still need to review and check the original curves one by one.
[0010] Sixth, the time-domain simulation computing platforms (such as PSASP, PSD-BPA, ADPSS, MATLAB, etc.) used by different power grids and dispatching agencies are different in terms of simulation step size and output sampling frequency. Existing solutions have not made a unified agreement on the time reference of input data and the image generation process. The same physical process will generate input data with inconsistent time reference and form on different computing platforms, resulting in a significant performance drop when the model is used across computing platforms.
[0011] In summary, existing automated stability assessment methods cannot solve the technical problems of fully covering the three types of curves: generator power angle, bus voltage, and system frequency, as well as generalization across regional power grids and computing platforms. Summary of the Invention
[0012] To address the shortcomings of existing manual stability assessment methods, such as low efficiency, inability to handle batch analysis needs, strong subjectivity, difficulty in unifying judgment criteria, and difficulty in solidifying rules to adapt to customized needs; existing automated stability assessment methods employ numerical matrix grayscale encoding and rely on feature dimensionality reduction, resulting in image size variations with power grid scale and loss of curve shape information; modeling only a single stability assessment physical quantity, failing to achieve full coverage of three types of curves: generator power angle, bus voltage, and system frequency; fixed freezing of the backbone network, leading to limited cross-regional adaptability recovery; fixed decision thresholds, failing to quantitatively constrain the missed judgment rate; outputting only binary classification labels, failing to indicate the instability period; and lacking a unified input time base and image generation process, thus failing to generalize across computing platforms, this invention provides a method and apparatus for determining the transient stability of power systems.
[0013] According to one aspect of the present invention, a method for determining the transient stability of a power system is provided, comprising: Historical time-domain data of each stability-determining physical quantity in the power system is acquired, and the historical time-domain data of each stability-determining physical quantity is converted into two-dimensional historical image data in RGB format according to a unified curve image conversion protocol. The stability-determining physical quantities include generator power angle, bus voltage and system frequency. Based on the historical image data of each stable physical quantity, the initial stability model established based on the pre-trained ConvNeXt deep learning model is trained, verified, and tested to generate the optimal stability model for each stable physical quantity. The initial stability model for each stable physical quantity reuses the backbone network and pre-trained weights of the same pre-trained ConvNeXt deep learning model. Acquire real-time time-domain data of at least one stability-determining physical quantity in the power system, and convert the real-time time-domain data into two-dimensional real-time image data in RGB format according to the unified curve image conversion protocol. The real-time image data is used as the input of the optimal stability model for the corresponding stability-determining physical quantity. The stability label of each stability-determining physical quantity is output, and the determination result of the transient stability of the power system is output based on the stability label. The stability label is used to indicate whether the corresponding stability-determining physical quantity in the power system is stable, and the determination result is used to indicate whether the power system is stable.
[0014] According to another aspect of the present invention, the present invention provides a power system transient stability determination device, the device comprising: The model building module is used to acquire historical time-domain data of each stability-determining physical quantity in the power system, convert the historical time-domain data into two-dimensional historical image data in RGB format according to a unified curve imagery protocol, and train, verify, and test the initial stability-determining model based on the pre-trained ConvNeXt deep learning model based on the historical image data of each stability-determining physical quantity, and generate the optimal stability-determining model for each stability-determining physical quantity. The stability-determining physical quantities include generator power angle, bus voltage, and system frequency. The initial stability-determining model for each stability-determining physical quantity reuses the backbone network and pre-trained weights of the same pre-trained ConvNeXt deep learning model. The data acquisition module is used to acquire real-time time-domain data of at least one stability-determining physical quantity in the power system. The data processing module is used to generate two-dimensional real-time image data in RGB format based on the real-time time domain data according to the unified curve imaging protocol. The inference output module is used to take the real-time image data as input to the optimal stability model of the corresponding stability-determining physical quantity, output the stability label of each stability-determining physical quantity, and output the determination result of the transient stability of the power system based on the stability label. The stability label is used to indicate whether the corresponding stability-determining physical quantity in the power system is stable, and the determination result is used to indicate whether the power system is stable.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, the storage medium storing a computer program that, when executed by a processor, implements the methods described in any of the above aspects of the present invention.
[0016] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the method described in any of the preceding aspects of the present invention.
[0017] The power system transient stability determination method and apparatus of this invention uses a unified curve visualization protocol to plot the time-domain data of three types of stability-determining physical quantities into RGB curve trajectory images of uniform size that are independent of the power grid scale. This allows the three types of physical quantities to fall into the same representation space and reuse the same pre-trained backbone network. Through two-stage fine-tuning with phased unfreezing, decision threshold tuning oriented towards the missed detection rate constraint, and time inverse mapping of activation-like heatmaps, it further realizes cross-regional power grid adaptation, quantitative control of instability missed detection rate, and location output of instability periods. The technical effects of the method and apparatus compared with the prior art are shown in Table 1.
[0018] Table 1
[0019] As shown in Table 1, this invention addresses the shortcomings of existing technologies, such as low efficiency and strong subjectivity in manual stability assessment, and the use of numerical matrix grayscale encoding and feature reduction in existing automated stability assessment methods, which model single stability assessment physical quantities, freeze the backbone network, fix the decision threshold, provide only single output information, and lack a unified input time reference. This invention achieves full coverage of three types of curves—generator power angle, bus voltage, and system frequency—without feature reduction, and consistent assessment across regional power grids and computing platforms. This effectively improves the stability assessment speed and the recognition rate of complex instability modes, quantitatively controls the instability false negative rate, and reduces model development costs. It should be noted that the comparative data in Table 1 and this specification are obtained from self-comparison experiments under the same dataset, backbone network, training hyperparameters, and random seed. Due to differences in example systems, sample sizes, and instability criteria, the absolute values of different literature are not directly comparable. Attached Figure Description
[0020] Exemplary embodiments of the present invention can be more fully understood by referring to the following figures: Figure 1 This is a flowchart of a power system transient stability determination method according to a preferred embodiment of the present invention; Figure 2 This is a schematic diagram of the power system transient stability determination device according to a preferred embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of an electronic device according to a preferred embodiment of the present invention. Detailed Implementation
[0021] Exemplary embodiments of the invention will now be described with reference to the accompanying drawings. However, the invention may be embodied in many different forms and is not limited to the embodiments described herein. These embodiments are provided to fully and completely disclose the invention and to fully convey its scope to those skilled in the art. The terminology used in the exemplary embodiments illustrated in the drawings is not intended to limit the invention. In the drawings, the same units / elements are referred to by the same reference numerals.
[0022] Unless otherwise stated, the terms used herein (including technical terms) have their common meaning as understood by one of ordinary skill in the art. Furthermore, it is understood that terms defined in commonly used dictionaries should be understood to have a meaning consistent with the context of their relevant field, and not to be interpreted as having an idealized or overly formal meaning.
[0023] Figure 1 This is a flowchart of a power system transient stability determination method according to a preferred embodiment of the present invention. Figure 1 As shown, the power system transient stability determination method described in this preferred embodiment starts from step 101.
[0024] In step 101, historical time-domain data of each stability-determining physical quantity in the power system is acquired. The historical time-domain data is converted into two-dimensional historical image data in RGB format according to a unified curve image conversion protocol. The initial stability-determining model based on the pre-trained ConvNeXt deep learning model is trained, verified, and tested based on the historical image data of each stability-determining physical quantity to generate the optimal stability-determining model for each stability-determining physical quantity. The stability-determining physical quantities include generator power angle, bus voltage, and system frequency. The initial stability-determining model for each stability-determining physical quantity reuses the backbone network and pre-trained weights of the same pre-trained ConvNeXt deep learning model.
[0025] Preferably, a unified curve visualization protocol is defined before acquiring historical time-domain data of each stability-determining physical quantity in the power system, wherein the unified curve visualization protocol includes: The time-domain data is resampled according to the set uniform sampling frequency and uniform number of data points to obtain resampled time-domain data with a consistent time base. Using time as the horizontal axis, with a fixed number of pixels along the horizontal axis, the sampling points of the resampled temporal data are mapped to a fixed pixel interval on the horizontal axis at equal intervals according to time sequence, thus establishing a definite linear correspondence between the pixels on the horizontal axis and time. Using a stability-determining physical quantity as the vertical axis, the values of this stability-determining physical quantity within its preset value range are mapped linearly to a set pixel interval on the vertical axis. Furthermore, the same stability-determining physical quantity uses the same preset value range and the same pixel interval on the vertical axis when generating the historical image data and the real-time image data. According to the set unified rendering parameters, the curve trajectory corresponding to the resampled time domain data is drawn as an RGB image with a unified length and width. Each stability curve of each stability-determining physical quantity is drawn as a separate RGB image with the same unified length and width. One stability curve corresponds to one data sample, so that the unified length and width are independent of the scale of the power system and the number of stability-determining physical quantities.
[0026] Preferably, the unified rendering parameters include the number of pixels in the canvas width and height, curve line width, curve color, background color, and anti-aliasing switch; the unified sampling frequency and the unified number of data points are independent of the simulation step size of the time-domain simulation computing platform that generates the time-domain data, so that the RGB images generated by the same transient process on different time-domain simulation computing platforms are consistent with each other, wherein the same transient process is a transient process with the same fault type, fault location, fault clearing time, initial running state, and simulation time window; the consistency means that the pixel-by-pixel difference rate of the generated RGB images is not greater than a set threshold.
[0027] In this preferred embodiment, the unified sampling frequency, unified number of data points, preset value range, vertical axis pixel interval, unified rendering parameters, and unified length and width dimensions constitute a set of fixed configurations that are independent of specific power systems and specific simulation platforms. This set of configurations remains completely consistent during the training phase of generating historical image data and the inference phase of generating real-time image data, and is not changed when applied across regional power grids and across simulation platforms.
[0028] In this preferred embodiment, a specific set of configurations for the unified curve visualization protocol is as follows.
[0029] First, a unified time standard is established: the curves are parsed into a unified (time scale, numerical) sequence according to the output data file formats of each time-domain simulation platform (such as the curve output file of PSASP, the *.swx curve file of PSD-BPA, the exported text of ADPSS and MATLAB / PST, etc.); the sampling frequency is uniformly set to 50Hz, the time length is uniformly set to 10 seconds, and the number of data points is uniformly set to 500 points, that is, the time corresponding to the k-th sampling point is 0.02×(k-1) seconds (k=1, 2, ..., 500); for time-domain simulation platforms with simulation step size not equal to 0.02 seconds or output sampling frequency not equal to 50Hz (such as the 0.005-second step size of PSD-BPA, the 0.002-second step size of ADPSS, and the variable step size output of MATLAB / PST), the curves are first interpolated with cubic splines according to their original time scales, and then resampled at equal intervals of 0.02 seconds in the [0, 10) second interval to obtain a unified 500-point sequence. Secondly, the preset value ranges for each stability-determining physical quantity are as follows: The power angle sequence A(t) has a preset range of 0-600°. Voltage sequence U(t): Preset value range 0-1.5pu; Frequency sequence F(t): preset value range 48-52Hz.
[0030] Next, mapping and rendering: Using "time" as the horizontal axis, 500 sampling points are mapped at equal intervals according to time sequence to the horizontal axis pixel range of the effective drawing area of the canvas (in this preferred embodiment, the horizontal axis pixels are 16 to 207, totaling 192 pixels, with 191 adjacent intervals). Adjacent sampling points are connected by straight line segments, establishing a definite linear correspondence between the horizontal axis pixels and time. Using "physical quantity" as the vertical axis, the values of the stable physical quantity within its preset range are mapped linearly to the vertical axis pixel range of the effective drawing area of the canvas (in this preferred embodiment). The vertical axis spans from 16 to 207 pixels, totaling 192 pixels. The upper limit of the preset value range corresponds to 16 pixels on the vertical axis, and the lower limit corresponds to 207 pixels. This ensures that the three types of stable physical quantities with different dimensions and orders of magnitude occupy the same pixel span along the vertical axis. The unified rendering parameters are: canvas dimensions of 224×224 pixels, a pure black RGB (0,0,0) background, pure white RGB (255,255,255) curves, a line width of 1 pixel, anti-aliasing disabled, and no axes, ticks, grid lines, borders, or legends drawn. Therefore, the image size of the three types of curves is unified at 224×224, adapting to the input requirements of ConvNeXt.
[0031] It should be noted that the aforementioned uniform 224×224 dimensions are determined solely by the unified curve visualization protocol itself, and are unrelated to power grid scale parameters such as the number of generators, buses, and lines in the power system, as well as the number of selected stability-determining physical quantities. Regardless of the number of generators or buses in a power grid, each stability-determining curve is individually plotted as a 224×224 RGB image, with one curve corresponding to one data sample. This rule of "individually plotting each curve" is the direct cause of the decoupling between image size and power grid scale. Existing technologies stitch together all electrical features in the same scenario into a single image, and the one-dimensional size of the image is necessarily proportional to the feature dimension. However, in this preferred embodiment, an increase in power grid scale only increases the number of samples, without changing the size of a single sample. Therefore, when the power grid is expanded, measurement configurations are adjusted, or analysis windows are adjusted, the size of the input image remains unchanged, and the already trained optimal stability-determining model can be used directly without redesigning the input structure, recalculating the dimensionality reduction matrix, or retraining the model. By converting the power angle, voltage, and frequency time-domain sequences into 224×224 RGB images of the same size and with the same rendering rules, the curves of the three stability-determining physical quantities can share the same model architecture, which greatly reduces the model development cost.
[0032] Furthermore, the imaging method used in this preferred embodiment is fundamentally different from the imaging methods in the prior art. The prior art arranges multidimensional electrical features into a two-dimensional numerical matrix according to the two directions of "time" and "feature", and then assigns corresponding gray values to each point according to the different values of the matrix elements. Each pixel of the image corresponds to a "feature-time" value, which is a visual encoding of the numerical matrix. There is only an adjacency relationship between adjacent pixels in terms of arrangement order. The continuous trajectory of the curve does not exist in the image. Morphological features reflected by the curve trend, such as oscillation envelope, over-limit duration, and multiple pendulum shapes, cannot be directly extracted by the convolution kernel. Therefore, this type of scheme must also rely on feature dimensionality reduction steps such as two-dimensional principal component analysis to compress the input dimension, and the dimensionality reduction process will further cause the loss of the above-mentioned morphological information.
[0033] In this preferred embodiment, the trajectory of the time-domain curve itself is drawn onto the canvas according to uniform rendering parameters. The white pixels in the image are connected to form a continuous curve, and its slope, envelope, number of zero crossings, length and position of the limit-crossing segment are directly presented in geometric form. This naturally matches the edge, texture and shape features that the ConvNeXt backbone network is good at extracting. Therefore, it can be directly input into the model without any feature dimensionality reduction, thereby effectively preserving the trend, oscillation and limit-crossing morphological features of the time-domain curve and achieving the technical effect of minimal cross-domain information loss.
[0034] Furthermore, this preferred embodiment renders the curve as an RGB three-channel image instead of a single-channel grayscale image. The technical significance of this lies in aligning it with the input distribution of the pre-trained model: the model pre-trained on ImageNet by ConvNeXt et al. uses a first-layer convolutional kernel trained with three-channel input. If a single-channel grayscale input is used, the first-layer convolutional kernel must be summed or copied along the channel dimension, which would disrupt the statistical relationship between the pre-trained weights and prevent the pre-trained feature extraction capability from being fully inherited. By using RGB three-channel rendering combined with normalization based on channel mean and channel standard deviation, the input distribution can be aligned with the pre-trained input distribution without modifying any layer of the pre-trained model's structure.
[0035] Preferably, the initial stability determination model based on the pre-trained ConvNeXt deep learning model is trained, validated, and tested to generate the optimal stability determination model for each stability determination physical quantity, including: An initial stability model for each stable physical quantity is generated based on a pre-trained ConvNeXt deep learning model. The initial stability model includes the backbone network of the pre-trained ConvNeXt deep learning model and a replaced classification head. The backbone network includes multiple network stages connected in sequence. The classification head is a classifier containing an adaptive average pooling layer, a flattening layer, a normalization layer, and a fully connected layer with an output dimension of 2. The historical time-domain data of each stability-determining physical quantity constitutes the data sample set of that stability-determining physical quantity, and the data samples in the data sample set are divided into an initial training set, an initial validation set, and an initial test set according to a set ratio; Physical consistency enhancement is performed on the data samples in the initial training set for each stable physical quantity to generate a corresponding enhanced training set; For each stable physical quantity, the data samples in the enhanced training set, initial validation set, and initial test set are rendered according to the unified curve visualization protocol to generate the corresponding image training set, image validation set, and image test set. The data samples in the image training set, image validation set, and image test set are standardized respectively to generate a standard training set, a standard validation set, and a standard test set. Based on the standard training set, standard validation set, and standard test set for each stability-determining physical quantity, the initial stability-determining model is trained, validated, and tested respectively, and the model with the highest accuracy on the standard validation set is taken as the optimal stability-determining model for each stability-determining physical quantity.
[0036] Preferably, the physical consistency enhancement is performed on the data samples in the initial training set for each stable physical quantity, wherein: The physical consistency enhancement includes at least one of the following: overall translation along the time axis, clipping and padding along the time axis, amplitude scaling within the preset value range according to a set ratio, superimposing random noise that conforms to the measurement noise distribution, data point loss according to a set loss rate, and curve line width jitter. The random noise is Gaussian noise with a mean of 0. The physical consistency enhancement does not include horizontal flipping along the time axis, nor does it include rotational transformations that cause points on the curve to deviate from their original horizontal axis pixel positions.
[0037] This preferred embodiment enhances the physical consistency of the data samples in the initial training set, increasing data diversity without compromising the physical meaning of electrical quantities. This effectively improves the model's generalization ability and prevents overfitting. Standardizing the data samples in the image training, validation, and test sets ensures that the input data distribution closely approximates the input distribution of the pre-trained model, thereby accelerating model convergence and reducing the risk of gradient vanishing / exploding, thus stabilizing the training process. Furthermore, by only enhancing the physical consistency of the initial training set data samples, while leaving the initial validation and test sets unenhanced, data leakage is avoided, ensuring the fairness of the model validation / testing phases in reflecting real-world data performance and evaluation.
[0038] Preferably, the standardization of data samples in the image training set, image validation set, and image test set to generate a standard training set, a standard validation set, and a standard test set includes: Map the pixel values of the data samples in the image training set, image validation set, and image test set to [0,1]; and Based on the channel mean and channel standard deviation of the pre-training dataset used by the pre-trained ConvNeXt deep learning model, the three color channels of the data sample are normalized respectively to align the input distribution of the data sample with the pre-training input distribution of the pre-trained ConvNeXt deep learning model, thereby generating a standard training set, a standard validation set, and a standard test set.
[0039] Preferably, the training of the initial stability model includes a two-stage fine-tuning process involving phased unfreezing, specifically: In the first stage, all parameters of the backbone network are frozen, and the classification head is trained only with the set baseline learning rate until the accuracy of the standard validation set no longer improves in the set consecutive rounds. In the second stage, the network phase at the end of the backbone network is unfrozen, and the parameters of the unfrozen part are trained with the backbone learning rate. At the same time, the classification head is trained with the benchmark learning rate, wherein the backbone learning rate is less than the benchmark learning rate, and the ratio of the two is the set difference coefficient. In both the first and second stages, cross-entropy loss with class weights is used as the loss function, where the class weights are the normalized reciprocal of the ratio of stable samples to unstable samples in the standard training set.
[0040] To verify the technical effect of using the unified curve visualization protocol defined in this invention to visualize the curve trajectory corresponding to the time domain data of the stability physical quantity, this preferred embodiment conducted comparative experiments on different input representation methods under the same dataset, the same backbone network (ConvNeXt-Tiny), the same training hyperparameters, and the same random seed. The dataset was taken from a 500kV section of the East China Power Grid (containing 32 equivalent generators, 186 buses, and 187 AC lines). PSASP 7.0 simulation was used, with load levels ranging from 75% to 120% in 5% increments. Three-phase short-circuit faults were set at 10%, 50%, and 90% load levels on all lines, with fault clearing times ranging from 0.1 to 0.25 seconds. The simulation duration was 10 seconds with a step size of 0.01 seconds, generating a total of 12,000 curve samples (4,000 each for power angle, voltage, and frequency). Instability samples accounted for approximately 35%, and were divided into an initial training set, an initial validation set, and an initial test set in an 8:1:1 ratio (400 curves per type for the test set). The accuracy rates for each group were measured under the condition of maximum probability decision (i.e., a decision threshold of 0.5) to ensure comparability. The comparison results are as follows: (a) Direct one-dimensional input of numerical sequences: power angle accuracy 91.4%, voltage accuracy 89.7%, frequency accuracy 90.2%, instability false negative rate 6.8%, complex instability mode recognition rate 61.7%; (b) Numerical matrix grayscale encoded image: power angle accuracy 93.1%, voltage accuracy 91.5%, frequency accuracy 92.0%, instability false negative rate 5.1%, complex instability pattern recognition rate 72.5%; (c) Numerical matrix grayscale encoded image + 2D principal component analysis dimensionality reduction: power angle accuracy 92.6%, voltage accuracy 90.8%, frequency accuracy 91.3%, instability false negative rate 5.6%, complex instability pattern recognition rate 68.9%; (d) RGB image of each curve trajectory in this preferred embodiment: power angle accuracy 96.2%, voltage accuracy 95.8%, frequency accuracy 96.5%, instability false negative rate 2.9%, complex instability pattern recognition rate 94.7%.
[0041] The aforementioned complex instability pattern recognition rate refers to the recognition rate for three types of instability samples: multi-pendulum instability, low-frequency oscillation divergence, and continuous voltage drop. It is evident that, under identical experimental conditions, the image-based method of plotting curve trajectories improves overall accuracy by approximately 3–5 percentage points compared to the numerical matrix grayscale encoding method, and improves the complex instability pattern recognition rate by approximately 22 percentage points. Furthermore, the introduction of two-dimensional principal component analysis for dimensionality reduction actually leads to a decrease in various indicators, verifying that the dimensionality reduction process does indeed result in the loss of morphological information.
[0042] Furthermore, regarding the relationship between input size and power grid scale: for the IEEE-39 node example (58-dimensional electrical features × 40 time nodes), the size of the grayscale encoded image of the numerical matrix is 58×40; for the aforementioned 500kV sub-region example of the East China power grid, its electrical features total 842 dimensions (composed of the power angle, electromagnetic power, and terminal voltage of 32 generators, the voltage amplitude and phase angle of 186 buses, and the active and reactive power of 187 AC lines), taking 1000 time nodes with a step size of 0.01 seconds and a duration of 10 seconds, the size becomes 842×1000; when the sub-region is expanded with 8 generators, 20 buses, and 22 AC lines, the electrical features increase to 950 dimensions, and the size becomes 950×1000. In all three cases above, the trained model cannot be directly reused due to the change in input dimensions, and the dimension-reduced projection matrix needs to be recalculated. In this preferred embodiment, the size of a single sample image is always 224×224 in the above three cases. The increase in the scale of the power grid is only reflected in the increase in the number of sample lines, and the model can be directly reused.
[0043] Furthermore, regarding consistency across simulation platforms, this preferred embodiment calculates and derives the power angle curve using four time-domain simulation platforms—PSASP (simulation step size 0.01 seconds), PSD-BPA (0.005 seconds), ADPSS (0.002 seconds), and MATLAB / PST (variable step size)—for the same example (a three-phase short-circuit fault at the beginning of a power grid line in a certain region). If plotting is done directly using the original samples from each platform, the consistency rate of the judgment results across the four platforms is only 81.5%, with an average accuracy of 88.7%. However, after plotting using the unified time base resampling and unified rendering parameters of this preferred embodiment, the pixel-by-pixel difference rate between the RGB images generated by the four platforms is less than 0.3% (this difference is only caused by the numerical integration error of each platform itself), increasing the consistency rate of the judgment results across the four platforms to 99.6% and the average accuracy to 96.1%. In this preferred embodiment, the pixel-by-pixel difference rate is the proportion of pixels in two RGB images where the color difference at corresponding pixel positions exceeds a set color difference threshold to the total number of pixels in the image. Furthermore, regarding the design details of sharing the same model architecture for the three types of stability-determining physical quantities: In this preferred embodiment, the initial stability-determining models for the three stability-determining physical quantities—generator power angle, bus voltage, and system frequency—have identical backbone network structures (all are ConvNeXt-Tiny, containing 4 network stages, with the number of blocks in each stage being [3,3,9,3] and the number of channels in each stage being [96,192,384,768]), and are all initialized with the same ImageNet-1k pre-trained weights. That is, the backbone networks of the three models achieve 100% weight reuse during the initialization phase; the parameters of the classification heads are independent of each other among the three models. Each classification head contains a LayerNorm(768) and a Linear(768,2), with approximately 3.1 × 10^6 trainable parameters. 3 The number of parameters in the backbone network is approximately 2.86 × 10⁻⁶. 7 The number of parameters in the classification header is less than two ten-thousandths of the number of parameters in the main branch.
[0044] After training, the weights of the three optimal stable models are as follows: the stem layer in the backbone network and the first to third network stages remain frozen during the two-stage fine-tuning, with their parameters (approximately 1.32 × 10⁻⁶). 7 The number of nodes (approximately 53MB) is identical across all three models, therefore only one copy needs to be loaded into video memory during deployment and shared by all three models; only the fourth network stage at the end of the backbone network (approximately 1.54×10) is identical. 7 The parameters (approximately 61MB) and the classification header, due to the different physical quantities for judgment after the second-stage fine-tuning, need to be stored separately. As a result, the weight usage of the three types of curves decreased from approximately 342MB (approximately 3 × 114MB ≈ 342MB) when loading three complete models separately, to approximately 53MB + 3 × 61MB ≈ 236MB.
[0045] This brings two direct benefits: First, during the development phase, there is no need to design feature extraction methods and network structures for each type of stable physical quantity, nor is it necessary to perform structure search and hyperparameter search separately. Only the architecture and hyperparameters need to be determined once on the first type of curve, and the same architecture and hyperparameters can be used for the subsequent two types of curves. Second, during the deployment phase, the shared backbone front end only needs to be computed once to be reused for the three types of curves, reducing the amount of redundant computation.
[0046] As another preferred implementation, when there are stricter requirements for model size or inference latency, a lightweight variant with the entire backbone network frozen can be used. That is, in the second stage, no network stage is unfrozen, and only the classification head is trained. In this case, the backbones of the three models are completely consistent, the weight occupancy can be further reduced to about 114MB, and the three classification heads can be connected in parallel to the same backbone network to form a multi-head stability model. A batch forward propagation is performed on the three types of curve images under the same disturbance scenario to simultaneously output the instability probability of each of the three types of curves. The cost is that the adaptability to cross-regional power grids is reduced accordingly (see the comparison data of cross-regional generalization in the following section for details).
[0047] In this preferred embodiment, the specific process of obtaining the optimal stability determination model for each stability determination physical quantity, completing the decision threshold tuning, and outputting the decision result based on the standard training set, standard validation set, and standard test set for each stability determination physical quantity is as follows: (1) Model initialization: Load the pre-trained model and modify the classifier to adapt it for binary classification. num_features = model.classifier[2].in_features # Extract the number of backbone output features model.classifier = nn.Sequential( nn.AdaptiveAvgPool2d((1,1)), # Adaptive pooling to a 1×1 feature map nn.Flatten(1), # Flatten to form eigenvectors nn.LayerNorm(num_features, eps=1e-6), # Layer normalization (matching the original ConvNeXt structure) nn.Linear(num_features, 2) # Binary classification output (stable = 0, unstable = 1) ) (2) Multi-curve joint training and verification - two-stage fine-tuning with phased unfreezing Phase 1 (Frozen Backbone Phase): Set `freeze_backbone=True` to freeze all parameters of the ConvNeXt backbone network. Train the classifier head only with the baseline learning rate, so that the randomly initialized classifier head matches the output features of the pre-trained backbone first, avoiding the destruction of the pre-trained weights by the large gradient backpropagation in the early stage. When the accuracy on the standard validation set no longer improves for 3 consecutive rounds, this phase ends and transitions to Phase 2 (in this preferred embodiment, this switch occurs in the 8th round). The second stage (phased unfreezing stage): Unfreeze one network stage at the end of the backbone network (i.e., the 4th network stage, with 768 channels; if further improvement is needed, the last two network stages can be unfrozen), and apply the backbone learning rate to this unfrozen part, while the classification head continues to be trained with the baseline learning rate; in this preferred embodiment, the baseline learning rate is 1×10. -4 The difference coefficient is set to 0.1, meaning the backbone learning rate is 1×10⁻⁶. -5 ; Loss function: Both stages use cross-entropy loss with class weights (nn.CrossEntropyLoss(weight=class_weights)). The class weights are calculated according to the balanced mode of scikit-learn's compute_class_weight function: Let the number of stable samples in the standard training set be N1 and the number of unstable samples be N2. The total number of samples is N=N1+N2. Then the weight of the stable class is w1=N / (2×N1) and the weight of the unstable class is w2=N / (2×N2). That is, the weight of each class is the normalized form of the inverse of the number of samples in that class. The unstable class with fewer samples gets higher weights to alleviate the class imbalance of "more stable samples and fewer unstable samples". Optimizer: AdamW (weight decay 0.01, code optim.AdamW), and set the learning rate for the classification head and the unfrozen backbone according to the parameter group respectively; Learning rate scheduling: ReduceLROnPlateau only takes effect in the second phase, with a patience of 2. That is, if the accuracy of the standard validation set does not improve for two consecutive rounds in the second phase, the learning rate is halved (code scheduler), to distinguish it from the phase switching criterion in the first phase (patience of 3). Gradient clipping: torch.nn.utils.clip_grad_norm_(model.parameters(), max_norm=1.0), to prevent gradient explosion; Training rounds: The maximum number of training rounds is set to 60 rounds and early stopping is adopted. In this preferred embodiment, the first stage is 8 rounds and the second stage is 7 rounds before convergence, for a total of 15 rounds. The "best model" with the highest accuracy on the standard validation set (best_model_multi_curve.pth, code torch.save) is saved.
[0048] The difference between the two-stage fine-tuning described above and the existing approach of simply retraining the classification layer lies in the fact that the high-level semantic feature extraction parameters at the end of the backbone network can be appropriately adjusted according to the distribution of data in the target domain, while the differential learning rate ensures that this adjustment is much smaller than that of the classification head, thus avoiding catastrophic forgetting while gaining domain adaptability. Corresponding comparative experimental data can be found in the cross-regional generalization section below.
[0049] (3) Optimal model testing Model loading: Load the best model weights and set them to evaluation mode (model.eval()). Batch inference: Load the test set in batches using DataLoader (batch_size=8, num_workers=4), and disable gradient computation (torch.no_grad()): Forward propagation: outputs = model(images), outputting the category logits; Probability transformation: probability = torch.softmax(outputs, dim=1), which obtains the stable class probability and the unstable class probability; Label prediction: probs = torch.softmax(outputs, dim=1)[:, 1] Take the instability probability, preds= (probs>= tau).long(), and adjust the decision threshold tau=τ*output predicted label according to (4) below; Results record: Save the "true label, predicted label, confidence score, image path, and curve name" of all samples for subsequent analysis.
[0050] (4) Decision threshold setting After completing the above training, the decision threshold is tuned for the optimal stability model of each stability-determining physical quantity on the standard validation set. The specific process is as follows: (i) Perform forward propagation on all samples in the standard validation set and obtain the instability probability p1 of each sample by probability = torch.softmax(outputs, dim=1); (ii) Traverse the candidate decision thresholds τ within the threshold search interval [0.05, 0.95] with a step size of 0.001, and calculate the false negative rate P_MD (the proportion of real unstable samples judged as stable) and the false alarm rate P_FA (the proportion of real stable samples judged as unstable) for each τ. (iii) Among all candidate decision thresholds that satisfy P_MD ≤ P_MD_max, the τ* that minimizes P_FA is taken as the final decision threshold for the stability physical quantity. The upper limit of the missed decision rate P_MD_max is set according to the power grid safety requirements. In this preferred embodiment, it is 0.5%. (iv) During the reasoning stage, the results are no longer output according to the category with the highest probability, but are judged as unstable if p1≥τ* and stable if p1<τ*; (v) When p1 falls into the uncertainty interval [τ*-0.1, τ*+0.1], the sample is marked as a sample to be reviewed and a review prompt is output, which is then further reviewed by the analyst or time-domain simulation.
[0051] In this preferred embodiment, the determined decision thresholds are: power angle curve τ*=0.271, voltage curve τ*=0.238, and frequency curve τ*=0.305. Comparative experiments on a test set with approximately 35% of unstable samples show that when using a fixed maximum probability decision (equivalent to τ=0.5), the instability false alarm rate is 2.9% and the false alarm rate is 3.6%. After adjusting for the aforementioned false alarm rate constraint, the false alarm rate decreases to 0.4%, the false alarm rate increases to 6.8%, and the overall accuracy is 95.4%, with approximately 2.3% of samples falling into the uncertainty range. It is evident that this preferred embodiment achieves a significant decrease in the false alarm rate by moderately increasing the false alarm rate, meeting the power system's safety requirement of "better to have a false alarm than a false alarm"—samples falsely judged as unstable can be verified and eliminated within seconds by time-domain simulation, while unjudged unstable samples will not generate any alarm signals, potentially preventing dispatchers from taking emergency control measures before system instability occurs. Furthermore, since the instability probability distributions of the three types of stability-determining physical quantities are not the same, this preferred embodiment independently sets the decision thresholds for each of the three, rather than sharing a single threshold.
[0052] It should be noted that, in order to ensure a consistent standard for comparisons between different schemes, all accuracy and false negative rates given in this manual, except for the data explicitly marked as "tuning threshold" in this section, are measured under the maximum probability decision (τ=0.5).
[0053] (5) Results analysis and visualization Generate precision, recall, and F1 score (e.g., F1 ≥ 96% for the power angle curve) for the three classes using sklearn.metrics.classification_report, and save it as classification_report.txt; Draw confusion matrices (confusion_matrix + ConfusionMatrixDisplay) according to curve type, and save them as confusion_matrix.png to visually display the distribution of misclassifications; Error sample analysis: Filter misjudged samples, record "curve name, true label, predicted label, confidence level, and image path", and save it as error_samples.json; generate an error sample PDF (all_error_samples.pdf), display the misjudged images sorted by confidence level, and annotate key information (such as "true: stable, predicted: unstable, confidence level: 0.82") to facilitate backtracking and optimization.
[0054] (6) Inverse mapping output of the unstable characteristic period For samples determined to be unstable, this preferred embodiment further outputs the unstable characteristic time period, the specific process of which is as follows: (i) Take the feature map (size 7×7×768) output by the fourth network stage of the backbone network, calculate the gradient of the score of the unstable category on the feature map, and perform global average pooling on the gradient to obtain the weight of each channel. (ii) After weighted summation of each channel of the feature map with the above weights, ReLU activation is performed to obtain a 7×7 class activation heatmap, which is then upsampled to 224×224 by bilinear interpolation. (iii) Take the maximum value of the upsampled heatmap along the vertical axis and normalize it to [0,1] to obtain a one-dimensional attention distribution g(p) with a length of 224, where p is the pixel number on the horizontal axis; (iv) Only search for continuous intervals within the horizontal pixel interval p∈[16, 207] of the effective drawing area; pixels falling outside this interval are not included in the determination of the unstable feature period; select continuous horizontal pixel intervals [p] where g(p) is greater than the attention threshold (0.6 in this preferred embodiment). s, p e According to the unified curve visualization protocol, the linear correspondence between horizontal axis pixels and time is inversely mapped to the time interval [t1, t2]. In this preferred embodiment, the correspondence is t = (p - 16) / 191 × 10 (unit: seconds), that is, horizontal axis pixel 16 corresponds to simulation time 0 seconds, pixel 207 corresponds to 10 seconds, a total of 192 pixel positions, 191 adjacent intervals, each pixel in the horizontal direction corresponds to approximately 0.0524 seconds, and the 192 pixels in the effective drawing area cover the complete simulation time window from 0 to 10 seconds, where p s, p e t1 and t2 are the left and right endpoints of the unstable feature pixel interval, respectively, and the start and end times of the unstable feature period. (v) Take [t1, t2] as the instability characteristic time period of the physical quantity to be judged, and output it together with the stability label and instability probability.
[0055] Since the linear correspondence between horizontal axis pixels and time is strictly fixed by a unified curve visualization protocol, and the training and inference phases are completely consistent, the above inverse mapping does not introduce an additional calibration step. Tests on 500 samples with known instability initiation times show that the average deviation between the instability feature time period obtained from the inverse mapping and the manually labeled instability initiation time is 0.18 seconds (approximately 3.5 horizontal axis pixels), with a standard deviation of 0.11 seconds. 93.6% of the samples have a deviation of less than 0.4 seconds. Therefore, the judgment result is upgraded from "whether instability has occurred" in the existing technology to "whether instability has occurred and when instability occurred," significantly improving the interpretability and verifiability of the results.
[0056] As can be seen from the above process of generating the optimal stability model for each stability-determining physical quantity, this preferred embodiment converts each time-domain curve of each stability-determining physical quantity into a fixed-size RGB image according to a unified curve imagery protocol (preserving morphological features such as curve trends, oscillations, and limit exceedances). It automatically learns the instability mode using the ConvNeXt model that reuses the same pre-trained backbone (without requiring manual feature design). It improves generalization through pre-training transfer, physical consistency enhancement, and two-stage fine-tuning. It controls the risk of missed detection by threshold tuning of the missed detection rate constraint. Finally, it outputs the instability feature time period through inverse mapping of the activation heatmap, thereby achieving batch stability determination and result traceability.
[0057] The performance and effect of the optimal stability model obtained through training using this preferred embodiment are as follows: (1) Efficiency has been greatly improved A single RTX 3090 GPU can determine the stability of three types of curves at a speed of 1200 lines / second. It only takes 1.7 seconds to process 2000 curves (600 for power angle, 800 for voltage, and 600 for frequency), which is 4200 times more efficient than manual interpretation (2 hours / 2000 lines).
[0058] (2) High accuracy and consistency In the source domain (East China Power Grid) test set (400 curves of each of the three types, totaling 1200 curves, with the highest probability decision caliber), the stability determination accuracy is ≥95%. Power angle curve: accuracy 96.2%, instability recall 97.1% (i.e., instability false negative rate 2.9%). Voltage curve: accuracy 95.8%, false alarm rate 3.9% (lower than the traditional threshold method of 15%). Frequency curve: accuracy 96.5%, consistency of analysis results across different batches reached 100% (no subjective human error).
[0059] (3) Generalization is significantly improved Based on pre-trained transfer learning and physical consistency enhancement: The model trained on the East China Power Grid, after two-stage fine-tuning, was applied to the North China Power Grid. The power angle accuracy decreased by only 1.2 percentage points relative to the source domain benchmark of the same caliber, while it decreased by 7.8 percentage points without any migration adaptation. When adapting to different curve types (such as switching from a voltage curve to a frequency curve), only about 100 additional data points of that type of curve need to be added and fine-tuned in two stages. The adaptation cycle is shortened from about 10 person-days for remodeling to about 2 person-days, and the adaptation cost is reduced by about 80%.
[0060] (4) Experimental conditions and detailed data for cross-regional power grid generalization The experimental conditions for the cross-regional generalization experiment are as follows: the source domain is a 500kV section of the East China Power Grid, containing 32 equivalent generators, 186 buses, and 187 AC lines; the simulation software is PSASP. 7.0, with load levels ranging from 75% to 120% in 5% increments, three-phase short-circuit faults were set at 10%, 50%, and 90% load levels on all lines. Fault clearing times ranged from 0.1 to 0.25 seconds, with a simulation duration of 10 seconds and a simulation step size of 0.01 seconds. A total of 12,000 curve samples (4,000 curves of each of the three types) were generated for training. The target domain was a section of the North China Power Grid, containing 27 equivalent generators, 154 buses, and 161 AC lines. The simulation software was changed to PSD-BPA (simulation step size of 0.005 seconds), and the fault setting method was the same as the source domain. A total of 3,000 curve samples were generated as a cross-regional test set, and another 300 curve samples (100 of each type) were generated as a cross-regional fine-tuning set. All the following data sets were measured under the maximum probability decision condition (τ=0.5). The test results are as follows: Source domain (East China Power Grid) test set: power angle accuracy 96.2%, voltage accuracy 95.8%, frequency accuracy 96.5%, instability false negative rate 2.9%; Direct cross-regional application (without any fine-tuning): power angle accuracy 88.4%, voltage accuracy 87.1%, frequency accuracy 89.6%, instability false negative rate 4.2%; Retraining only the classification layer (freezing the entire backbone network, i.e., the existing transfer method, which is a lightweight variant of the aforementioned backbone freezing): power angle accuracy 91.3%, voltage accuracy 90.2%, frequency accuracy 92.1%, and instability false negative rate 3.6%; The two-stage fine-tuning of this preferred embodiment (freezing the backbone training classification head, then unfreezing the terminal network stage and continuing training with a differential learning rate of 0.1) achieves the following accuracy rates: power angle accuracy 95.0%, voltage accuracy 94.7%, frequency accuracy 95.4%, and instability miss rate 3.1%.
[0061] As can be seen, after fine-tuning the model trained in the East China Power Grid and applying it to the North China Power Grid using this preferred implementation method, the power angle accuracy only decreased by 1.2 percentage points (96.2%→95.0%) compared to the source domain benchmark of the same caliber. In contrast, the existing transfer learning method, which only retrains the classification layer, resulted in a 4.9 percentage point decrease (96.2%→91.3%), and without any transfer adaptation, the decrease was 7.8 percentage points (96.2%→88.4%). The aforementioned cross-regional fine-tuning used only 300 target domain curve samples and took approximately 11 minutes on a single RTX 3090 GPU. If the decision threshold is readjusted in the target domain according to the aforementioned upper limit of 0.5% for the false negative rate, the instability false negative rate after the two-stage fine-tuning can be further reduced to below 0.5%, at which point the overall accuracy is 94.3%.
[0062] (5) Input distribution alignment effect of cross-domain transfer To verify the alignment effect between the image encoding method and the input distribution of the pre-trained model, this preferred embodiment compares different channel processing and normalization strategies on the source domain dataset. To facilitate observation of convergence speed differences, the upper limit of the training epochs in this control experiment was uniformly increased to 60 epochs. The convergence epoch was defined as the epoch when the accuracy on the standard validation set first reached 99% of its final value, with all other conditions remaining identical. (a) Single-channel grayscale input, first-layer convolution kernel summed by channel: 27 convergence rounds, test accuracy 92.8%; (b) The grayscale image was copied to three channels and normalized to the mean and standard deviation of [0.5, 0.5, 0.5]: 19 convergence rounds, 94.6% accuracy. (c) Three-channel RGB rendering without normalization: 23 convergence rounds, 93.5% accuracy. (d) In this preferred embodiment, three-channel RGB rendering is performed and normalized by channel according to the ImageNet-1k channel mean [0.485, 0.456, 0.406] and channel standard deviation [0.229, 0.224, 0.225]: 12 convergence rounds, test accuracy 96.2%.
[0063] Furthermore, the comparison between transfer and no transfer is as follows: With 9600 training samples, the backbone network achieved 41 convergence epochs and 89.1% accuracy with random initialization, while ImageNet-1k pre-trained transfer achieved 12 convergence epochs and 96.2% accuracy with the same result. When the training samples were reduced to 2400, the accuracy of the randomly initialized network dropped to 78.3% (46 convergence epochs), while the pre-trained transfer still achieved 94.9% (14 convergence epochs). This demonstrates that the advantage of pre-trained transfer with aligned input distribution is particularly significant under small sample conditions, which has important engineering value for real-world power grids where unstable samples are scarce.
[0064] (6) Adaptation of cross-stable physical quantities and model development costs When adapting to different curve types (e.g., switching from a power angle curve to a voltage curve, and then to a frequency curve), after obtaining the optimal stability model for the former type of curve, the same two-stage fine-tuning is performed directly using the optimal stability model as the starting point and the image data of the latter type of curve generated according to a unified curve imagery protocol. Only about 100 additional curve data of this type are needed, reducing the adaptation cycle from about 10 person-days for remodeling to about 2 person-days, a reduction of about 80%. For the three types of curves in total: the existing method of designing artificial features and modeling each type of curve separately requires about 30 person-days, while the shared backbone method of this preferred embodiment requires about 12 person-days (about 8 person-days for the first type and about 2 person-days for each of the latter two types), reducing model development costs by about 60%.
[0065] (7) System-level determination On 1000 complete disturbance scenarios (each scenario contains three curves: power angle, voltage, and frequency, with instability scenarios accounting for approximately 35%), after fusing the stability labels of the three types of curves according to the veto rule (all three types of curves use the decision threshold obtained by adjusting the aforementioned upper limit of 0.5% for the missed detection rate), the system-level missed detection rate is 0.2%, and the system-level false alarm rate is 8.1% (since the veto rule takes the union of the three types of judgments, and there is a strong correlation between the false alarms of the three types of curves, the system-level false alarm rate is slightly higher than the 6.8% of a single stability-determining physical quantity). The system-level judgment accuracy rate is 94.7%, and it can simultaneously provide the stability-determining physical quantity with the earliest start of the instability characteristic period and its instability characteristic period.
[0066] In step 102, real-time time-domain data of at least one stability-determining physical quantity in the power system is acquired.
[0067] In step 103, according to the unified curve imaging protocol, two-dimensional real-time image data in RGB format is generated based on the real-time temporal data.
[0068] In this preferred embodiment, the method for generating two-dimensional real-time image data in RGB format based on real-time time-domain data is exactly the same as the method for generating two-dimensional historical image data in RGB format based on historical time-domain data. That is, it uses the same set of configurations: unified sampling frequency, unified number of data points, preset value range, vertical axis pixel interval, unified rendering parameters, and unified length and width dimensions. Further details will not be elaborated here. Strictly using the same curve visualization protocol in both the training and inference phases is a prerequisite for ensuring the direct reuse of the model across different power grids and simulation computing platforms.
[0069] In step 104, the real-time image data is used as the input of the optimal stability model for the corresponding stability-determining physical quantity, and a stability label for each stability-determining physical quantity is output. The determination result of the transient stability of the power system is output based on the stability label. The stability label is used to indicate whether the corresponding stability-determining physical quantity in the power system is stable, and the determination result is used to indicate whether the power system is stable.
[0070] Preferably, the step of using the real-time image data as input to the optimal stability model for the corresponding stability-determining physical quantity, and outputting a stability label for each stability-determining physical quantity, includes: The real-time image data is input into the optimal stability model of the corresponding stability-determining physical quantity to obtain the instability probability of the stability-determining physical quantity. The instability probability is compared with the decision threshold obtained by tuning the stability physical quantity on the standard verification set according to the upper limit constraint of the missed decision rate. When the instability probability is not less than the decision threshold, a stability label indicating instability is output; otherwise, a stability label indicating stability is output. When the instability probability falls within the uncertainty range centered on the decision threshold, the corresponding time-domain data will be marked as a sample to be reviewed and a review prompt will be output. When the determination result is instability, the instability characteristic period of the determined physical quantity is further output in accordance with the aforementioned inverse mapping of the activation heatmap.
[0071] Preferably, the method further includes: When the stability label corresponding to the stability physical quantity becomes unstable, the class activation heatmap of the instability category is calculated based on the feature map output by the terminal network stage in the optimal stability model. Aggregate the aforementioned class activation heatmaps along the vertical axis to obtain a one-dimensional attention distribution along the horizontal axis. Within the fixed pixel range of the horizontal axis, according to the linear correspondence between horizontal axis pixels and time in the unified curve imaging protocol, the horizontal axis pixel range in the one-dimensional attention distribution where the attention is greater than the set attention threshold is mapped back to the time range, which is then output as the instability characteristic period of the unstable physical quantity.
[0072] Preferably, the method further includes: The transient stability determination result of the power system is output based on the stability label, including: The output judgment result is that the power system is stable if and only if all stability label flags correspond to stable physical quantities. Otherwise, the output judgment result is that the power system is unstable, and the earliest stable physical quantity and its instability characteristic period are output.
[0073] In this preferred embodiment, when any stability label corresponding to a stability-based physical quantity becomes unstable, the reason for the overall instability of the power system is output. This is because the occurrence of any one of power angle instability, voltage instability, and frequency instability means that the system cannot maintain transient stability under this disturbance, and there is coupling between the three (for example, power angle instability is often accompanied by voltage drop). Performing a "one-vote veto" can avoid system-level omissions caused by errors in the judgment of a single physical quantity.
[0074] The power system transient stability determination method described in this preferred embodiment is highly practical in engineering. It can interface with mainstream simulation software such as PSASP, PSD-BPA, ADPSS, and MATLAB, automatically reading three types of curve data and parsing, resampling, and rendering images according to a unified curve imagery protocol, without the need for manual conversion. The model is lightweight, with a total weight of approximately 236MB for the three types of curves (of which the shared backbone front section is approximately 53MB), and can be deployed on a regular server (a single GPU is sufficient to run it), without the need for dedicated hardware. It is highly maintainable, with a modular code design (time base resampling, curve rendering, model inference, threshold decision, and heatmap inverse mapping are decoupled from each other). When optimizing a certain module (such as changing the model backbone or adjusting the upper limit of the false negative rate), no other logic needs to be modified.
[0075] Furthermore, since the unified curve visualization protocol solidifies the time base resampling and rendering parameters into a set of configurations that are independent of the power grid and simulation platform, this preferred embodiment only needs to access the curve data according to the protocol when connecting to a new power grid or a new simulation computing platform. There is no need to redesign the input structure or recalculate the dimensionality reduction matrix. Existing models can be directly reused. If necessary, a small number of target domain samples can be used for two-stage fine-tuning to adapt the model, thereby realizing the engineering deployment across regional power grids and computing platforms.
[0076] Figure 2 This is a schematic diagram of the power system transient stability determination device according to a preferred embodiment of the present invention. Figure 2 As shown, the power system transient stability determination device 200 according to this preferred embodiment includes: The model building module 201 is used to acquire historical time-domain data of each stability-determining physical quantity in the power system, convert the historical time-domain data into two-dimensional historical image data in RGB format according to a unified curve image conversion protocol, and train, verify and test the initial stability-determining model based on the pre-trained ConvNeXt deep learning model based on the historical image data of each stability-determining physical quantity, and generate the optimal stability-determining model for each stability-determining physical quantity. The stability-determining physical quantities include generator power angle, bus voltage and system frequency. The initial stability-determining model for each stability-determining physical quantity reuses the backbone network and pre-trained weights of the same pre-trained ConvNeXt deep learning model. Data acquisition module 202 is used to acquire real-time time-domain data of at least one stability-determining physical quantity in the power system; The data processing module 203 is used to generate two-dimensional real-time image data in RGB format based on the real-time time domain data according to the unified curve imaging protocol. The inference output module 204 is used to take the real-time image data as input to the optimal stability model of the corresponding stability-determining physical quantity, output the stability label of each stability-determining physical quantity, and output the determination result of the transient stability of the power system according to the stability label. The stability label is used to indicate whether the corresponding stability-determining physical quantity in the power system is stable, and the determination result is used to indicate whether the power system is stable.
[0077] The steps of the power system transient stability determination device and the power system transient stability determination method described in this preferred embodiment to obtain real-time time-domain data of the physical quantities for power system stability determination, convert them into real-time image data, input them into the optimal stability determination model, and obtain the determination result are the same, and the technical effects achieved are also the same, so they will not be repeated here.
[0078] Figure 3 This is a schematic diagram of the structure of an electronic device according to a preferred embodiment of the present invention. Figure 3 As shown, the electronic device includes one or more processors 301 and memory 302.
[0079] The processor 301 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0080] The memory 302 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 301 may execute the program instructions to implement the power system transient stability determination method of the various disclosed embodiments described above and / or other desired functions. In one example, the electronic device may also include an input device 303 and an output device 304, these components being interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0081] In addition, the input device 303 may also include, for example, a keyboard, a mouse, etc.
[0082] The output device 304 can output various information to the outside. The output device 304 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0083] Of course, for the sake of simplicity, Figure 3Only some of the components of the electronic device relevant to the present invention are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device may include any other suitable components depending on the specific application.
[0084] In addition to the methods and devices described above, embodiments of the present invention may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the power system transient stability determination methods according to various embodiments of the present invention described in the "Exemplary Methods" section of this specification.
[0085] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of the present invention. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0086] Furthermore, embodiments of the present invention may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps in the power system transient stability determination method according to various embodiments of the present invention described in the "Exemplary Methods" section above.
[0087] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0088] The basic principles of the present invention have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in the present invention are merely examples and not limitations, and should not be considered as essential features of each embodiment of the present invention. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the present invention to the necessity of employing the aforementioned specific details.
[0089] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, since they largely correspond to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0090] The block diagrams of devices, apparatuses, devices, and systems involved in this invention are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0091] The apparatus and methods of the present invention may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of the present invention are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, the present invention may also be implemented as a program recorded on a recording medium, the program comprising machine-readable instructions for implementing the methods according to the present invention. Thus, the present invention also covers recording media storing programs for performing the methods according to the present invention.
[0092] It should also be noted that in the apparatus, device, and method of the present invention, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered equivalents of the present invention. The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the invention. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the invention. Therefore, the invention is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.
[0093] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the invention to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.
Claims
1. A method for determining the transient stability of a power system, characterized in that, The method includes: Historical time-domain data of each physical quantity in the power system is acquired, and the historical time-domain data of each stability-determining physical quantity is converted into two-dimensional historical image data in RGB format according to a unified curve imageization protocol. Based on the historical image data of each stability-determining physical quantity, the initial stability-determining model based on the pre-trained ConvNeXt deep learning model is trained, verified, and tested to generate the optimal stability-determining model for each stability-determining physical quantity. The stability-determining physical quantities include generator power angle, bus voltage, and system frequency. The initial stability-determining model for each stability-determining physical quantity reuses the backbone network and pre-trained weights of the same pre-trained ConvNeXt deep learning model. Acquire real-time time-domain data of at least one stability-determining physical quantity in a power system; According to the unified curve imaging protocol, the real-time temporal data is converted into two-dimensional real-time image data in RGB format; The real-time image data is used as the input of the optimal stability model for the corresponding stability-determining physical quantity. The stability label of each stability-determining physical quantity is output, and the determination result of the transient stability of the power system is output based on the stability label. The stability label is used to indicate whether the corresponding stability-determining physical quantity in the power system is stable, and the determination result is used to indicate whether the power system is stable.
2. The method according to claim 1, characterized in that, Before acquiring historical time-domain data for each stability-determining physical quantity in the power system, a unified curve visualization protocol is defined, wherein the unified curve visualization protocol includes: The time-domain data is resampled according to the set uniform sampling frequency and uniform number of data points to obtain resampled time-domain data with a consistent time base. Using time as the horizontal axis, with a fixed number of pixels along the horizontal axis, the sampling points of the resampled temporal data are mapped to a fixed pixel interval on the horizontal axis at equal intervals according to time sequence, thus establishing a definite linear correspondence between the pixels on the horizontal axis and time. Using a stability-determining physical quantity as the vertical axis, the values of this stability-determining physical quantity within its preset value range are mapped linearly to a set pixel interval on the vertical axis. Furthermore, the same stability-determining physical quantity uses the same preset value range and the same pixel interval on the vertical axis when generating the historical image data and the real-time image data. According to the set unified rendering parameters, the curve trajectory corresponding to the resampled time domain data is drawn as an RGB image with a unified length and width. Each stability curve of each stability-determining physical quantity is drawn as a separate RGB image with the same unified length and width. One stability curve corresponds to one data sample, so that the unified length and width are independent of the scale of the power system and the number of stability-determining physical quantities.
3. The method according to claim 2, characterized in that, The unified rendering parameters include the number of pixels in the canvas width and height, curve line width, curve color, background color, and anti-aliasing switch. The unified sampling frequency and the unified number of data points are independent of the simulation step size of the time-domain simulation computing platform that generates the time-domain data, so that the RGB images generated by the same transient process on different time-domain simulation computing platforms are consistent with each other. The same transient process is a transient process with the same fault type, fault location, fault clearing time, initial running state, and simulation time window. The consistency means that the pixel-by-pixel difference rate of the generated RGB images is not greater than a set threshold.
4. The method according to claim 2, characterized in that, The process of training, validating, and testing the initial stability model based on the pre-trained ConvNeXt deep learning model to generate the optimal stability model for each stability physical quantity includes: An initial stability model for each stable physical quantity is generated based on a pre-trained ConvNeXt deep learning model. The initial stability model includes the backbone network of the pre-trained ConvNeXt deep learning model and a replaced classification head. The backbone network includes multiple network stages connected in sequence. The classification head is a classifier containing an adaptive average pooling layer, a flattening layer, a normalization layer, and a fully connected layer with an output dimension of 2. The historical time-domain data of each stability-determining physical quantity constitutes the data sample set of that stability-determining physical quantity, and the data samples in the data sample set are divided into an initial training set, an initial validation set, and an initial test set according to a set ratio; Physical consistency enhancement is performed on the data samples in the initial training set for each stable physical quantity to generate a corresponding enhanced training set; For each stable physical quantity, the data samples in the enhanced training set, initial validation set, and initial test set are rendered according to the unified curve visualization protocol to generate the corresponding image training set, image validation set, and image test set. The data samples in the image training set, image validation set, and image test set are standardized respectively to generate a standard training set, a standard validation set, and a standard test set. Based on the standard training set, standard validation set, and standard test set for each stability-determining physical quantity, the initial stability-determining model is trained, validated, and tested respectively, and the model with the highest accuracy on the standard validation set is taken as the optimal stability-determining model for each stability-determining physical quantity.
5. The method according to claim 4, characterized in that, The physical consistency enhancement is performed on the data samples in the initial training set for each stable physical quantity, wherein: The physical consistency enhancement includes at least one of the following: overall translation along the time axis, clipping and padding along the time axis, amplitude scaling within the preset value range according to a set ratio, superimposing random noise that conforms to the measurement noise distribution, data point loss according to a set loss rate, and curve line width jitter. The random noise is Gaussian noise with a mean of 0. The physical consistency enhancement does not include horizontal flipping along the time axis, nor does it include rotational transformations that cause points on the curve to deviate from their original horizontal axis pixel positions.
6. The method according to claim 4, characterized in that, The standardization of data samples in the image training set, image validation set, and image test set to generate standard training set, standard validation set, and standard test set includes: Map the pixel values of the data samples in the image training set, image validation set, and image test set to [0,1]; and Based on the channel mean and channel standard deviation of the pre-training dataset used by the pre-trained ConvNeXt deep learning model, the three color channels of the data sample are normalized respectively to align the input distribution of the data sample with the pre-training input distribution of the pre-trained ConvNeXt deep learning model, thereby generating a standard training set, a standard validation set, and a standard test set.
7. The method according to claim 4, characterized in that, The initial stability model is trained, including a two-stage fine-tuning process involving phased unfreezing, specifically: In the first stage, all parameters of the backbone network are frozen, and the classification head is trained only with the set baseline learning rate until the accuracy of the standard validation set no longer improves in the set consecutive rounds. In the second stage, the network phase at the end of the backbone network is unfrozen, and the parameters of the unfrozen part are trained with the backbone learning rate. At the same time, the classification head is trained with the benchmark learning rate, wherein the backbone learning rate is less than the benchmark learning rate, and the ratio of the two is the set difference coefficient. In both the first and second stages, cross-entropy loss with class weights is used as the loss function. The class weights include stable class weights and unstable class weights, which are determined by dividing the total number of samples in the standard training set by the product of the number of classes and the number of samples in the corresponding class.
8. The method according to claim 4, characterized in that, The step of using the real-time image data as input to the optimal stability model for the corresponding stability-determining physical quantity and outputting a stability label for each stability-determining physical quantity includes: The real-time image data is input into the optimal stability model of the corresponding stability-determining physical quantity to obtain the instability probability of the stability-determining physical quantity. The instability probability is compared with the decision threshold of the stability physical quantity. When the instability probability is not less than the decision threshold, a stability label indicating that the stability physical quantity is unstable is output; otherwise, a stability label indicating that the stability physical quantity is stable is output. When the instability probability falls within the uncertainty range set around the decision threshold, the corresponding time-domain data will be marked as a sample to be reviewed and a review prompt will be output. The decision threshold is determined on the standard verification set by searching for the value that minimizes the false alarm rate within a set threshold search interval, with the constraint that the false alarm rate of unstable samples is not greater than the set upper limit of the false alarm rate. The decision threshold for each stable physical quantity is determined independently.
9. The method according to claim 4, characterized in that, The method further includes: When the stability label corresponding to the stability physical quantity becomes unstable, the class activation heatmap of the instability category is calculated based on the feature map output by the terminal network stage in the optimal stability model. Aggregate the aforementioned class activation heatmaps along the vertical axis to obtain a one-dimensional attention distribution along the horizontal axis. Within the fixed pixel range of the horizontal axis, according to the linear correspondence between horizontal axis pixels and time in the unified curve imaging protocol, the horizontal axis pixel range in the one-dimensional attention distribution where the attention is greater than the set attention threshold is mapped back to the time range, which is then output as the instability characteristic period of the unstable physical quantity.
10. The method according to claim 9, characterized in that, The transient stability determination result of the power system is output based on the stability label, including: The output judgment result is that the power system is stable if and only if all stability label flags correspond to stable physical quantities. Otherwise, the output judgment result is that the power system is unstable, and the earliest stable physical quantity and its instability characteristic period are output.
11. The method according to claim 7, characterized in that, The method also includes model adaptation of cross-discriminatory stable physical quantities, specifically: After obtaining the optimal stability model of the first stability physical quantity, the optimal stability model of the first stability physical quantity is fine-tuned using historical image data of the second stability physical quantity generated according to the unified curve imagery protocol. The model obtained by the two-stage fine-tuning is then used as the optimal stability model of the second stability physical quantity. Among them, the first stability-determining physical quantity and the second stability-determining physical quantity are two different quantities among generator power angle, bus voltage and system frequency.
12. A device for determining the transient stability of a power system, characterized in that, The device includes: The model building module is used to acquire historical time-domain data of each stability-determining physical quantity in the power system, convert the historical time-domain data into two-dimensional historical image data in RGB format according to a unified curve imagery protocol, and train, verify, and test the initial stability-determining model based on the pre-trained ConvNeXt deep learning model based on the historical image data of each stability-determining physical quantity, and generate the optimal stability-determining model for each stability-determining physical quantity. The stability-determining physical quantities include generator power angle, bus voltage, and system frequency. The initial stability-determining model for each stability-determining physical quantity reuses the backbone network and pre-trained weights of the same pre-trained ConvNeXt deep learning model. The data acquisition module is used to acquire real-time time-domain data of at least one stability-determining physical quantity in the power system. The data processing module is used to generate two-dimensional real-time image data in RGB format based on the real-time time domain data according to the unified curve imaging protocol. The inference output module is used to take the real-time image data as input to the optimal stability model of the corresponding stability-determining physical quantity, output the stability label of each stability-determining physical quantity, and output the determination result of the transient stability of the power system based on the stability label. The stability label is used to indicate whether the corresponding stability-determining physical quantity in the power system is stable, and the determination result is used to indicate whether the power system is stable.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method as described in any one of claims 1 to 11.
14. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the steps of the method as claimed in any one of claims 1 to 11.