Photovoltaic power prediction method based on adaptive depth modeling and hyper-parameter optimization
By combining adaptive deep modeling and hyperparameter optimization with feature selection, mode decomposition, and parallel deep learning, the accuracy and robustness of photovoltaic power prediction under complex weather conditions are solved, enabling more efficient photovoltaic power generation system scheduling and energy management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG ELECTRIC POWER DESIGN INST
- Filing Date
- 2026-01-15
- Publication Date
- 2026-05-08
AI Technical Summary
Existing photovoltaic power prediction methods have low prediction accuracy and poor model generalization ability under complex weather conditions, making it difficult to handle high-dimensional multi-source meteorological data, resulting in insufficient scheduling efficiency and energy management capabilities of photovoltaic power generation systems.
An adaptive deep modeling and hyperparameter optimization approach is adopted. Features are selected by Pearson correlation coefficient and maximum information coefficient. Multivariate variational mode decomposition and parallel deep modeling are combined. Bidirectional long short-term memory network and iTransformer model are used, and the Heron Eagle optimization algorithm is introduced to optimize hyperparameters, thereby improving the robustness and generalization ability of the model.
It significantly improves the accuracy and robustness of photovoltaic power prediction, enhances the interpretability and applicability of the model, is suitable for short-term photovoltaic power prediction, and provides a new solution for other complex time series predictions.
Smart Images

Figure CN122000875A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of photovoltaic power prediction technology, and specifically to a photovoltaic power prediction method based on adaptive deep modeling and hyperparameter optimization. Background Technology
[0002] Photovoltaic power forecasting, as an important energy management technology, has wide applications in power system dispatching, load forecasting, and energy trading. With the continuous growth of global demand for clean energy, photovoltaic power generation has become one of the fastest-growing renewable energy sources globally. However, photovoltaic power output is significantly affected by meteorological factors, including irradiance, temperature, humidity, and wind speed. These factors are typically time-series, non-stationary, and multi-scale, leading to numerous challenges in photovoltaic power forecasting.
[0003] Currently, common photovoltaic power prediction methods mainly include those based on statistical models, machine learning algorithms, and deep learning methods. Traditional statistical methods, such as time series analysis and regression models, while providing some predictive accuracy, often fail to meet the demands of practical applications when faced with complex weather changes and highly uncertain environments. Machine learning methods (such as support vector machines and random forests) can handle certain nonlinear problems, but they often rely on manual feature engineering and have limited performance under large-scale, rapidly changing meteorological data. Deep learning methods (such as LSTM, BiLSTM, and CNNs) have become the mainstream technology in photovoltaic power prediction due to their powerful learning capabilities, but they still suffer from low prediction accuracy and poor model generalization ability when faced with data redundancy and significant noise interference.
[0004] With the expansion of photovoltaic power generation, traditional methods struggle to provide stable and efficient forecasts when dealing with high-dimensional, multi-source data and complex weather changes. Therefore, there is an urgent need to develop a more accurate, robust, and adaptive photovoltaic power forecasting method to address the processing demands of multi-source meteorological data, cross-scale issues, and large-scale data, thereby further improving the scheduling efficiency and energy management capabilities of photovoltaic power generation systems. Summary of the Invention
[0005] This invention proposes an adaptive deep modeling and hyperparameter optimization method for photovoltaic power prediction. Specifically, it provides a photovoltaic power prediction method based on feature selection, mode decomposition, parallel deep modeling, and hyperparameter optimization. This method aims to solve the problem of insufficient accuracy and robustness of existing prediction methods under complex weather conditions. Through the synergistic effect of multiple technical means, this method improves the performance of photovoltaic power prediction.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: An adaptive deep modeling and hyperparameter optimization method for photovoltaic power prediction involves performing the following steps using a computer device. Step S1: Data preprocessing and feature selection: Two feature-based screening methods are used: A: Pearson correlation coefficient: Calculates the linear correlation between meteorological factors and historical power data to further screen out features closely related to photovoltaic power.
[0007] B: Maximum Information Coefficient (MIC): Evaluates the nonlinear correlation of multi-source meteorological factors and screens out the key features most relevant to photovoltaic power.
[0008] The first round of screening uses the Pearson correlation coefficient to identify features with a strong linear correlation to photovoltaic power, typically setting a correlation coefficient threshold of 0.5. The second round of screening uses the maximum information coefficient (MIC) to further screen features with a strong nonlinear correlation to photovoltaic power, thus ensuring that the selected features can capture both linear and nonlinear relationships.
[0009] Step S2: Mode Decomposition: Multivariate variational mode decomposition (MVMD) is used to perform co-operative intrinsic mode decomposition on meteorological data and historical power data to suppress noise and aliasing in the data and extract feature information at different scales.
[0010] Step S3: Parallel deep modeling: A bidirectional long short-term memory network (BiLSTM) and an iTransformer parallel subnetwork were designed to capture short-term temporal memory and long-range dependencies respectively, while handling cross-modal interactions and fusing them at the modal-level mapping layer.
[0011] Step S4: Hyperparameter Optimization: The Heron Eagle Optimization Algorithm (SBOA) is introduced to globally optimize the hyperparameters of the decomposition model and the deep network. This step consists of two parts: MVMD optimization: Optimize the hyperparameters in the mode decomposition process to ensure more accurate feature extraction.
[0012] Deep network optimization: Optimize the network structure, learning rate and other hyperparameters of BiLSTM and iTransformer to improve the robustness and generalization ability of the model.
[0013] This invention, through a combination of the above-mentioned technical means, effectively improves the accuracy of photovoltaic power prediction, solves the problem of performance degradation in complex environments of existing methods, and enhances the interpretability and applicability of the model. This method is not only applicable to short-term photovoltaic power prediction, but also provides a new approach and solution for complex time-series prediction in other fields.
[0014] Furthermore, the feature selection in step S1 includes: S11: Data Preprocessing and Feature Selection Raw meteorological and photovoltaic power data were preprocessed to ensure consistency and accuracy. First, all data were converted to a fixed time resolution and timestamp standardized and aligned to guarantee sequence consistency. Missing values in the photovoltaic power data were explicitly marked and their time information was preserved. Simultaneously, outliers were identified and corrected to ensure data reliability.
[0015] S12: Pearson correlation coefficient screening For each meteorological factor (such as temperature, humidity, irradiance, wind speed, etc.), calculate its Pearson correlation coefficient with photovoltaic power, using the following formula: (1) In the formula, and These are sample values for meteorological factors and photovoltaic power, respectively. and It is its mean.
[0016] Select relevant features: Based on the calculated correlation coefficient values, select the top N features that have a strong linear relationship with photovoltaic power. Generally, a correlation coefficient threshold of 0.5 is set. If the correlation coefficient is higher than this threshold, the feature is considered to have a strong linear relationship with photovoltaic power and will proceed to the next round of screening.
[0017] S13: Maximum Information Coefficient (MIC) Screening: The MIC method is introduced to measure the correlation between meteorological variables and photovoltaic power series, and features highly correlated with the target forecast are screened out. Mutual information is calculated. and The formula is as follows (2) (3) In the formula: and These represent the number of grids divided vertically and horizontally, respectively. Indicates to and Two-dimensional continuous integral; , They are respectively and The marginal probability distribution; For samples in the grid and The joint probability distribution in; The size is 0.55 or 0.6 times the corresponding data.
[0018] The features selected using Pearson correlation coefficient and MIC are combined to obtain a candidate feature set. If the same feature is selected in both rounds of selection, that feature is retained.
[0019] S14: Feature Normalization After feature selection, to ensure that all features have the same scale and to avoid the impact of features of different scales on subsequent modeling, the selected features are normalized. The specific steps are as follows: MinMax normalization: scales the value of each feature to the range [0,1], using the following formula: (4) In the formula: These are the original eigenvalues. It is the minimum value of the feature. It is the maximum value of the feature, which is the feature value after MinMax normalization, ensuring that its range is between [0,1].
[0020] The mode decomposition in step S2 includes: S21: MVMD Feature Extraction and Mode Decomposition in Photovoltaic Power Prediction MVMD introduces a common center frequency and cross-channel alignment constraints within a variational framework, enabling collaborative decomposition of PV and key meteorological features at the time-frequency domain level. This improves noise immunity and decomposition stability, and effectively alleviates mode aliasing.
[0021] The MVMD modal decomposition method is as follows: The input raw sequence data contains Data vector of each channel In this context, the original sequence is represented as In MVMD, the number of modes is set to... Through optimization, the input signal can be decomposed into Aligned modal components, satisfying Each modal component is represented as .
[0022] Multi-modulation oscillation signal Perform Hilbert transformations and record the results. Next, the center frequencies of all modal components of the signal are... Add an exponent term and adjust it to the corresponding baseband frequency, then calculate the Hilbert transform. gradient function Norms, establishing optimization constraints: (5) In the formula: It is a passage The Each modal component; It is a bandwidth constraint to suppress high-frequency oscillations.
[0023] To address the linear equality constraints in multichannel mode decomposition, an augmented Lagrangian method is introduced. By adding a quadratic penalty term for the reconstruction error and introducing Lagrange multipliers, constraint violations are penalized, and the strict satisfaction of constraints is ensured. This transforms the original constrained variational problem into an equivalent unconstrained optimization problem. The corresponding augmented Lagrangian function can be expressed as: (6) In the formula: This involves introducing constraints on the corresponding Lagrange multipliers.
[0024] S22: To efficiently solve the augmented Lagrangian function, the alternating direction multiplier method is used to update the parameters, transforming it into several simple sub-optimization problems for further solution.
[0025] After the above steps, the signal frequency band is decomposed, and the number of channels is finally obtained. and modal component number Multiplying several narrowband intrinsic mode function (IMF) components ensures frequency consistency across different channels.
[0026] The parallel depth modeling process in step S3 is as follows: To balance short-term memory and long-term dependencies on a single prediction channel, a cascaded encoding-prediction architecture is adopted.
[0027] S31: Modeling process of bidirectional long short-term memory network (Bilstm): The basic structural units and algorithms of BiLSTM are derived from LSTM. The present invention is constructed as shown in Figure 5. Taking the LSTM at a given time 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.
[0028] The specific calculation process is shown in equations (7) to (12).
[0029] (7) (8) (9) (10) (11) (12) 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.
[0030] 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: (13) In the formula and These represent the outputs of the forward LSTM and the backward LSTM, respectively. and It is a weight matrix.
[0031] S32: iTransformer modeling process: The ITransformer encoder model primarily consists of a multi-head attention layer and a feedforward neural network. The multi-head self-attention mechanism extracts feature relationships between different sequences, thereby capturing key information. The feedforward neural network enhances the model's generalization ability. Additionally, two normalization layers are added to improve model stability and accelerate training convergence.
[0032] The self-attention mechanism in the multi-head attention layer is the core mechanism of the Transformer series models. By calculating the attention of load and environmental variables, comparing the calculated attention scores, and then selecting key information for multivariate load prediction in (6)(7).
[0033] (14) (15) in, W* and W' are parameter matrices used to compute the Q, K, and V vectors. Q, K, and V correspond to the query vector, key vector, and value vector, respectively. By computing the dot product K between the query value and the key value, the feature representation of each time series can be fully extracted. After exponential normalization, this feature representation is multiplied by the value vector to obtain the attention representation A(Q,K,V). Softmax is an exponential normalization function used to compute the self-attention weights. To prevent the vanishing of the softmax gradient due to excessively large values of Q·K, the softmax gradient is eliminated. Scaling is achieved by dividing Q·K7 by d, where d is the dimension of K. The final attention score reveals the correlation between multivariate load and environmental variables. The above attention mechanism operates only on a series of mappings to the input variable X. Based on this, it is extended to a multi-head attention mechanism. For independent mappings, a subspace of n sets of input variables is created, and different attention representations are established for parallel operations. The final outputs are merged to compute the output. (16) (17) Where i represents the i-th attention head. A represents the computational expression for the i-th attention head. Q, K, and V are the query vector, keyword vector, and value vector of the i-th attention head of the input vector X, respectively. This represents the weight matrix in the multi-head attention merging calculation expression. It is the number of attention heads created. It is a multi-head attention merging calculation expression.
[0034] Output layer: Its output layer is a projection module composed of MLP (Multilayer Perception). This module performs nonlinear mapping output through multivariate labels processed independently by the encoder module, and selects photovoltaic power generation, wind power generation, and user electricity load prediction sequences for output.
[0035] S33: Output of the fully connected layer fusion module Before the output layer, the outputs of BiLSTM and iTransformer are concatenated into a longer feature vector. This is achieved by concatenating the output feature vectors of the two sub-networks along their feature dimensions, as shown in the formula: (18) concatenated feature vectors The input is passed to a fully connected layer. The fully connected layer computes a new feature representation through a weighted summation of bias terms, and then generates the final output using a non-linear activation function (such as ReLU, Sigmoid, etc.). The calculation formula for the fully connected layer is as follows: (19) It is a weight matrix. It is a bias term. It is an activation function. It is the final prediction result after calculation by the fully connected layer.
[0036] The hyperparameter optimization process in step S4 is as follows: By introducing the Heron Eagle Optimization Algorithm (SBOA), key hyperparameters in MVMD (such as the number of modes) can be optimized simultaneously. and smoothing parameters SBOA performs global and local searches across the entire solution space, effectively avoiding local optima and improving the model's generalization ability and robustness.
[0037] Specifically: S41: Initialize the population: At the start of the algorithm, the problem settings need to be initialized, including the dimension, upper and lower bounds, size d, and number of iterations of the solution space. Each individual represents a potential solution, and an initial population is randomly generated.
[0038] The dimension of the solution space; , The upper and lower bounds of the problem; Population size, representing the number of solutions; Maximum number of iterations; : The current iteration number.
[0039] During population initialization, each individual Represents a potential solution: (20) The fitness of each individual is calculated using the objective function: (twenty one) Optimal solution The optimal solution is selected by comparing the fitness of all individuals: (twenty two) S42: Exploration Phase The goal of the exploration phase is to extensively search the solution space to avoid getting trapped in local optima. This phase is divided into three periods: early, middle, and late, each using a different update strategy.
[0040] 1. Initial Exploration Phase ( ): During this phase, the heron updates its position through random movement. The position update formula is as follows: (twenty three) In the formula, Indicates the updated individual position. It is an adjustment factor that controls the search step size.
[0041] Based on fitness, a position is only updated if its fitness is better than the current solution: (twenty four) In the formula, This indicates the updated individual position.
[0042] 2. Mid-term exploration phase ( ): In the mid-stage, the egret begins to focus on optimizing around the current optimal solution, and the updated formula is as follows: (25) In the formula, This is the current optimal solution. It is a random factor that controls the randomness of position updates.
[0043] When updating the position, the fitness score will also be used to determine whether to accept the new solution. (26) 3. Later exploration stage ( ) In the later stages, the heron will further optimize the known good solutions, converging to the optimal solution through local search. The position update formula is as follows: (27) In the formula, It is a random step size used to adjust the search process.
[0044] Similarly, the location is updated based on fitness: (28) S43: Exploitation Phase The goal of the development phase is to refine and optimize the known optimal solutions to further improve the quality of the solutions. During this phase, the algorithm performs local searches, typically employing two strategies.
[0045] First strategy ( ) When random number When the value is less than 0.5, the heron will perform local optimization based on the current optimal solution: (29) Second strategy ( ) When random number When the value is greater than or equal to 0.5, the heron will adjust its position based on random locations: (30) After the update, each individual determines whether to choose the new position based on its fitness value. If the new position has better fitness, the current solution is updated, and the optimal solution is saved. W(31) Finally, when the maximum number of iterations T is reached, the optimal solution is output.
[0046] S44: Validation and Final Model The trained model is validated using a validation set to obtain the final TimesNetBiLSTM network; the test set is then input into the final model, and... The model's predictive performance was tested using evaluation metrics such as mean absolute percentage error (MAPE), mean absolute error (MAE), and root mean square error (RMSE).
[0047] As described above, this invention relates to a medium-term photovoltaic power prediction method based on multi-source meteorological data, aiming to improve the prediction accuracy and robustness of photovoltaic power generation systems under complex meteorological conditions. The method first uses Pearson correlation coefficient and maximum information coefficient (MIC) to feature-select meteorological factors closely related to photovoltaic power, such as air pressure and solar irradiance, ensuring the model can capture both linear and nonlinear relationships between photovoltaic power and meteorological factors. Next, multivariate variational mode decomposition (MVMD) is used to perform co-mode decomposition on meteorological data and historical power data, suppressing noise and extracting multi-scale feature information. Then, a parallel bidirectional long short-term memory network (BiLSTM) and an iTransformer subnet are designed to capture short-term temporal features and long-range dependencies, respectively, and are interactively fused at the mode level. Finally, the Heron Eagle Optimization Algorithm (SBOA) is used to globally optimize the model's hyperparameters to further improve prediction performance. Experimental results show that this method can significantly improve prediction accuracy in photovoltaic power prediction and has better generalization ability and robustness compared to traditional methods.
[0048] The innovation of this invention is 1. Apply the Heron Eagle Optimization Algorithm (SBOA) to the hyperparameter optimization of MVMD and deep learning models to avoid local optima.
[0049] 2. The collaborative optimization strategy of MVMD and SBOA was adopted to enhance the feature extraction capabilities of multi-source meteorological data and photovoltaic power data.
[0050] 3. By jointly optimizing the hyperparameters of MVMD and deep learning models, the accuracy and stability of the entire prediction framework are improved.
[0051] 4. Based on SBOA, dynamic hyperparameter adjustment enables flexible hyperparameter optimization, adapting to different tasks and scenarios, improving the accuracy and robustness of photovoltaic power prediction, and ensuring higher prediction reliability.
[0052] The beneficial effects of this invention are: 1. Improve prediction accuracy and robustness: By introducing SBOA to optimize the hyperparameters of MVMD and deep learning models, key features of meteorological and photovoltaic power data are effectively extracted, enhancing the prediction accuracy and robustness of the model in complex environments and avoiding the problem of local optima.
[0053] 2. Optimized feature extraction process: SBOA optimizes the number of modalities in MVMD. and smoothing parameters This improves the accuracy of mode decomposition, reduces noise interference, and provides clearer and more reliable input features for deep learning models.
[0054] 3. Improve training efficiency and stability: SBOA simultaneously optimizes the hyperparameters of deep learning models (such as learning rate, batch size, network structure, etc.), significantly improving the training efficiency and stability of the model through global optimization.
[0055] 4. Enhanced system scalability: This method has strong versatility and scalability, can adapt to different photovoltaic power generation scenarios and operating conditions, improves the generalization ability of the model, and is widely applicable to photovoltaic systems of various sizes and types. Attached Figure Description
[0056] Figure 1 This is a flowchart of the photovoltaic power prediction model of the present invention; Figure 2 This is a Pearson correlation analysis diagram of park data according to an embodiment of the present invention; Figure 3 This is a correlation analysis diagram of MIC (Micro-Matching Interference) of park data according to an embodiment of the present invention; Figure 4 This is a flowchart of the SBOA algorithm according to an embodiment of the present invention; Figure 5aThis is a photovoltaic power decomposition diagram of the variational mode decomposition (MVMD) diagram of the park data in an embodiment of the present invention; Figure 5b This is an illumination intensity decomposition diagram of the variational mode decomposition (MVMD) diagram of the park data in an embodiment of the present invention; Figure 5c This is a barometric decomposition diagram of the variational mode decomposition (MVMD) diagram of the park data in an embodiment of the present invention; Figure 6 This is a diagram of the BiLSTM structure according to an embodiment of the present invention; Figure 7 This is a structural diagram of the itransformer according to an embodiment of the present invention; Figure 8 This is a graph showing the photovoltaic power prediction results of the model in an embodiment of the present invention. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0058] like Figure 1 As shown: A photovoltaic power prediction method based on multi-scale feature extraction and parallel modeling using TimesNetBiLSTM according to an embodiment of the present invention includes the following steps: Step S1: Data preprocessing and feature selection: Two feature-based screening methods are used: like Figure 2 The Pearson correlation coefficient was used to calculate the linear correlation between meteorological factors and historical power data, and features closely related to photovoltaic power were further screened out.
[0059] by Figure 3 The maximum information coefficient (MIC) is used to evaluate the nonlinear correlation of multi-source meteorological factors and screen out the key features most relevant to photovoltaic power.
[0060] The first round of screening uses the Pearson correlation coefficient to identify features with a strong linear correlation to photovoltaic power, typically setting a correlation coefficient threshold of 0.5. The second round of screening uses the maximum information coefficient (MIC) to further screen features with a strong nonlinear correlation to photovoltaic power, thus ensuring that the selected features can capture both linear and nonlinear relationships.
[0061] Step S2: Mode Decomposition: Multivariate variational mode decomposition (MVMD) is used to perform co-operative intrinsic mode decomposition on meteorological data and historical power data to suppress noise and aliasing in the data and extract feature information at different scales.
[0062] Step S3: Parallel Deep Modeling: A design was developed as follows... Figure 6 The bidirectional long short-term memory network (BiLSTM) shown is similar to... Figure 7 The parallel subnets composed of the iTransformer structure shown capture short-term temporal memory and long-range dependencies respectively, while handling cross-modal interactions and fusing them at the modal-level mapping layer.
[0063] Step S4: Hyperparameter optimization: with Figure 4 The diagram illustrates the introduction of the Heron Eagle Optimization Algorithm (SBOA) to globally optimize the hyperparameters of the decomposition model and the deep network. This step involves two aspects: MVMD optimization: Optimize the hyperparameters in the mode decomposition process to ensure more accurate feature extraction.
[0064] Deep network optimization: Optimize the network structure, learning rate and other hyperparameters of BiLSTM and iTransformer to improve the robustness and generalization ability of the model.
[0065] This invention, through a combination of the above-mentioned technical means, effectively improves the accuracy of photovoltaic power prediction, solves the problem of performance degradation in complex environments of existing methods, and enhances the interpretability and applicability of the model. This method is not only applicable to short-term photovoltaic power prediction, but also provides a new approach and solution for complex time-series prediction in other fields.
[0066] The following are detailed explanations: The feature selection in step S1 includes: S11: Data Preprocessing and Feature Selection Raw meteorological and photovoltaic power data were preprocessed to ensure consistency and accuracy. First, all data were converted to a fixed time resolution and timestamp standardized and aligned to guarantee sequence consistency. Missing values in the photovoltaic power data were explicitly marked and their time information was preserved. Simultaneously, outliers were identified and corrected to ensure data reliability.
[0067] S12: Pearson correlation coefficient screening For each meteorological factor (such as temperature, humidity, irradiance, wind speed, etc.), calculate its Pearson correlation coefficient with photovoltaic power, using the following formula: (1) In the formula, and These are sample values for meteorological factors and photovoltaic power, respectively. and It is its mean.
[0068] Select relevant features: Based on the calculated correlation coefficient values, select the top N features that have a strong linear relationship with photovoltaic power. Generally, a correlation coefficient threshold of 0.5 is set. If the correlation coefficient is higher than this threshold, the feature is considered to have a strong linear relationship with photovoltaic power and will proceed to the next round of screening.
[0069] S13: Maximum Information Coefficient (MIC) Screening: The MIC method is introduced to measure the correlation between meteorological variables and photovoltaic power series, and features highly correlated with the target forecast are screened out. Mutual information is calculated. and The formula is as follows (2) (3) In the formula: and These represent the number of grids divided vertically and horizontally, respectively. Indicates to and Two-dimensional continuous integral; , They are respectively and The marginal probability distribution; For samples in the grid and The joint probability distribution in; The size is 0.55 or 0.6 times the corresponding data.
[0070] The features selected using Pearson correlation coefficient and MIC are combined to obtain a candidate feature set. If the same feature is selected in both rounds of selection, that feature is retained.
[0071] S14: Feature Normalization After feature selection, to ensure that all features have the same scale and to avoid the impact of features of different scales on subsequent modeling, the selected features are normalized. The specific steps are as follows: MinMax normalization: scales the value of each feature to the range [0,1], using the following formula: (4) In the formula: These are the original eigenvalues. It is the minimum value of the feature. It is the maximum value of the feature, which is the feature value after MinMax normalization, ensuring that its range is between [0,1].
[0072] The mode decomposition in step S2 includes: S21: MVMD Feature Extraction and Mode Decomposition in Photovoltaic Power Prediction MVMD introduces a common center frequency and cross-channel alignment constraints within a variational framework, enabling collaborative decomposition of PV and key meteorological features at the time-frequency domain level. This improves noise immunity and decomposition stability, and effectively alleviates mode aliasing.
[0073] The MVMD modal decomposition method is as follows: The input raw sequence data contains Data vector of each channel In this context, the original sequence is represented as In MVMD, the number of modes is set to... Through optimization, the input signal can be decomposed into Aligned modal components, satisfying Each modal component is represented as .
[0074] Multi-modulation oscillation signal Perform Hilbert transformations and record the results. Next, the center frequencies of all modal components of the signal are... Add an exponent term and adjust it to the corresponding baseband frequency, then calculate the Hilbert transform. gradient function Norms, establishing optimization constraints: (5) In the formula: It is a passage The Each modal component; It is a bandwidth constraint to suppress high-frequency oscillations.
[0075] To address the linear equality constraints in multichannel mode decomposition, an augmented Lagrangian method is introduced. By adding a quadratic penalty term for the reconstruction error and introducing Lagrange multipliers, constraint violations are penalized, and the strict satisfaction of constraints is ensured. This transforms the original constrained variational problem into an equivalent unconstrained optimization problem. The corresponding augmented Lagrangian function can be expressed as: (6) In the formula: This involves introducing constraints on the corresponding Lagrange multipliers.
[0076] S22: To efficiently solve the augmented Lagrangian function, the alternating direction multiplier method is used to update the parameters, transforming it into several simple sub-optimization problems for further solution.
[0077] After the above steps, the signal frequency band is decomposed, and the final result is as follows: Figure 5a , Figure 5b , Figure 5c Number of channels shown and modal component number Multiplying several narrowband intrinsic mode function (IMF) components ensures frequency consistency across different channels.
[0078] The parallel depth modeling process in step S3 is as follows: To balance short-term memory and long-term dependencies on a single prediction channel, a cascaded encoding-prediction architecture is adopted.
[0079] S31: Modeling process of bidirectional long short-term memory network (Bilstm): The basic structural units and algorithms of BiLSTM are derived from LSTM. This invention constructs a system based on... Taking the LSTM at a given time 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.
[0080] The specific calculation process is shown in equations (7) to (12).
[0081] (7) (8) (9) (10) (11) (12) 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.
[0082] 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: (13) In the formula and These represent the outputs of the forward LSTM and the backward LSTM, respectively. and It is a weight matrix.
[0083] S32: iTransformer modeling process: The iTransformer encoder model primarily consists of a multi-head attention layer and a feedforward neural network. The multi-head self-attention mechanism extracts feature relationships between different sequences, thereby capturing key information. The feedforward neural network enhances the model's generalization ability. Additionally, two normalization layers are added to improve model stability and accelerate training convergence.
[0084] The self-attention mechanism in the multi-head attention layer is the core mechanism of the Transformer series models. By calculating the attention of load and environmental variables, comparing the calculated attention scores, and then selecting key information for multivariate load prediction in (6)(7).
[0085] (14) (15) in, , and This is the parameter matrix used to compute the Q, K, and V vectors. Q, K, and V correspond to the query vector, key vector, and value vector, respectively. By calculating the dot product K between the query value and the key value, the feature representation of each time series can be fully extracted. After exponential normalization, this feature representation is multiplied by the value vector to obtain the attention expression A(Q,K,V). Softmax is an exponential normalization function used to compute the self-attention weights. To prevent the vanishing of the softmax gradient due to excessively large values of Q·K, the softmax gradient is eliminated. Scaling is achieved by dividing Q·K7 by d, where d is the dimension of K. The final attention score reveals the correlation between multivariate load and environmental variables. The above attention mechanism operates only on a series of mappings to the input variable X. Based on this, it is extended to a multi-head attention mechanism. For independent mappings, a subspace of n sets of input variables is created, and different attention expressions are established for parallel operations. Finally, the outputs are merged to compute the output. (16) (17) Where i represents the i-th attention head. This represents the computational expression for the i-th attention head. , and These are the query vector, keyword vector, and value vector of the i-th attention head of the input vector X, respectively. This represents the weight matrix in the multi-head attention merging calculation expression. It is the number of attention heads created. It is a multi-head attention merging calculation expression.
[0086] Output layer: Its output layer is a projection module composed of MLP (Multilayer Perception). This module performs nonlinear mapping output through multivariate labels processed independently by the encoder module, and selects photovoltaic power generation, wind power generation, and user electricity load prediction sequences for output.
[0087] S33: Output of the fully connected layer fusion module Before the output layer, the outputs of BiLSTM and iTransformer are concatenated into a longer feature vector. , This is achieved by concatenating the output feature vectors of the two subnets along the feature dimension, as shown in the formula: (18) concatenated feature vectors The input is passed to a fully connected layer. The fully connected layer computes a new feature representation through a weighted summation of bias terms, and then generates the final output using a non-linear activation function (such as ReLU, Sigmoid, etc.). The calculation formula for the fully connected layer is as follows: (19) It is a weight matrix. It is a bias term. It is an activation function. It is the final prediction result after calculation by the fully connected layer.
[0088] The hyperparameter optimization process in step S4 is as follows: By introducing the Heron Eagle Optimization Algorithm (SBOA), key hyperparameters in MVMD (such as the number of modes) can be optimized simultaneously. and smoothing parameters SBOA performs global and local searches across the entire solution space, effectively avoiding local optima and improving the model's generalization ability and robustness.
[0089] Specifically: S41: Initialize the population: At the start of the algorithm, the problem settings need to be initialized, including the dimension, upper and lower bounds, size d, and number of iterations of the solution space. Each individual represents a potential solution, and an initial population is randomly generated.
[0090] The dimension of the solution space; , The upper and lower bounds of the problem; Population size, representing the number of solutions; Maximum number of iterations; : The current iteration number.
[0091] During population initialization, each individual Represents a potential solution: (20) In the formula: Indicates the first A solution in each dimension.
[0092] Fitness of each individual The following is calculated using the objective function: (twenty one) In the formula: This indicates the corresponding fitness level.
[0093] Optimal solution The optimal solution is selected by comparing the fitness of all individuals: (twenty two) In the formula: Denotes the variables that minimize the objective function. S42: Exploration Phase The goal of the exploration phase is to extensively search the solution space to avoid getting trapped in local optima. This phase is divided into three periods: early, middle, and late, each using a different update strategy.
[0094] Initial exploration phase ( ): During this phase, the heron updates its position through random movement. The position update formula is as follows: (twenty three) In the formula, Indicates the updated individual position. This is the [number]. The individual in the first Current position in dimension and These two are randomly generated solutions or individual positions. They represent the positions of two solutions randomly selected from the search space. Typically, in particle swarm optimization, the positions of other individuals are used to explore new solutions. It is an adjustment factor that controls the search step size.
[0095] Based on fitness, a position is only updated if its fitness is better than the current solution: (twenty four) In the formula, Indicates the updated individual position. This indicates the fitness of the new solution. This indicates the old interpretation.
[0096] Mid-term exploration phase ( ): In the mid-stage, the egret begins to focus on optimizing around the current optimal solution, and the updated formula is as follows: (25) In the formula, This is the current optimal solution. It is a random factor that controls the randomness of position updates.
[0097] When updating the position, the fitness score will also be used to determine whether to accept the new solution. (26) Later exploration phase ( ) In the later stages, the heron will further optimize the known good solutions, converging to the optimal solution through local search. The position update formula is as follows: (27) In the formula, It is a random step size used to adjust the search process.
[0098] Similarly, the location is updated based on fitness: (28) S43: Development Phase The goal of the development phase is to refine and optimize the known optimal solutions to further improve the quality of the solutions. During this phase, the algorithm performs local searches, typically employing two strategies.
[0099] First strategy ( ) When random number When the value is less than 0.5, the heron will perform local optimization based on the current optimal solution: (29) Second strategy ( ) When random number When the value is greater than or equal to 0.5, the heron will adjust its position based on random locations: (30) After the update, each individual determines whether to choose the new position based on its fitness value. If the new position has better fitness, the current solution is updated, and the optimal solution is saved. W(31) Finally, when the maximum number of iterations T is reached, the optimal solution is output.
[0100] S44: Validation and Final Model The trained model is validated using a validation set to obtain the final deep neural network model; the test set is then input into the final model, and... The model's predictive performance was tested using evaluation metrics such as mean absolute percentage error (MAPE), mean absolute error (MAE), and root mean square error (RMSE).
[0101] To enable those skilled in the art to better understand the present invention, the following simulation was performed: This invention combines meteorological data (including atmospheric temperature, humidity, air pressure, illuminance, etc.) of Wuhan 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.
[0102] This invention is based on Figure 1 The prediction process shown is simulated. The data source is a large city in central China, and 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.
[0103] Table 1 Feature Acquisition Table 1Collected characteristics
[0104] 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.
[0105] The hardware platform includes an Intel Core i7 CPU and an NVIDIA RTX 3060 GPU. Data was divided into training, validation, and test sets in a 4:1:1 ratio. Medium-term forecasts of future photovoltaic power were made with a 15-minute timeframe.
[0106] In the feature selection stage, air pressure and solar irradiance were chosen as key features for photovoltaic power prediction. First, using Pearson correlation coefficients, a strong correlation was found between air pressure and solar irradiance and photovoltaic power, especially solar irradiance, which showed a significant positive correlation, consistent with the intuition that higher solar irradiance leads to higher photovoltaic power output. Second, the maximum information coefficient (MIC) was used to further verify the nonlinear correlation between these two features. Although the relationship between air pressure and photovoltaic power may not be nonlinear, MIC analysis showed that changes in air pressure still have a significant impact on photovoltaic power, especially under conditions of significant weather variation. Therefore, air pressure and solar irradiance were selected as key features in this study, effectively improving the model's prediction accuracy.
[0107] Parameter settings The final result of the decomposition by Mvmd, after passing through SBOA, yields K=2. =109.
[0108] The model utilizes the deep learning algorithms BiLSTM and iTransformer, with key hyperparameters optimized using SBOA. Hyperparameter optimization is crucial for improving model performance, especially for BiLSTM and iTransformer models, where the choice of hyperparameters directly impacts performance, convergence speed, and generalization ability. For BiLSTM models, hyperparameters such as hidden layer dimension, learning rate, and batch size are key factors influencing the model's learning ability, temporal dependency modeling, and memorization capabilities on time-series data. By using SBOA for global search and local optimization, optimal combinations can be found across a broad hyperparameter space, effectively improving the model's prediction accuracy and stability.
[0109] For the iTransformer model, important hyperparameters include the number of heads in the multi-head attention mechanism, the dimension of each layer, and the number of layers in the encoder and decoder. Optimizing these hyperparameters enables the model to better capture multi-scale features in the data and improves its performance in long-range dependency modeling. The relevant parameters are shown in Table 2.
[0110] Table 2 Parameter Settings
[0111] Prediction Results Analysis Table 3 Photovoltaic Prediction Experiment Parameters
[0112] Based on the experimental results, this method performs excellently in photovoltaic power prediction, achieving evaluation metrics of MAE 27.08, SMAPE 0.193, RMSE 58.28, and R² 0.957. Specifically, a lower MAE value indicates lower prediction error and higher prediction accuracy; a SMAPE close to 0 indicates that the model accurately captures the fluctuation trend of photovoltaic power; and a lower RMSE further proves that the model can fit the actual data well in most situations. Furthermore, the high R² of 0.957 indicates that the model explains 95.7% of the data variation, demonstrating extremely strong fitting ability and high-precision prediction. The charts show that the predicted values are very close to the actual values, especially when photovoltaic power fluctuates significantly; the model can still accurately predict peaks and troughs, proving its excellent predictive ability and robustness.
[0113] The graphical results show that the model successfully predicted the medium-term trend of photovoltaic power. A comparison of predicted and actual values reveals that the model accurately captures power fluctuations for most time periods, especially in the low and medium power ranges, with relatively small errors. Specifically, the model can stably predict both the rising and falling trends of photovoltaic power, particularly demonstrating excellent prediction performance for daytime fluctuations and stable nighttime regions, especially within the diurnal cycle. Compared to the baseline model, this method exhibits significant advantages in overall accuracy, goodness of fit, and long-term prediction capability.
[0114] However, in certain special cases, such as sudden changes in power or short-term sharp fluctuations, the model's predictions may underestimate the magnitude of changes and fail to fully keep up with the rapid pace of change. This may be because the model fails to fully utilize multi-scale features or ignores the impact of short-term disturbances. To further improve the model's performance in complex scenarios, future research could consider incorporating multimodal data or stronger time-series modeling capabilities, such as improved attention mechanisms or features that integrate short-term disturbances with long-term trends, to better address high-frequency fluctuations in photovoltaic power.
[0115] In summary, this method demonstrates high accuracy and stability in medium-term photovoltaic power forecasting, especially during daytime and low-power periods, but further optimization is needed to address scenarios with rapid fluctuations.
[0116] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method described above.
[0117] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method described above.
[0118] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the adaptive deep modeling and hyperparameter optimization photovoltaic power prediction methods described in the above embodiments.
[0119] It is understood that the systems, devices, and storage media provided in the embodiments of the present invention correspond to the methods provided in the embodiments of the present invention, and the explanations, examples, and beneficial effects of the relevant content can be referred to the corresponding parts of the above methods.
[0120] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0121] It should be noted that in this invention, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0122] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0123] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A photovoltaic power prediction method based on adaptive deep modeling and hyperparameter optimization, characterized in that, Includes the following steps, S1. Preprocessing and feature filtering of raw meteorological data and photovoltaic power data: S2. Multivariate variational mode decomposition (MVMD) technology is used to perform synergistic intrinsic mode decomposition on meteorological data and historical power data to suppress noise and aliasing in the data and extract feature information at different scales. S3. A bidirectional long short-term memory network (BiLSTM) and an iTransformer parallel subnetwork were designed to capture short-term temporal memory and long-range dependencies respectively, while handling cross-modal interactions and fusing them at the modal-level mapping layer. S4. Introduce the Heron Eagle Optimization Algorithm (SBOA) to globally optimize the hyperparameters of the decomposition model and deep network.
2. The photovoltaic power prediction method based on adaptive deep modeling and hyperparameter optimization according to claim 1, characterized in that: S1 utilizes two feature selection methods: Pearson correlation coefficient: Calculates the linear correlation between meteorological factors and historical power data to further screen out features closely related to photovoltaic power; Maximum Information Coefficient (MIC): Evaluates the nonlinear correlation of multi-source meteorological factors and screens out the key features most relevant to photovoltaic power. The first round of screening used the Pearson correlation coefficient to identify features that have a strong linear correlation with photovoltaic power. The second round of screening uses the maximum information coefficient (MIC) to further filter out features that have a strong nonlinear correlation with photovoltaic power, thereby ensuring that the selected features can capture both linear and nonlinear relationships.
3. The photovoltaic power prediction method based on adaptive deep modeling and hyperparameter optimization according to claim 2, characterized in that: S1 includes the following steps: S11: Data Preprocessing and Feature Selection All data is uniformly converted to a fixed time resolution and timestamped and aligned to ensure sequence consistency; missing values in photovoltaic power data are explicitly marked and their time information is preserved; at the same time, outliers are identified and corrected to ensure data reliability. S12: Pearson correlation coefficient screening For each meteorological factor, calculate its Pearson correlation coefficient with photovoltaic power, using the following formula: (1) In the formula, and These are sample values for meteorological factors and photovoltaic power, respectively. and It is its mean; Select relevant features: Based on the calculated correlation coefficient values, select the top N features that have a strong linear relationship with photovoltaic power; If the correlation coefficient is higher than the threshold, it is considered that the feature has a strong linear relationship with photovoltaic power, and it is selected to enter the next round of screening. S13: Maximum Information Coefficient (MIC) Screening: 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; Computing mutual information and The formula is as follows (2) (3) In the formula: and These represent the number of grids divided vertically and horizontally, respectively. Indicates to and Two-dimensional continuous integral; , They are respectively and The marginal probability distribution; For samples in the grid and The joint probability distribution in; The size is 0.55 or 0.6 powers of the corresponding data; The features selected by Pearson correlation coefficient and MIC are combined to obtain a candidate feature set; if the same feature is selected in both rounds of selection, the feature is retained. S14: Feature Normalization After feature selection is completed, the selected features are normalized; the specific steps are as follows: MinMax normalization: scales the value of each feature to the range [0,1], using the following formula: (4) In the formula: These are the original eigenvalues. It is the minimum value of the feature. It is the maximum value of the feature, which is the feature value after MinMax normalization, ensuring that its range is between [0,1].
4. The photovoltaic power prediction method based on adaptive deep modeling and hyperparameter optimization according to claim 3, characterized in that: The mode decomposition in step S2 includes: S21: MVMD Feature Extraction and Mode Decomposition in Photovoltaic Power Prediction The MVMD modal decomposition method is as follows: The input raw sequence data contains Data vector of each channel In this context, the original sequence is represented as In MVMD, the number of modes is set to... By optimizing, the input signal is decomposed into Aligned modal components, satisfying Each modal component is represented as ; Multi-modulation oscillation signal Perform Hilbert transformations and record the results. Next, the center frequencies of all modal components of the signal are... Add an exponent term and adjust it to the corresponding baseband frequency, then calculate the Hilbert transform. gradient function Norms, establishing optimization constraints: (5) In the formula: It is a passage The Each modal component; It is a bandwidth constraint to suppress high-frequency oscillations; To address the linear equality constraint problem in multi-channel mode decomposition, an augmented Lagrange method is introduced. By adding a quadratic penalty term for the reconstruction error and introducing Lagrange multipliers, the constraint violation term is penalized and the strict satisfaction of the constraint conditions is ensured, thereby transforming the original constrained variational problem into an equivalent unconstrained optimization problem. Its corresponding augmented Lagrangian function is expressed as: (6) In the formula: This involves introducing constraints on the corresponding Lagrange multipliers; S22: To efficiently solve the augmented Lagrangian function, the alternating direction multiplier method is used to update the parameters, transforming it into several sub-optimization problems for further solution; After the above steps, the signal frequency band is decomposed, and the number of channels is finally obtained. and modal component number The product consists of several narrowband intrinsic mode function (IMF) components.
5. The photovoltaic power prediction method based on adaptive deep modeling and hyperparameter optimization according to claim 4, characterized in that: The parallel depth modeling process in step S3 is as follows: To balance short-term memory and long-term dependencies on a single prediction channel, a cascaded encoding-prediction architecture is adopted. S31: Modeling process of bidirectional long short-term memory network (Bilstm): The basic structural units and algorithms of BiLSTM are derived from LSTM. The LSTM unit takes the final output result as input. and current variables First, determine the cell state. The forgotten content is calculated using a forgetting gate to obtain 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; The specific calculation process is shown in equations (7) to (12); (7) (8) (9) (10) (11) (12) 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. BiLSTM outperforms LSTM in bidirectional time series feature extraction. The output of BiLSTM is calculated as follows by combining bidirectional LSTMs: (13) In the formula and These represent the outputs of the forward LSTM and the backward LSTM, respectively. and It is a weight matrix; S32: iTransformer modeling process: The self-attention mechanism in the multi-head attention layer is the core mechanism of the Transformer series models. By calculating the attention of load and environmental variables, comparing the calculated attention scores, and then selecting the key information for multivariate load prediction in (6)-(7); (14) (15) in, , and It is a parameter matrix used to calculate the Q, K, and V vectors; Q, K, and V correspond to the query vector, key vector, and value vector, respectively; by calculating the dot product K between the query value and the key value, the feature representation of each time series is fully extracted; after exponential normalization, this feature representation is multiplied by the value vector to obtain the attention expression A(Q,K,V); Gradient elimination was performed on the softmax function; scaling was achieved by dividing Q·K7 by d, where d is the dimension of K; the resulting attention scores revealed the correlation between multivariate load and environmental variables. For independent mappings, a subspace of n sets of input variables was created, and different attention representations were established for parallel operations; finally, the outputs were merged to compute the output. (16) (17) Where i represents the i-th attention head; This represents the computational expression for the i-th attention head; , and These are the query vector, keyword vector, and value vector of the i-th attention head of the input vector X, respectively; The weight matrix represents the multi-head attention merging calculation expression; It is the number of attention heads created. It is a multi-head attention merging calculation expression; Its output layer is a projection module composed of MLPs; this module performs nonlinear mapping output through multivariate labels processed independently by the encoder module, and selects photovoltaic power generation, wind power generation and user electricity load prediction sequences for output; S33: Output of the fully connected layer fusion module Before the output layer, the outputs of BiLSTM and iTransformer are concatenated into a longer feature vector. , This is achieved by concatenating the output feature vectors of the two subnets along the feature dimension, as shown in the formula: (18) concatenated feature vectors The input is fed into a fully connected layer; the fully connected layer calculates a new feature representation through a weighted summation of bias terms, and then generates the final output through a non-linear activation function. The calculation formula for the fully connected layer is as follows: (19) It is a weight matrix. It is a bias term. It is an activation function. It is the final prediction result after calculation by the fully connected layer.
6. The photovoltaic power prediction method based on adaptive deep modeling and hyperparameter optimization according to claim 5, characterized in that: wherein, The hyperparameter optimization process in step S4 is as follows: S41: Initialize the population: The initial problem settings include the dimension, upper and lower bounds, size d, and number of iterations of the solution space; each individual represents a potential solution, and an initial population is randomly generated. The dimension of the solution space; , The upper and lower bounds of the problem; Population size, representing the number of solutions; Maximum number of iterations; : The current iteration number; During population initialization, each individual Represents a potential solution: (20) Indicates the first A solution in each dimension; The fitness of each individual is calculated using the objective function: (21) Indicates the corresponding fitness level; Optimal solution The optimal solution is selected by comparing the fitness of all individuals: (22) In the formula: This represents the variable that minimizes the objective function; S42: Exploration Phase The goal of the exploration phase is to extensively search the solution space to avoid getting trapped in local optima. This phase is divided into three periods: early, middle, and late, each using a different update strategy. S43: Exploitation Phase The goal of the development phase is to refine and optimize the known optimal solutions to further improve the quality of the solutions. S44: Validation and Final Model 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 by analyzing evaluation metrics such as mean absolute percentage error (MAPE), mean absolute error (MAE), and root mean square error (RMSE).
7. The photovoltaic power prediction method based on adaptive deep modeling and hyperparameter optimization according to claim 6, characterized in that: S42 includes the following steps: The initial exploration phase is : During this phase, the heron updates its position through random movement; the position update formula is as follows: (23) In the formula, Indicates the updated individual position. This is the [number]. The individual in the first Current position in dimension and These two are the positions of randomly generated solutions or individuals; they represent the positions of two solutions randomly selected from the search space. It is an adjustment factor that controls the search step size; Based on fitness, a position is only updated if its fitness is better than the current solution: (24) In the formula, Indicates the updated individual position. This indicates the fitness of the new solution. This indicates the old interpretation; Mid-term exploration phase : In the mid-stage, the egret begins to focus on optimizing around the current optimal solution, and the updated formula is as follows: (25) In the formula, This is the current optimal solution. It is a random factor that controls the randomness of position updates; When updating the position, the fitness score will also be used to determine whether to accept the new solution. (26) The later exploration stage : In the later stages, the heron will further optimize the known good solutions, converging to the optimal solution through local search; the position update formula is as follows: (27) In the formula, It is a random step size used to adjust the search process; Similarly, the location is updated based on fitness: (28)。 8. The photovoltaic power prediction method based on adaptive deep modeling and hyperparameter optimization according to claim 7, characterized in that, S43 includes the following steps: Development phase (Exploitation): At this stage, the algorithm performs a local search, choosing one of two strategies: First strategy, ; When random number When the value is less than 0.5, the heron will perform local optimization based on the current optimal solution: (29) The second strategy, ; When random number When the value is greater than or equal to 0.5, the heron will adjust its position based on random locations: (30) After the update, each individual determines whether to choose a new position based on its fitness value; if the new position has better fitness, the current solution is updated, and the optimal solution is saved. W(31) Finally, when the maximum number of iterations T is reached, the optimal solution is output.