Photovoltaic power prediction method based on multi-scale feature extraction and TimesNet-BiLSTM parallel modeling
By combining variational mode decomposition and whale migration optimization algorithms with the TimesNet-BiLSTM parallel neural network, the problems of missing data processing and multi-cycle feature extraction in photovoltaic power prediction are solved, achieving high-precision and robust photovoltaic power prediction and supporting grid stability.
Patent Information
- Application Number
- CN202511682294.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-10
AI Technical Summary
Existing photovoltaic power prediction methods lack end-to-end modeling capabilities when dealing with missing data. VMD parameters rely on empirical settings and are not optimized in conjunction with downstream time series models, making it difficult to achieve high-precision and robust short-term photovoltaic power prediction.
A collaborative design of variational mode decomposition (VMD) and whale migration optimization algorithm (WMA) is adopted, combined with the TimesNet-BiLSTM parallel neural network, to adaptively optimize multi-scale decomposition and periodic perception fusion, directly process missing data and extract multi-period features.
It improves the accuracy and robustness of photovoltaic power prediction, enabling high-precision short-term prediction even under conditions of missing data, and supports the safe and stable operation of the power grid under high-proportion photovoltaic grid connection.
Smart Images

Figure CN121503794A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a photovoltaic power prediction method based on multi-scale feature extraction and parallel modeling using TimesNet-BiLSTM. Background Technology
[0002] Solar energy, as the most abundant and cleanest renewable energy resource, has become an important component of my country's energy structure transformation. By the end of 2021, my country's cumulative installed photovoltaic (PV) power capacity reached 306 million kilowatts, maintaining its leading position globally. PV power generation has become the mainstay of new energy development; however, due to the influence of factors such as sunlight intensity, weather, temperature, and humidity, its output power exhibits significant uncertainty, especially when the proportion of PV installations is high, which can impact the stability of the power grid.
[0003] Currently, photovoltaic power prediction methods mainly include physical models, statistical models, and machine learning methods. To improve the ability to characterize non-stationary time series features, some studies have introduced variational mode decomposition (VMD) to decompose the original sequence at multiple scales, and used intelligent optimization algorithms (such as particle swarm optimization and genetic algorithms) to assist in selecting VMD parameters. Meanwhile, deep learning models such as recurrent neural networks (RNN), long short-term memory networks (LSTM), and their variants have also been widely applied to time series modeling. Recently, some novel time series models (such as TimesNet) have attracted attention due to their periodicity-aware capabilities.
[0004] However, existing methods still have significant limitations: First, they generally rely on preprocessing methods such as interpolation to handle missing data, lacking the ability to model the original incomplete sequences end-to-end, which easily introduces biases; second, existing studies usually design signal decomposition and prediction models separately, with VMD parameters often relying on empirical settings or general optimization strategies, failing to coordinate with downstream time series models for optimization; and third, there is no method that effectively integrates multi-scale decomposition, adaptive parameter optimization, and multi-period time series feature extraction, making it difficult to achieve high-precision and robust short-term photovoltaic power prediction under conditions of missing data. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention aims to improve the robustness and multi-period modeling capability of photovoltaic (PV) power prediction under missing data conditions. Based on the collaborative design of variational mode decomposition (VMD), whale migration optimization (WMA), and parallel temporal neural networks, a PV power prediction method based on adaptive multi-scale decomposition and a period-aware fusion network is proposed. This method does not rely on interpolation preprocessing, can directly process original sequences containing missing values, and significantly improves short-term prediction accuracy through adaptive parameter optimization and joint modeling of multi-period features, supporting the safe and stable operation of the power grid under high-proportion PV grid connection.
[0006] To achieve the above objectives, the technical solution of the present invention is as follows: A photovoltaic power prediction method based on multi-scale feature extraction and parallel modeling using TimesNet-BiLSTM includes the following steps: Step S1: Multi-scale signal decomposition and feature input construction: The raw photovoltaic power data and corresponding meteorological feature data with fixed sampling intervals are obtained, normalized, missing value marked and time aligned; variational mode decomposition (VMD) is used to decompose the power sequence into multiple scales, and the whale migration optimization algorithm (WMA) is used to optimize the number of modes K and the penalty factor α, construct the corresponding photovoltaic decomposition features, and form the final model input feature set.
[0007] Step S2: Construction of the TimesNet-BiLSTM parallel neural network prediction model: A parallel neural network model consisting of TimesNet and Bidirectional Long Short-Term Memory (BiLSTM) is constructed. TimesNet models the two-dimensional temporal changes within and between periods through a periodic folding mechanism, while BiLSTM extracts long-term dependent features. The outputs of both are merged in a fusion layer and connected to a fully connected layer to generate predicted values.
[0008] Step S3: Model Training and Prediction Output: The parallel neural network is trained based on historical data, and loss functions such as mean squared error are used to optimize the model parameters. In the prediction stage, the new photovoltaic power and meteorological characteristics are input into the trained parallel network, and the photovoltaic power prediction results are output.
[0009] The signal construction and feature selection in step S1 include: S1-1: Data Preprocessing and Normalization: The raw meteorological and photovoltaic power data are preprocessed. All data are converted to a fixed time resolution, and timestamps are standardized and aligned to ensure sequence consistency. Missing points in the photovoltaic power data are explicitly marked, and their time information is preserved. Outliers are identified and corrected. Nighttime power values are uniformly set to zero, and the data is normalized using a min-max normalization method to eliminate dimensional differences.
[0010] S1-2: Feature correlation screening based on maximum information coefficient: The MIC method is introduced to measure the correlation between meteorological variables and photovoltaic power series, and features that are highly correlated with the target prediction are screened out.
[0011] S1-3: Variational Mode Decomposition (VMD) decomposition of the signal: VMD is used to decompose the photovoltaic power sequence into a multi-scale signal, extracting components such as periodicity, trend and high-frequency disturbance.
[0012] S1-4: Whale Migration Optimization Algorithm (WMA) optimizes VMD parameters: WMA is used to optimize the number of modes and penalty factor in VMD, improving the stability and accuracy of signal decomposition. WMA performs global and local searches based on the migratory behavior mechanism of whales to optimize the combination of VMD parameters.
[0013] The construction of the parallel neural network model in step S2 includes: S2-1: TimesNet Subnetwork Modeling and Feature Extraction The TimesNet model transforms time series data from a one-dimensional structure to a two-dimensional structure, using the Inception module to extract multi-scale feature information within and between periods. The core of the model is the data embedding process. To ensure the model can understand the temporal relationships within the time series data, different embedding modules are employed: PositionalEmbedding: Generates positional codes for each time step, embedding timing information.
[0014] TokenEmbedding: Maps input features to a higher-dimensional vector space through one-dimensional convolution.
[0015] TemporalEmbedding: Encodes periodic temporal features, transforming temporal information into vectors usable by the model.
[0016] Inception Block: Uses multiple convolutional kernels to extract multi-scale features, capturing local and global features in the signal.
[0017] S2-2: BiLSTM Subnetwork Modeling
[0018] BiLSTM can better learn long-term dependency features in time series data by simultaneously capturing both forward and backward dependencies in the sequence. Each BiLSTM layer contains two LSTM networks, one processing forward information (from front to back) and the other processing backward information (from back to front).
[0019] S2-3: Accessing the Fully Connected Layer
[0020] After the output of the BiLSTM subnetwork, it is connected to the fully connected layer for information integration and prediction task execution.
[0021] The model training and prediction output in step S3 includes: S3-1: Batch Training The training set is input into the TimesNet-BiLSTM network in batches according to the number of sample signals processed each time; during training, the number of sampling points for each sample signal to be processed is set, and the features of the in-phase and quadrature components are extracted using convolutional units.
[0022] S3-2: Extraction of Non-Adjacent Periodic Features
[0023] The extracted signal features are input into the bidirectional long short-term memory (BiLSTM) layer in the TimesNet-BiLSTM network to further extract the relevant features of non-adjacent signal periods. The output of the long short-term memory layer is a one-dimensional vector containing only the modulation scheme category, and the correspondence between the modulation scheme and the category is established based on this one-dimensional vector.
[0024] S3-3: Model Training and Convergence
[0025] Mean squared error (MSE) was chosen as the loss function, and the Adam optimization algorithm was used to iteratively train the model. During training, early stopping was used to avoid overfitting, and the performance on the validation set was used to determine whether to stop training early. If the model's performance continued to improve during training, the network parameters were updated until the convergence condition was met.
[0026] S3-4: Verification and Testing of the Final Model
[0027] The trained model is validated using a validation set to obtain the final TimesNet-BiLSTM network. Input the test set into the final model, and use... The model's predictive performance was tested using evaluation metrics such as Symmetric Mean Absolute Percentage Error (SMAPE), Mean Absolute Error (MAE), and Root Mean Square Error (RMSE).
[0028] The working principle of this invention is as follows: In the data preprocessing stage, photovoltaic power and meteorological characteristics are normalized, outlier corrections are performed, and missing values are explicitly marked. The maximum information coefficient (MIC) method is used to screen feature variables that are highly correlated with the prediction target. In the signal processing stage, VMD is used to decompose the photovoltaic power sequence into intrinsic mode functions (IMFs) of different frequencies. The whale migration optimization algorithm (WMA) is used to adaptively optimize the number of modes K and the penalty factor α to obtain the optimal decomposition result. Subsequently, in the modeling stage, a parallel neural network structure composed of TimesNet and BiLSTM is designed: TimesNet extracts two-dimensional time-series features within and between periods through a periodic folding mechanism, while BiLSTM captures long-term dependency information in the time series. The two are jointly modeled in the fusion layer to enhance the overall expressive power. Finally, the model is trained and optimized using loss functions such as mean squared error (MSE), and the prediction performance is evaluated using metrics such as RMSE, MAE, SMAPE, and R².
[0029] The innovation of this invention is: 1. Robust modeling of missing data without interpolation: The original missing structure is preserved and explicitly labeled, allowing the model to directly learn the relationship between missing and valid signals, avoiding interpolation noise and improving the prediction robustness under incomplete data.
[0030] 2. WMA-VMD Adaptive Multi-Scale Decomposition: The whale migration optimization algorithm is used to optimize VMD parameters. With prediction performance as feedback, data-driven adaptive decomposition is achieved, thereby improving feature quality.
[0031] 3. TimesNet-BiLSTM Parallel Periodic Awareness Architecture: TimesNet extracts multi-scale features within / between periods, and BiLSTM models long-term nonlinear dependencies. The two are fused in parallel to achieve joint modeling of photovoltaic time series multi-period and long-term dynamics.
[0032] The beneficial effects of this invention are: 1. This invention improves the accuracy of photovoltaic power prediction by fusing TimesNet and BiLSTM models in parallel, which not only captures global trends in long-term series but also fully utilizes local temporal features. Compared with traditional methods, this invention effectively avoids error accumulation, enhances the accuracy of multi-step prediction, and ensures the reliability of long-term prediction.
[0033] 2. Traditional prediction methods often struggle to handle missing data in time series data, or require manual interpolation. This invention, through an adaptive missing value awareness model, eliminates the need for interpolation to fill in missing data. It directly learns the missing data patterns and leverages the bidirectional modeling capabilities of BiLSTM and the multi-scale modeling capabilities of TimesNet to effectively fill in missing segments. This avoids the interpolation operations of traditional methods, improving the flexibility and accuracy of data processing.
[0034] 3. This invention only completes missing data during the training phase, rather than interpolating the entire dataset, thus avoiding information leakage and ensuring that the model can better simulate missing data in real-world environments. This method effectively improves the model's robustness in imperfect data environments, ensuring good generalization ability in practical applications and thereby enhancing the reliability of prediction results. Attached Figure Description
[0035] Figure 1 This is a flowchart of the photovoltaic power prediction model of the present invention.
[0036] Figure 2 This is the initial power diagram of the photovoltaic power of the present invention.
[0037] Figure 3 This is a magnified view of a typical geographical location where power is collected.
[0038] Figure 4 This is a correlation analysis chart of MIC (Minimum Income, Stock) data from the park.
[0039] Figure 5 This is a variational mode decomposition (VMD) diagram of the park's data.
[0040] Figure 6 This is a graph showing the photovoltaic power prediction results from the model.
[0041] Figure 7 This is a diagram of the TimesNet architecture.
[0042] Figure 8 It is a BiLSTM diagram.
[0043] Figure 9 This is a flowchart of the whale migration optimization algorithm. Specific implementation methods
[0044] The invention will now be further described with reference to the accompanying drawings.
[0045] Reference Figures 1-9 A photovoltaic power prediction method based on multi-scale feature extraction and parallel modeling using TimesNet-BiLSTM includes the following steps: S1: Multiscale signal decomposition and feature input construction Raw photovoltaic power data and corresponding meteorological feature data with fixed sampling intervals are acquired, normalized, missing value labeled, and time aligned. Variational mode decomposition (VMD) is used to decompose the power series into multiple scales, and the whale migration optimization algorithm (WMA) is used to jointly optimize the number of modes K and the penalty factor α. Then, based on the maximum information coefficient (MIC) method, IMF components and meteorological features that are highly correlated with the prediction target are selected to form the final model input feature set.
[0046] S2: Construction of Parallel Neural Network Prediction Structure
[0047] A parallel neural architecture consisting of TimesNet and Bidirectional Long Short-Term Memory (BiLSTM) is constructed. TimesNet models two-dimensional temporal changes within and between periods through a periodic folding mechanism, while BiLSTM extracts long-term dependent features. The outputs of both are merged in a fusion layer and connected to a fully connected layer to generate predicted values.
[0048] S3: Model Training and Prediction Output
[0049] The parallel neural network is trained based on historical data, and the model parameters are optimized using loss functions such as mean square error. In the prediction stage, the newly input photovoltaic power and meteorological characteristics are fed into the trained parallel network, and the photovoltaic power prediction results are output.
[0050] Furthermore, the specific details of signal construction and feature selection performed in step S1 are as follows: S1-1: Before model building, the original historical meteorological data and photovoltaic power generation data are comprehensively preprocessed to improve data quality and enhance the reliability of model input. First, all data are uniformly converted to a fixed time resolution, and timestamps are standardized and aligned to ensure sequence consistency. For missing points in the photovoltaic power data, instead of using traditional interpolation methods, the missing locations are explicitly marked and their time information is preserved, allowing the subsequent model to directly perceive and adapt to missing conditions. Based on this, outlier detection and correction are further implemented. Abnormal points such as sudden changes and drifts are identified and replaced using neighborhood statistics or reasonable estimation methods, thereby reducing the interference of observation errors on modeling. For data under no-sunlight conditions (such as nighttime), the photovoltaic power value is uniformly set to zero to avoid misjudging it as a low-power output stage.
[0051] Finally, after missing value processing, outlier removal, and nighttime power correction, all characteristic variables (including photovoltaic power and meteorological factors) were normalized. A min-max normalization method was used to map all values to... The normalization interval is used to eliminate the impact of differences in feature dimensions on the model training process, thereby improving the stability and convergence speed of subsequent neural network modeling. The normalization formula is as follows: (1) In the formula, Represents the original data. and These represent the minimum and maximum values of the feature, respectively. This is the normalized value.
[0052] S1-2: Feature Correlation Screening Based on Maximum Information Coefficient
[0053] To improve the effectiveness of the model's input features and overall predictive performance, this paper introduces the Maximum Information Coefficient (MIC) method into the modeling process to measure and filter the correlation between the original meteorological variables and the photovoltaic power series. MIC can simultaneously measure both linear and nonlinear dependencies between variables, making it suitable for capturing potential coupling patterns and non-stationary features in complex time series.
[0054] Compared to traditional linear analysis methods such as Pearson correlation coefficient, MIC has stronger adaptability and robustness in identifying multiple types of dependencies. It can comprehensively explore the nonlinear, high-order coupling and local correlation characteristics that may exist between photovoltaic output and meteorological factors (such as irradiance, temperature, wind speed, etc.), significantly improving the scientificity and practicality of feature selection before modeling.
[0055] In mathematical terms, MIC is based on mutual information (MI) normalization to measure the maximum correlation strength between any two variables x and y. The formula for calculating mutual information is shown below: (2) (3) In the formula, and These are the marginal probability distributions. Let be the joint probability density function. , To make variables and The number of grids to be divided into, This is the maximum grid resolution, which is usually related to the number of samples. It is set to... .
[0056] In photovoltaic (PV) prediction modeling, the MIC (Match Indicator) values are calculated for each IMF component and the corresponding meteorological factors (such as irradiance, temperature, and wind speed) at each time point, along with the target PV power data. A correlation threshold (such as 0.3 or 0.5) is then set. Finally, feature variables with MIC values higher than the threshold are selected as inputs to the prediction model to eliminate redundant and invalid information, thereby improving the model's generalization ability and prediction accuracy.
[0057] S1-3: Variational Mode Decomposition (VMD) decomposition of the signal
[0058] After completing the data cleaning and correction operations in step S1-1, the meteorological factors and power sequences that are highly correlated with photovoltaic power are first screened out based on the aforementioned maximum information coefficient (MIC) method in S1-2.
[0059] Subsequently, the selected original photovoltaic power time series was used as input, and multi-scale signal decomposition was performed using the variational mode decomposition (VMD) method. VMD can decompose the non-stationary original sequence into several intrinsic mode functions (IMFs) with different frequency characteristics. Each IMF component represents the local variation pattern of the original power sequence in different frequency ranges. Through this decomposition, the periodicity, trend, and high-frequency perturbation components of the photovoltaic power data can be effectively extracted, providing a more physically meaningful input basis for subsequent modeling and prediction.
[0060] In finding the extrema of the constrained variational model, the signal is described as follows: (4) (5) In the formula It is the Dirac function, used to represent a unit impulse input. Indicates the first indivual IMF (Intrinsic Mode Function) ; It is the center frequency of each IMF. It is an analytic signal constructed through the Hilbert Transform. It is a modulation factor used to modulate the spectrum of each IMF to baseband for easier subsequent analysis. This represents the Euclidean norm, or L2 norm. The bandwidth estimate for each IMF is obtained by Gaussian smoothing of the signal and then using its square norm. The calculations are performed. Therefore, the overall objective optimization problem of VMD can be understood as: "Minimizing the sum of the estimated bandwidths of all IMFs".
[0061] This variational optimization problem can be modeled using the Augmented Lagrangian method and solved using the Alternating Direction Multiplier Method (ADMM). To solve the variational mode decomposition problem of photovoltaic power time series, this embodiment employs the Alternating Direction Multiplier Method (ADMM) for iterative optimization. The basic process is as follows: 1. Construct the extended Lagrange function: (6) In the formula: the first term is the bandwidth penalty for each modal function; the second term is the squared reconstruction error term; and the third term is the dual term introduced by the linear constraint condition.
[0062] 2. Alternating Optimization Model (ADMM): In each iteration, the following three variables are updated sequentially: 1) Modal function (Analytical solution in the frequency domain): (7) 2) Center frequency Update: (8) 3) Lagrange multipliers Update: (9) 4) Iteration termination criteria: The iteration terminates when the following convergence condition is met: , (10) in For the error threshold, Normal settings .
[0063] In the specific modal decomposition process, the number of modes... With penalty factor The mode number is a key parameter affecting decomposition performance. Inappropriate parameter settings can lead to insufficient mode extraction, redundant mode numbers, or even the loss of important features in the original signal, thus affecting the accuracy of subsequent modeling and prediction. Therefore, this invention, based on the aforementioned ADMM optimization framework, further introduces a mode number parameter based on prediction error feedback. With penalty factor The joint optimization mechanism achieves adaptive parameter configuration by minimizing the prediction model error. At the same time, an adaptive step size adjustment mechanism is introduced to dynamically adjust the update rate of the Lagrange multipliers, thereby improving the convergence efficiency and stability of the solution. In addition, a multi-round decomposition structure fusion strategy is designed to integrate feature information from different decomposition levels, thereby enhancing the model's generalization ability and robustness to complex signals.
[0064] S1-4: VMD Parameter Optimization Based on Whale Migration Optimization Algorithm
[0065] To achieve the number of modes in variational mode decomposition (VMD) With penalty factor To address adaptive optimization, this paper introduces a metaheuristic optimization algorithm based on the migratory behavior mechanism of humpback whales—the Whale Migrating Algorithm (WMA). This algorithm simulates the synchronization, orientation awareness, and environmental adaptability of humpback whales during seasonal migration, thereby achieving a dynamic balance between global search and local exploitation in the optimization process.
[0066] Whales exhibit strong robustness and high path consistency during natural migrations, maintaining the stability of their migration routes even in the face of complex environmental disturbances. This is mainly due to their fusion perception of multi-source navigation information (such as geomagnetism, celestial navigation, and acoustic source localization). Inspired by this, WMA introduces mechanisms such as direction guidance, historical memory updating, and migration disturbances to improve the adaptability and stability of the search process.
[0067] 1. Initialization phase: Individual whale (i.e., the parameter combination to be optimized) Given upper and lower bounds of the search space and Uniformly generated internally, with the following initialization formula: (11) In the formula, The dimension is A random vector, each element of which follows a set order. Uniform distribution This represents the Hadamard element-wise product.
[0068] 2. Navigator Guidance:
[0069] The number of whales with higher experience points (navigators) is set to [number]. Individuals were ranked from highest to lowest fitness, and the top-ranked individuals were selected. The average position of each individual is used as the global guiding vector: (12) In the formula: The individual with the best fitness is denoted as . .
[0070] 3. Non-navigator individual update (local collaboration + global optimal guidance):
[0071] For less experienced whales (i.e., non-leader individuals), the index Its EFDD update strategy takes into account two factors: 1) Follow nearby individuals Forming local synergy; 2) Towards the global optimum near.
[0072] The updated formula is as follows: (13) 4. Leader Individual Update (Perturbation Strategy) For individual navigators (index) If the search area is not found in the specified region, a perturbation strategy is employed to explore new areas in order to maintain search diversity. The update formula is as follows: (14) In the formula, , \ is the dimension of Interval random vector.
[0073] 5. Update judgment: Updated location It is only accepted if fitness is improved, that is: (15) In this invention, the Whale Migration Optimization Algorithm (WMA) is used to automatically optimize the combination of key parameters in Variational Mode Decomposition (VMD). To improve the stability and accuracy of signal decomposition, this algorithm simulates the synchronization and sense of direction during humpback whale migration, enabling a global search and local exploitation of the parameter space, ultimately outputting the optimal parameter configuration.
[0074] Furthermore, in step S2, the parallel neural network prediction model is constructed as follows: S2-1: TimesNet Subnetwork Modeling and Feature Extraction The TimesNet model transforms time series from a one-dimensional (1D) structure to a two-dimensional (2D) structure using a parametrically efficient inception block, simultaneously extracting dual feature information within and between periods. In photovoltaic power prediction tasks, this model effectively enhances the ability to model periodicity, trends, and disturbances in time series.
[0075] TimesNet consists of multiple stacked TimeBlocks and introduces a residual connection mechanism. This structure helps to alleviate the vanishing gradient problem, speed up model convergence, and improve overall expressive power.
[0076] 1. Input embedding and residual connections
[0077] For a length of ,Include One-dimensional time series of 1 variable The initial input first passes through a data embedding layer ( The initial input is first processed through an embedding layer to extract key information from the sequence. The update calculation for each TimeBlock layer is as follows: (16) In the formula, Indicates the first The output of the layer time block, This represents the time block module, which contains a series of operations for extracting periodic-related information and performing time series modeling.
[0078] 2. Periodic Feature Extraction (FFT)
[0079] To extract the periodic features of the time series, the input sequence is first subjected to a Fast Fourier Transform (FFT). The sequence with the largest amplitude is then retained. One frequency component: (17) (18) Then calculate the corresponding period: (19) In the formula, Indicates Fast Fourier Transform; Indicates amplitude calculation; This indicates taking the average. It is the amplitude in the frequency domain; It is frequency; It is a cycle.
[0080] 3. Ascending order dimension:
[0081] The above calculations extract the periodic information from the signal. The period calculation function Period is then used for further processing to obtain period-related information. The specific steps are as follows: (20) In the formula, Function for calculating period length Frequency domain amplitude vector; Represents i dominant frequencies, corresponding to the frequency vector with the largest amplitude. One frequency; Frequency corresponds to period .
[0082] 4. Convert the input sequence into a two-dimensional tensor.
[0083] Based on the periodic information extracted in the above steps, the input sequence is converted into multiple two-dimensional tensors. First, zero-padding is applied to the data to maintain a consistent output size. Then, the one-dimensional sequence is converted into multiple two-dimensional tensors, as detailed below: (twenty one) In the formula, , This indicates that zeros are padded to both ends of the input data.
[0084] 5. Extracting two-dimensional features
[0085] Local features reside in the transformed 2D tensor, with rows and columns representing intra- and inter-period features, respectively. To extract rich features from the data, this method introduces an efficient initial block from the Inception V1 module in GoogleNet. This module utilizes different convolutional kernels and pooling operations across multiple channels to extract multi-scale features across and within periods, as shown in Fig. 3. The specific calculation is as follows: (twenty two) 6. Dimensionality Reduction and Adaptive Fusion (2D→1D) Multiple 2D feature tensors corresponding to different frequencies will be mapped back to 1D tensors to achieve the integration of the final output. First, these tensors are reconstructed into 1D based on period / frequency, and then weighted fusion is performed. This process includes the following three steps: 1) Restore the 2D feature tensor to a 1D vector (using Trunc truncation): (twenty three) 2) Calculate the frequency weighting coefficients using Softmax: (twenty four) 3) Perform a weighted summation of the 1D features for all frequencies to obtain the final output: (25) In the formula, This indicates that the length is The tensor is truncated to the initial time length. .
[0086] S2-1: Temporal Feature Modeling of BiLSTM Submodule
[0087] Building upon the spatial (periodic) features extracted by the TimesNet module, this paper introduces a Bidirectional Long Short-Term Memory (BiLSTM) network as a second sub-model in the parallel structure to further model the dependencies and dynamic characteristics of time series data. BiLSTM can simultaneously capture the dynamic correlation between historical information and future context, enhancing the ability to model the non-stationary and hysteretic characteristics of photovoltaic power.
[0088] The basic structural units and algorithms of BiLSTM are derived from LSTM. This invention constructs a system as follows: Figure 5 Taking the LSTM at time t as an example, the LSTM unit will input the final output result. and current variables First, it is necessary to determine the cell state. The forgotten content is calculated by using a forgetting gate to calculate the forgetting factor from the input variables. Next, input the variables. and The sigmoid activation function at the input gate determines which new information about the cell state needs to be updated and creates new candidate cell states. By inputting the gate Activation function.
[0089] The specific calculation process is shown in equations (26) to (31): (26) (27) (28) (29) (30) (31) In the formula 、 、 、 、 、 、 、 It is the weight matrix of the corresponding gates in the network, and 、 、 、 It is the bias matrix; and These represent the sigmoid and tanh activation functions, respectively.
[0090] Considering both forward and backward information from time series data can effectively improve prediction accuracy. Compared to the unidirectional state transfer in standard LSTM, the BiLSTM structure can learn both forward and backward conditioning simultaneously. Through bidirectional time series feature extraction, BiLSTM exhibits superior performance compared to LSTM. The output of BiLSTM, calculated by combining bidirectional LSTMs, is as follows: (32) In the formula, and These represent the outputs of the forward LSTM and the backward LSTM, respectively. and It is a weight matrix.
[0091] Evaluation method: When performing predictive analysis on subtasks with different multi-dimensional loads, the analysis needs to be conducted on the same time scale. The analysis focuses on evaluation metrics such as Symmetric Mean Absolute Percentage Error (SMAPE), Mean Absolute Error (MAE), and Root Mean Square Error (RMSE). The specific expressions for these metrics are as follows: (33) (34) (35) (36) In the formula, It is a predicted value. It is the average value. It is the actual value. It refers to the sample size, MAE measures the mean error, RMSE highlights the impact of large errors, and SMAPE is used to assess the magnitude of relative errors.
[0092] To enable those skilled in the art to better understand the present invention, the simulation performed in step S4 is as follows:
[0093] This invention combines meteorological data (including atmospheric temperature, humidity, air pressure, illuminance, etc.) from the Wuhan area with real-time photovoltaic power data, uses a 15-minute time scale, and employs machine learning algorithms to make high-precision predictions of photovoltaic power.
[0094] This invention is based on Figure 1 The prediction process shown is simulated. The prediction dataset covers the period from December 16, 2024 to February 28, 2025. The system includes photovoltaic power generation and related weather data, with a sampling interval of every 15 minutes. Meteorological characteristics include atmospheric temperature, atmospheric humidity, solar irradiance, atmospheric pressure, simplified total radiation, wind speed, wind direction, cumulative rainfall, and cumulative radiation.
[0095] Table 1 Feature Acquisition
[0096] Table 1 Collected characteristics
[0097] To improve data quality, outliers were identified using the quartile method, and missing and outlier data were uniformly imputed using interpolation to ensure the stability of subsequent modeling. After data preprocessing, normalization was performed to prevent differences in the order of magnitude of different variables from affecting the model's prediction accuracy.
[0098] The hardware platform includes an Intel Core i7 CPU and an NVIDIA RTX 3060 GPU. The data was divided into training, validation, and test sets in a 4:1:1 ratio. Future photovoltaic power was predicted in 15-minute increments.
[0099] Parameter settings
[0100] To ensure the training stability and generalization ability of the joint model in photovoltaic power prediction, the main hyperparameters were systematically set and adjusted during the experiment. Key parameters involved in the model include input window length, number of Autoformer network layers and attention mechanism structure, hidden dimension of the LSTM module, activation function type, loss function form, optimizer selection, Dropout probability, and maximum number of iterations, as shown in Table 2.
[0101] Table 2 Parameter Settings
[0102] Prediction Results Analysis
[0103] Table 3 Photovoltaic Prediction Experimental Parameters
[0104] The VMD decomposition exhibits smaller prediction errors in RMSE, MAE, and SMAPE, indicating that decomposition reduces high-frequency noise interference. The introduction of parallel prediction using TimesNet and BiLSTM further improves RMSE, MAE, and SMAPE, validating the effectiveness of complementary frequency-domain and time-domain modeling. The proposed method demonstrates higher accuracy and robustness in photovoltaic power prediction.
[0105] The graphical results show that the model accurately captures the diurnal variation trend of photovoltaic power and maintains small errors in both peak and trough regions. Compared with the baseline model, this method has significant advantages in overall fit and nighttime low power prediction. However, it exhibits some underestimation in scenarios with localized sharp fluctuations, which can be further improved by introducing more multi-scale features (short-term perturbations + long-term trends) or attention mechanisms.
[0106] In this specification, the illustrative descriptions of the invention are not necessarily directed at the same embodiments or examples. Those skilled in the art can combine and integrate the different embodiments or examples described in this specification. Furthermore, the content described in the embodiments of this specification is merely an enumeration of implementation forms of the inventive concept, and the scope of protection of this invention should not be regarded as limited to the specific forms stated in the embodiments.
Claims
1. A photovoltaic power prediction method based on multi-scale feature extraction and parallel modeling using TimesNet-BiLSTM, characterized in that, Includes the following steps: S1. Multi-scale signal decomposition and feature input construction: Obtain raw photovoltaic power data and corresponding meteorological feature data with fixed sampling intervals, and perform normalization, missing value marking and time alignment; Variational mode decomposition (VMD) is used to decompose the power sequence at multiple scales. The whale migration optimization algorithm (WMA) is used to optimize the number of modes K and the penalty factor α, construct the corresponding photovoltaic decomposition features, and form the final model input feature set. S2. Construction of the TimesNet-BiLSTM Parallel Neural Network Prediction Model: Construct a parallel neural network model consisting of TimesNet and a bidirectional long short-term memory network BiLSTM; TimesNet models the two-dimensional temporal changes within and between periods through a periodic folding mechanism, BiLSTM extracts long-term dependency features, and the outputs of the two are merged in the fusion layer and connected to the fully connected layer to generate predicted values. S3. Model Training and Prediction Output: The parallel neural network is trained based on historical data, and loss functions such as mean squared error are used to optimize the model parameters. In the prediction stage, the new photovoltaic power and meteorological characteristics are input into the trained parallel network, and the photovoltaic power prediction results are output.
2. The photovoltaic power prediction method based on multi-scale feature extraction and parallel modeling of TimesNet-BiLSTM as described in claim 1, characterized in that, The signal construction and feature selection in step S1 specifically include: S1-1. Data Preprocessing and Normalization: The raw meteorological data and photovoltaic power data are preprocessed; all data are uniformly converted to a fixed time resolution, and the timestamps are standardized and aligned to ensure sequence consistency; missing points in the photovoltaic power data are explicitly marked and their time information is retained; outliers are identified and corrected; the nighttime power value is uniformly set to zero, and the data is normalized using the min-max normalization method to eliminate dimensional differences; S1-2. Feature correlation screening based on maximum information coefficient: The MIC method is used to measure the correlation between meteorological variables and photovoltaic power series, and features that are highly correlated with the target prediction are screened out. S1-3. Multi-mode decomposition (VMD) of the signal: The photovoltaic power sequence is decomposed into a multi-scale signal using VMD to extract components such as periodicity, trend and high-frequency disturbance. S1-4. WMA optimization algorithm for fish migration optimizes VMD parameters: WMA is used to optimize the number of modes and penalty factor in VMD, improving the stability and accuracy of signal decomposition; WMA performs global and local searches based on the migration behavior mechanism of whales to optimize the combination of VMD parameters.
3. The photovoltaic power prediction method based on multi-scale feature extraction and parallel modeling of TimesNet-BiLSTM as described in claim 2, characterized in that, Steps S1-4 specifically include: S1-4-1. Initialization; Individual whale (i.e., the parameter combination to be optimized) Given upper and lower bounds of the search space and Uniformly generated internally, with the following initialization formula: (11) In the formula, The dimension is A random vector, each element of which follows a set order. Uniform distribution This represents the Hadamard element-wise product; S1-4-2. Navigator Guidance; The number of whales with higher experience points (navigators) is set to [number]. Individuals were ranked from highest to lowest fitness, and the top-ranked individuals were selected. The average position of each individual is used as the global guiding vector: (12) In the formula: The individual with the best fitness is denoted as . ; S1-4-3. Non-navigator individual update: local collaboration + global optimal guidance; For less experienced whales, i.e., non-leader individuals, index Its update strategy takes into account two factors: 1) Follow nearby individuals Forming local synergy; 2) Towards the global optimum near; The updated formula is as follows: (13) S1-4-4. Navigator Individual Update (Perturbation Strategy) For individual navigators, index If a perturbation strategy is employed to explore new regions, it will maintain search diversity; the update formula is as follows: (14) In the formula, , \ is the dimension of Interval random vector; S1-4-5. Update judgment: Updated location It is only accepted if fitness is improved, that is: (15)。 4. The photovoltaic power prediction method based on multi-scale feature extraction and parallel modeling of TimesNet-BiLSTM as described in claim 1, characterized in that, Step S2, which involves constructing a parallel neural network prediction model, includes: S2-1. TimesNet Subnetwork Modeling and Feature Extraction: The TimesNet model transforms time series data from a one-dimensional structure to a two-dimensional structure, using the Inception module to extract multi-scale feature information within and between periods. The core of the model is the data embedding process. To ensure the model can understand the temporal relationships of time series data, different embedding modules are used: PositionalEmbedding: Generates a position code for each time step and embeds timing information; TokenEmbedding: Maps input features to a higher-dimensional vector space through one-dimensional convolution; TemporalEmbedding: Encodes periodic temporal features, transforming temporal information into vectors usable by the model; Inception Block: Uses multiple convolutional kernels to extract multi-scale features, capturing local and global features in the signal; S2-2. BiLSTM Subnetwork Modeling: By simultaneously capturing both forward and reverse dependencies in a sequence, BiLSTM can better learn long-term dependency features in time-series data; each BiLSTM layer contains two LSTM networks, one processing forward information (from front to back) and the other processing reverse information (from back to front). S2-3. Fully Connected Layer: After the output of the BiLSTM subnetwork, the fully connected layer is connected to integrate information and execute the prediction task.
5. The photovoltaic power prediction method based on multi-scale feature extraction and parallel modeling of TimesNet-BiLSTM as described in claim 4, characterized in that, Step S2-1 includes the following steps: S2-1-1. Input embedding and residual connection; For a length of ,Include One-dimensional time series of 1 variable The initial input first passes through a data embedding layer ( The initial input is first processed through an embedding layer to extract key information from the sequence; the update calculation for each TimeBlock layer is as follows: (16) In the formula, Indicates the first The output of the layer time block, This represents a time block module, which contains a series of operations for extracting periodic-related information and performing time series modeling. S2-1-2. Periodic Feature Extraction; To extract the periodic features of the time series, the input sequence is first subjected to a Fast Fourier Transform (FFT); the sequence with the largest amplitude is retained. One frequency component: (17) (18) Then calculate the corresponding period: (19) In the formula, Indicates Fast Fourier Transform; Indicates amplitude calculation; This indicates taking the average. It is the amplitude in the frequency domain; It is frequency; It is a cycle; S2-1-3. Ascending order dimension; The above calculations extract the periodic information from the signal. The period calculation function Period is then used for further processing to obtain period-related information. The specific steps are as follows: (20) In the formula, Function for calculating period length Frequency domain amplitude vector; Represents i dominant frequencies, corresponding to the frequency vector with the largest amplitude. One frequency; Frequency corresponds to period ; S2-1-4. Convert the input sequence into a two-dimensional tensor; Based on the periodic information extracted in the above steps, the input sequence is converted into multiple two-dimensional tensors. First, zero-padding is applied to the data to maintain a consistent output size. Then, the one-dimensional sequence is converted into multiple two-dimensional tensors. The specific process is as follows: (21) In the formula, , This indicates that zeros are padded to both ends of the input data. S2-1-5. Extract two-dimensional features; Local features reside in the transformed 2D tensor, with rows and columns representing intra- and inter-period features, respectively. To extract rich features from the data, an efficient initial block from the Inception V1 module in GoogleNet is introduced. This module utilizes different convolutional kernels and pooling operations across multiple channels to extract multi-scale features across and within periods. The specific calculation is as follows: (22) S2-1-6. Dimensionality Reduction and Adaptive Fusion (2D→1D); Multiple 2D feature tensors corresponding to different frequencies will be mapped back to 1D tensors to achieve the integration of the final output. First, these tensors are reconstructed into 1D based on period / frequency, and then weighted and fused. This process includes the following three steps: 1) Restore the 2D feature tensor to a 1D vector (using Trunc truncation): (23) 2) Calculate the frequency weighting coefficients using Softmax: (24) 3) Perform a weighted summation of the 1D features for all frequencies to obtain the final output: (25) In the formula, This indicates that the length is The tensor is truncated to the initial time length. .
6. The photovoltaic power prediction method based on multi-scale feature extraction and parallel modeling of TimesNet-BiLSTM as described in claim 1, characterized in that, The model training and prediction output mentioned in step S3 includes: S3-1. Batch Training: The training set is input into the TimesNet-BiLSTM network in batches according to the number of sample signals processed each time; during the training process, the number of sampling points for each sample signal to be processed is set, and the features of the in-phase component and the quadrature component are extracted using the convolution unit; S3-2. Non-adjacent period feature extraction: The extracted signal features are input into the bidirectional long short-term memory layer (BiLSTM) in the TimesNet-BiLSTM network to further extract the relevant features of non-adjacent signal periods; the output of the long short-term memory layer is a one-dimensional vector containing only the modulation scheme category, and the correspondence between the modulation scheme and the category is established based on this one-dimensional vector; S3-3. Model Training and Convergence: The mean squared error (MSE) is selected as the loss function, and the Adam optimization algorithm is used to iteratively train the model. During the training process, early stopping is used to avoid overfitting, and the performance on the validation set is used to determine whether to stop training early. If the model's performance continues to improve during training, the network parameters are updated until the convergence condition is met. S3-4. Validating and Testing the Final Model: Validate the trained model using the validation set to obtain the final TimesNet-BiLSTM network; input the test set into the final model and use... The model's predictive performance was tested using evaluation metrics such as Symmetric Mean Absolute Percentage Error (SMAPE), Mean Absolute Error (MAE), and Root Mean Square Error (RMSE).