Extreme weather power grid fault scene generation method and system

By using WGAN-GP generation adversarial network and K-medoids clustering algorithm, the data dependence and computational complexity in power grid fault scenario generation in extreme weather was solved, and high-quality and diverse fault scenario samples were generated, which improved the generalization ability and accuracy of the model.

CN119807793APending Publication Date: 2025-04-11CHINA SOUTHERN POWER GRID COMPANY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411919928.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The prior art has problems with data dependence, computational complexity and model accuracy in the generation of power grid failure scenarios in extreme weather, making it difficult to effectively capture new types of extreme weather events that may occur in the future.

Method used

The network variant WGAN-GP based on Wasserstein distance is used to generate and augment the scene data, and the quality of the generated data is evaluated through Wasserstein Distance and Fréchet Inception Distance. Finally, the generated data is clustered using the K-medoids algorithm to filter out high-frequency scenarios.

Benefits of technology

Generate high-quality and diverse grid fault scenario samples to cover multiple aspects of data distribution, reduce dependence on historical data, improve the model's generalization ability of different fault conditions, and reduce calculation costs and overfitting risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807793A_ABST
    Figure CN119807793A_ABST
Patent Text Reader

Abstract

The invention discloses an extreme weather power grid fault scene generation method and system. The method comprises the following steps: collecting fault ledger data, meteorological big event records and meteorological observation data of power grid operation and maintenance management; data preprocessing and data analysis are carried out; based on the constructed extreme weather fault scene data sample, constructing a WGAN-GP network model, and training the network model to generate fault scene sample data; evaluating the generated scene data, determining training parameters according to an evaluation index and distribution analysis of the generated data and the original data, and obtaining optimal generated scene data; and cutting down the generated scenes, cutting down a large number of generated scenes through a K-medoids method, and screening out high-frequency scenes. The method has the advantages that the quality of the generated data is improved, the method is closer to the distribution of real data, the generated samples can be better generalized, the human deviation is reduced, and the transparency of the data generation capability of the model is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power grid operation management and maintenance, and in particular to a method and system for generating extreme weather power grid failure scenarios based on a generative adversarial network. Background Art

[0002] In recent years, the occurrence of extreme weather events such as heavy rain, floods, typhoons, and blizzards may not only damage power grid equipment and cause line tripping, but also cause large-scale power outages, posing huge challenges to the safe and stable operation of the power grid, and also causing serious impacts on the social economy and people's lives. Therefore, studying the generation technology of power grid fault scenarios under extreme weather conditions has far-reaching significance for the stable operation and intelligent management of the power grid.

[0003] Generally speaking, extreme weather events such as typhoons, heavy rains, and snowstorms do not usually occur frequently, resulting in relatively few historical fault records. This scarcity of data limits the training of traditional machine learning models because they require a large amount of data to learn fault characteristics. Due to insufficient data, the model may not be able to accurately capture the impact of extreme weather on the power grid, resulting in reduced accuracy of prediction and diagnosis.

[0004] By artificially generating grid failure scenarios under extreme weather conditions, richer data can be provided to the model, especially when historical data is insufficient. Scenario generation technology can help simulate a variety of possible failure scenarios, thereby providing more comprehensive training samples for the fault warning model. This diversity of simulated data helps improve the model's ability to generalize to different fault conditions, enabling it to better cope with unknown extreme events in the real world. At the same time, using augmented data in model training can also help identify and mitigate potential data biases, ensuring that the model maintains performance in the face of real-world diversity.

[0005] At present, the methods for generating power grid fault scenarios under extreme weather conditions mainly include the following two methods: (1) Methods based on statistical analysis: By analyzing the impact of historical extreme weather events on the power grid, the climate-topography state parameters of the power grid are determined, and discrete distribution functions are constructed to evaluate the line vulnerability; (2) Monte Carlo random sampling: The Monte Carlo method is used to analyze the vulnerability of power grid lines, generate possible fault scenarios, and combine the correlation analysis between the access location of distributed power sources and extreme weather to construct a power grid model under extreme weather conditions.

[0006] However, the current deficiencies mainly include: (1) Data dependence: Existing methods may rely too much on historical data and statistical analysis, and may not be able to fully capture new types of extreme weather events that may occur in the future. (2) Computational complexity: As the scale of the power grid expands and the types of extreme weather increase, the amount of computation required to generate fault scenarios may increase dramatically, resulting in high computational costs. (3) Model accuracy: When simulating the impact of extreme weather on power grid components, the model may have certain assumptions and simplifications, which may affect the accuracy of fault scenario generation. Therefore, how to overcome the impact of traditional methods on the generation of extreme weather power grid fault scenarios urgently needs in-depth research and exploration. Summary of the invention

[0007] In view of the defects of the prior art, the present invention provides a method and system for generating extreme weather power grid failure scenarios. A variant of the adversarial generative network based on Wasserstein distance, WGAN-GP (Wasserstein GAN with Gradient Penalty), is used to generate and augment scenario data. The effect of generating scenario data is evaluated by Wasserstein Distance and Fréchet Inception Distance (FID). Finally, the K-medoids algorithm is used to cluster the generated data to filter out the scenarios that appear frequently.

[0008] In order to achieve the above invention object, the technical solution adopted by the present invention is as follows:

[0009] A method for generating an extreme weather power grid failure scenario comprises the following steps:

[0010] S1: Collect fault log data, major meteorological event records and meteorological observation data for power grid operation and maintenance management, and perform data preprocessing and data analysis;

[0011] S2: Based on the extreme weather fault scenario data samples constructed in step S1, a WGAN-GP network model is constructed, including: constructing a discriminator and a generator, and training the network model to generate fault scenario sample data;

[0012] S3: Generate fault scenario sample data for evaluation, determine training parameters based on evaluation indicators and distribution analysis of generated fault scenario sample data and original data, and obtain optimal generated scenario data.

[0013] S4: Generate scene reduction, which uses the K-medoids method to reduce a large number of generated scenes and screen out high-frequency scenes.

[0014] Furthermore, a discriminator is constructed in S2, which specifically includes:

[0015] The discriminator is constructed using a fully connected network or a convolutional neural network (CNN). The network contains linear layers and activation layers, and the output head is a linear layer.

[0016] The input includes real data and generated data, both of which have the same dimension and distribution.

[0017] The discriminator outputs a scalar value representing the probability that the data is real.

[0018] Use Wasserstein distance as the loss function:

[0019] L D = sup E x~p(x) (D(x))-E z~p(z) (D(G(z)))

[0020] Introduce gradient penalty to ensure Lipschitz continuity:

[0021]

[0022] The loss function of the discriminator is:

[0023] L GP =E z~p(z) (D(G(z)))-E x~p(x) (D(x))+λ·L p |s

[0024] In the formula, sup represents the upper bound of the score function of the discriminator D, and the discriminator D needs to satisfy 1-Lipschitz continuity. x~p(x) random variable x is sampled from the real data distribution p(x), E represents the expected value, and D(x) represents the score of the discriminator on the real data x. D(G(z)) The score of the discriminator on the generated data G(z). E z~p(z) represents the expected value of the random variable z, where z follows the distribution p(z). λ represents the weight coefficient of the gradient penalty term. L p |s is the Lipschitz continuity gradient penalty enhancement term, s is the variable for interpolation between the generated sample and the real sample, and t follows a uniform distribution from 0 to 1. L GP is the loss function of the discriminator.

[0025] The training process of the discriminator:

[0026] Update the discriminator and generator alternately. Fix the generator, update the discriminator, and minimize L D +L GP . Fix the updated discriminator, update the generator, and maximize -L D .

[0027] Furthermore, a generator is constructed in S2, which specifically includes:

[0028] The backbone network for building the generator contains multiple fully connected modules, each of which consists of a linear layer, a batch normalization layer, and an activation layer. The output head includes a linear layer and an activation layer to constrain the generated data.

[0029] The input is random noise, sampled from a standard normal distribution, and the input dimension is determined by the generator design.

[0030] The output is the generated data, which has the same dimensions as the real data. An activation function is used to match the distribution range of the real data.

[0031] Using Wasserstein distance as the loss function, the goal is to maximize the score of the discriminator on the generated data:

[0032] L G =-E z~p(z) (D(G(z)))

[0033] Generator training process:

[0034] Update the generator and discriminator alternately. Fix the generator and update the discriminator; fix the updated discriminator and update the generator to maximize its loss function L G .

[0035] Furthermore, Wasserstein Distance and Fréchet Inception Distance (FID) are selected as evaluation indicators of generated data quality in S3.

[0036] Use Wasserstein Distance to obtain generated sample data and real data.

[0037] Calculate the Wasserstein Distance between the generated data and the real data to measure the difference in their distributions.

[0038] Evaluate the Wasserstein Distance value. The smaller the value, the closer the distribution of the generated data is to the real data.

[0039] Use Fréchet Inception Distance (FID) to calculate the Fréchet distance between the feature distributions of real data and generated data. Evaluate the FID value, the smaller the value, the closer the generated data is to the real data in the feature space.

[0040] Furthermore, in S3, the training parameters of the WGAN-GP model are adjusted according to the evaluation results of Wasserstein Distance and FID. The WGAN-GP model is retrained using the optimized parameters, and the quality of the generated data is re-evaluated.

[0041] Furthermore, the steps of the K-medoids method in S4 for scene reduction are as follows:

[0042] (1) Data preprocessing: Clean and standardize the raw data to facilitate cluster analysis.

[0043] (2) Scenario definition: define the attributes and characteristics of the scenario, which will be used for subsequent clustering analysis.

[0044] (3) Select initial medoids: Randomly select k data points from the dataset as initial medoids.

[0045] (4) Cluster assignment: Based on the distance between each scene’s features and medoids, the scene is assigned to the cluster represented by the nearest medoid.

[0046] (5) Medoid update: For each cluster, recalculate the medoid and select the scene in the cluster that minimizes the sum of the distances from all scenes to the medoid as the new medoid.

[0047] (6) Iterative optimization: Repeat steps 4 and 5 until the medoids no longer change or the preset number of iterations is reached.

[0048] (7) Scenario frequency analysis: Perform frequency analysis on the medoids in each cluster to determine which scenarios have a higher probability of appearing.

[0049] (8) Extract high-frequency scenes: Extract medoids from each cluster as the representative of the cluster. These medoids represent scenes with a higher probability of occurrence.

[0050] (9) Result evaluation: Evaluate the quality of clustering results to ensure that the extracted scenes are representative.

[0051] The present invention also discloses a system for generating extreme weather power grid fault scenarios, which can be used to implement the above-mentioned method for generating extreme weather power grid fault scenarios, specifically comprising:

[0052] Data collection and preprocessing module, the functions are as follows:

[0053] Data collection: Collect fault log data, major meteorological event records and meteorological observation data for power grid operation and maintenance management.

[0054] Data preprocessing: Clean and standardize the collected raw data.

[0055] Data analysis: Analyze the distribution characteristics and correlation of data, identify key attributes and features, and provide support for subsequent model training.

[0056] Generate adversarial network model module, the functions are as follows:

[0057] Generator construction: Design a generator network structure to generate power grid failure scenario data under extreme weather conditions.

[0058] Discriminator construction: Design the discriminator network structure to distinguish generated data from real data.

[0059] WGAN-GP training: Use Wasserstein distance to optimize the performance of the generator and discriminator, introduce gradient penalty to enhance the Lipschitz continuity of the discriminator, and improve training stability.

[0060] Generate data: Generate fault scenario sample data based on the trained generator.

[0061] Generate a sample data evaluation module with the following functions:

[0062] Evaluation indicators: Wasserstein Distance is used to measure the distribution difference between generated data and real data, and Fréchet Inception Distance (FID) is used to calculate the feature distribution difference between generated data and real data.

[0063] Evaluation and parameter adjustment: Analyze the quality of the generated fault scenario sample data based on the evaluation indicators, adjust the model parameters, optimize the generation effect, and ensure that the quality of the generated data reaches the best state.

[0064] Generate a scene reduction module with the following functions:

[0065] K-medoids clustering: Perform data preprocessing on the generated fault scenario samples, including cleaning and standardization, define the attributes and characteristics of the scenario for cluster analysis, randomly select initial medoids, and perform cluster assignment, update medoids, and iterate optimization until the medoids are stable.

[0066] High-frequency scene screening: Perform frequency analysis to screen out high-frequency scenes and extract representative medoids as the final high-frequency scenes.

[0067] Furthermore, the extreme weather power grid fault scenario generation system further includes:

[0068] The results evaluation and optimization module has the following functions:

[0069] Result evaluation: Evaluate the quality of the generated and reduced scene data to ensure it is representative.

[0070] Optimization Suggestions: Provide optimization suggestions and improvement measures to further improve the performance of the scene generation system.

[0071] The result presentation module has the following functions:

[0072] Data visualization: Displays the generated fault scenario diagrams and distribution, such as fault location, impact range, and frequency analysis.

[0073] Report Generation: Automatically generate detailed reports containing generated scenario data and evaluation metrics.

[0074] Interactive analysis tools: Provides a scene browser and parameter adjustment tools to support real-time viewing and optimization of generated data.

[0075] Decision support: Conduct risk assessments and emergency response recommendations to help develop effective prevention and emergency response plans.

[0076] The present invention also discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for generating extreme weather power grid failure scenarios when executing the program.

[0077] The present invention also discloses a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method for generating extreme weather power grid failure scenarios is implemented.

[0078] Compared with the prior art, the advantages of the present invention are:

[0079] 1. Generate high-quality samples

[0080] (1) Stable training process: WGAN-GP uses the Wasserstein distance to evaluate the difference between generated data and real data, providing a more stable training process than traditional GAN. This distance metric reduces the risk of mode collapse during training and makes the generated samples closer to the distribution of real data.

[0081] (2) Diverse samples: This method is able to generate diverse data samples that cover multiple aspects of data distribution rather than being limited to common patterns in the dataset. This diversity improves the quality of the generated data and helps to more comprehensively simulate power grid failure scenarios under extreme weather.

[0082] 2. Flexible sample augmentation

[0083] (1) Unlimited data generation: Through WGAN-GP, any number of samples can be generated as needed, which enables sufficient training data to be obtained to enhance the training effect of the model when data is scarce. This flexibility overcomes the limitation of traditional sampling methods on the number of samples.

[0084] (2) Reduce the risk of overfitting: WGAN-GP generates new samples by learning the overall distribution of the data, reducing the reliance on specific samples in the training data, thereby reducing the risk of overfitting. This enables the generated samples to generalize better and improves the performance of the model in practical applications.

[0085] 3. Strong adaptability

[0086] (1) Processing complex data distribution: WGAN-GP can process multimodal and non-Gaussian distributed data and adapt to complex sample distributions. Compared with traditional methods, this adaptability enables the generated data to more accurately reflect the potential impact of extreme weather on the power grid.

[0087] (2) Reducing human bias: This method reduces the bias that may be introduced by manually selecting samples by automatically generating samples, thereby improving the objectivity and reliability of the generated data.

[0088] 4. Have a certain degree of explainability

[0089] The generated samples of WGAN-GP can be explained by its network structure and training process. This interpretability provides a deep understanding of the generation process and enhances the transparency of the model's ability to generate data. BRIEF DESCRIPTION OF THE DRAWINGS

[0090] Figure 1 It is a flow chart of a method for generating extreme weather power grid failure scenarios according to an embodiment of the present invention.

[0091] Figure 2 It is a flow chart of step S1 of an embodiment of the present invention.

[0092] Figure 3 It is a flow chart of step S2 of an embodiment of the present invention. DETAILED DESCRIPTION

[0093] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and examples.

[0094] like Figure 1 As shown, the present invention provides a method for generating an extreme weather power grid failure scenario, comprising the following steps:

[0095] S1: Collect fault log data, major meteorological event records and meteorological observation data for power grid operation and maintenance management, and perform data preprocessing and data analysis;

[0096] Table 1 Factors affecting power grid failure

[0097]

[0098] S2: Based on the extreme weather fault scenario data samples constructed in step S1, a WGAN-GP network model is constructed, and the network model is trained to generate fault scenario sample data;

[0099] S3: Generate scene data evaluation. According to the evaluation index and the distribution analysis of the generated data and the original data, determine the training parameters to obtain the best generated scene data. Calculate the distance between the generated scene data and the original data. Prepare the time series sample data by sliding the window to ensure the continuity of the generated samples in the time series. And determine the optimal window size through ablation experiments. The specific results are shown in Table 2:

[0100] Table 2 Evaluation indicators for generating typhoon scenarios

[0101]

[0102]

[0103] In order to constrain the smoothness of the generated sample data in time series, the sliding time window method is used to input the real time series sample data into the GAN network at the same time to generate time series sample data. For the observation data with a fixed time interval, the optimal time window size is found by changing the time window size. The generated data are compared using two evaluation indicators, Wasserstein Distance and Fréchet Inception Distance. The distribution difference between the generated samples and the real samples is evaluated from different angles. As can be seen from Table 3, as the window size increases, the distances of Wasserstein Distance and Fréchet Inception Distance both increase. That is, the real distance between the two distributions increases. The distance between the generated samples and the real samples evaluated from the two perspectives of mean and covariance terms also increases. When the window increases from 3 to 5, Fréchet Inception Distance evaluates the difference between the generated samples and the real samples from the two perspectives of mean and covariance terms, and the distance increases significantly, but the actual physical distance between the two distributions does not increase significantly. This shows that the diversity of the generated data increases. When the window size continues to increase from 5, the true distance between the two distributions increases significantly, while the Fréchet Inception Distance does not increase significantly, so the window size of 5 is selected.

[0104] S4: Generate scene reduction, which uses the K-medoids method to reduce a large number of generated scenes and screen out high-frequency scenes.

[0105] like Figure 2 As shown, the S1 specifically includes:

[0106] S11: Extreme weather segment screening. Based on the records of major meteorological events, extreme weather scenes are identified and screened. This step involves identifying and selecting specific time periods during which significant meteorological events occurred.

[0107] S12: Slicing of meteorological observation data for extreme weather scenarios. Segments corresponding to extreme weather scenarios are selected from the meteorological observation data. This means extracting the parts corresponding to the identified extreme weather events from the continuous meteorological observation data.

[0108] S13: Grouping the Segments. Group the extracted meteorological observation sequences (segments) according to the data collection locations. Then, further subdivide these groups according to the continuity of time to obtain grouped data groups.

[0109] S14: Repeated value processing: For the same location, if there are repeated sampling data, the mean of multiple samplings is used as the final observation data.

[0110] S15: Deletion of severely missing data. Check the continuity of the data and delete any groups with long-term continuous missing values ​​to ensure data quality.

[0111] S16: Fill in the missing values. For the missing values ​​in the observation data of the same group, the bilinear interpolation method is used to fill them to ensure the integrity of the data.

[0112] S17: Joining extreme weather observation data with fault log data. Combined with the fault log data, the fault status information is filled into the corresponding extreme weather observation data to facilitate correlation analysis between faults and meteorological conditions.

[0113] S18: Pearson correlation coefficient analysis. Perform correlation analysis on multi-dimensional observation data and fault status, and select key features that can characterize extreme weather fault status.

[0114] S19: Key feature distribution analysis. Perform statistical analysis on the distribution of key feature data and draw box plots. Prepare for generating data constraints based on adversarial generative networks.

[0115] The results of data statistical analysis are shown in Table 3:

[0116] Table 3 Statistical analysis results of raw data

[0117]

[0118]

[0119] like Figure 3 As shown, the S2 specifically includes:

[0120] Due to the randomness of extreme weather and the insufficient number of training samples, model training is difficult. The original adversarial generative network (GAN) training process is prone to instability and training crash problems.

[0121] WGAN-GP improves the stability of training and the quality of generated samples through Wasserstein distance and gradient penalty. The specific performance is as follows: WGAN-GP uses Wasserstein distance to measure the difference between the distribution of real data and the distribution of generated data, which makes the training process more stable and reduces the risk of mode collapse; in traditional GAN, the output of the discriminator is usually normalized by the Sigmoid function, which may cause the gradient to disappear or explode. WGAN-GP avoids this problem because it does not need to normalize the output of the discriminator; WGAN-GP introduces gradient penalty, which helps to ensure that the gradient of the discriminator remains within a reasonable range during training, thereby improving the stability of training; WGAN-GP is able to learn more effective feature representations because it does not rely on the output distribution of the discriminator, but directly optimizes the Wasserstein distance between generated data and real data;

[0122] Building the Discriminator

[0123] The goal of the Discriminator is to distinguish real data from fake data generated by the generator.

[0124] Discriminator network architecture: Discriminator is a simple multiple fully connected network consisting of linear layers and activation layers. The network output head is a simple linear layer.

[0125] Typically this is a deep neural network, either a convolutional neural network (CNN) for image data or a fully connected network (FCN) for other types of data.

[0126] Discriminator input: The input of Discriminator consists of two parts: real data and fake data generated by the generator. Real data and fake data have the same dimension and distribution.

[0127] Discriminator output: The output of the Discriminator is a scalar value indicating the probability that the input data is the real data, that is, the output is the unnormalized raw score because the Wasserstein distance is used as the loss function.

[0128] Discriminator loss function: WGAN-GP uses Wasserstein distance as the loss function. Using Wasserstein distance instead of JS divergence for data augmentation can alleviate the crash problem caused by unstable training. In order to enhance the stability of Wasserstein distance, gradient penalty is introduced. The introduction of gradient penalty enhances Lipschitz continuity and makes the model converge faster.

[0129] L D = sup E x~p(x) (D(x))-E z~p(z) (D(G(z)))

[0130] In the formula, sup represents the upper bound, and the discriminator D needs to satisfy 1-Lipschitz continuity.

[0131]

[0132] Where, L p |s is the Lipschitz continuity gradient penalty enhancement term, s is the variable for interpolation between the generated sample and the real sample, and t follows a uniform distribution from 0 to 1. L GP is the loss function of the discriminator.

[0133] Discriminator Training:

[0134] During the training process, the Discriminator and Generator are updated alternately. In each iteration, the Generator is first fixed, the Discriminator is updated, and the loss function LD+LGP is minimized. Then the updated Discriminator is fixed, the Generator is updated, and -LD is maximized.

[0135] Build Generator

[0136] The goal of the Generator is to generate fake data that is as close to the real data distribution as possible.

[0137] Generator network architecture: The Generator backbone network contains multiple fully connected modules, each of which consists of a linear layer, a batch normalization layer, and an activation layer. The network output head is composed of a linear layer and an activation layer. In the generator network, the generated data is constrained according to the boundary value of the original data to ensure the validity and rationality of the generated data.

[0138] Generator input: The input to the generator is random noise, usually a vector sampled from a standard normal distribution. The dimensionality of the input depends on the design and complexity of the generator.

[0139] Generator output: The output of the Generator is the generated data, whose dimension should be the same as the real data. The output data passes through an activation function (such as Tanh or Sigmoid) to match the distribution range of the real data.

[0140] Generator loss function: WGAN-GP uses Wasserstein distance as the loss function, which requires that the data generated by the Generator can maximize the score of the Discriminator. The loss function calculation formula of the Generator is:

[0141] L G =-E z~p(z) (D(G(z)))

[0142] Among them, D(G(z)) is the score of the Discriminator on the data generated by the Generator, and p(z) is the noise distribution.

[0143] Generator training: During the training process, the Discriminator and Generator are updated alternately. In each iteration, the Generator is first fixed and the Discriminator is updated; then the updated Discriminator is fixed and the Generator is updated to maximize its loss function L G .

[0144] The sample data evaluation indicators generated in S3 include:

[0145] Wasserstein Distance is a method to measure the difference between two probability distributions. Wasserstein Distance can be used to evaluate the difference in probability distribution between the data generated by the generator and the real data.

[0146] W(P,Q)=min γ∈∏(P,Q) E (x,y)~γ[||xy||]

[0147] Where: P and Q are two probability distributions, ∏(P,Q) is the set of all possible joint distributions, and the marginal distributions of these joint distributions are P and Q. γ is a specific joint distribution, E represents the expected value, and ||xy|| is the distance between any two points x and y.

[0148] Fréchet Inception Distance (FID) calculates the Fréchet distance between the feature distributions of real data and generated data, that is, the distance between two multivariate Gaussian distributions. FID first calculates the mean and covariance matrix of the two data sets, and then uses these statistics to estimate the Fréchet distance between the two distributions.

[0149] FID(P,Q)=||μ P -μ Q ||+Tr(∑ P +∑ Q -2(∑ P ∑ Q ) 1 / 2

[0150] Where: P and Q are the characteristic distributions of real data and generated data respectively. P and μ Q is the mean vector of the two distributions. ∑ P and∑ Q is the covariance matrix of the two distributions. ||.|| represents the Euclidean distance (L2 norm). Tr represents the trace of the matrix. (∑ P ∑ Q ) 1 / 2 is the square root of the product of two covariance matrices and is computed using singular value decomposition (SVD).

[0151] The sample data generated in S4 is reduced:

[0152] The scene data generated by WGAN often contains outliers or noise, and the generated multidimensional data may be non-spherical or irregular data clusters. K-medoids has good robustness to outliers and noise, and can find non-spherical data clusters with irregular data distribution. And medoid selection is based on minimization of distance rather than random mean calculation, so the results of each iteration are relatively stable. Therefore, this paper uses the K-medoids algorithm for scene reduction to select scenes with obvious features and a high probability of occurrence.

[0153] The K-medoids algorithm is used for the basic steps of scene reduction:

[0154] (1) Data preprocessing: Clean and standardize the raw data to facilitate cluster analysis.

[0155] (2) Scenario definition: define the attributes and characteristics of the scenario, which will be used for subsequent clustering analysis.

[0156] (3) Select initial medoids: Randomly select k data points from the dataset as initial medoids.

[0157] (4) Cluster assignment: Based on the distance between each scene’s features and medoids, the scene is assigned to the cluster represented by the nearest medoid.

[0158] (5) Medoid update: For each cluster, recalculate the medoid and select the scene in the cluster that minimizes the sum of the distances from all scenes to the medoid as the new medoid.

[0159] (6) Iterative optimization: Repeat steps 4 and 5 until the medoids no longer change or the preset number of iterations is reached.

[0160] (7) Scenario frequency analysis: Perform frequency analysis on the medoids in each cluster to determine which scenarios have a higher probability of appearing.

[0161] (8) Extract high-frequency scenes: Extract medoids from each cluster as the representative of the cluster. These medoids represent scenes with a higher probability of occurrence.

[0162] (9) Result evaluation: Evaluate the quality of clustering results to ensure that the extracted scenes are representative.

[0163] In another embodiment of the present invention, a system for generating an extreme weather power grid fault scenario is provided. The system can be used to implement the above-mentioned method for generating an extreme weather power grid fault scenario, specifically comprising:

[0164] Data collection and preprocessing module, the functions are as follows:

[0165] Data collection: Collect fault log data of power grid operation and maintenance management, records of major meteorological events (such as typhoons, heavy rains, blizzards, etc.), and meteorological observation data (including real-time meteorological data and historical data).

[0166] Data preprocessing: The collected raw data is cleaned (noise data is removed and missing values ​​are corrected) and standardized (data normalization is performed to ensure that the data is analyzed at the same scale).

[0167] Data analysis: Analyze the distribution characteristics and correlation of data, identify key attributes and features, and provide support for subsequent model training.

[0168] Generate adversarial network model module, the functions are as follows:

[0169] Generator construction: Design a generator network structure to generate power grid failure scenario data under extreme weather conditions.

[0170] Discriminator construction: Design the discriminator network structure to distinguish generated data from real data.

[0171] WGAN-GP training: Use Wasserstein distance to optimize the performance of the generator and discriminator, introduce gradient penalty to enhance the Lipschitz continuity of the discriminator, and improve training stability.

[0172] Generate data: Generate fault scenario sample data based on the trained generator.

[0173] Generate a sample data evaluation module with the following functions:

[0174] Evaluation indicators: Wasserstein Distance is used to measure the distribution difference between generated data and real data, and Fréchet Inception Distance (FID) is used to calculate the feature distribution difference between generated data and real data.

[0175] Evaluation and parameter adjustment: Analyze the quality of the generated fault scenario sample data based on the evaluation indicators, adjust the model parameters, optimize the generation effect, and ensure that the quality of the generated data reaches the best state.

[0176] Generate a scene reduction module with the following functions:

[0177] K-medoids clustering: Perform data preprocessing on the generated fault scenario samples, including cleaning and standardization, define the attributes and characteristics of the scenario for cluster analysis, randomly select initial medoids, and perform cluster assignment, update medoids, and iterate optimization until the medoids are stable.

[0178] High-frequency scene screening: Perform frequency analysis to screen out high-frequency scenes and extract representative medoids as the final high-frequency scenes.

[0179] The results evaluation and optimization module has the following functions:

[0180] Result evaluation: Evaluate the quality of the generated and reduced scene data to ensure it is representative.

[0181] Optimization Suggestions: Provide optimization suggestions and improvement measures to further improve the performance of the scene generation system.

[0182] The result presentation module has the following functions:

[0183] Data Visualization

[0184] Fault scenario diagram: The generated fault scenario data is presented in the form of a chart or map, including the fault location, impact range, and extreme weather conditions.

[0185] Scene distribution: Displays the distribution of generated scenes in the feature space to help users understand the diversity and distribution of scenes.

[0186] Frequency analysis: Use a bar chart or pie chart to show the distribution of high-frequency scenarios and identify which scenarios are most common.

[0187] Report Generation

[0188] Automatic Reporting: Generates automatic reports containing data analysis results, statistics of generated scenarios, and evaluation metrics.

[0189] Fault scenario description: Provides a detailed description of the generated scenario, including influencing factors, scenario characteristics, and potential impacts.

[0190] Interactive analysis tools

[0191] Scenario Browser: Provides an interactive tool that allows users to browse and filter different generated scenarios to view specific fault conditions and related data.

[0192] Parameter Adjustment: Allows users to adjust generation and evaluation parameters and view their impact on the generated scenario in real time, helping to optimize the data generation and analysis process.

[0193] Decision support

[0194] Risk assessment: Perform risk assessment based on the generated failure scenario data to identify potential high-risk areas and failure types.

[0195] Emergency Response Recommendations: Provide recommendations for emergency response and preventive measures to develop more effective emergency plans based on generated scenario data.

[0196] In another embodiment of the present invention, a terminal device is provided, the terminal device includes a processor and a memory, the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., which are the computing core and control core of the terminal, which are suitable for implementing one or more instructions, and are specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding functions; the processor described in the embodiment of the present invention can be used for the operation of the above-mentioned extreme weather power grid fault scenario generation method.

[0197] In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory), which is a memory device in a terminal device for storing programs and data. It is understandable that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and the extended storage medium supported by the terminal device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage.

[0198] One or more instructions stored in a computer-readable storage medium can be loaded and executed by a processor to implement the corresponding steps of the method for generating extreme weather power grid failure scenarios in the above-mentioned embodiment; one or more instructions in the computer-readable storage medium are loaded and executed by the processor.

[0199] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0200] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0201] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0202] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0203] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the implementation methods of the present invention, and should be understood that the protection scope of the present invention is not limited to such special statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.

Claims

1. A method for generating extreme weather power grid failure scenarios, characterized in that: The following steps are involved: S1: Collect fault log data, major meteorological event records and meteorological observation data for power grid operation and maintenance management; And perform data preprocessing and data analysis; S2: Based on the extreme weather fault scenario data samples constructed in step S1, a WGAN-GP network model is constructed, including: constructing a discriminator and a generator, and training the network model to generate fault scenario sample data; S3: Generate fault scenario sample data evaluation, determine training parameters based on evaluation indicators and distribution analysis of generated fault scenario sample data and original data, and obtain optimal generated scenario data; S4: Generate scene reduction, which uses the K-medoids method to reduce a large number of generated scenes and screen out high-frequency scenes.

2. The method for generating extreme weather power grid failure scenarios according to claim 1, characterized in that: The discriminator is constructed in S2, which includes: Use a fully connected network or a convolutional neural network (CNN) to build a discriminator; the network contains a linear layer and an activation layer, and the output head is a linear layer; The input includes real data and generated data, both of which have the same dimension and distribution; The discriminator outputs a scalar value, which represents the probability that the data is real; Use Wasserstein distance as the loss function: L D =sup E x~p(x) (D(x))-E z~p(z) (D(G(z))) Introduce gradient penalty to ensure Lipschitz continuity: The loss function of the discriminator is: L GP =E z~p(z) (D(G(z)))-E x~p(x) (D(x))+λ·L p |s In the formula, sup represents the upper bound of the scoring function of the discriminator D, and the discriminator D needs to satisfy 1-Lipschitz continuity; x~p(x) random variable x is sampled from the real data distribution p(x), E represents the expected value, D(x) represents the score of the discriminator on the real data x; D(G(z)) is the score of the discriminator on the generated data G(z); E z~p(z) represents the expected value of the random variable z, where z follows the distribution p(z); λ represents the weight coefficient of the gradient penalty term; L p |s is the Lipschitz continuity gradient penalty enhancement term, s is the variable for interpolation between the generated sample and the real sample, and t follows a uniform distribution from 0 to 1; L GP is the loss function of the discriminator; The training process of the discriminator: Update the discriminator and generator alternately; fix the generator, update the discriminator, and minimize L D +L GP ;Fix the updated discriminator, update the generator, and maximize -L D .

3. The method for generating extreme weather power grid failure scenarios according to claim 2, characterized in that: The generator is constructed in S2, including: The backbone network for building the generator consists of multiple fully connected modules, each of which consists of a linear layer, a batch normalization layer, and an activation layer; the output head includes a linear layer and an activation layer to constrain the generated data; The input is random noise, sampled from a standard normal distribution, and the input dimension is determined by the generator design; The output is the generated data, whose dimension is the same as the real data; the activation function is used to match the distribution range of the real data; Using Wasserstein distance as the loss function, the goal is to maximize the score of the discriminator on the generated data: L G =-E z~p(z) (D(G(z))) Generator training process: Update the generator and discriminator alternately; fix the generator and update the discriminator; fix the updated discriminator and update the generator to maximize its loss function L G .

4. The method for generating extreme weather power grid failure scenarios according to claim 1, characterized in that: In S3, Wasserstein Distance and Fréchet Inception Distance, abbreviated as FID, are selected as evaluation indicators of generated data quality; Use Wasserstein Distance to obtain generated sample data and real data; Calculate the Wasserstein Distance between the generated data and the real data to measure their distribution differences; Evaluate the Wasserstein Distance value. The smaller the value, the closer the distribution of the generated data is to the real data. Use FID to calculate the Fréchet distance between the feature distributions of the real data and the generated data; evaluate the FID value, the smaller the value, the closer the generated data is to the real data in the feature space.

5. The method for generating extreme weather power grid failure scenarios according to claim 4, characterized in that: In S3, the training parameters of the WGAN-GP model are adjusted according to the evaluation results of Wasserstein Distance and FID; the WGAN-GP model is retrained using the optimized parameters, and the quality of the generated data is re-evaluated.

6. The method for generating extreme weather power grid failure scenarios according to claim 1, characterized in that: The steps of the K-medoids method in S4 for scene reduction are as follows: 1) Data preprocessing: cleaning and standardizing the raw data to facilitate cluster analysis; 2) Scenario definition: define the attributes and characteristics of the scenario, which will be used for subsequent cluster analysis; 3) Select initial medoids: randomly select k data points from the dataset as initial medoids; 4) Cluster assignment: Based on the distance between the features of each scene and the medoids, the scene is assigned to the cluster represented by the nearest medoid; 5) Medoid update: For each cluster, recalculate the medoid; select the scene in the cluster that minimizes the sum of the distances from all scenes to the medoid as the new medoid; 6) Iterative optimization: Repeat steps 4 and 5 until the medoids no longer change or the preset number of iterations is reached; 7) Scenario frequency analysis: Perform frequency analysis on the medoids in each cluster to determine which scenarios have a higher probability of appearing; 8) Extract high-frequency scenes: Extract medoids from each cluster as the representative of the cluster. These medoids represent scenes with a high probability of occurrence. 9) Result evaluation: Evaluate the quality of the clustering results to ensure that the extracted scenes are representative.

7. A system for generating extreme weather power grid failure scenarios, characterized in that: The system can be used to implement the method for generating extreme weather power grid failure scenarios as described in any one of claims 1 to 6, specifically including: Data collection and preprocessing module, the functions are as follows: Data collection: Collect fault log data, major meteorological event records and meteorological observation data for power grid operation and maintenance management; Data preprocessing: cleaning and standardizing the collected raw data; Data analysis: Analyze the distribution characteristics and correlation of data, identify key attributes and features, and provide support for subsequent model training; Generate adversarial network model module, the functions are as follows: Generator construction: Design the generator network structure to generate power grid failure scenario data under extreme weather conditions; Discriminator construction: Design the discriminator network structure to distinguish generated data from real data; WGAN-GP training: Use Wasserstein distance to optimize the performance of the generator and discriminator, introduce gradient penalty to enhance the Lipschitz continuity of the discriminator, and improve training stability; Generate data: Generate fault scenario sample data based on the trained generator; Generate a sample data evaluation module with the following functions: Evaluation indicators: Use Wasserstein Distance to measure the distribution difference between generated data and real data, and use FID to calculate the feature distribution difference between generated data and real data; Evaluation and parameter adjustment: Analyze the quality of the generated fault scenario sample data based on the evaluation indicators, adjust the model parameters, optimize the generation effect, and ensure that the quality of the generated data reaches the best state; Generate a scene reduction module with the following functions: K-medoids clustering: Perform data preprocessing on the generated fault scenario samples, including cleaning and standardization, define the attributes and characteristics of the scenario for cluster analysis, randomly select initial medoids, perform cluster assignment, update medoids, and iterate optimization until the medoids are stable; High-frequency scene screening: Perform frequency analysis to screen out high-frequency scenes and extract representative medoids as the final high-frequency scenes.

8. The method for generating extreme weather power grid failure scenarios according to claim 7, characterized in that: The extreme weather power grid failure scenario generation system further includes: The results evaluation and optimization module has the following functions: Result evaluation: Evaluate the quality of the generated and reduced scene data to ensure that it is representative; Optimization suggestions: Provide optimization suggestions and improvement measures to further improve the performance of the scene generation system; The result presentation module has the following functions: Data visualization: Displays the generated fault scenario diagrams and distribution, such as fault location, impact range, and frequency analysis; Report generation: Automatically generate detailed reports containing generated scenario data and evaluation indicators; Interactive analysis tools: Provides scene browser and parameter adjustment tools to support real-time viewing and optimization of generated data; Decision support: Conduct risk assessments and emergency response recommendations to help develop effective prevention and emergency response plans.

9. A computer device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for generating an extreme weather power grid failure scenario as described in one of claims 1 to 6 is implemented.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, which, when executed by a processor, implements the method for generating an extreme weather power grid failure scenario as described in one of claims 1 to 6.