A machine learning-based photovoltaic power multi-time scale prediction method
By combining multi-input multi-output modeling and discrete wavelet transform with a lightweight gradient booster, the problems of multi-scale coordination and regional adaptability in photovoltaic power prediction are solved, achieving efficient and accurate photovoltaic power prediction and supporting the safe, stable and economical operation of photovoltaic power generation systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-14
- Publication Date
- 2026-04-07
AI Technical Summary
Existing photovoltaic power prediction technologies suffer from weak multi-scale prediction coordination and lack of regional adaptability, resulting in complex system structures, high redundancy, high computational resource consumption, and high operation and maintenance costs. Furthermore, the models need to be retrained and optimized when applied in different regions, leading to low efficiency.
A multi-scale power prediction model is constructed using a multi-input multi-output modeling strategy. Discrete wavelet transform is used for data denoising. Lightweight gradient booster (LightGBM) is used as the base learner. Multi-output regression is implemented by encapsulating multi-output regressors. Differentiated modeling strategies are adopted for different time scales to construct medium-term, day-ahead, and ultra-short-term prediction models.
It improves the accuracy and efficiency of photovoltaic power prediction, reduces the consumption of computing resources and operation and maintenance costs, enhances the regional adaptability of the model, and supports the large-scale and standardized application of photovoltaic power generation in a wide range of regions.
Smart Images

Figure CN121502731B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of photovoltaic power prediction, and particularly relates to a photovoltaic power multi-time scale prediction method based on machine learning. BACKGROUND
[0002] The photovoltaic power output is highly dependent on meteorological conditions and presents significant intermittency, volatility and randomness. The instantaneous change of solar intensity, the rapid movement of clouds and the seasonal and regional climate differences result in the dramatic fluctuations of photovoltaic output in the day, within the day and even between different seasons, bringing unprecedented challenges to real-time balancing of the power system. Therefore, high prediction of photovoltaic power generation has evolved from an auxiliary technology to a key technology to ensure the safe, stable and economic operation of the new power system. Developing photovoltaic power prediction technology that is suitable for different regional characteristics, covers multiple time scales and meets the engineering precision requirements has become an urgent engineering requirement for building a new power system. By fusing physical models and data-driven models and integrating multiple data sources and algorithm advantages, a hybrid model that fuses meteorological prediction and measured data can be generated to realize accurate prediction of photovoltaic power generation and effectively improve the power grid power prediction efficiency. However, the existing photovoltaic power prediction technology still has many key problems, which limit its overall engineering and fine application.
[0003] Weak multi-scale prediction coordination is one of the important problems faced by the existing technology. Currently, medium-term, day-ahead and ultra-short-term prediction is usually completed by independent subsystems, and this architecture makes the system structure complex and redundant. The prediction results of each subsystem lack time sequence consistency and even contradict each other. Maintaining multiple independent models and data pipelines not only significantly increases the computing resource consumption and operation and maintenance cost, but also cannot form an effective error feedback and collaborative optimization mechanism due to the fragmentation of models, resulting in limited overall prediction efficiency.
[0004] The most prominent problem of the existing prediction model is the lack of regional adaptability, which leads to high deployment cost and low efficiency in actual large-scale application. The prediction model is usually trained based on specific site data, and the model parameters and feature engineering are highly dependent on the local data distribution. When applied to new regions with significant differences in climate characteristics, the model performance will deteriorate seriously, and the model has to be retrained and optimized for each new region. This not only leads to high research and development cost and long deployment cycle, but also greatly reduces the application efficiency, seriously hindering the large-scale and standardized application process of the technology in a wide range of regions. SUMMARY
[0005] In order to overcome the problems in the prior art, the application provides a photovoltaic power multi-time scale prediction method based on machine learning.
[0006] The technical solution of the application to solve the above technical problems is as follows:
[0007] The application provides a photovoltaic power multi-time scale prediction method based on machine learning, comprising the following steps:
[0008] Step 100: Obtain original photovoltaic power time series data and weather forecast data, and perform preprocessing;
[0009] Step 200: Adopt a multi-input multi-output modeling strategy, adopt a differentiated modeling strategy for different time scales, construct a multi-scale power prediction model, and train the multi-scale power prediction model based on the processed data;
[0010] Step 300: Perform prediction output based on the trained multi-scale power prediction model, and evaluate the trained power prediction model for different regions and different weather data.
[0011] Further, the step 100 comprises:
[0012] Discrete wavelet transform is adopted to perform denoising processing on the original photovoltaic power time series data to obtain a reconstructed denoised power signal; the reconstructed denoised power signal and the weather forecast data are subjected to data normalization processing respectively to obtain normalized power data and normalized weather forecast data.
[0013] Further, the discrete wavelet transform adopted to perform denoising processing on the original photovoltaic power time series data to obtain a reconstructed denoised power signal comprises:
[0014] The original photovoltaic power time series data is subjected to multi-layer wavelet decomposition to be decomposed into approximation coefficients and detail coefficients; based on the first layer of detail coefficients, a median absolute deviation method is adopted to estimate a noise standard deviation;
[0015] Based on the noise standard deviation, a denoising threshold is calculated; based on the denoising threshold, soft threshold processing is performed on the detail coefficients to obtain soft threshold processed detail coefficients;
[0016] Based on the approximation coefficients and the soft threshold processed detail coefficients, inverse wavelet transform is performed to reconstruct the denoised power signal.
[0017] Further, the step 100 further comprises calculating the standardized installed capacity of the photovoltaic power station according to the original photovoltaic power time series data.
[0018] Further, in the step 200, the multi-scale power prediction model comprises a medium-term power prediction model, a day-ahead power prediction model and an ultra-short-term power prediction model.
[0019] Further, in the step 200, the multi-input multi-output modeling strategy and the differentiated modeling strategy for different time scales comprise:
[0020] The ultra-short-term power prediction model adopts a multiple-input multiple-output modeling strategy, and LightGBM is selected as a base learning machine.
[0021] The prediction tasks of the medium-term power prediction model and the day-ahead power prediction model are respectively decomposed into multiple prediction sub-tasks, each prediction sub-task adopts an independent multiple-input multiple-output modeling strategy, and LightGBM is selected as a base learning machine, and the prediction results of the independent base learning machines are spliced into a complete multiple-output prediction matrix.
[0022] Further, in the step 200, the multi-scale power prediction model is trained based on the processed data, including: the denoised power data and the weather forecast features are spliced to form the input feature vector of the power prediction model, and the normalized power data is taken as the output label, so as to train the multi-scale power prediction model.
[0023] Further, in the step 200, the multi-scale power prediction model is trained based on the processed data, including: the denoised power data and the weather forecast features are spliced to form the input feature vector of the power prediction model, and the normalized power data is taken as the output label, so as to train the multi-scale power prediction model.
[0024] Further, the weather forecast data includes: short-wave downward radiation, short-wave direct normal radiation, short-wave scattering radiation, dew point temperature, humidity.
[0025] Further, the trained power prediction model is evaluated, including: based on the standardized installed capacity of the photovoltaic power station, and based on the weather forecast data of different regions, different power prediction model evaluation indexes are set.
[0026] Compared with the prior art, the present application has the following technical effects:
[0027] (1) In view of the weak multi-scale prediction coordination in the prior art, the present application adopts a multiple-input multiple-output modeling strategy to construct a multi-scale power prediction model. The medium-term, day-ahead and ultra-short-term predictions are integrated, avoiding the problems of complex structure, high redundancy and lack of time sequence consistency caused by independent subsystems. Through a unified model architecture and a collaborative optimization mechanism, the computational resource consumption and operation and maintenance cost are reduced, an effective error feedback and collaborative optimization mechanism is formed, and the overall prediction performance is significantly improved.
[0028] (2) The original photovoltaic power time series data is denoised by discrete wavelet transform, and the weather forecast data and power data are preprocessed, so that high-quality data basis is provided for model training. At the same time, a light gradient boosting machine is used as a base learner, and a multi-output regressor is packaged to realize multi-output regression, which further improves the prediction accuracy. Accurate photovoltaic power prediction can improve the efficiency of power grid power prediction, ensure the safe, stable and economic operation of new power systems, and meet the urgent engineering needs of building new power systems.
[0029] (3) The photovoltaic power multi-time scale prediction method based on machine learning provided by the present application effectively solves the outstanding problem that the existing prediction model lacks regional adaptability. By combining the advantages of physical models and data-driven models, the model is no longer highly dependent on specific site data for training. This method can better adapt to the differences in climate characteristics of different regions, avoid the need to retrain and optimize the model for each new region, significantly reduce the research and development cost and deployment cycle, and greatly improve the application efficiency, laying a foundation for the large-scale and standardized application of the technology in a wide range of regions. BRIEF DESCRIPTION OF DRAWINGS
[0030] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the drawings needed in the description of the embodiments or the prior art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0031] Figure 1 The flowchart of the present application;
[0032] Figure 2 The flowchart of the LightGBM algorithm implementation of the present application;
[0033] Figure 3 The flowchart of the segmented modeling implementation of the present application;
[0034] Figure 4 The photovoltaic power prediction situation of the first test sample within the next 4 hours;
[0035] Figure 5 The photovoltaic power prediction situation of the second test sample within the next 4 hours;
[0036] Figure 6 The photovoltaic power prediction situation of the third test sample within the next 4 hours;
[0037] Figure 7 The photovoltaic power prediction situation of the fourth test sample within the next 4 hours;
[0038] Figure 8 A preview image showing the prediction results for the next 15 minutes;
[0039] Figure 9 A graph showing the predicted effect for the next hour;
[0040] Figure 10 A graph showing the predicted effect for the next 2 hours;
[0041] Figure 11 This is a graph showing the predicted effect for the next 4 hours. Detailed Implementation
[0042] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the specific implementation methods, structures, features, and effects of the technical solutions proposed according to the present invention are described in detail below with reference to the accompanying drawings and preferred embodiments. Specific features, structures, or characteristics in one or more embodiments may be combined in any suitable form. Unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0043] This embodiment provides a machine learning-based method for multi-timescale prediction of photovoltaic power, aiming to solve the problem of power prediction accuracy at different prediction timescales in photovoltaic power generation systems. Specifically, this invention proposes a complete technical solution for three typical application scenarios: ultra-short-term prediction (4 hours), day-ahead prediction (24 hours), and medium-term prediction (10 days).
[0044] In this embodiment, refer to Figures 1-3 A multi-timescale prediction method for photovoltaic power based on machine learning, characterized by the following steps:
[0045] Step 100: Obtain raw photovoltaic power time series data and weather forecast data, and perform preprocessing;
[0046] Step 200: Employ a multi-input multi-output modeling strategy, adopt differentiated modeling strategies for different time scales, construct a multi-scale power prediction model, and train the multi-scale power prediction model based on the processed data;
[0047] Step 300: Develop a prediction output based on the trained multi-scale power prediction model, and evaluate the trained power prediction model for different regions and different weather data.
[0048] The following is a detailed explanation of each of the above steps:
[0049] Step 100: Obtain raw photovoltaic power time series data and weather forecast data, and perform preprocessing.
[0050] Photovoltaic power refers to the maximum output power generation capacity of a photovoltaic module under standard test conditions (illuminance of 1000W / m², temperature of 25℃, and atmospheric quality of AM1.5), and the unit is usually peak watt (Wp).
[0051] Weather forecast data includes swdown: shortwave downward radiation (W / m²); swddni: shortwave direct normal radiation (W / m²); swddif: shortwave scattered radiation (W / m²); td2m: 2-meter dew point temperature (K); rh2m: 2-meter relative humidity (%).
[0052] As an example, step 100 specifically includes:
[0053] Step 110: Use Discrete Wavelet Transform (DWT) to denoise the original photovoltaic power time series data to obtain the denoised power data.
[0054] This step 100 specifically includes:
[0055] Step 111: Perform multi-level wavelet decomposition on the original photovoltaic power time series data, decomposing it into approximation coefficients and detail coefficients.
[0056] The Daubechies wavelet basis function db4 was selected to perform a four-level wavelet decomposition on the original photovoltaic power time series data, decomposing the original photovoltaic power time series data into approximation coefficients and detail coefficients:
[0057] ;
[0058] In the above formula, This represents a list used to store the approximation coefficients and detail coefficients obtained after wavelet decomposition, including all the results obtained after decomposing the original photovoltaic power data; This represents the fourth-level approximation coefficients, which contain the main low-frequency components of the signal; This represents the first level of detail coefficients. This represents the second level of detail coefficients. This represents the third level of detail coefficients. This represents the fourth level of detail coefficients, where each level of detail coefficients contains high-frequency noise components at different scales.
[0059] The approximation coefficients reflect the main low-frequency components of the signal, that is, the general trend and outline of the signal. In the multi-layered structure of wavelet decomposition, as the number of decomposition layers increases, the signal information contained in the approximation coefficients becomes increasingly generalized, mainly reflecting the long-term trend of the signal. In photovoltaic power time series, It can capture the overall variation pattern of power over a longer time scale (such as one day or several days). This corresponds to the finest scale, capable of capturing extremely subtle high-frequency changes in the signal, such as instantaneous fluctuations or noise spikes in photovoltaic power; while The corresponding scale is relatively coarse, reflecting the high-frequency variation characteristics at a larger scale, and includes some power fluctuation patterns with relatively short periods.
[0060] Step 112: Based on the first layer of detail coefficients, estimate the noise standard deviation using the Median Absolute Deviation (MAD) method.
[0061] The first layer of detail coefficients mainly contains high-frequency noise information, corresponding to the highest frequency components. The median absolute deviation method is used to estimate the noise standard deviation σ of the first layer of detail coefficients.
[0062] ;
[0063] In the above formula, 0.6745 is the conversion coefficient between MAD and standard deviation under the standard normal distribution; This indicates taking the median.
[0064] Step 113: Calculate the denoising threshold based on the noise standard deviation.
[0065] The denoising threshold λ is calculated using the Universal Threshold method:
[0066] ;
[0067] In the above formula, N The length of the data sequence.
[0068] The denoising threshold λ can effectively remove noise while preserving the main features of the signal. The principle is based on the different characteristics of signal and noise in the wavelet domain. The wavelet coefficients of noise are relatively small and evenly distributed at all scales. By using the denoising threshold, most of the noise coefficients can be set to zero, while retaining larger signal coefficients.
[0069] Step 114: Based on the denoising threshold, perform soft thresholding on the detail coefficients to obtain the detail coefficients after soft thresholding.
[0070] Thresholding: for detail coefficients cD1 tocD4 Apply soft thresholding:
[0071] ;
[0072] In the above formula, Indicates detail coefficients; This represents the detail coefficients after soft thresholding. This indicates a sign function, used to preserve the sign of the original coefficients; This means subtracting the threshold from the absolute value of the detail coefficient; if the result is less than 0, then it is set to 0.
[0073] Compared to hard thresholding, soft thresholding produces smoother denoising results and avoids introducing artificial oscillations. Hard thresholding directly sets coefficients below the threshold to zero while leaving coefficients above the threshold unchanged. This can lead to discontinuities at the threshold points, causing signal oscillations. Soft thresholding, on the other hand, uses linear contraction to make the processed coefficients smoother.
[0074] Step 115: Perform inverse wavelet transform (IDWT) based on the approximation coefficients and the detail coefficients after soft thresholding. The denoised power data is as follows:
[0075] ;
[0076] In the above formula, This represents the first level of detail coefficients after soft thresholding. This represents the second layer of detail coefficients after soft thresholding. This represents the third level of detail coefficients after soft thresholding. This represents the fourth level of detail coefficients after soft thresholding. This indicates the power signal after noise reduction processing.
[0077] Through the wavelet denoising process described above, while preserving the main characteristics of the photovoltaic power signal, high-frequency noise interference is effectively suppressed, thereby significantly improving the signal-to-noise ratio (SNR) of the data and providing a high-quality data foundation for subsequent analysis.
[0078] In photovoltaic power time series data, after wavelet denoising processing, the noise components in the data are effectively suppressed, making the power data more accurately reflect the actual photovoltaic power generation situation, and providing a higher quality data foundation for subsequent data analysis, power prediction and other applications.
[0079] Step 120: Based on the weather forecast features and the denoised power data, perform data normalization processing to obtain normalized weather forecast features and power data.
[0080] The denoised power data and various feature data are subjected to Min-Max normalization to map the data to the [0, 1] interval:
[0081] ;
[0082] In the above formula, This represents the normalized data value; Represents the original data value; This represents the minimum value in the feature data; This represents the maximum value in the feature data.
[0083] Among them, various characteristic data include weather forecast characteristics, which include temperature T, total irradiance GHI, shortwave radiation swdown, direct radiation swddni, diffuse radiation swddif, dew point temperature td2m, and relative humidity rh2m.
[0084] Create a separate MinMaxScaler object for each feature type and store its respective normalization parameters for subsequent denormalization operations.
[0085] Step 130: Calculate the standardized installed capacity of the photovoltaic power plant based on the original photovoltaic power time series data.
[0086] Calculate the standardized installed capacity of photovoltaic power plants based on historical power data. Cap :
[0087]
[0088] in, The rated installed capacity is 28.95141 MW in this case. and These are the minimum and maximum values of historical power data, respectively. This parameter is used in the calculation of subsequent evaluation indicators.
[0089] Step 200: Employ a multi-input multi-output modeling strategy, adopt differentiated modeling strategies for different time scales, construct a multi-scale power prediction model, and train the multi-scale power prediction model based on the processed data.
[0090] As an example, step 200 specifically includes:
[0091] Step 210: Construct training samples using the sliding window technique.
[0092] This invention uses a sliding window technique to construct training samples, and the specific steps are as follows:
[0093] (1) Determine the size of the input window and the output window, where the size of the input window is the number of time points of historical power data, and the size of the output window is the number of time points of future prediction. Specifically, the ultra-short-term prediction is 16 points (4 hours, one point every 15 minutes), the day-ahead prediction is 96 points (24 hours), and the medium-term prediction is 960 points (10 days).
[0094] (2) Construct the input feature vector of the power prediction model, including for each time position i Based on the denoised power data and weather forecast features, feature concatenation is performed to form a complete input feature vector. Among them, the denoised power data ,form input_size 3D feature vectors; weather forecast features are extracted from the corresponding weather forecast data based on the prediction time domain. It includes five meteorological elements: shortwave radiation (swdown), direct radiation (swddni), diffuse radiation (swddif), dew point temperature (td2m), and relative humidity (rh2m). After being flattened, it forms an output_size×5-dimensional feature vector.
[0095] (3) Extract the normalized power data As output labels This forms an output vector of dimension output_size.
[0096] (4) When dividing the training set and the test set, ensure that there is a sufficient gap between the end position of the training set and the beginning position of the test set:
[0097] ;
[0098] This design ensures that the output window of the last sample in the training set does not overlap with the input window of the test set, avoiding overly optimistic evaluations caused by data leakage.
[0099] Step 220: Employ a multi-input multi-output modeling strategy and adopt differentiated modeling strategies for different time scales to construct a multi-scale power prediction model.
[0100] Traditional single-step prediction models can only predict the power value at one future time point at a time, requiring recursive prediction for multiple time points, leading to error accumulation. Photovoltaic power prediction tasks need to predict power values at multiple future time points simultaneously. This invention employs a multi-input multi-output (MIMO) modeling strategy to directly establish a mapping relationship from historical time windows to multiple future time points:
[0101] ;
[0102] in, L The length of the history window; H To predict the length of the time domain; The power data after noise reduction. W Features of weather forecasts; f For the power prediction model, LightGBM is used in this implementation.
[0103] For medium-term forecasting (10 days, 96 time points) and day-ahead forecasting (24 hours, 96 time points) tasks, the most intuitive approach is to use direct MIMO modeling: using 96 historical power points as input to directly predict 96 future power points. However, this method has the following significant problems: it requires training 96 independent LightGBM regressors, each learning one output dimension. A higher output dimension leads to more complex mapping relationships that the model needs to learn, making model learning more difficult; the longer the prediction time domain, the greater the uncertainty and the larger the error, leading to severe accumulation of prediction errors over long periods; and all output dimensions use the same hyperparameter configuration, resulting in insufficient model flexibility.
[0104] To address the aforementioned issues, this embodiment proposes a segmented prediction strategy. This strategy decomposes the long-term prediction task into multiple short-term prediction sub-tasks, leveraging the high accuracy of short-term predictions and concatenating them to achieve long-term prediction. Unlike directly using MIMO, segmented prediction constructs separate training and testing sets for different time periods, and then trains an independent LightGBM-MIMO model for each time period.
[0105] In its implementation, this invention uses LightGBM as the base learner and employs a MultiOutputRegressor for multi-output encapsulation to achieve efficient MIMO modeling.
[0106] (1) Optimized configuration of LightGBM-based learner:
[0107] The continuous features are discretized into bins using the histogram-based algorithm, such as... k After constructing the histogram from the bins, only traversal is needed. k Finding the optimal split point using bins reduces the computational complexity from O(n) to O(k).
[0108] A leaf-wise growth strategy is adopted, in which the node with the largest splitting gain is selected from all current leaf nodes for splitting each time. Prioritizing the splitting of the node with the largest gain can reduce the loss function faster and achieve higher accuracy at the same tree depth; at the same time, it selects the global optimum for each split, resulting in faster convergence and fewer trees required.
[0109] The GOSS (Gradient-based One-Side Sampling) sampling strategy is adopted, which retains samples with large gradients and randomly samples samples with small gradients, reducing computational cost while maintaining accuracy; samples with smaller gradients can be randomly sampled. Compared with random sampling, it focuses more on samples that are difficult to predict, resulting in less accuracy loss. The GOSS algorithm used in this invention is as follows: sort the samples in descending order according to the absolute value of the gradient; retain the top a% of samples with large gradients; randomly sample b% of samples with small gradients from the remaining samples; assign a weight (1-a) / b to the samples with small gradients to compensate for information loss.
[0110] The Exclusive Feature Bundling (EFB) technique is used to bundle mutually exclusive features together, reducing feature dimensionality. For example, the EFB algorithm can be used to merge mutually exclusive features (such as "sunny day" and "cloudy day") to reduce feature dimensionality.
[0111] Regularization parameters are set to prevent overfitting. This invention adds an L1 norm penalty term to the leaf node weights in the loss function to promote sparse solutions (L1 regularization); adds an L2 norm penalty term to the leaf node weights in the loss function to smooth the leaf weights (L2 regularization); and sets a minimum split gain, which is used only when the gain from splitting exceeds a threshold to prevent excessive splitting.
[0112] (2) MultiOutputRegressor MultiOutput Encapsulation Mechanism: Create an independent LightGBM regressor copy for each output dimension. Each regressor uses the same input feature X, but the target variable is different columns of Y, and learns different mapping relationships. All regressors can be trained in parallel, making full use of multi-core CPU resources. When making predictions, all regressors work in parallel and predict their respective output dimensions to form a complete multi-output prediction matrix. Compared with deep learning models, the training speed and prediction speed are improved, and the prediction accuracy is improved, achieving the optimal balance between speed and accuracy.
[0113] Specifically, the medium-term forecasting model predicts for 10 days, the day-ahead forecasting model predicts for 24 hours, and the ultra-short-term forecasting model predicts for 4 hours. The medium-term, day-ahead, and ultra-short-term forecasting models have high output dimensions, at 960, 96, and 16 dimensions respectively, resulting in high model complexity. This invention employs a MultiOutputRegressor encapsulation, which is a meta-estimator. It uses a one-vs-one strategy to decompose the multi-output problem into multiple single-output problems, with each output dimension handled by an independent LightGBM model. The implementation mechanism is as follows:
[0114] ① Model replication: Create an independent base learner for each output dimension;
[0115] ② Independent training: Each base learner is trained on the same input feature X, but the target variable is a certain column of Y. ;
[0116] ③ Parallel prediction: All base learners work in parallel, each predicting its own output dimension;
[0117] ④ Result Concatenation: The prediction results of each base learner are concatenated into a complete multi-output prediction matrix. After the base learner LightGBM outputs its prediction results, the results are processed; the normalized results and the true values are converted back to the original scale, indices for different regions are calculated, and model evaluation and error analysis are performed.
[0118] Comprehensive modeling of different forecast time scales is achieved through three methods:
[0119] ① Ultra-short-term forecast modeling (4 hours, 16 time points): A high-complexity model configuration is adopted. The input window includes 120 historical power points (30 hours), 120 historical meteorological points (30 hours × 5 elements), and 16 future meteorological forecast points (4 hours × 5 elements). A multi-dimensional feature space is constructed, and 16 future power points are output at once using the direct MIMO modeling method. Among them, the 5 elements include shortwave radiation (swdown), direct radiation (swddni), diffuse radiation (swddif), dew point temperature (td2m), and relative humidity (rh2m).
[0120] ② Day-ahead prediction modeling (24 hours, 96 time points): A segmented prediction strategy is adopted, decomposing the 24 hours (96 points) into 6 sub-tasks of 4 hours (16 points), and each sub-task trains an independent MIMO model; the input window contains 96 historical power points and 96 historical meteorological points (96×5 elements), constructing a multi-dimensional feature space; by using the segmented strategy, the output dimension is reduced from 96 to 16, which not only reduces the training difficulty of the model, but also increases the number of training samples. Compared with the direct MIMO strategy, this method can effectively improve the prediction accuracy and generalization ability of the model.
[0121] ③ Medium-term forecast modeling (10 days, 960 time points): Low-complexity model configuration is used to prevent overfitting, and a strict data leakage protection mechanism is implemented. The end index of the training set = the start index of the test set - the input window size - the output window size, ensuring that future weather forecast data is not used.
[0122] Specifically, the day-ahead forecasting task is modeled in segments:
[0123] ① Segmentation strategy design: The 24-hour (96 time points) prediction task is decomposed into 6 sub-tasks of 4 hours (16 time points), with time periods of 1-16, 17-32, 33-48, 49-64, 65-80, and 81-96 respectively. Each sub-task corresponds to an independent MIMO model. By reducing the output dimension of a single model and increasing the number of training samples, the problems of insufficient samples and excessive model complexity in long sequence prediction are effectively alleviated.
[0124] ② Segmented dataset construction and sharing mechanism: For the first segmented dataset... k During a time period, when constructing the sliding window dataset, the input features... It contains 96 historical power points and 96 historical meteorological points (576 dimensions in total), and outputs labels. These are 16 future power points for the k-th time period; the six time periods share the same input features but have different output labels, enabling feature reuse and improving data utilization efficiency.
[0125] ③ Independent model training and parameter optimization: An independent LightGBM+MultiOutputRegressor model is trained for each time period. The hyperparameters of the six models are the same, but they learn different model parameters through their respective training processes, so that each model focuses on the prediction characteristics of a specific time period. By using GPU parallel acceleration, the total training time of the six models is significantly reduced, meeting the near real-time requirements.
[0126] ④ Prediction result splicing and post-processing: For the test set, six models were used to predict the power values for six time periods, which were then spliced together in chronological order to form a complete prediction of 96 time points. The splicing results are inversely normalized to restore the original power dimensions, and post-processing is performed (negative values are corrected to 0, and values exceeding the installed capacity are corrected to the installed capacity) to ensure the physical rationality of the prediction results.
[0127] The segmented prediction strategy proposed in this embodiment can significantly reduce the output dimension of a single model from 96 dimensions to 16 dimensions, thus significantly reducing the difficulty of model learning. Since ultra-short-term prediction (16 points) has already achieved excellent performance, segmented prediction can directly use the same model structure and hyperparameters, and can reuse the successful experience of ultra-short-term prediction. Segmented prediction can configure different hyperparameters and use different features for different time periods, greatly improving the sensitivity of the model. In addition, when using the segmented prediction strategy described in this invention, the evaluation index ACC value under the same test set is higher than the evaluation index ACC value of the prediction results when using the direct MIMO strategy for ultra-short-term prediction, thus improving the prediction accuracy.
[0128] Step 400: Evaluate the trained power prediction model based on the total installed capacity of photovoltaic power plants for the current month.
[0129] Different power grid evaluation indicators are adopted for different regions. For example, (1) For regions with complex meteorological characteristics, such as frequent changes in cloud cover and large fluctuations in photovoltaic power; long rainy season and many low-power periods; high humidity and large proportion of diffuse radiation, the evaluation indicator adopts the adaptive normalized relative error RMSE; (2) For regions with many sunny days and relatively stable fluctuations in photovoltaic power; dry and little rain and large proportion of direct radiation; large diurnal temperature range and strong regularity of power curve, the regional evaluation indicator adopts the error-weighted RMSE.
[0130] The specific manifestations of regions with complex meteorological characteristics are as follows: (1) Radiation fluctuations are severe, such as the intraday variance of shortwave downward radiation (SWDR) being greater than 200W / m², and the proportion of shortwave scattered radiation in the total radiation (scattering ratio) exceeding 35%; (2) Humidity environment is significant, such as the annual average relative humidity being greater than 75%, and the dew point temperature being maintained above 20℃ for a long time; (3) Low power characteristics are obvious, such as the number of days with peak power below 30% of the installed capacity due to the rainy season accounting for more than 20% of the total number of days in the year.
[0131] In practical photovoltaic (PV) power generation systems, installed capacity is a crucial reference indicator. When power output falls below a certain percentage of the installed capacity, the system's operating status and error characteristics change. Statistical analysis of data from numerous PV power plants revealed that when power output falls below 20% of the installed capacity, failure to adjust the calculation method for relative error can lead to distorted performance assessments of the model during these low-power periods. Choosing a threshold of 0.2 strikes a balance between assessments during high-power and low-power periods.
[0132] At this time, the power grid evaluation index adopts the adaptive normalized relative error RMSE. Its core idea is: during high power periods (P ≥ 0.2×Cap): use the actual power as the normalization factor and pay attention to the relative error; during low power periods (P<0.2×Cap): use 0.2×Cap as the normalization factor to avoid excessive relative error.
[0133] For each prediction time i The predicted power is The actual power is Its relative error can be expressed as: , This represents the normalization factor. When, the normalization factor is ; At that time, the normalization factor is 0.2×Cap.
[0134] First, calculate the average of the squared relative error at each time point under different power ranges, then take the square root to obtain the average relative error. Subtract the average relative error from 1 and convert it into a percentage to obtain the accuracy evaluation index.
[0135] The following are the evaluation indicators for ultra-short-term forecasts, day-ahead forecasts, and medium-term forecasts:
[0136] (1) Evaluation indicators for ultra-short-term forecasting:
[0137] ;
[0138] In the above formula, An indicator representing the accuracy of ultra-short-term forecasts; Cap This represents the total installed capacity of the photovoltaic power station for the current month; when Power outage time for i Available power at any given time; when Unlimited power supply for i Actual power at any given moment; For 4 hours ago i Predicted power at time step. The value range is [0, 100%]. When the predicted value is exactly equal to the actual value, the indicator value is 100%, indicating that the prediction is completely accurate; the closer the indicator value is to 100%, the higher the prediction accuracy; the lower the indicator value, the worse the prediction accuracy.
[0139] (2) Evaluation indicators for the current forecast:
[0140] ;
[0141] In the above formula, The evaluation indicators represent the forecasts made recently. Cap This represents the total installed capacity of the photovoltaic power station for the current month; when Power outage time for i Available power at any given time; when Unlimited power supply for i Actual power at any given moment; For the day before i The predicted power at any given time; Cap is the total installed capacity of the photovoltaic power plant for the current month.
[0142] The value range is [0, 100%]. When the predicted value is exactly equal to the actual value, the indicator value is 100%, indicating that the prediction is completely accurate; the closer the indicator value is to 100%, the higher the prediction accuracy; the lower the indicator value, the worse the prediction accuracy.
[0143] (3) Evaluation indicators for medium-term forecasts:
[0144] ;
[0145] In the above formula, Evaluation indicators representing medium-term forecasts; Cap This represents the total installed capacity of the photovoltaic power station for the current month; when Power outage time for i Available power at any given time; when Unlimited power supply for i Actual power at any given moment; For 4 days ago i The predicted power at any given time; Cap is the total installed capacity of the photovoltaic power plant for the current month.
[0146] The value range is [0, 100%]. When the predicted value is exactly equal to the actual value, the indicator value is 100%, indicating that the prediction is completely accurate; the closer the indicator value is to 100%, the higher the prediction accuracy; the lower the indicator value, the worse the prediction accuracy.
[0147] For regions with annual effective sunshine hours greater than 2500 hours and relatively stable photovoltaic power fluctuations; or dry climates with annual precipitation less than 400 mm and direct radiation accounting for more than 55% of total radiation; or average diurnal temperature range greater than 12℃ and a power curve correlation coefficient with the clear sky model higher than 0.9, the evaluation index adopts error-weighted RMSE. The core idea is that the larger the error, the higher the weight, and the more the model needs to focus on these difficult-to-predict time points. A fixed installed capacity is used as the normalization factor, which is simple to calculate and has clear physical meaning. Through the weighting mechanism, the model pays more attention to the times when prediction is difficult (such as sudden weather changes, cloud cover, etc.).
[0148] For a set j Actual power at time and j Ultra-short-term prediction power at time point The basic root mean square error:
[0149] ;
[0150] To ensure that weights are comparable and standardized, weights :
[0151] ;
[0152] Substituting the weights into the basic root mean square error formula, we get:
[0153] ;
[0154] because ,but:
[0155] ;
[0156] To correlate evaluation metrics with the scale of photovoltaic power plants, the installed capacity (Cap) is used to normalize the error-weighted RMSE. The overall accuracy is defined to be related to the error-weighted RMSE, and accuracy is inversely proportional to error; that is, the larger the error, the lower the accuracy. Therefore:
[0157] (1) Evaluation indicators for ultra-short-term forecasting:
[0158]
[0159] ;
[0160] In the above formula, An indicator representing the accuracy of ultra-short-term forecasts; This represents the actual power at time j; Let j represent the ultra-short-term prediction power at time j; CapThis represents the total installed capacity of photovoltaic power plants for the current month. This indicates the overall accuracy of ultra-short-term real-time forecasts; Indicates the first i The accuracy of ultra-short-term predictions for individual time periods or samples; This represents the total number of sub-periods or samples involved in the calculation. For ultra-short-term forecasts, given a forecast duration of 4 hours and a time resolution of 15 minutes, the number of predicted sub-periods, m, can be calculated by dividing the total forecast duration by the time resolution, which is 16.
[0161] Ultra-short-term forecasting The value range is [0, 100%]. When ,but This means that if the sum of the absolute values of the differences between the actual power and the predicted power at all times is 0, that is, the predicted value is exactly equal to the actual value, the accuracy reaches 100%.
[0162] (2) Evaluation indicators for the current forecast:
[0163] ;
[0164] In the above formula, The evaluation indicators represent the forecasts made recently. express i Actual power at any given moment; express i The day-ahead power forecast at any given time; Cap This represents the total installed capacity of the photovoltaic power plant for the current month; n represents the number of predicted sub-periods, which is 96. Evaluation indicators for the current day's forecast. The value range is [0, 100%].
[0165] (3) Evaluation indicators for medium-term forecasts:
[0166] ;
[0167] In the above formula, Indicates the first k Accuracy of mid-term forecasts; express i Actual power at any given moment; Indicates advance k Heaven against the first i Power prediction at any given time; This represents the average accuracy of the 10-day intermediate-term forecast; n represents the number of sub-periods in the forecast, which is 960. Intermediate-term forecast accuracy The value range is [0, 100%].
[0168] By directly linking the model's prediction accuracy to the power grid assessment standards through the Cap parameter, the model optimization direction is aligned with business needs. Compared to a single standardization method (such as Z-score standardization), the differentiated normalization strategy can significantly improve the model's prediction accuracy while preserving the physical meaning of the data, facilitating result interpretation and anomaly diagnosis.
[0169] Taking ultra-short-term forecasting as an example, refer to Figures 4-7 The graph shows the photovoltaic power predictions for four test samples over the next four hours (16 time points, 15-minute intervals). Each sample is represented by blue and red curves, indicating the actual and predicted power, respectively. As can be seen from the graph, the predicted power curve and the actual power curve show similar trends in most samples, indicating that the model can capture the changes in photovoltaic power over time.
[0170] Reference Figures 8-11 The prediction performance was compared for the next 15 minutes, 1 hour, 2 hours, and 4 hours. Each subplot uses the test sample number as the horizontal axis and photovoltaic power as the vertical axis; the blue and red curves represent the actual and predicted power, respectively. The predicted curves closely approximate the actual curves.
[0171] 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 in the above formulas. 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, and should all be included within the protection scope of the present invention.
Claims
1. A multi-timescale prediction method for photovoltaic power based on machine learning, characterized in that, Includes the following steps: Step 100: Obtain raw photovoltaic power time series data and weather forecast data, and perform preprocessing; Step 200: Employ a multi-input multi-output modeling strategy, adopt differentiated modeling strategies for different time scales, construct a multi-scale power prediction model, and train the multi-scale power prediction model based on the processed data; Multi-scale power prediction models include: medium-term power prediction models, day-ahead power prediction models, and ultra-short-term power prediction models; A multi-input multi-output (MIMO) modeling strategy is adopted, with differentiated modeling strategies for different time scales. These include: the ultra-short-term power prediction model adopts an MIMO modeling strategy and selects LightGBM as the base learner; the prediction tasks of the medium-term power prediction model and the day-ahead power prediction model are decomposed into multiple prediction sub-tasks; each prediction sub-task adopts an independent MIMO modeling strategy and selects LightGBM as the base learner; and the prediction results of the independent base learners are concatenated into a complete multi-output prediction matrix. Step 300: Develop a prediction output based on the trained multi-scale power prediction model, and evaluate the trained power prediction model for different regions and different weather data. The trained power prediction model is evaluated, including setting different power prediction model evaluation indicators based on the standardized installed capacity of photovoltaic power plants and based on weather forecast data for different regions. Different power grid evaluation indicators are adopted for different regions. For regions with complex meteorological characteristics, such as frequent changes in cloud cover and large fluctuations in photovoltaic power; long rainy seasons and many periods of low power; high humidity and a large proportion of diffuse radiation, the evaluation indicator adopts the adaptive normalized relative error RMSE. For regions with many sunny days and relatively stable photovoltaic power fluctuations; dry and little rain with a large proportion of direct radiation; large diurnal temperature range and strong regularity of power curves, the regional evaluation indicator adopts the error-weighted RMSE. Adaptive normalized relative error RMSE: for each prediction time step i The predicted power is The actual power is Its relative error is expressed as: , Indicates the normalization factor; When, the normalization factor is ; When the normalization factor is 0.2×Cap, first calculate the average value of the square of the relative error at each time point under different power ranges, then take the square root to obtain the average relative error, subtract the average relative error from 1 and convert it into a percentage form to obtain the evaluation index. Self-weighted RMSE: To ensure the comparability and standardization of weights, the weights... : ; Substituting the weights into the root mean square error formula, since... ,but: ; In the above formula, Represents a group j Actual power at any given time; express j Ultra-short-term prediction power at any given time; To correlate evaluation metrics with the scale of photovoltaic power plants, the installed capacity (Cap) is used to weight the error. Normalization is performed.
2. The photovoltaic power multi-timescale prediction method based on machine learning according to claim 1, characterized in that, Step 100 includes: Discrete wavelet transform was used to denoise the original photovoltaic power time series data to obtain the reconstructed denoised power signal. Data normalization was then performed on the reconstructed denoised power signal and the weather forecast data to obtain normalized power data and normalized weather forecast data, respectively.
3. The photovoltaic power multi-timescale prediction method based on machine learning according to claim 2, characterized in that, The step of using discrete wavelet transform to denoise the original photovoltaic power time series data to obtain a reconstructed and denoised power signal includes: The original photovoltaic power time series data is subjected to multi-level wavelet decomposition, which decomposes it into approximation coefficients and detail coefficients; based on the first-level detail coefficients, the median absolute deviation method is used to estimate the noise standard deviation. Based on the noise standard deviation, the denoising threshold is calculated; based on the denoising threshold, the detail coefficients are subjected to soft thresholding to obtain the detail coefficients after soft thresholding. The power signal after denoising is reconstructed by performing inverse wavelet transform based on the approximation coefficients and the detail coefficients after soft thresholding.
4. The photovoltaic power multi-timescale prediction method based on machine learning according to claim 3, characterized in that, Step 100 further includes: calculating the standardized installed capacity of the photovoltaic power station based on the original photovoltaic power time series data.
5. The photovoltaic power multi-timescale prediction method based on machine learning according to claim 1, characterized in that, In step 200, the multi-scale power prediction model is trained based on the processed data, including: concatenating the denoised power data and weather forecast features to form the input feature vector of the power prediction model, and using the normalized power data as the output label, thereby training the multi-scale power prediction model.
6. The photovoltaic power multi-timescale prediction method based on machine learning according to claim 5, characterized in that, In step 300, the prediction output is based on the trained multi-scale power prediction model, including: splicing the prediction results of the trained medium-term power prediction model, day-ahead power prediction model and ultra-short-term power prediction model in chronological order; and performing inverse normalization on the spliced result to restore it to the original power dimension.
7. The photovoltaic power multi-timescale prediction method based on machine learning according to claim 3, characterized in that, The weather forecast data includes: shortwave downward radiation, shortwave direct normal radiation, shortwave scattered radiation, dew point temperature, and humidity.
Citation Information
Patent Citations
Photovoltaic prediction method based on refined modeling and integrated learning
CN118735062A