A method and system for power system load forecasting based on multi-scale anomaly detection

By combining Transformer-XL, GAN and MSC-VAE models, the shortcomings of traditional power load forecasting and anomaly detection methods in dealing with nonlinear and multi-dimensional changes are solved, achieving higher-precision load forecasting and more sensitive anomaly detection. , improving the overall performance of the power system.

CN118841979BActive Publication Date: 2025-01-21YANTAI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411311278.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-21
Estimated Expiration
2044-09-20

AI Technical Summary

Technical Problem

Traditional power load prediction methods and abnormal detection methods are difficult to effectively deal with nonlinear and multi-dimensional changes in power load data, resulting in low prediction accuracy and missed and false alarms of abnormal detection.

Method used

A power system load forecasting method based on multi-scale anomaly detection is adopted, combined with Transformer-XL, generative adversarial network (GAN) and multi-scale convolutional variational autoencoder (MSC-VAE) to build a collaborative working model. The model captures long-term dependencies through Transformer-XL, GAN generates forecast data that approximates the real load, and MSC-VAE is responsible for detecting potential anomalies and automatically adjusting hyperparameters through Bayesian optimization.

Benefits of technology

It significantly improves the accuracy of power load forecasting and the sensitivity of abnormal detection, optimizes the rationality and economy of power dispatching, reduces omissions and false alarms, and improves the stability and security of the power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118841979B_ABST
    Figure CN118841979B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of model operation technology, and in particular to a method and system for load forecasting of a power system based on multi-scale anomaly detection. The method comprises constructing a load forecasting model combining Transformer-XL and a generative adversarial network; predicting multi-source data of the power system based on the load forecasting model to obtain load forecasting data; performing anomaly detection on multi-source data of the power system based on a multi-scale convolutional variational autoencoder to obtain anomaly detection results; fusing the anomaly detection results with the load forecasting results to generate a comprehensive score; and automatically adjusting key hyperparameters using Bayesian optimization according to the generated comprehensive score. The present invention can better handle nonlinear and multi-dimensional changes in power load data, thereby significantly improving the accuracy of load forecasting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of model operation technology, and in particular to a method and system for power system load forecasting based on multi-scale anomaly detection. Background Art

[0002] As the scale and complexity of power systems increase, accurate load forecasting and sensitive anomaly detection have become crucial tasks in the operation of power systems. The accuracy of power load forecasting directly affects the rationality and economy of power dispatch, while anomaly detection is an important means to ensure the safe and stable operation of power systems. Traditional load forecasting methods mostly rely on time series analysis and linear models, which show significant deficiencies in dealing with nonlinear and multi-dimensional changes in power loads, resulting in low prediction accuracy. At the same time, traditional anomaly detection methods mainly rely on preset rules and thresholds, which often perform poorly when dealing with complex abnormal patterns and are prone to omissions and false alarms.

[0003] With the development of deep learning technology, models such as generative adversarial networks (GAN) and variational autoencoders (VAE) have gradually become research hotspots. GAN can generate realistic data samples and identify abnormal patterns in the data through adversarial training between the generator and the discriminator, while VAE can extract and reconstruct features of high-dimensional data by learning the potential distribution of the data. However, the use of GAN or VAE alone still has limitations in power system applications, such as the difficulty in effectively handling long-term dependencies and limited ability to capture local details.

[0004] Traditional load forecasting methods rely on time series analysis and linear models, which are difficult to effectively deal with nonlinear and multi-dimensional changes in power load data, resulting in low prediction accuracy. How to effectively improve the accuracy of power load forecasting to cope with complex data characteristics is one of the technical problems to be solved in the present invention.

[0005] Traditional anomaly detection methods mainly rely on preset rules and thresholds, which are difficult to handle complex anomaly patterns. This method is prone to missed reports and false reports in practical applications of power systems, affecting the safe and stable operation of the system. Therefore, it is necessary to develop a more intelligent and sensitive anomaly detection method that can effectively identify potential anomalies in power systems.

[0006] Although Transformer-XL, Generative Adversarial Network (GAN) and Variational Autoencoder (VAE) have advantages in processing complex data, the use of these models alone still has some limitations in power system applications, such as insufficient processing of long-term dependencies and limited ability to capture local details. How to combine the advantages of these deep learning models to make up for their respective shortcomings and improve the overall performance of power system load forecasting and anomaly detection is a key issue that the present invention needs to solve. Summary of the invention

[0007] In order to solve the above-mentioned problems, the present invention provides a method and system for power system load forecasting based on multi-scale anomaly detection, aiming to improve the accuracy of load forecasting and the sensitivity of anomaly detection, and ensure the stable and efficient operation of the power system.

[0008] In a first aspect, the present invention provides a method for power system load forecasting based on multi-scale anomaly detection, which adopts the following technical solution:

[0009] A method for power system load forecasting based on multi-scale anomaly detection, comprising:

[0010] Acquire multi-source data of power system;

[0011] Preprocessing of multi-source data of power system;

[0012] Construct a load forecasting model combining Transformer-XL and generative adversarial network;

[0013] Based on the load forecasting model, the multi-source data of the power system is predicted to obtain the load forecast data; based on the multi-scale convolutional variational autoencoder, the multi-source data of the power system is detected for anomalies to obtain the anomaly detection results;

[0014] Combine anomaly detection results with load forecast results to generate a comprehensive score;

[0015] Based on the resulting composite score, key hyperparameters are automatically tuned using Bayesian optimization.

[0016] Furthermore, the construction of the load forecasting model combining Transformer-XL and generative adversarial network includes respectively constructing a Transformer-XL network, a generator and a discriminator, wherein the Transformer-XL network is used to capture the long-term dependencies and complex time series characteristics in the power load data; the generator is used to process the high-dimensional features output by Transformer-XL to generate a prediction value that is close to the actual load; and the discriminator is used to evaluate the difference between the generated data and the actual data.

[0017] Furthermore, the use of the Transformer-XL network to capture the long-term dependency and complex time series characteristics in the power load data includes using the Transformer-XL network to capture the long-term dependency and complex time series characteristics in the power load data by introducing relative position encoding and memory mechanism, wherein the formula of relative position encoding is:

[0018]

[0019] Where R is the relative position embedding, Q, K, V are the query matrix, key matrix and value matrix respectively, T is the time step, d k is the dimension of the key vector.

[0020] The memory mechanism formula is:

[0021]

[0022] Among them, m t-1 is the memory cell of the previous time step, x t is the input for the current time step.

[0023] Furthermore, the generator is used to process the high-dimensional features output by Transformer-XL to generate a predicted value close to the real load, including using the generator to receive the high-dimensional feature representation output by Transformer-XL, and combining historical load data and random noise as input for load forecasting, wherein the generator maps the input features to the load forecast value to minimize the error between the generated data and the real data, and its loss function combines the adversarial loss and the prediction loss:

[0024]

[0025] Among them, E is the expected value, which represents the expected value of the generator input noise z, z~p z (z) indicates that the noise z follows the noise distribution p z (z), G(z) is the data generated by the generator, D(G(z)) is the output of the discriminator for the data G(z) generated by the generator, log(1-D(G(z))) is the adversarial loss term, which indicates the degree to which the data generated by the generator deceives the discriminator. x is the real data, λ is the balance coefficient, and MSE(G(z),x) is the mean square error between the generator's prediction value and the real value.

[0026] Furthermore, the use of a discriminator to evaluate the difference between the generated data and the real data includes using the discriminator to receive the load forecast data generated by the generator and the real historical load data, and calculating the discrimination probability through a deep neural network, wherein the discriminator optimizes its discrimination ability through the following loss function:

[0027]

[0028] Among them, E is the expected value, which represents the average calculation of the real data x and the generator input noise z, x~p data (x) indicates that the real data x follows the data distribution p data (x), D(x) is the output of the discriminator for the real data x, logD(x) represents the loss of the discriminator for correctly classifying the real data x, z~p z (z) indicates that the noise z follows the noise distribution p z (z), G(z) is the data generated by the generator, D(G(z)) is the output of the discriminator for the data G(z) generated by the generator, and log(1-D(G(z))) represents the loss when the discriminator classifies the data G(z) generated by the generator.

[0029] Furthermore, the multi-source data of the power system is detected for anomalies based on the multi-scale convolutional variational autoencoder, including using an encoder to extract multi-scale features of the input data, and mapping it to a latent space to generate a latent vector for representing the core features of the data; using a decoder to restore the latent vector to reconstructed data, and comparing it with the original input data, and determining whether there is an anomaly by analyzing the reconstruction error.

[0030] Furthermore, the anomaly detection results and load forecasting results are integrated to generate a comprehensive score, including weighted fusion of the load forecasting features generated by Transformer-XL, the data features generated by the generative adversarial network, and the anomaly detection features generated by the multi-scale convolutional variational autoencoder, and the comprehensive score is obtained by calculating the fused features.

[0031] In a second aspect, a power system load forecasting system based on multi-scale anomaly detection includes:

[0032] The data acquisition module is configured to acquire multi-source data of the power system;

[0033] The preprocessing module is configured to preprocess the multi-source data of the power system;

[0034] The model building module is configured to build a load forecasting model combining Transformer-XL and a generative adversarial network;

[0035] The prediction module is configured to predict the multi-source data of the power system based on the load prediction model to obtain load prediction data;

[0036] The detection module is configured to perform anomaly detection on multi-source data of the power system based on a multi-scale convolutional variational autoencoder to obtain anomaly detection results;

[0037] A fusion module, configured to fuse the anomaly detection results and the load forecast results to generate a comprehensive score;

[0038] The optimization module,is configured to automatically tune key hyperparameters using Bayesian optimization,based on the generated composite score.

[0039] In a third aspect, the present invention provides a computer-readable storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded by a processor of a terminal device and executing the described method.

[0040] In a fourth aspect, the present invention provides a terminal device, comprising a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; and the computer-readable storage medium is used to store multiple instructions, wherein the instructions are suitable for being loaded by the processor and executing the described method.

[0041] In summary, the present invention has the following beneficial technical effects:

[0042] 1. By combining Transformer-XL, Generative Adversarial Network (GAN) and Multi-Scale Convolutional Variational Autoencoder (MSC-VAE), the present invention can more accurately process nonlinear and multi-dimensional changes in power load data, thereby significantly improving the accuracy of load forecasting. Compared with traditional time series analysis and linear models, the present invention provides more accurate and reliable forecasting results, optimizing the rationality and economy of power dispatching.

[0043] 2. The MSC-VAE model can effectively capture local abnormal patterns in the data through multi-scale convolution design, solving the problem that traditional anomaly detection methods are prone to underreporting and false alarms in complex abnormal patterns, and showing significant advantages in ensuring the safety and stability of power system operation.

[0044] 3. The present invention makes up for the limitations of a single model in processing power system data through the collaborative work of Transformer-XL, GAN and MSC-VAE. Transformer-XL is responsible for capturing long-term dependencies, GAN generates forecast data close to the real load, and MSC-VAE is responsible for detecting potential anomalies. The combination of the three significantly improves the overall performance of the system in complex power data processing.

[0045] 4. By introducing Bayesian optimization technology, the present invention can automatically adjust the hyperparameters in the Transformer-XL, GAN and MSC-VAE models, thereby achieving optimal prediction and detection performance in different application scenarios, further enhancing the intelligence and adaptability of the system, and enabling it to better adapt to the changing power system environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 is a schematic diagram of a power system load forecasting method based on multi-scale anomaly detection according to Embodiment 1 of the present invention;

[0047] Figure 2 It is a structural schematic diagram of a power system load forecasting system based on multi-scale anomaly detection in Example 1 of the present invention. DETAILED DESCRIPTION

[0048] The present invention is further described in detail below in conjunction with the accompanying drawings.

[0049] Example 1

[0050] Reference Figure 1 , a method for power system load forecasting based on multi-scale anomaly detection in this embodiment includes:

[0051] Acquire multi-source data of power system;

[0052] Preprocessing of multi-source data of power system;

[0053] Construct a load forecasting model combining Transformer-XL and generative adversarial network;

[0054] Based on the load forecasting model, the multi-source data of the power system is predicted to obtain the load forecast data; based on the multi-scale convolutional variational autoencoder, the multi-source data of the power system is detected for anomalies to obtain the anomaly detection results;

[0055] Combine anomaly detection results with load forecast results to generate a comprehensive score;

[0056] Based on the resulting composite score, key hyperparameters are automatically tuned using Bayesian optimization.

[0057] Specific:

[0058] 1. Data input and preprocessing:

[0059] To ensure the quality and consistency of the data, the following preprocessing steps were performed:

[0060] Data cleaning and denoising: Detect and remove outliers in the data through statistical analysis methods, use signal processing technology (Butterworth low-pass filter) to smooth the data, reduce the interference of high-frequency noise on model training to perform noise filtering, and its transfer function is:

[0061]

[0062] Where s is the complex frequency variable used for Laplace transform, ω c is the cut-off frequency and n is the order of the filter.

[0063] Data normalization: Since the scales of different data sources may be inconsistent, the normalization method is used to standardize the data to the same range, eliminating the impact of scale differences, so that the mean of each feature is 0 and the standard deviation is 1:

[0064]

[0065] Among them, X is the original data, μ is the mean, and σ is the standard deviation.

[0066] Principal Component Analysis (PCA): When processing high-dimensional data, PCA is used to reduce the dimensionality and extract key features, thereby reducing the computational complexity while retaining important information of the data.

[0067] ① Calculate the covariance matrix: used to describe the linear relationship between features. The formula is as follows:

[0068]

[0069] Among them, X i is the i-th data sample, μ is the feature mean, n is the number of samples, and T is the transpose of the matrix.

[0070] ②Eigenvalue decomposition: Perform eigenvalue decomposition on the covariance matrix to obtain the eigenvalue and the corresponding eigenvector. The size of the eigenvalue indicates the importance of the corresponding eigenvector:

[0071]

[0072] Where V is the eigenvector matrix of the covariance matrix C, and each column is an eigenvector. ∧ is a diagonal matrix, and each element on the diagonal is an eigenvalue of the covariance matrix C.

[0073] ③Select principal components: Sort by eigenvalue, select the eigenvectors corresponding to the first k largest eigenvalues ​​as principal components, and project the original data onto these principal components:

[0074]

[0075] Among them, X is the original data, V k is the matrix consisting of the first k eigenvectors.

[0076] Subsequent data processing using these principal components significantly reduces the dimensionality of the features while retaining most of the information in the data.

[0077] 2. Load forecasting combining Transformer-XL and Generative Adversarial Network (GAN):

[0078] After completing data preprocessing, in order to achieve high-precision prediction of power load, the system inputs the data into a hybrid model that combines generative adversarial networks (GANs) and Transformer-XL for load forecasting. The model consists of three parts: the Transformer-XL network, the generator, and the discriminator, which work together to capture complex time dependencies and generate load forecast values ​​that are close to reality.

[0079] The Transformer-XL network effectively captures the long-term dependencies and complex time series characteristics in power load data by introducing relative position encoding and memory mechanisms. Its workflow is as follows:

[0080] (1) Relative position encoding: Different from the absolute position encoding of the standard Transformer, Transformer-XL uses relative position encoding, which enables the model to better handle long-term dependent features. The formula for relative position encoding is:

[0081]

[0082] Where R is the relative position embedding, Q, K, V are the query matrix, key matrix and value matrix respectively, T is the time step, d k is the dimension of the key vector.

[0083] (2) Memory mechanism: Transformer-XL introduces a memory unit to store previous hidden states, thereby extending the context window of the model and enabling the model to process data with a longer time span. The formula is:

[0084]

[0085] Among them, m t-1 is the memory cell of the previous time step, x t is the input for the current time step.

[0086] Generator: The generator processes the high-dimensional features output by Transformer-XL through a deep neural network to generate a predicted value that is close to the actual load.

[0087] Input processing: The generator receives the high-dimensional feature representation output by Transformer-XL and combines it with historical load data and random noise as input for load forecasting.

[0088] Feature mapping and loss optimization: The generator maps input features to load prediction values ​​to minimize the error between generated data and real data. Its loss function combines adversarial loss and prediction loss:

[0089]

[0090] Among them, E is the expected value, which represents the expected value of the generator input noise z, z~p z (z) indicates that the noise z follows the noise distribution p z (z), G(z) is the data generated by the generator, D(G(z)) is the output of the discriminator for the data G(z) generated by the generator, log(1-D(G(z))) is the adversarial loss term, which indicates the degree to which the data generated by the generator deceives the discriminator. x is the real data, λ is the balance coefficient, and MSE(G(z),x) is the mean square error between the generator's prediction value and the real value.

[0091] Discriminator: The discriminator is responsible for evaluating the difference between generated data and real data. During the training process, the discriminator is continuously optimized to ensure that the data generated by the generator gradually approaches the real load value.

[0092] Input processing: The discriminator receives the load forecast data generated by the generator and the real historical load data, and calculates the discrimination probability through a deep neural network.

[0093] Adversarial training: The discriminator optimizes its discrimination ability through the following loss function:

[0094]

[0095] Among them, E is the expected value, which represents the average calculation of the real data x and the generator input noise z, x~p data (x) indicates that the real data x follows the data distribution p data (x), D(x) is the output of the discriminator for the real data x, logD(x) represents the loss of the discriminator for correctly classifying the real data x, z~p z (z) indicates that the noise z follows the noise distribution p z (z), G(z) is the data generated by the generator, D(G(z)) is the output of the discriminator for the data G(z) generated by the generator, and log(1-D(G(z))) represents the loss when the discriminator classifies the data G(z) generated by the generator.

[0096] 3. Anomaly Detection with Multi-Scale Convolutional Variational Autoencoder (MSC-VAE):

[0097] In order to improve the effect of power system anomaly detection, the present invention introduces MSC-VAE. MSC-VAE can effectively capture multi-level features in the data through multi-scale convolution operations, thereby detecting complex abnormal patterns in the power system.

[0098] Multi-layer convolution: Through multi-layer convolution operations, MSC-VAE can extract multi-scale features of power load data. The size of each layer of convolution kernel is different, which can capture local patterns of different scales.

[0099]

[0100] Among them, Conv i Represents the i-th layer convolution operation, X is the input data, FeatureMap i is the feature map output by this layer.

[0101] After extracting multi-scale features, MSC-VAE compresses and reconstructs these features through a variational autoencoder to capture the core features of the data and detect anomalies.

[0102] Encoder: The encoder extracts the multi-scale features of the input data and maps them to the latent space to generate a latent vector z, which is used to represent the core features of the data. The expression formula is:

[0103]

[0104] where μ and σ are the mean and variance of the latent space, and ε is the noise sampled from a standard normal distribution.

[0105] Decoder: The decoder receives the latent variable z and maps it back to the original data space to generate the reconstructed data X′. The quality of the reconstruction is measured by the following loss function:

[0106] L VAE =E q(z|X) [log p(X|z)]-KL(q(z|X)||p(z))

[0107] Among them, E q(z|X) Represents the expectation of the latent variable z from the posterior distribution q(z|X), q(z|X) is the posterior distribution, which represents the probability distribution of the latent variable z given the data X, and logp(X|z) is the log likelihood of the reconstruction error, that is, the logarithm of the probability of reconstructing the input data X given the latent variable z. KL(q(z|X)||p(z)) is the Kullback-Leibler divergence, which is used to measure the difference between the posterior distribution q(z|X) and the prior distribution p(z), ensuring that the distribution of the latent variable q(z|X) does not deviate from the specified prior distribution p(z).

[0108] Anomaly Detection: By analyzing the reconstruction error, MSC-VAE is able to identify anomalous data points. The reconstruction error is calculated as follows:

[0109]

[0110] Where X is the original data and X′ is the reconstructed data.

[0111] When the reconstruction error exceeds the set threshold, the data point is marked as an anomaly. This method is particularly suitable for detecting complex abnormal patterns and can significantly reduce false positives and false negatives.

[0112] 4. Synergy and comprehensive feature fusion of Transformer-XL, GAN and MSC-VAE:

[0113] To further improve the system's performance in power load forecasting and anomaly detection, we combined Transformer-XL, Generative Adversarial Networks (GANs), and Multi-Scale Convolutional Variational Autoencoders (MSC-VAEs) to form a powerful hybrid model. This model uses feature fusion technology to combine Transformer-XL's load forecasting results, GAN-generated data, and MSC-VAE's anomaly detection results to provide more accurate system analysis.

[0114] Feature Fusion:

[0115] In this stage, we merge the load forecasting features generated by Transformer-XL, the data features generated by GAN, and the anomaly detection features generated by MSC-VAE to improve the overall performance of the model.

[0116] Combination of Transformer-XL and GAN: Transformer-XL first extracts long-term dependency features of power load data, and its output features are input into the generator (GAN), which further processes these features to generate data that approximates the real load.

[0117]

[0118] Among them, F TXL is the feature output by Transformer-XL, F GAN is the feature generated by the generator.

[0119] MSC-VAE feature fusion: The load forecast results generated by GAN are fused with the anomaly detection results generated by MSC-VAE to retain the key information from both GAN and MSC-VAE.

[0120]

[0121] Weighted Fusion: To better balance the prediction accuracy and sensitivity of anomaly detection, we assign weights to the features of Transformer-XL, GAN, and MSC-VAE respectively.

[0122]

[0123] in, Alpha, Beta, and Gamma is the fusion weight coefficient. This fusion method ensures the dual advantages of the system in load forecasting and anomaly detection, and the best value can be found through optimization to maximize the performance of the model.

[0124] Overall rating:

[0125] Based on the above fusion features, we calculate the comprehensive score of the system for the final power load forecasting and anomaly detection decision:

[0126]

[0127] Among them, MLP represents a multi-layer perceptron, which is used to map the fused features into the final comprehensive score S fusion ,This score is used to evaluate the load forecasting accuracy and anomaly detection effect of the system.

[0128] Classifier decision: Based on the comprehensive score S fusion , the classifier makes classification decisions, such as judging whether a load forecast value is accurate or whether a data point is abnormal, and the formula is:

[0129]

[0130] Among them, C is the classifier.

[0131] Decision output: Determine the next step based on the classifier’s output D. For example, if D indicates an abnormality, an alarm or further analysis is triggered.

[0132] 5. System optimization:

[0133] In order to ensure that the system can maintain optimal performance in various complex environments, the present invention introduces Bayesian optimization technology. Bayesian optimization is used to automatically adjust key hyperparameters in the system, such as learning rate, convolution kernel size, etc., to maximize the prediction and detection performance of the model. Through this optimization, the system can maintain stable and efficient operation in different scenarios. In simple terms, Bayesian optimization can be expressed by the following formula:

[0134]

[0135] Among them, x * represents the optimal hyperparameter combination found, α(x) is the acquisition function used to select the next hyperparameter, D 1:tIn time series analysis, it represents the data from time point 1 to time point t. This process ensures that the system can automatically adjust to the optimal state according to the specific application scenario, thereby improving the prediction accuracy and anomaly detection capabilities of the power system.

[0136] Example 2

[0137] This embodiment provides a method for power system load forecasting based on multi-scale anomaly detection, including:

[0138] The data acquisition module is configured to acquire multi-source data of the power system;

[0139] The preprocessing module is configured to preprocess the multi-source data of the power system;

[0140] The model building module is configured to build a load forecasting model combining Transformer-XL and a generative adversarial network;

[0141] The prediction module is configured to predict the multi-source data of the power system based on the load prediction model to obtain load prediction data;

[0142] The detection module is configured to perform anomaly detection on multi-source data of the power system based on a multi-scale convolutional variational autoencoder to obtain anomaly detection results;

[0143] A fusion module, configured to fuse the anomaly detection results and the load forecast results to generate a comprehensive score;

[0144] The optimization module,is configured to automatically tune key hyperparameters using Bayesian optimization,based on the generated composite score.

[0145] A computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device, for a method for predicting power system load based on multi-scale anomaly detection.

[0146] A terminal device includes a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, wherein the instructions are suitable for being loaded and executed by the processor to implement a power system load forecasting method based on multi-scale anomaly detection.

[0147] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for power system load forecasting based on multi-scale anomaly detection, characterized in that: include: Acquire multi-source data of power system; Preprocessing of multi-source data of power system; Construct a load forecasting model combining Transformer-XL and generative adversarial network; Based on the load forecasting model, the multi-source data of the power system is predicted to obtain the load forecast data; based on the multi-scale convolutional variational autoencoder, the multi-source data of the power system is detected for anomalies to obtain the anomaly detection results; Combine anomaly detection results with load forecast results to generate a comprehensive score; Based on the generated composite score, Bayesian optimization is used to automatically adjust key hyperparameters; The load forecasting model combining Transformer-XL and generative adversarial network is constructed, including constructing a Transformer-XL network, a generator and a discriminator respectively, wherein the Transformer-XL network is used to capture the long-term dependency and complex time series characteristics in the power load data; the generator is used to process the high-dimensional features output by Transformer-XL to generate a prediction value close to the real load; and the discriminator is used to evaluate the difference between the generated data and the real data; The method of using the Transformer-XL network to capture the long-term dependency and complex time series characteristics in the power load data includes using the Transformer-XL network to capture the long-term dependency and complex time series characteristics in the power load data by introducing relative position encoding and memory mechanism, wherein the formula of relative position encoding is: Where R is the relative position embedding, Q, K, V are the query matrix, key matrix and value matrix respectively; The memory mechanism formula is: Among them, m t-1 is the memory cell of the previous time step, x t is the input of the current time step; The generator is used to process the high-dimensional features output by Transformer-XL to generate a prediction value close to the real load, including using the generator to receive the high-dimensional feature representation output by Transformer-XL, and combining historical load data and random noise as input for load prediction, wherein the generator maps the input features to the load prediction value to minimize the error between the generated data and the real data, and its loss function combines the adversarial loss and the prediction loss: Among them, the first term is the adversarial loss, G(z) is the data generated by the generator, x is the real data, λ is the balance coefficient, and MSE(G(z),x) is the mean square error between the generator's predicted value and the real value; The method of using a discriminator to evaluate the difference between the generated data and the real data includes using the discriminator to receive the load forecast data generated by the generator and the real historical load data, and calculating the discrimination probability through a deep neural network, wherein the discriminator optimizes its discrimination ability through the following loss function: Among them, the first term is the discriminant loss of the discriminator on the real data, and the second term is the discriminant loss on the generated data; The method of detecting anomalies of multi-source data of the power system based on the multi-scale convolutional variational autoencoder comprises extracting multi-scale features of input data by using an encoder, mapping the features to a latent space, generating a latent vector for representing the core features of the data; restoring the latent vector to reconstructed data by using a decoder, and comparing the data with the original input data, and determining whether anomalies exist by analyzing reconstruction errors; The anomaly detection results and load forecast results are integrated to generate a comprehensive score, including weighted fusion of the load forecast features generated by Transformer-XL, the data features generated by the generative adversarial network, and the anomaly detection features generated by the multi-scale convolutional variational autoencoder, and the comprehensive score is obtained by calculating the fused features.

2. A power system load forecasting system based on multi-scale anomaly detection, executing the method according to claim 1, characterized in that ,include: The data acquisition module is configured to acquire multi-source data of the power system; The preprocessing module is configured to preprocess the multi-source data of the power system; The model building module is configured to build a load forecasting model combining Transformer-XL and a generative adversarial network; The prediction module is configured to predict the multi-source data of the power system based on the load prediction model to obtain load prediction data; The detection module is configured to perform anomaly detection on multi-source data of the power system based on a multi-scale convolutional variational autoencoder to obtain anomaly detection results; A fusion module, configured to fuse the anomaly detection results and the load forecast results to generate a comprehensive score; The optimization module,is configured to automatically tune key hyperparameters using Bayesian optimization,based on the generated composite score.

3. A computer-readable storage medium storing a plurality of instructions, characterized in that: The instructions are suitable for being loaded by a processor of a terminal device and executing the method according to claim 1 .

4. A terminal device, comprising a processor and a computer-readable storage medium, wherein the processor is used to implement each instruction; and the computer-readable storage medium is used to store multiple instructions, characterized in that: The instructions are suitable for being loaded by a processor and executing the method as claimed in claim 1 .

Citation Information

Patent Citations

  • Intelligent completion method for missing data of power grid

    CN115333092A

  • Generative confrontation Transform-based power load data anomaly detection method

    CN116738204A