Photovoltaic power ultra-short-term prediction method, system, equipment and medium

By optimizing hyperparameters using a CNN-LSTM-Attention hybrid prediction model and the Crowned Pig optimization algorithm, the challenges of model structure selection and hyperparameter optimization in photovoltaic power prediction are solved, achieving high-precision photovoltaic power prediction and supporting grid dispatch and electricity market transactions.

CN121997298AActive Publication Date: 2026-05-08CHANGCHUN UNIV OF TECH
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHANGCHUN UNIV OF TECH
Filing Date
2026-04-09
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing photovoltaic power prediction methods suffer from difficulties in model structure selection and hyperparameter optimization, resulting in insufficient prediction accuracy and stability, which makes it difficult to meet the needs of real-time grid dispatch and electricity market transactions.

Method used

A hybrid prediction model of CNN-LSTM-Attention is adopted, and the hyperparameters are optimized by the Crowned Porcupine optimization algorithm. Combined with the chaotic mapping strategy, an efficient photovoltaic power prediction model is constructed. Through data preprocessing and feature selection, high-precision prediction of historical data of photovoltaic power plants is achieved.

Benefits of technology

It improves the accuracy and stability of photovoltaic power prediction, reduces the difficulty of hyperparameter optimization, and realizes high-precision ultra-short-term photovoltaic power prediction, supporting grid dispatch and power market trading decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121997298A_ABST
    Figure CN121997298A_ABST
Patent Text Reader

Abstract

The invention discloses a photovoltaic power ultra-short-term prediction method, system and device and a medium, and relates to the field of photovoltaic power prediction.The method comprises the steps that historical operation data of a photovoltaic power station is obtained and preprocessed; based on a preset time window, constructing the preprocessed historical operation data into a supervised learning sample set; a CNN-LSTM-Attention hybrid prediction model is constructed; adopting a crown porcupine optimization algorithm to optimize hyper-parameters of the hybrid prediction model to obtain an optimal hyper-parameter combination, and assigning the optimal hyper-parameter combination to the hybrid prediction model; and training the hybrid prediction model by using a supervised learning sample set, determining a trained photovoltaic power prediction model, inputting the to-be-predicted data into the trained photovoltaic power prediction model, and determining a photovoltaic power prediction value at a future time point, thereby reducing the difficulty of hyper-parameter optimization, and avoiding the problem of difficulty in model structure selection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of photovoltaic power prediction, and in particular to a method, system, device and medium for ultra-short-term photovoltaic power prediction. Background Technology

[0002] With the acceleration of the global energy transition, the proportion of photovoltaic (PV) power generation in the power system continues to rise. However, PV output is significantly affected by meteorological factors such as sunlight intensity, temperature, and humidity, exhibiting significant intermittency and volatility. Large-scale grid connection poses a severe challenge to the safe and stable operation of the power grid and the absorption of new energy sources. Accurate PV power forecasting, especially ultra-short-term forecasts of 15 minutes to 4 hours in the future, is a key technical support for real-time grid dispatching, power plant operation optimization, and electricity market transactions.

[0003] Currently, photovoltaic power prediction methods are mainly divided into two categories: 1. Physical Model: Relies on high-precision numerical weather prediction (NWP) and complex photoelectric conversion equations. Its disadvantages include high modeling difficulty, high computational cost, and extremely stringent requirements for the accuracy of meteorological forecast data.

[0004] 2. Statistical / Learning Methods: These include traditional models such as Autoregressive Integrated Moving Average (ARIMA) and Support Vector Regression (SVR), as well as emerging deep learning methods such as Long Short-Term Memory (LSTM) and Convolutional Neural Networks (CNN). Traditional methods struggle to characterize the complex nonlinear relationship between meteorological factors and power. While deep learning methods demonstrate stronger learning capabilities, they face two major challenges: Choosing the right model architecture is challenging: a single model (such as LSTM or CNN) cannot effectively capture spatiotemporal features simultaneously. While hybrid models (such as CNN-LSTM) can complement each other's strengths, their performance is highly dependent on the design of the model architecture.

[0005] Hyperparameter optimization is challenging: Deep learning models contain numerous hyperparameters (such as learning rate, number of layers, number of neurons, etc.), and the settings of these parameters directly affect model performance. Traditional manual trial-and-error parameter tuning is inefficient and unreliable, easily getting trapped in local optima, thus becoming a bottleneck restricting further improvements in model performance. Summary of the Invention

[0006] The purpose of this application is to provide a method, system, device and medium for ultra-short-term photovoltaic power prediction, which can solve the problems of difficulty in model structure selection and high difficulty in hyperparameter optimization.

[0007] To achieve the above objectives, this application provides the following solution: In a first aspect, this application provides a method for ultra-short-term photovoltaic power prediction, comprising the following steps.

[0008] Historical operating data of the photovoltaic power station is acquired and preprocessed; the historical operating data includes meteorological factor data corresponding to time and actual photovoltaic power data.

[0009] Based on a preset time window, the preprocessed historical operating data is constructed into a supervised learning sample set. The meteorological factor data of the past preset historical time step in each sample in the supervised learning sample set is used as the input feature, and the actual photovoltaic power data of the future preset prediction step in each sample is used as the output feature; the sample is the preprocessed historical operating data.

[0010] A CNN-LSTM-Attention hybrid prediction model is constructed; the CNN-LSTM-Attention hybrid prediction model includes a CNN feature extraction layer, an LSTM temporal modeling layer, an Attention mechanism layer and an output layer connected in sequence.

[0011] The hyperparameters of the CNN-LSTM-Attention hybrid prediction model are optimized using the hog optimization algorithm to obtain the optimal hyperparameter combination, and the optimal hyperparameter combination is assigned to the CNN-LSTM-Attention hybrid prediction model. The hog optimization algorithm is to introduce chaotic mapping to perturb the position of individuals in the hog population after the position of the hog population is updated to avoid the optimization algorithm from getting trapped in local optima.

[0012] The CNN-LSTM-Attention hybrid prediction model is trained and assigned values ​​using the supervised learning sample set. The trained photovoltaic power prediction model is then determined, and the data to be predicted is input into the trained photovoltaic power prediction model to determine the photovoltaic power prediction value at future time points.

[0013] Secondly, this application provides a photovoltaic power ultra-short-term prediction system, including the following modules.

[0014] The data preprocessing module is used to acquire historical operating data of the photovoltaic power station and preprocess the historical operating data; the historical operating data includes meteorological factor data corresponding to time and actual photovoltaic power data.

[0015] The sample construction module, connected to the data preprocessing module, is used to construct a supervised learning sample set from the preprocessed historical operating data based on a preset time window. The meteorological factor data of the past preset historical time step in each sample in the supervised learning sample set is used as input features, and the actual photovoltaic power data of the future preset prediction step in each sample is used as output features; the sample is the preprocessed historical operating data.

[0016] The model storage and retrieval module is used to construct a CNN-LSTM-Attention hybrid prediction model. The hyperparameters of the CNN-LSTM-Attention hybrid prediction model are optimized using the hog optimization algorithm to obtain the optimal hyperparameter combination, and this optimal hyperparameter combination is assigned to the CNN-LSTM-Attention hybrid prediction model. The CNN-LSTM-Attention hybrid prediction model includes a CNN feature extraction layer, an LSTM temporal modeling layer, an Attention mechanism layer, and an output layer connected in sequence. The hog optimization algorithm involves introducing chaotic mapping to perturb the individual positions within the hog population after the population position is updated.

[0017] The prediction execution module is connected to the sample construction module and the model storage and retrieval module, respectively. It is used to train the assigned CNN-LSTM-Attention hybrid prediction model using the supervised learning sample set, determine the trained photovoltaic power prediction model, and input the data to be predicted into the trained photovoltaic power prediction model to determine the photovoltaic power prediction value at future time points.

[0018] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described photovoltaic power ultra-short-term prediction method.

[0019] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method for ultra-short-term photovoltaic power prediction.

[0020] According to the specific embodiments provided in this application, this application has the following technical effects: This application employs the Crested Porcupine Optimization (CPO) algorithm to optimize the hyperparameters of a CNN-LSTM-Attention hybrid prediction model, obtaining the optimal hyperparameter combination. This optimal hyperparameter combination is then assigned to the CNN-LSTM-Attention hybrid prediction model. The CPO algorithm introduces chaotic mapping to perturb the individual positions within the crested porcupine population after position updates, optimizing the hyperparameter search process through chaotic perturbation. This reduces the difficulty of hyperparameter optimization and avoids the algorithm getting trapped in local optima. Furthermore, the CNN-LSTM-Attention hybrid prediction model is used to achieve accurate extraction and weight allocation of spatiotemporal features, addressing the problems existing in single models and current hybrid models. The CNN-LSTM-Attention hybrid prediction model avoids the problem of difficult model structure selection. Furthermore, this application acquires historical operating data of photovoltaic power plants, preprocesses the historical operating data, and constructs a supervised learning sample set based on a preset time window. The supervised learning sample set is used to train the assigned CNN-LSTM-Attention hybrid prediction model, determining the trained photovoltaic power prediction model. The data to be predicted is then input into the trained photovoltaic power prediction model to determine the photovoltaic power prediction value at future time points. This photovoltaic power prediction model is an ultra-short-term photovoltaic power prediction model that can automatically achieve high accuracy and high stability, improving prediction accuracy and stability. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart illustrating a photovoltaic power ultra-short-term prediction method provided in an embodiment of this application.

[0023] Figure 2 A schematic diagram of the Spearman correlation coefficient matrix between photovoltaic input characteristics and actual power generation provided in an embodiment of this application. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0025] To make the objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0026] like Figure 1 As shown in the figure, this application provides a method for ultra-short-term photovoltaic power prediction. This method is based on a CNN-LSTM-Attention hybrid prediction model and includes the following steps.

[0027] S1: Obtain historical operating data of the photovoltaic power station and preprocess the historical operating data; the historical operating data includes meteorological factor data corresponding to time and actual photovoltaic power data.

[0028] S2: Based on a preset time window, the preprocessed historical operating data is constructed into a supervised learning sample set. The meteorological factor data of the past preset historical time step in each sample in the supervised learning sample set is used as the input feature, and the actual photovoltaic power data of the future preset prediction step in each sample is used as the output feature; the sample is the preprocessed historical operating data.

[0029] S3: Construct a CNN-LSTM-Attention hybrid prediction model; the CNN-LSTM-Attention hybrid prediction model includes a CNN feature extraction layer, an LSTM temporal modeling layer, an Attention mechanism layer, and an output layer connected in sequence.

[0030] S4: The hyperparameters of the CNN-LSTM-Attention hybrid prediction model are optimized using the hog optimization algorithm to obtain the optimal hyperparameter combination, and the optimal hyperparameter combination is assigned to the CNN-LSTM-Attention hybrid prediction model. The hog optimization algorithm introduces chaotic mapping to perturb the individual positions in the hog population after the position of the hog population is updated, so as to avoid the optimization algorithm from getting trapped in local optima.

[0031] S5: Use the supervised learning sample set to train the assigned CNN-LSTM-Attention hybrid prediction model, determine the trained photovoltaic power prediction model, and input the data to be predicted into the trained photovoltaic power prediction model to determine the photovoltaic power prediction value at future time points.

[0032] In one exemplary embodiment, S1 includes the following steps.

[0033] S11: Use the interquartile range method to identify and correct outliers in the historical running data.

[0034] S12: The moving average method is used to smooth the corrected historical running data to suppress random noise in the original data. For example, setting the window size to 5 and smoothing the corrected historical running data y... t =(x t-2 +x t-1 +x t +x t+1 +x t+2 ) / 5, where x t-2 x t-1 x t x t+1 and x t+2 This represents the original historical running data from time t-2 to t+2, where t is the time.

[0035] S13: Based on smoothed historical operating data, calculate the correlation coefficient (such as Spearman correlation coefficient) between various meteorological factor data and actual photovoltaic power data, and select the meteorological factor data with the highest correlation to actual photovoltaic power data as key features for model input. This application selects four factors with high correlation: irradiance, module temperature, ambient temperature, and humidity.

[0036] S14: Using a normalization method, the screened meteorological factor data and actual photovoltaic power data are mapped to a preset interval to determine the preprocessed historical operating data.

[0037] In one exemplary embodiment, S11 specifically includes the following steps.

[0038] S111: Calculate the 25th percentile Q1 and 75th percentile Q3 of the historical running data to obtain the interquartile range IQR = Q3 - Q1.

[0039] S112: Historical operating data that exceeds the range [Q1-1.5IQR, Q3+1.5IQR] are identified as outliers, and linear interpolation is used to correct the outliers.

[0040] In an exemplary embodiment, the data preprocessing method in S1, in addition to using the IQR method and the moving average method, can also use other outlier processing and data smoothing methods to achieve cleaning and noise reduction of photovoltaic data.

[0041] In an exemplary embodiment, key features in S13 include light intensity, component temperature, ambient temperature, and humidity.

[0042] In an exemplary embodiment, S14 uses the Min-Max normalization method to map the filtered meteorological factor data and actual photovoltaic power data to the [0,1] interval to eliminate the influence of dimensions.

[0043] In an exemplary embodiment, S2 sets the historical time step (kim=2, representing the past two time points) and the prediction step (zim=1, representing the future one time point). The filtered meteorological feature data from the past "kim" time steps in each sample are used as input features, and the actual photovoltaic power values ​​for the future "zim" time steps are used as output features. Since the data sampling interval in this application is 15 minutes, an ultra-short-term prediction sample of "predicting the power of the next 15 minutes from data from the past 30 minutes" is constructed, i.e., a supervised learning sample set.

[0044] In one exemplary embodiment, the CNN feature extraction layer includes at least one layer of a one-dimensional convolutional neural network for extracting local spatial features from the input features. For example, two convolutional layers can be used, with the first layer having 32 "3x1" convolutional kernels and the second layer having 64 "3x1" convolutional kernels, supplemented by batch normalization and dropout layers to prevent overfitting.

[0045] The LSTM temporal modeling layer includes a long short-term memory neural network layer, used to learn the long-term temporal dependencies in the output features of the CNN feature extraction layer. Its number of hidden units needs optimization, and the output mode can be set to output the long-term temporal dependencies of the last time step.

[0046] The Attention mechanism layer, connected after the LSTM temporal modeling layer, uses an attention mechanism to perform a weighted summation of the long-term temporal dependencies output by the LSTM temporal modeling layer, enabling the CNN-LSTM-Attention hybrid prediction model to adaptively focus on key information at different time steps. For example, a scaled dot product attention mechanism can be used.

[0047] Output layer: Based on the output of the Attention mechanism layer, the photovoltaic power value at future time points is predicted.

[0048] In an exemplary embodiment, in the CNN-LSTM-Attention hybrid model, an equivalent variant of the same network structure can be used to adjust the network architecture while ensuring the prediction effect.

[0049] In one exemplary embodiment, S3, the following steps are also included.

[0050] The optimization objective of the CNN-LSTM-Attention hybrid prediction model is set to minimize the root mean square error of the CNN-LSTM-Attention hybrid prediction model on the validation set.

[0051] In one exemplary embodiment, the hyperparameters include the learning rate, the number of LSTM hidden units, and the L2 regularization coefficient.

[0052] The introduction of chaotic mapping to perturb the individual positions in the Crowned Porcupine population specifically includes: Logistic mapping is introduced to perturb the individual positions in the Crown Hybrid pig population, generating new positions, which are then compared with the original positions to select the optimal position for the next iteration.

[0053] In one exemplary embodiment, the hyperparameters that need to be optimized and their search range are defined.

[0054] Learning rate: Search range [1×10] -4 1×10 -2 ]; Number of hidden LSTM cells: Search range [40, 100].

[0055] L2 regularization coefficient: Search range [1×10] -5 1×10 -2 ].

[0056] The optimization objective is set to minimize the root mean square error (RMSE) of the CNN-LSTM-Attention hybrid prediction model on the validation set.

[0057] In an exemplary embodiment, S4 uses the Crowned Porcupine Optimization Algorithm to automatically optimize the defined hyperparameters.

[0058] Initialization: Initialize the CPO algorithm parameters and the Crown hog population. Each individual position in the Crown hog population represents a set of hyperparameters to be optimized.

[0059] Chaotic perturbation strategy: After updating the position of the Fiery Crown Pig population, a chaotic mapping (Logistic mapping) is introduced to perturb the position of individuals in the population, generating a new position. This new position is then compared with the original position, and the optimal position is selected for the next iteration. This strategy aims to enhance the algorithm's global search capability and avoid getting trapped in local optima.

[0060] Iterative optimization: The CPO algorithm's position update (simulating its random search, prey encirclement, spiral update, etc.) and chaotic perturbation strategies are executed repeatedly until the maximum number of iterations is reached or the convergence condition is met. The optimal position found at the end is decoded, which is the optimal combination of hyperparameters.

[0061] This application employs the hog optimization algorithm to automatically optimize the hyperparameters of the CNN-LSTM-Attention hybrid model, thereby improving model performance. Other equivalent improved metaheuristic optimization algorithms can be considered as alternatives to this application.

[0062] In an exemplary embodiment, the training and prediction of the CNN-LSTM-Attention hybrid prediction model are as follows.

[0063] Model Training: The optimal combination of hyperparameters obtained through optimization is assigned to the constructed CNN-LSTM-Attention hybrid model. The CNN-LSTM-Attention hybrid model is trained using the constructed supervised learning sample set to obtain the trained photovoltaic power prediction model.

[0064] Power prediction: The meteorological factor data and actual photovoltaic power data in the test set are preprocessed in the same way and constructed into a supervised learning sample set to be predicted according to the S2 method. The sample set is then input into the trained photovoltaic power prediction model, and the output of the model is the photovoltaic power prediction value of the test set.

[0065] The complete process of building and optimizing the CNN-LSTM-Attention hybrid prediction model is shown below.

[0066] First, actual photovoltaic power data is imported. Outliers are identified using the IQR method, and the data is smoothed using the moving average method. After dividing the data into training, validation, and test sets, data normalization is performed. Then, the CPO algorithm parameters, population M, maximum number of iterations T, and search dimension are initialized. A chaotic initialization of the hog population is used to represent hyperparameter combinations, with each hog representing a set of hyperparameters. The iteration begins at t=1. After entering the iterative optimization phase, the hyperparameters of each hog i in generation t are decoded, and a CNN-LSTM-Attention model is constructed. After model training and validation, the individual optimum and the global optimum are updated. If t≤T, the next generation begins at t=t+1, and the parameters α, A, C, ρ, and I are calculated. If ρ≤0.5 and |A|≥1, a random search is explored: X(t+1)=X_rand-A+|C X_rand-X(t)|;If ρ≤0.5, |A|<1, develop the surrounding prey X(t+1)=X (t)-A+|CX (t) -X(t)|; If ρ>0.5, develop spiral update X(t+1)=D'-e^(bl) cos(2πl)+X (t), by choosing to explore random search, develop a prey-encircling strategy, or develop a spiral update strategy to update the individual position, while introducing chaotic perturbations to avoid premature convergence; if t>T, after the iteration, the optimal hyperparameter combination is output to build the final prediction model and complete photovoltaic power prediction and performance evaluation on the test set. The optimal parameter combination is used to build a CPO-CNN-LSTM-Attention hybrid prediction model, that is, the assigned CNN-LSTM-Attention hybrid prediction model, to perform photovoltaic power prediction on the test set, and calculate prediction performance indicators such as RMSE, MAE, MAPE, etc. The model is evaluated and the results are visualized until the end. Among them, the meaning of each variable is: X(t) represents the current position, X (t) represents the current optimal position, X_rand represents the random individual position, t represents the current iteration number, T represents the maximum iteration number, A, C, I, and ρ are algorithm parameters, b is a constant, D' represents the distance between the current position and the optimal position, α is the attention weight coefficient, X(t+1) represents the position at time t+1, and M is the parameter population, i.e., the Crowned Hippophae pig population.

[0067] The correlation coefficient method was used to analyze the correlation strength between various meteorological factor data and actual photovoltaic power data, providing a basis for selecting model input features. Figure 2 The Spearman correlation matrix showing the photovoltaic input characteristics and actual power generation reveals a strong positive correlation between actual power generation and features such as total radiation, direct radiation, and module temperature, with correlation coefficients of 0.704, 0.7568, and 0.6129, respectively; and a negative correlation with humidity, with a correlation coefficient of -0.2115. Based on this correlation analysis, this application selects illuminance, module temperature, ambient temperature, and humidity as model inputs, eliminating redundant features with weak correlations. This effectively reduces the model input dimensionality while ensuring information integrity, thereby improving training efficiency and prediction accuracy.

[0068] The CPO-CNN-LSTM-Attention hybrid prediction model proposed in this application compares with existing models such as CNN, LSTM, CNN-LSTM, CPO-CNN-LSTM, and CNN-LSTM-Attention in terms of Mean Absolute Error (MAE), Root Mean Square Error (RMSE), Mean Absolute Percentage Error (MAPE), Mean Squared Error (MSE), and Coefficient of Determination (R²). 2The differences lie in these key evaluation metrics. Compared to other comparative models, the CNN-LSTM-Attention model proposed in this application shows the minimum values ​​for all error metrics (MAE, RMSE, MAPE, MSE), and in R... 2 The fact that the index shows the maximum value indicates that the model has higher prediction accuracy, smaller prediction error, and stronger fitting ability in photovoltaic power prediction tasks.

[0069] Table 1 quantitatively demonstrates the performance of CNN, LSTM, CNN-LSTM, CPO-CNN-LSTM, CNN-LSTM-Attention, and the CNN-LSTM-Attention model proposed in this application on MAE, MAPE, MSE, RMSE, and R. 2 The specific values ​​for the five key evaluation metrics are as follows. The CNN-LSTM-Attention model proposed in this application achieves the minimum values ​​for the four error metrics: MAE, MAPE, MSE, and RMSE, which are 4.1409, 27.4059, 25.5803, and 5.0577, respectively; and in R... 2 The maximum value of 0.8323 was achieved, which is significantly better than other comparative models, further verifying the high accuracy and superiority of the technical solution in the ultra-short-term photovoltaic power prediction task.

[0070] Table 1 Comparison of Photovoltaic Power Prediction Performance Indicators of Various Models

[0071] The validated photovoltaic power prediction model is applied to the grid dispatch system, power plant monitoring system or photovoltaic power plant to guide automatic generation control (AGC), photovoltaic power plant output adjustment or electricity market trading decisions.

[0072] This application provides a photovoltaic power ultra-short-term prediction system, which includes the following modules.

[0073] The data preprocessing module is used to acquire historical operating data of the photovoltaic power station and preprocess the historical operating data; the historical operating data includes meteorological factor data corresponding to time and actual photovoltaic power data.

[0074] The sample construction module, connected to the data preprocessing module, is used to construct a supervised learning sample set from the preprocessed historical operating data based on a preset time window. The meteorological factor data of the past preset historical time step in each sample in the supervised learning sample set is used as input features, and the actual photovoltaic power data of the future preset prediction step in each sample is used as output features; the sample is the preprocessed historical operating data.

[0075] The model storage and retrieval module is used to construct a CNN-LSTM-Attention hybrid prediction model. The hyperparameters of the CNN-LSTM-Attention hybrid prediction model are optimized using the hog optimization algorithm to obtain the optimal hyperparameter combination, and this optimal hyperparameter combination is assigned to the CNN-LSTM-Attention hybrid prediction model. The CNN-LSTM-Attention hybrid prediction model includes a CNN feature extraction layer, an LSTM temporal modeling layer, an Attention mechanism layer, and an output layer connected in sequence. The hog optimization algorithm involves introducing chaotic mapping to perturb the individual positions within the hog population after the population position is updated.

[0076] The prediction execution module is connected to the sample construction module and the model storage and retrieval module, respectively. It is used to train the assigned CNN-LSTM-Attention hybrid prediction model using the supervised learning sample set, determine the trained photovoltaic power prediction model, and input the data to be predicted into the trained photovoltaic power prediction model to determine the photovoltaic power prediction value at future time points.

[0077] This application constructs a CNN-LSTM-Attention hybrid model, fully utilizing the local feature extraction capability of CNN, the long-term temporal modeling capability of LSTM, and the key information focusing capability of the Attention mechanism, enabling a more comprehensive capture of the complex fluctuation patterns of photovoltaic power. Experimental results show that the optimized prediction model of this application has significantly lower error metrics such as RMSE and MAE than the single model and the unoptimized hybrid model. 2 The accuracy reached 0.8323, proving its high precision.

[0078] This application addresses the challenge of determining hyperparameters in hybrid models by introducing the Crowned Porcupine Optimization (CPO) algorithm. The CPO algorithm incorporates a chaotic perturbation strategy, significantly enhancing its global search capability and effectively avoiding the pitfalls of traditional hyperparameter tuning methods (such as manual trial and error, grid search) or basic metaheuristic algorithms that are prone to getting trapped in local optima. This allows the model to automatically find the optimal combination of hyperparameters, resulting in a substantial improvement in predictive performance compared to the basic model (e.g., a 34.4% reduction in RMSE).

[0079] By employing a data-driven deep learning model combined with an efficient automatic optimization algorithm, this application does not rely on precise physical equations and complex numerical weather prediction, but can adaptively learn the "weather-power" mapping relationship under different meteorological conditions. Through IQR outlier handling and feature selection, the quality of input features is ensured, resulting in a trained model that exhibits smaller prediction bias and better stability on the test set, i.e., excellent generalization ability.

[0080] This application provides a complete end-to-end solution for data processing model construction and optimization, as well as prediction and application. The methodology is clear, and the system structure is well-defined. The ultra-short-term forecast results at the 15-minute level can be directly used in power grid dispatching systems, power plant monitoring systems, or photovoltaic power plants to guide automatic generation control (AGC), photovoltaic power plant output adjustment, or electricity market trading decisions, demonstrating clear engineering application value.

[0081] In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments. The computer device can be a server or a terminal. The computer device includes a processor, a memory, an input / output interface (I / O), and a communication interface. The processor, memory, and I / O interface are connected via a system bus, and the communication interface is connected to the system bus via the I / O interface. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device stores data to be processed. The I / O interface of the computer device is used for exchanging information between the processor and external devices. The communication interface of the computer device is used for communicating with an external terminal via a network connection. When the computer program is executed by the processor, it implements the above-described methods.

[0082] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0083] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by hardware related to computer program instructions. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0084] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0085] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0086] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for ultra-short-term photovoltaic power prediction, characterized in that, include: Acquire historical operating data of the photovoltaic power station and preprocess the historical operating data; The historical operating data includes meteorological factor data corresponding to time and actual photovoltaic power data; Based on a preset time window, the preprocessed historical operating data is constructed into a supervised learning sample set. The meteorological factor data of the past preset historical time step in each sample in the supervised learning sample set is used as the input feature, and the actual photovoltaic power data of the future preset prediction step in each sample is used as the output feature. The sample is preprocessed historical operational data; Construct a CNN-LSTM-Attention hybrid prediction model; the CNN-LSTM-Attention hybrid prediction model includes a CNN feature extraction layer, an LSTM temporal modeling layer, an Attention mechanism layer and an output layer connected in sequence; The hyperparameters of the CNN-LSTM-Attention hybrid prediction model are optimized using the hog optimization algorithm to obtain the optimal hyperparameter combination, and the optimal hyperparameter combination is assigned to the CNN-LSTM-Attention hybrid prediction model. The hog optimization algorithm involves introducing chaotic mapping to perturb the positions of individuals in the hog population after the position update. The CNN-LSTM-Attention hybrid prediction model is trained and assigned values ​​using the supervised learning sample set. The trained photovoltaic power prediction model is then determined, and the data to be predicted is input into the trained photovoltaic power prediction model to determine the photovoltaic power prediction value at future time points.

2. The photovoltaic power ultra-short-term prediction method according to claim 1, characterized in that, Preprocessing the historical operational data includes: The interquartile range method is used to identify and correct outliers in the historical operating data. The moving average method is used to smooth the corrected historical operating data; Based on smoothed historical operating data, the correlation coefficient between each meteorological factor data and the actual photovoltaic power data is calculated, and the meteorological factor data with the highest correlation with the actual photovoltaic power data is selected as the key features of the model input. A normalization method is used to map the screened meteorological factor data and actual photovoltaic power data to a preset interval to determine the preprocessed historical operating data.

3. The photovoltaic power ultra-short-term prediction method according to claim 2, characterized in that, The interquartile range method is used to identify and correct outliers in the historical operating data, specifically including: Calculate the 25th percentile Q1 and 75th percentile Q3 of the historical running data to obtain the interquartile range IQR = Q3 - Q1; Historical operating data that exceeds the range [Q1-1.5IQR, Q3+1.5IQR] are identified as outliers, and linear interpolation is used to correct these outliers.

4. The photovoltaic power ultra-short-term prediction method according to claim 2, characterized in that, The key features include light intensity, component temperature, ambient temperature, and humidity.

5. The photovoltaic power ultra-short-term prediction method according to claim 1, characterized in that, The CNN feature extraction layer contains at least one one-dimensional convolutional neural network layer for extracting local spatial features from the input features; The LSTM temporal modeling layer includes a long short-term memory neural network layer, which is used to learn the long-term temporal dependencies in the output features of the CNN feature extraction layer. The Attention mechanism layer, connected after the LSTM temporal modeling layer, uses an attention mechanism to perform a weighted summation of the long-term temporal dependencies output by the LSTM temporal modeling layer. The output layer is used to predict the photovoltaic power value at future time points based on the summation result of the Attention mechanism layer.

6. The photovoltaic power ultra-short-term prediction method according to claim 1, characterized in that, The hyperparameters include the learning rate, the number of LSTM hidden units, and the L2 regularization coefficient; The introduction of chaotic mapping to perturb the individual positions in the Crowned Porcupine population specifically includes: Logistic mapping is introduced to perturb the individual positions in the Crown Hybrid pig population, generating new positions, which are then compared with the original positions to select the optimal position for the next iteration.

7. The photovoltaic power ultra-short-term prediction method according to claim 1, characterized in that, The process of constructing a CNN-LSTM-Attention hybrid prediction model also includes: The optimization objective of the CNN-LSTM-Attention hybrid prediction model is set to minimize the root mean square error of the CNN-LSTM-Attention hybrid prediction model on the validation set.

8. A photovoltaic power ultra-short-term prediction system, characterized in that, The photovoltaic power ultra-short-term prediction system is used to execute the photovoltaic power ultra-short-term prediction method according to any one of claims 1-7, and the photovoltaic power ultra-short-term prediction system includes: The data preprocessing module is used to acquire historical operating data of the photovoltaic power station and preprocess the historical operating data; the historical operating data includes meteorological factor data corresponding to time and actual photovoltaic power data; The sample construction module, connected to the data preprocessing module, is used to construct a supervised learning sample set from the preprocessed historical operating data based on a preset time window. The meteorological factor data of the past preset historical time step in each sample in the supervised learning sample set is used as the input feature, and the actual photovoltaic power data of the future preset prediction step in each sample is used as the output feature. The sample is the preprocessed historical operating data. The model storage and retrieval module is used to construct a CNN-LSTM-Attention hybrid prediction model. It employs a porcupine optimization algorithm to optimize the hyperparameters of the CNN-LSTM-Attention hybrid prediction model, obtaining the optimal hyperparameter combination, and then assigns this optimal hyperparameter combination to the CNN-LSTM-Attention hybrid prediction model. The CNN-LSTM-Attention hybrid prediction model includes a CNN feature extraction layer, an LSTM temporal modeling layer, an Attention mechanism layer, and an output layer connected sequentially. The porcupine optimization algorithm involves introducing chaotic mapping to perturb the individual positions within the porcupine population after the population's position is updated. The prediction execution module is connected to the sample construction module and the model storage and retrieval module, respectively. It is used to train the assigned CNN-LSTM-Attention hybrid prediction model using the supervised learning sample set, determine the trained photovoltaic power prediction model, and input the data to be predicted into the trained photovoltaic power prediction model to determine the photovoltaic power prediction value at future time points.

9. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the photovoltaic power ultra-short-term prediction method according to any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the photovoltaic power ultra-short-term prediction method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Unmanned aerial vehicle task allocation method based on chaotic mapping crown porcupine optimization algorithm

    CN118795930A

  • Outdoor two-wheeled robot path planning method based on improved crown porcupine optimization algorithm

    CN119509567A

  • Photovoltaic power generation prediction method based on deep learning

    CN120090172A

  • Short-term power load prediction method

    CN120300774A