Distributed power supply prediction system and application
By constructing a multi-factor driven collaborative prediction framework and a CNN-BiLSTM-Attention model, the problems of single feature dimension and limited model structure in existing technologies are solved, and accurate and stable prediction of distributed power output and load is achieved, improving prediction accuracy and adaptability.
Patent Information
- Application Number
- CN202511692472.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-02-27
AI Technical Summary
Existing forecasting schemes have limited input feature dimensions, poor dynamic adaptability, and fail to fully consider the coupled influence of multiple factors such as environment, meteorology, and historical operating status. They also have weak feature extraction methods, limited model structures, and insufficient capture of spatiotemporal dependencies, resulting in low accuracy and instability in the forecasting of distributed power output and load.
A multi-factor driven framework for the coordinated prediction of distributed power generation output and load is constructed. The KNN-PCA feature enhancement method is used for feature selection and extraction. A prediction model based on CNN-BiLSTM-Attention is proposed and optimized with the Adam algorithm to achieve accurate prediction of distributed power generation output and load.
It improves the model's dynamic adaptability and prediction robustness under complex operating conditions, simplifies the complexity of actual deployment, realizes accurate and stable prediction of distributed power output and load, reduces the impact of gradient problems, and improves prediction accuracy and stability.
Smart Images

Figure CN121581284A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of new energy application technology, specifically to a distributed power prediction system and its application. Background Technology
[0002] Against the backdrop of global energy structure transformation, clean energy technologies such as solar and wind power have become core drivers of sustainable development. With the rapid development of distributed power generation equipment (such as photovoltaic and wind power equipment) that utilizes clean energy for power generation, microgrids (MG), as an important carrier of distributed energy, have gradually evolved from early single small power generation units into intelligent power generation and distribution systems that integrate distributed generation, energy storage systems, and energy conversion devices [Guo Fanghong, Xu Bowen, Zhang Wenan, Deng Ruilong. A review of research on smart grid energy management based on learning optimization [J]. Control and Decision, 2022, 37(05): 1089-1101.]. With the increasing penetration rate of distributed power sources such as photovoltaic and wind power in microgrids, they have significantly reduced power generation costs and environmental impact, and promoted the innovation of load patterns, with loads actively participating in the operation and regulation of microgrids.
[0003] In the field of power systems, power output and load forecasting are extremely important for the entire power sector [Xuhan L. Analysis of power system load forecasting based on neural networks[J]. Journal of Physics: Conference Series, 2023, 2664(1).]. By accurately forecasting the output of distributed power sources and user load demand, the utilization of renewable energy can be optimized, dependence on fossil fuels can be reduced, thereby reducing greenhouse gas emissions and environmental pollution. Especially today, with the increasing importance of intermittent energy sources such as wind and solar power, accurate data forecasting models are needed [Yang Zeng, Ding Shiyin, Ye Meng, et al. Short-term power load forecasting model based on variational mode decomposition and deep learning[J]. Electrical Measurement & Instrumentation, 2023, 60(02): 126-131+146.]. This is particularly crucial for balancing the power grid and ensuring the stability and reliability of power supply. While the addition of distributed generation equipment such as photovoltaic and wind power devices to microgrids reduces the generation and environmental costs of microgrids, and transforms the power load from a rigid load unable to be controlled by the grid into a flexible load actively participating in the operation of the microgrid and capable of responding to power demand, the source and load sides are susceptible to interference from meteorological, geographical, and human factors, exhibiting instability, periodicity, and strong influence from weather conditions, leading to power fluctuations and significant uncertainty challenges for microgrids. Therefore, accurate prediction models are needed to address the problem of power output fluctuations in microgrids caused by source-load uncertainty [Sun Sizhou, Wang Chenxi, Wang Yu, Zhu Xuehua, Lu Huacai. Multi-objective optimization dispatching of a micro-grid considering uncertainty in wind power forecasting[J]. Energy Reports, 2022, 8.]. Using data prediction methods to transform uncertainty into a deterministic problem facilitates better handling of practical issues in subsequent optimization.
[0004] Traditional data prediction methods include physical methods that simulate atmospheric dynamics and statistical methods that analyze and model historical data. For example, Chen et al. [Chen X, Du Y, Wen H, et al. Forecasting-based powerramp-rate control strategies for utility-scale PV systems[J]. IEEE Transactions on Industrial Electronics, 2018, 66(3): 1862-1871.] proposed a method for controlling the ramp rate based on ground-based ultra-short-term photovoltaic power prediction technology to predict photovoltaic output power. Massidda et al. [Massidda L, Marrocu M. Use of multilinear adaptive regression splines and numerical weather prediction to forecast the power output of a PV plant in Borkum, Germany[J]. Solar Energy, 2017, 146: 141-149.] proposed a multilinear adaptive regression spline model based on historical weather data and solar power generation data. However, traditional methods are costly, rely on a single model structure, have low accuracy, and cannot fully capture the complexity and dynamism of electricity. In particular, their predictive accuracy and adaptability have become increasingly apparent when facing the complex and ever-changing environment of distributed power generation and the electricity market.
[0005] To address these challenges, scholars have applied machine learning to real-world scenarios. Behera et al. [Behera MK, Majumder I, Nayak N. Solar photovoltaic power forecasting using optimized modified extreme learning machine technique[J]. Engineering Science and Technology, an International Journal, 2018, 21(3): 428-438.] achieved photovoltaic power forecasting using Extreme Learning Machine (ELM). The ELM model can overcome the overfitting and local minima problems associated with neural network methods. The literature [Ji Yaoqian. Research on microgrid optimization scheduling method considering source-load uncertainty[D]. Xi'an University of Technology, 2023.DOI:10.27398 / d.cnki.gxalu.2023.001604.] proposed an LSTM prediction model optimized by the JAYA optimization algorithm. The model was trained based on historical power load dataset and photovoltaic power generation dataset. Within the set parameter optimization range, the optimal LSTM hyperparameters were iteratively searched and the prediction model was established. The results showed that the accuracy of the prediction model was significantly improved. Suresh et al. [Suresh V, Janik P, Guerrero JM, et al. Microgrid energy management system with embedded deep learning forecaster and combined optimizer[J]. IEEEAccess, 2020, 8: 202225-202239.] proposed a photovoltaic power prediction model based on LSTM and autoencoder structures. The encoder part of the model consists of an input layer and an LSTM layer, while the decoder part consists of an LSTM layer and a feedforward neural network (FFNN).
[0006] Machine learning is also widely used in the field of user load forecasting. Deng et al. [Deng Daiyu, Li Jian, Zhang Zhenyuan, et al. Short-term power load forecasting based on EEMD-GRU-MLR [J]. Power System Technology, 2020, 44(02): 593-602.] Considering the influence of white noise, this method first uses ensemble empirical mode decomposition to decompose the power load data into intrinsic mode functions (IMFs) of different frequencies. Then, multiple linear regression (MLR) and gated recurrent unit neural network (GRU) are used to predict the low-frequency and high-frequency components, respectively. Finally, the prediction results are superimposed to obtain the final prediction result, which effectively improves the accuracy of short-term power load forecasting. Wu Fei et al. [Wu F, Cattani C, Song W, et al. Fractional ARIMA with an improved cuckoo search optimization for the efficient Short-term power load forecasting[J]. Alexandria Engineering Journal, 2020, 59(5): 3111-3118.] studied the use of an improved cuckoo search algorithm to optimize the parameters of a fractional autoregressive fractional moving average model, thereby ensuring the accuracy and effectiveness of the prediction. Zhang and Hong [Zhang Z, HongW C. Electric load forecasting by complete ensemble empirical mode decomposition adaptive noise and support vector regression with quantum-based dragonfly algorithm[J]. Nonlinear Dynamics, 2019, 98(4): 1107-1136.] used data preprocessed by adaptively noisy ensemble empirical mode decomposition and introduced it into a support vector regression algorithm optimized by a quantum-based dragonfly algorithm, overcoming the limitations of traditional algorithms and improving search efficiency.The literature [Eskandari H, Imani M, Moghaddam M P. Convolutional and Recurrent Neural network Based Model for Short-Term Load Forecasting[J]. Electric Power Systems Research,2021, 195(4): 1-14.] proposes a short-term load forecasting model based on CNN and bidirectional RNN. This model converts load and temperature time series data into a two-dimensional matrix and uses CNN to extract features, converting univariate data into multidimensional features, thereby improving the prediction capability of RNN. The literature [Meng Tenglong. Research on microgrid load forecasting and energy optimization management[D]. Northeastern University, 2016.] uses clustering algorithm and particle swarm optimization algorithm to optimize the parameters of neural network. The simulation experiment of load forecasting is carried out using the neural network model with optimized parameters. The results show that the method has a certain improvement on the accuracy of load forecasting. The literature [Li Xiaohui, Tong Xin, Cao Jingli, Li Meng, Zhang Yingchun, Wang Zizhou. Research and application of short-term load forecasting for microgrids based on CEEMD-IBA-LSSVM[J]. Computer Measurement & Control, 2023, 31(03):49-55.DOI:10.16526 / j.cnki.11-4762 / tp.2023.03.008.] observes the load variation pattern of a microgrid in a certain city in my country and concludes that the microgrid load has periodic characteristics. Then, based on the periodicity of the load, the objective function is established, and the support vector machine (SVM) algorithm is used to build a model for simulation experiments.
[0007] While artificial intelligence has been used for power output and user load forecasting, these models typically rely on univariate predictions, facing challenges such as low prediction accuracy, high model complexity, and limited predictability, making them ill-suited for more complex real-world applications. Microgrids operate at low voltage levels, have smaller network topologies, and exhibit greater volatility. Therefore, advanced AI technologies such as deep learning are needed to analyze the various factors influencing distributed power output and user load, extract complex patterns, and construct more accurate, efficient, and reliable prediction models.
[0008] 1. Existing prediction schemes have a single input feature dimension, poor dynamic adaptability, and do not fully consider the coupled influence of multiple factors such as environment, meteorology, and historical operating conditions. This invention constructs a multi-factor driven distributed power output and load collaborative prediction framework to realize multi-factor and multi-feature input, thereby improving the model's dynamic adaptability and prediction robustness under complex operating conditions.
[0009] 2. Existing feature extraction methods suffer from weaknesses and insufficient utilization of effective information. This invention provides an efficient feature enhancement method that innovatively combines KNN and PCA to form a feature enhancement technique that can take into account both global feature information and local similarity priors, thereby constructing a high-quality feature set with higher information density and stronger guidance.
[0010] 3. Existing model structures have limitations, including insufficient capture of spatiotemporal dependencies, gradient explosion and vanishing effects, and inaccurate long-term predictions. The accuracy and stability of predictions for highly volatile renewable energy output and load need improvement. This invention proposes a CNN-BiLSTM-Attention prediction model based on feature selection. This model effectively overcomes the gradient problem and collaboratively mines spatial correlations and bidirectional temporal dependencies in the data, ultimately achieving accurate and stable predictions of distributed power generation output and load.
[0011] In view of the above-mentioned shortcomings of the existing technology, the present invention is proposed. Summary of the Invention
[0012] This invention considers a multi-factor driven framework for the coordinated prediction of distributed power generation output and load. It selects a combination of KNN and PCA for feature selection and extraction, and proposes a CNN-BiLSTM-Attention prediction model based on the feature selection method. Through optimization with the Adam algorithm, it achieves accurate prediction of distributed power generation output and load, thereby improving the stability of microgrid operation, optimizing power resource allocation, and providing a scientific basis for the further application of new energy sources in the future.
[0013] To achieve the above objectives, the present invention adopts the following technical solution:
[0014] A distributed power source prediction system includes a KNN-PCA feature enhancement module, a three-stage fusion prediction module, and a data prediction and denormalization module. The three-stage fusion module comprises a CNN module, a bidirectional LSTM module, and an attention mechanism module. The specific process includes:
[0015] Step S1: The feature enhancement module performs data preprocessing and feature enhancement.
[0016] Select a dataset and divide it into training and test sets. Standardize the data to eliminate the influence of units of measurement.
[0017] The KNN-PCA feature enhancement module is applied to reduce and fuse the standardized multidimensional features, and an enhanced feature matrix that integrates global statistical structure and local similarity prior is constructed as the input of the subsequent three-stage fusion prediction module.
[0018] Step S2: Three-stage fusion module processing;
[0019] Step S21: Extract potential spatial information;
[0020] The enhanced feature matrix after preprocessing in step S1 is input into the CNN module, and local spatial features in the data are automatically extracted through one-dimensional convolutional layers and pooling layers, and then input into the subsequent bidirectional BiLSTM module.
[0021] Step S22, Attention mechanism module;
[0022] The feature sequences output by the CNN module are input into the BiLSTM network to learn the bidirectional long-term temporal dependencies of the data.
[0023] The output states of BiLSTM at all time steps are fed into the attention mechanism layer to dynamically calculate the weights at each time step and generate a weighted context vector.
[0024] Step S3: Data prediction and inverse normalization;
[0025] The preprocessed test set data from step S1 is input into the trained prediction model from step S2 to obtain preliminary prediction results.
[0026] The result is denormalized to map it back to the original data dimensions, resulting in the final distributed power output or load forecast. The root mean square error or mean absolute error index is then used to quantitatively evaluate the forecast performance.
[0027] The preferred technical solution provided by this invention is as follows:
[0028] In step S1, the KNN-PCA feature enhancement module is a feature extraction method that combines KNN feature enhancement with PCA dimensionality reduction, specifically including:
[0029] First, the data is standardized to eliminate dimensional differences and obtain standardized features, thus transforming the original samples into standardized samples.
[0030] After obtaining the normalized features, principal component analysis (PCA) is used to reduce the dimensionality of the features to address the issue of feature redundancy in the data.
[0031] The feature variables in the dataset are compressed to construct new variables that are linear combinations of the original variables, and these new feature variables reflect as much information as possible from the original feature variables while remaining uncorrelated with each other.
[0032] Subsequently, the original feature matrix is input into the KNN regression model to generate preliminary predicted values for the target variable;
[0033] Discover local similarity patterns between samples to provide prior estimates of target variables for subsequent deep learning models;
[0034] Finally, the PCA-reduced features and KNN predictions are concatenated column-wise to construct an enhanced feature matrix that integrates global statistical structure and local similarity priors.
[0035] A further preferred technical solution provided by the present invention is as follows:
[0036] The three-stage fusion module employs a spatiotemporal fusion CNN-BiLSTM-Attention architecture prediction model, the specific process of which is as follows:
[0037] The input to the prediction model is a time-series feature matrix;
[0038] After being input into the network, the CNN layer first automatically extracts local spatial features from the data through one-dimensional convolutional layers and pooling layers, while using the ReLU activation function for non-linear processing.
[0039] The CNN results are input into a bidirectional LSTM module for temporal feature extraction.
[0040] The bidirectional LSTM module is an improvement on RNN, adding cell states and "gates" to control the selective passage of historical data. It learns to retain or forget training load information and determines whether the information belongs to a useful "memory unit".
[0041] BiLSTM network is used to capture long-term practical dependencies and periodic patterns in the data. The forward LSTM of BiLSTM learns the dependencies from history to the future, and the backward LSTM learns the dependencies from the future to history.
[0042] The hidden state sequence output by the BiLSTM layer is input into the temporal attention mechanism layer. This mechanism dynamically calculates the importance weights of each time step, enabling the model to adaptively focus on the most critical historical moments for the current prediction task.
[0043] The time-attention mechanism first performs energy calculations, i.e., importance assessment;
[0044] Then, the attention mechanism weights are normalized, and the energy scores are converted into a probability distribution using the softmax function;
[0045] By weighting the features, the features at high-weight time points are enhanced, resulting in a context vector.
[0046] The preferred technical solution provided by the present invention is as follows:
[0047] In step S22, the Adam optimizer is further employed, with mean squared error as the loss function. All weight parameters of the network are iteratively updated through the backpropagation algorithm. The training process is monitored using the validation set, and an early stopping strategy is adopted to prevent overfitting, thereby completing the training and hyperparameter optimization of the model.
[0048] This invention also provides a technical solution for the application of a distributed power source prediction system in photovoltaic power generation output prediction.
[0049] This invention also provides a technical solution for the application of a distributed power generation prediction system in wind power output prediction.
[0050] This invention also provides a technical solution for the application of a distributed power source prediction system in user load prediction.
[0051] Beneficial effects:
[0052] (1) This invention constructs a multi-factor driven collaborative prediction framework and innovatively adopts the KNN-PCA feature enhancement method. The generated input feature set has both global structural and local similarity priors, which makes it exhibit higher prediction accuracy and stronger generalization ability in various volatile scenarios such as wind power, photovoltaics, and load.
[0053] (2) The CNN-BiLSTM-Attention hybrid prediction network proposed in this invention achieves comprehensive capture of spatial locality, long-term temporal bidirectional dependence and key time points in the data through the synergistic effect of CNN, BiLSTM and attention mechanism. It effectively overcomes the gradient problem and long-term inaccurate prediction caused by the limitations of traditional single model structure, and completes accurate prediction of distributed power output and load.
[0054] (3) This invention provides an end-to-end unified prediction solution. A single model structure can handle multiple prediction tasks on both the source and load sides, simplifying the complexity of actual deployment and increasing its practical value. Experimental results show that this method can effectively transform source-load uncertainty into more deterministic prediction output, providing more reliable technical support for the optimized scheduling and stable operation of microgrids.
[0055] Terminology Explanation:
[0056] (1) K-Nearest Neighbors Algorithm: The KNN algorithm ranks the importance of influencing factors by calculating the distance between them and the true value. Its core idea is to search for the K main factors that are closest to the true value in the feature space composed of influencing factors by calculating the distance between them, and finally use the data information of the K influencing factors to achieve data prediction. It has an easy-to-understand and easy-to-implement algorithm structure, and does not require fitting any model or estimating any function.
[0057] (2) Principal Component Analysis (PCA): PCA is a statistical method that transforms a set of potentially correlated variables into a few linearly uncorrelated variables through orthogonal transformation. Its core idea is to reduce the dimensionality of high-dimensional data by constructing new feature variables (i.e., principal components) while preserving the most important information of the original data. It has the advantages of reducing data redundancy, reducing noise interference, and improving the efficiency of subsequent model training, and it requires no prior assumptions.
[0058] (3) Convolutional Neural Networks: Convolutional Neural Networks are composed of multiple convolutional layers, pooling layers, and fully connected layers. It is a deep learning model that processes data with a grid structure. It extracts local spatial features from the input data through convolutional operations. Its core idea is to slide convolutional kernels across the input data to identify local patterns and gradually combine them into higher-level feature representations. In time series data analysis, CNNs help the model better understand the data by identifying patterns in the short term.
[0059] (4) Long Short-Term Memory Network: LSTM can solve the problems of gradient vanishing and gradient explosion in RNN. Its core concepts are cell state and "gate" structure. Cell state is equivalent to the information transmission path, and load information can be transmitted through cell state. "Gate" structure is a method that allows information to pass selectively. It learns the data information that needs to be saved or forgotten during training, that is, it judges whether the information belongs to a useful "memory cell".
[0060] (5) Attention mechanism: The attention mechanism can dynamically adjust the degree of importance according to the different features of the input data, give higher weight to important information in the output results, and reduce interference from irrelevant information. Attached Figure Description
[0061] Figure 1 This is the overall system architecture diagram of the present invention;
[0062] Figure 2 This is a flowchart illustrating the KNN-PCA feature enhancement module of the present invention;
[0063] Figure 3 This is a diagram of the CNN-BiLSTM-Attention prediction model architecture;
[0064] Figure 4 This is the performance of the CNN-BiLSTM-Attention model of the present invention on the task of predicting the output of distributed photovoltaic power generation.
[0065] Figure 4(a) shows the change in the training loss curve during the iterative process of the loss function. Figure 4 (b) Comparison between predicted and actual photovoltaic power output;
[0066] Figure 5 This is the performance of the CNN-BiLSTM-Attention model of the present invention on the task of predicting the output of distributed wind power generation.
[0067] Figure 5 (a) shows the change in the training loss curve during the iterative process of the loss function. Figure 5 (b) Comparison between predicted and actual wind power output;
[0068] Figure 6 The performance of the CNN-BiLSTM-Attention model of this invention on the user load prediction task;
[0069] Figure 6 (a) shows the change in the training loss curve during the iterative process of the loss function. Figure 6 (b) Comparison of predicted and actual user load values. Detailed Implementation
[0070] To more clearly illustrate the present invention, the following description, in conjunction with preferred embodiments and accompanying drawings, further explains the invention. Similar components in the drawings are indicated by the same reference numerals. Those skilled in the art should understand that the specific description below is illustrative rather than restrictive and should not be construed as limiting the scope of protection of the present invention.
[0071] Figure 1 This is the overall system architecture diagram of the present invention, as shown below. Figure 1 As shown, the distributed power source prediction system of the present invention includes a KNN-PCA feature enhancement module, a three-stage fusion prediction module, and a data prediction and denormalization module. The three-stage fusion module includes a CNN module, a bidirectional LSTM module, and an attention mechanism module. The specific process includes:
[0072] Step S1: The feature enhancement module performs data preprocessing and feature enhancement.
[0073] Figure 2 This is a flowchart illustrating the KNN-PCA feature enhancement module of the present invention, as shown below. Figure 2 As shown,
[0074] In wind and solar load forecasting, the raw data usually contains multiple related features (such as temperature, irradiance, wind speed, humidity, historical load values, etc.), and different features have different dimensions and magnitudes.
[0075] The feature extraction method proposed in this invention, which combines KNN feature enhancement with PCA dimensionality reduction, is as follows:
[0076] First, data standardization is performed to eliminate dimensional differences. For a given... Feature matrix Each column vector This represents a feature, where the vector length n represents the number of samples, and the mean is calculated column-wise. Standard deviation Standardized features are obtained:
[0077] (1),
[0078] The original samples can be transformed into standardized samples: It is between [0,1].
[0079] After obtaining the normalized features, to address the feature redundancy problem in wind and solar load data, Principal Component Analysis (PCA) is first used to reduce feature dimensionality. This method compresses the feature variables in the dataset, constructing new variables that are linear combinations of the original variables, while ensuring that the new feature variables reflect as much information as possible from the original feature variables while remaining uncorrelated. The sample covariance matrix is as follows:
[0080] (2),
[0081] in It is an eigenvalue diagonal matrix. This is the eigenvector matrix, from which the sharing rate and cumulative contribution rate of each feature are obtained. The first, second, ..., principal components are selected based on the cumulative contribution rate exceeding 95%, effectively removing redundant information. The i-th principal component... Represented as a linear combination of the original feature variables:
[0082] (3),
[0083] in, These are the original p feature vectors. Let be the eigenvector corresponding to the i-th principal component.
[0084] Subsequently, the original feature matrix is input into the KNN regression model to generate preliminary predicted values for the target variable, uncovering local similarity patterns between samples, and providing prior estimates of the target variable for subsequent deep learning models. Its output can be represented as follows:
[0085] (4),
[0086] Where K is the preset number of nearest neighbors, Indicates the relationship between the training set and the samples The set of indices of the K nearest samples. Let be the true target value corresponding to the j-th nearest neighbor sample.
[0087] Finally, the features reduced by PCA and the KNN predictions are concatenated column-wise to construct an enhanced feature matrix that integrates global statistical structure and local similarity priors.
[0088] (5),
[0089] This KNN enhancement method based on PCA dimensionality reduction features significantly enhances the ability to characterize the essential patterns of data while preserving the integrity of the original information to the greatest extent, thereby improving the accuracy and robustness of wind, solar, and load prediction tasks from the source of features.
[0090] Step S2: Three-stage fusion module processing;
[0091] Step S21: Extract potential spatial information;
[0092] The enhanced feature matrix after preprocessing in step S1 is input into the CNN module, and local spatial features in the data are automatically extracted through one-dimensional convolutional layers and pooling layers, and then input into the subsequent bidirectional BiLSTM module.
[0093] Step S22, Attention mechanism module;
[0094] The feature sequences output by the CNN module are input into the BiLSTM network to learn the bidirectional long-term temporal dependencies of the data.
[0095] The output states of BiLSTM at all time steps are fed into the attention mechanism layer to dynamically calculate the weights at each time step and generate a weighted context vector.
[0096] The specific process is as follows:
[0097] To address the challenges of spatial locality, temporal dependence, and unforeseen circumstances in prediction, traditional single models struggle to solve these issues simultaneously. Therefore, this invention proposes a three-stage fusion prediction model—the CNN-BiLSTM-Attention prediction model—as follows: Figure 3 As shown.
[0098] The model input is a time-series feature matrix. ,in It is the time step. It is the feature dimension. It is the set of real numbers, that is It has A matrix of n real elements. After being input into the network, the CNN layer first extracts local spatial features through convolution and pooling, and then performs non-linear processing using the ReLU activation function:
[0099] (6),
[0100] This represents the feature map after passing through a convolutional layer and activation function. * indicates a one-dimensional convolution. and These represent the weights and biases of the convolutional layer, respectively. The CNN results are input into a bidirectional LSTM layer for temporal feature extraction. LSTM is an improvement on RNN, adding unit states and "gates" to selectively pass historical data. It learns to retain or forget payload information during training, essentially determining whether the information belongs to a useful "memory unit." Taking a forward LSTM as an example, in each training process, a forget gate is used... Input Gate Output Gate This enables reading and modification of memory cells. The calculation formula for the output of the LSTM cell at each time point is as follows:
[0101] (1) Forget gate. Based on the current input load information. Output of power or load information at time t-1 Together, we determined that the LSTM needs to remove the redundant part of the load status information at time t-1.
[0102] (7),
[0103] in It is the Sigmoid function. It is the connection weight matrix of the forget gate. It is the bias term of the forget gate.
[0104] (2) Input gate. Filtered by Sigmod function and The process requires learning the output or load information, then... and New candidate output or load information can be obtained through the tanh function. Ultimately based on and Multiplication and Multiply and update the output or load information status at time t.
[0105] (8),
[0106] in, and These are the weight matrix and bias term of the input gate, respectively.
[0107] (9),
[0108] in, and These are the weight matrix and bias term for generating candidate states, respectively, and tanh is the tanh function.
[0109] (10)
[0110] This formula will change the old state and new candidate states Combine and update to the current cell state. .
[0111] (3) Output gate. Determines the output state that will be used as the current state. . and First, obtain the activation function using Sigmod. To control output or load prediction output, then use the tanh function to... The value is transformed to the range [-1, 1], and finally the result is compared with... Multiplying them yields a new output or load forecast. .
[0112] (11),
[0113] in, and These are the weight matrix and bias term of the output gate, respectively.
[0114] (12)
[0115] First, the cell state Scale to the [-1, 1] interval using the tanh function, then combine with the output gate. Multiply to obtain the final hidden state at the current moment. .
[0116] This invention further improves upon LSTM by employing a BiLSTM network to capture long-term practical dependencies and periodic patterns in the data. The forward LSTM of the BiLSTM learns the dependencies from history to the future, while the backward LSTM learns the dependencies from the future to history.
[0117] (13)
[0118] (14)
[0119] (15)
[0120] in, and These represent the hidden states at time t after passing through the forward and backward LSTM networks, respectively. This represents the vector concatenation operation. This is the output sequence of the BiLSTM layer. The hidden state sequence output by the BiLSTM layer. The input is fed into the temporal attention mechanism layer, where T represents the sequence length. This mechanism dynamically calculates the importance weights of each time step, enabling the model to adaptively focus on the historical moments most critical to the current prediction task.
[0121] The time-based attention mechanism first performs energy calculations, i.e., importance assessment:
[0122] (16)
[0123] in These are parameters that are adaptively adjusted. It is a bias term. The importance of each time point to the current prediction is assessed. Then, the attention mechanism weights are normalized, and the energy scores are converted into a probability distribution using a softmax function.
[0124] (17)
[0125] The attention weights at time step t satisfy the following conditions: , using the calculated By weighting the features, the features at high-weight time points are enhanced, resulting in a context vector containing key information about the entire sequence:
[0126] (18)
[0127] c is the final output of the attention mechanism, representing the key information extracted for the current prediction task after being weighted by attention weights. It is a vector that is mapped to the prediction space through the final fully connected layer.
[0128] Step S3: Data prediction and inverse normalization;
[0129] The preprocessed test set data from step S1 is input into the trained prediction model from step S2 to obtain preliminary prediction results.
[0130] The result is denormalized to map it back to the original data dimensions, resulting in the final distributed power output or load forecast. The root mean square error or mean absolute error index is then used to quantitatively evaluate the forecast performance.
[0131] The input is fed into a fully connected layer, where a nonlinearity is introduced through the ReLU function and mapped to the output space to obtain the wind, solar, and load prediction results:
[0132] (19)
[0133] in, and The weights and bias parameters of the fully connected layer are then passed through a linear output layer to obtain standardized predictions. :
[0134] (20)
[0135] in, and Here are the weights and bias parameters for the output layer. To verify the prediction performance, two evaluation metrics are used for comparison: Root-mean-square error (RMSE) and Mean Absolute error (MAE). RMSE is more sensitive to the error between predicted and actual values, and can intuitively reflect the accuracy of the model; MAE accurately reflects the prediction error, and the smaller the MAE value, the better the accuracy of the prediction model. Let the true value be... The predicted value is .
[0136] (twenty one),
[0137] (twenty two).
[0138] Simulation results
[0139] To verify the effectiveness of the model proposed in this invention, extensive experimental verification and analysis were conducted at two levels: distributed power generation output and user load prediction.
[0140] Experimental data and parameter settings
[0141] The experimental data were obtained from two publicly available datasets. For distributed power generation output prediction, a measured dataset of wind and solar power generation from a region in Xinjiang in 2019 was used. The dataset was sampled at 15-minute intervals, covering 35,040 sample points throughout 2014. The solar power generation dataset included historical output values as well as seven external influencing factors, including temperature, air pressure, and humidity; the wind power generation data included nine external influencing factors, including wind speed, wind direction, and temperature. For user load prediction, measured load data from a certain year in Australia was used as the sample dataset. The sampling interval was 30 minutes, and a total of 17,520 data samples were collected from January 1st to December 31st. In addition to the actual load, the dataset also included five related factors, including temperature, humidity, and electricity price.
[0142] In the experiment, the actual power generation or load value was used as the prediction target, and the remaining factors were used as feature inputs. The first 90% of the dataset was selected as the training set, and the last 10% of the data was used as the test set to evaluate the model's performance. The key parameters and hyperparameters of the model and network are set as shown in Table 1. The sliding window size was set to 96×5, the BiLSTM module adopted a two-layer hidden layer structure with 128 and 64 neurons respectively, and the Adam optimization method was used for training. The learning rate was set to 0.001, and the mean squared error loss function was used in the experimental simulation.
[0143] Table 1 Experimental Parameter Settings
[0144]
[0145] Prediction Results and Analysis
[0146] The proposed CNN-BiLSTM-Attention model performs as follows on the three prediction tasks: photovoltaic, wind power, and load. Figures 4 to 6 As shown. Figure 4 It is the prediction result of the designed network for photovoltaic power generation. Figure 4 (a) shows the change in the training loss curve. It can be seen that the loss function gradually decreases and converges, indicating that the model training process is stable and efficient. The comparison between predicted and true values on the test set is as follows: Figure 4 As shown in (b), it can be seen that the overall predicted value of the CNN-BiLSTM-Attention network has a high degree of fit with the real value. It can not only accurately track its daily fluctuation pattern, but also show excellent fit at most peak and valley points. This proves that the model has the ability to capture complex nonlinear changes.
[0147] Similarly, in the prediction experiments for wind power generation and user load, the results were as follows: Figure 5 and Figure 6As can be seen, the model's predicted curve closely matches the actual curve, further verifying the strong adaptability and robustness of the proposed framework under different prediction scenarios.
[0148] In addition, to objectively evaluate the effectiveness of the proposed model, we conducted a comparative experiment on its performance and prediction results with two mainstream models, CNN-LSTM and CNN-LSTM-Attention. The comparison results of prediction errors (RMSE and MAE) of the three models under the same experimental environment in three scenarios of photovoltaic, wind power and load are shown in Table 2.
[0149] Table 2 Comparison of three different schemes
[0150]
[0151] Analysis of the data in Table 2 shows that the CNN-BiLSTM-Attention model proposed in this invention significantly outperforms the comparative models in both error metrics across all prediction scenarios. This comparative result fully demonstrates that by introducing KNN-PCA feature enhancement and a bidirectional spatiotemporal attention mechanism, this invention effectively improves prediction accuracy and stability, providing a more reliable solution to the uncertainty problem in new energy power prediction.
[0152] The described embodiments are merely some, not all, of the embodiments in this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
Claims
1. A distributed power prediction system, characterized in that, It includes a KNN-PCA feature enhancement module, a three-stage fusion prediction module, and a data prediction and denormalization module. The three-stage fusion module comprises a CNN module, a bidirectional LSTM module, and an attention mechanism module. The specific process includes: Step S1: The feature enhancement module performs data preprocessing and feature enhancement. Select a dataset and divide it into training and test sets. Standardize the data to eliminate the influence of units of measurement. The KNN-PCA feature enhancement module is applied to reduce and fuse the standardized multidimensional features, and an enhanced feature matrix that integrates global statistical structure and local similarity prior is constructed as the input of the subsequent three-stage fusion prediction module. Step S2: Three-stage fusion module processing; Step S21: Extract potential spatial information; The enhanced feature matrix after preprocessing in step S1 is input into the CNN module, and local spatial features in the data are automatically extracted through one-dimensional convolutional layers and pooling layers, and then input into the subsequent bidirectional BiLSTM module. Step S22, Attention mechanism module; The feature sequences output by the CNN module are input into the BiLSTM network to learn the bidirectional long-term temporal dependencies of the data. The output states of BiLSTM at all time steps are fed into the attention mechanism layer to dynamically calculate the weights at each time step and generate a weighted context vector. Step S3: Data prediction and inverse normalization; The preprocessed test set data from step S1 is input into the trained prediction model from step S2 to obtain preliminary prediction results. The result is denormalized to map it back to the original data dimensions, resulting in the final distributed power output or load forecast. The root mean square error or mean absolute error index is then used to quantitatively evaluate the forecast performance.
2. The distributed power prediction system according to claim 1, characterized in that, In step S1, the KNN-PCA feature enhancement module is a feature extraction method that combines KNN feature enhancement with PCA dimensionality reduction, specifically including: First, the data is standardized to eliminate dimensional differences and obtain standardized features, thus transforming the original samples into standardized samples. After obtaining the normalized features, principal component analysis (PCA) is used to reduce the dimensionality of the features to address the issue of feature redundancy in the data. The feature variables in the dataset are compressed to construct new variables that are linear combinations of the original variables, and these new feature variables reflect as much information as possible about the original feature variables while remaining uncorrelated with each other. Subsequently, the original feature matrix is input into the KNN regression model to generate preliminary predicted values for the target variable; Discover local similarity patterns between samples to provide prior estimates of target variables for subsequent deep learning models; Finally, the PCA-reduced features and KNN predictions are concatenated column-wise to construct an enhanced feature matrix that integrates global statistical structure and local similarity priors.
3. The distributed power prediction system according to claim 1, characterized in that, The three-stage fusion module employs a spatiotemporal fusion CNN-BiLSTM-Attention architecture prediction model, the specific process of which is as follows: The input to the prediction model is a time-series feature matrix; After being input into the network, the CNN layer first automatically extracts local spatial features from the data through one-dimensional convolutional layers and pooling layers, while using the ReLU activation function for non-linear processing. The CNN results are input into a bidirectional LSTM module for temporal feature extraction. The bidirectional LSTM module is an improvement on RNN, adding cell states and "gates" to control the selective passage of historical data. It learns to retain or forget training load information and determines whether the information belongs to a useful "memory unit". BiLSTM network is used to capture long-term practical dependencies and periodic patterns in the data. The forward LSTM of BiLSTM learns the dependencies from history to the future, and the backward LSTM learns the dependencies from the future to history. The hidden state sequence output by the BiLSTM layer is input into the temporal attention mechanism layer. This mechanism dynamically calculates the importance weights of each time step, enabling the model to adaptively focus on the most critical historical moments for the current prediction task. The time-attention mechanism first performs energy calculations, i.e., importance assessment; Then, the attention mechanism weights are normalized, and the energy scores are converted into a probability distribution using the softmax function; By weighting the features, the features at high-weight time points are enhanced, resulting in a context vector.
4. A distributed power prediction system according to claim 1, characterized in that, In step S22, the Adam optimizer is further employed, with mean squared error as the loss function. All weight parameters of the network are iteratively updated through the backpropagation algorithm. The training process is monitored using the validation set, and an early stopping strategy is adopted to prevent overfitting, thereby completing the training and hyperparameter optimization of the model.
5. An application of a distributed power source prediction system as described in any one of claims 1-4 in photovoltaic power generation output prediction.
6. An application of a distributed power generation prediction system as described in any one of claims 1-4 in wind power output prediction.
7. An application of a distributed power source prediction system as described in any one of claims 1-4 in user load prediction.