Photovoltaic power prediction method and system based on Bayesian parameter optimization

By adopting the Bayesian parameter optimization method in the field of photovoltaic power generation, combined with CNN, LSTM and attention mechanism, the problem of low accuracy of photovoltaic power generation power prediction is solved, high-precision photovoltaic power generation power prediction is achieved, and the respective capabilities of the model are fully utilized. Advantages.

CN118630744APending Publication Date: 2024-09-10STATE GRID HENAN ELECTRIC POWER ELECTRIC POWER SCI RES INST +1
View PDF 0 Cites 8 Cited by

Patent Information

Application Number
CN202410723957.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

The accuracy of photovoltaic power generation prediction in the existing technology is low, and it is difficult to achieve high-precision prediction due to limitations such as data quality, influencing factors and modeling methods.

Method used

A photovoltaic power prediction method based on Bayesian parameter optimization is used, combining CNN, LSTM and attention mechanism to build a photovoltaic power generation prediction model, and the hyperparameters are optimized through Bayesian optimization algorithm to improve prediction accuracy.

Benefits of technology

Bayesian parameter optimization combines the advantages of CNN, LSTM and attention mechanism to achieve high-precision prediction of photovoltaic power generation, improving the prediction accuracy and model generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118630744A
    Figure CN118630744A
Patent Text Reader

Abstract

The invention discloses a photovoltaic power prediction method and system based on Bayesian parameter optimization. The method comprises the following steps: acquiring a historical photovoltaic data set, preprocessing the historical photovoltaic data set, and dividing the historical photovoltaic data set into a training set, a verification set and a test set; constructing a photovoltaic power generation power prediction model which sequentially comprises an input layer, a convolutional layer, a first dropout layer, an LSTM layer, a second dropout layer, an attention layer and a full connection layer, initializing model hyper-parameters, training the photovoltaic power generation power prediction model by using the hyper-parameters and the training set, and based on the trained model, obtaining a prediction result of the photovoltaic power generation power, performing photovoltaic power data prediction by using the test set; and performing hyper-parameter optimization on the photovoltaic power generation power prediction model by using a Bayesian optimization algorithm, inputting the optimized hyper-parameter into the photovoltaic power generation power prediction model so as to predict the photovoltaic power data again, and outputting a prediction result. According to the scheme, high-precision prediction of the photovoltaic power generation power is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of photovoltaic power generation, and in particular relates to a photovoltaic power prediction method and system based on Bayesian parameter optimization. Background Art

[0002] Photovoltaic power generation prediction is related to the power dispatch and demand balance of the power system. In order to better optimize energy dispatch, improve power generation efficiency and reduce energy costs, improving the prediction accuracy of photovoltaic power generation is of great practical significance. However, data quality, power-related influencing factors, modeling methods and other aspects will affect the final prediction accuracy of photovoltaic power generation. Summary of the invention

[0003] In order to solve the deficiencies in the prior art, the present invention provides a photovoltaic power prediction method and system based on Bayesian parameter optimization to solve the technical problem of high-precision prediction of photovoltaic power generation.

[0004] To solve the above technical problems, the present invention utilizes the following technical solutions.

[0005] The present invention first discloses a photovoltaic power prediction method based on Bayesian parameter optimization, which comprises the following steps:

[0006] Acquire a historical photovoltaic data set, preprocess the historical photovoltaic data set, and divide the historical photovoltaic data set into a training set, a validation set, and a test set;

[0007] Constructing a photovoltaic power generation prediction model, the photovoltaic power generation prediction model sequentially comprising an input layer, a convolutional layer, a first dropout layer, an LSTM layer, a second dropout layer, an attention layer, and a fully connected layer, initializing model hyperparameters, training the photovoltaic power generation prediction model using the hyperparameters and the training set, and predicting photovoltaic power data for the test set based on the trained model;

[0008] The photovoltaic power generation prediction model is optimized for hyperparameters using a Bayesian optimization algorithm, and the optimized hyperparameters are input into the photovoltaic power generation prediction model to re-predict the photovoltaic power data and output a prediction result.

[0009] The present invention further includes the following preferred embodiments:

[0010] The attention layer multiplies the input sequence by the weight matrix and applies the softmax function to convert the vector into a probability distribution σ, and then weights the probability distribution and the corresponding value to get the final output; where the probability distribution represents the weight or attention score of each position, the sum of the weights of all positions is equal to 1, and the weight of each position is in the range of 0 to 1;

[0011]

[0012] in is the input vector, z i and z j are the elements of the i-th and j-th input vectors in the K set; e is a natural constant; K is the number of real numbers in the vector set.

[0013] After predicting photovoltaic power data for the test set, the method further includes:

[0014] The mean absolute error MAE between the true value and the predicted value is used as the loss value and used as the objective function in the optimization process:

[0015]

[0016] Where N is the number of data, Y i is the real value of photovoltaic power data, is the predicted value of photovoltaic power data, and MAE is the mean absolute error.

[0017] The method of using the Bayesian optimization algorithm to optimize the hyperparameters of the photovoltaic power generation prediction model further includes:

[0018] Using the TPE algorithm as a probabilistic proxy model for Bayesian optimization, the likelihood distribution is redefined as:

[0019]

[0020] where n * =min{(x 1 ,y 1 ),…,(x i ,y i )} is the optimal value in the sample domain, l(m) represents the loss function corresponding to the observation value m is less than n * The density estimate of g(m) represents the loss function corresponding to the observation m greater than or equal to n * Density estimation of ;

[0021] Using expected improvement EI as the acquisition function, substituting p(m,n) into the EI formula is:

[0022]

[0023] Where γ=p(n<n * );

[0024] The maximum EI value is obtained when the parameter m has the maximum probability l(m) and the minimum probability g(m); the TPE algorithm returns the m that can achieve the maximum EI value in each iteration process. * :

[0025] m *= argmax EI y *(m);

[0026] The Bayesian optimization algorithm is used to find the minimum mean absolute error to determine the optimal parameter combination that gives the model the highest prediction accuracy.

[0027] The posterior probability distribution and the hyperparameter combination of the objective function are iteratively updated until a predefined iteration termination condition or an early termination condition is met.

[0028] The present invention also discloses a photovoltaic power prediction system based on Bayesian parameter optimization using the above photovoltaic power prediction method based on Bayesian parameter optimization, comprising:

[0029] A data set acquisition module, used to acquire a historical photovoltaic data set, preprocess the historical photovoltaic data set, and divide the historical photovoltaic data set into a training set, a validation set, and a test set;

[0030] A prediction model construction module is used to construct a photovoltaic power prediction model, wherein the photovoltaic power prediction model includes an input layer, a convolution layer, a first dropout layer, an LSTM layer, a second dropout layer, an attention layer, and a fully connected layer in sequence, initialize the model hyperparameters, train the photovoltaic power prediction model using the hyperparameters and the training set, and perform photovoltaic power data prediction on the test set based on the trained model;

[0031] The model parameter optimization module is used to optimize the hyperparameters of the photovoltaic power generation prediction model using a Bayesian optimization algorithm, input the optimized hyperparameters into the photovoltaic power generation prediction model to re-predict the photovoltaic power data and output the prediction results.

[0032] Accordingly, the present application also discloses a terminal, including a processor and a storage medium;

[0033] The storage medium is used to store instructions;

[0034] The processor is used to operate according to the instructions to execute the steps of the photovoltaic power prediction method based on Bayesian parameter optimization.

[0035] Correspondingly, the present application also discloses a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the aforementioned photovoltaic power prediction method based on Bayesian parameter optimization are implemented.

[0036] The beneficial effect of the present invention is that, compared with the prior art, the present invention provides a photovoltaic power prediction method and system based on Bayesian parameter optimization, which combines CNN, LSTM and attention mechanism to form a combined prediction model through Bayesian parameter optimization, CNN and LSTM extract the spatial relationship and time series information of photovoltaic power data and related feature data, and the attention mechanism highlights the important influencing factors at the current moment. The Bayesian optimization algorithm continuously iterates and updates the model through the two parts of the probability proxy function and the acquisition function, efficiently realizes the hyperparameter combination optimization work, gives full play to the respective advantages of the three network models, and realizes the high-precision prediction of photovoltaic power generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a flow chart of the photovoltaic power prediction method based on Bayesian parameter optimization in the present invention.

[0038] Figure 2 It is a schematic diagram of the CNN-LSTM-Attention network structure in the present invention.

[0039] Figure 3 It is the Bayesian optimization principle diagram in the present invention.

[0040] Figure 4 It is a hyperparameter flow chart of the Bayesian optimization prediction model in the present invention. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solution and advantages of the present invention more clear, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0042] The embodiments described in this application are only some embodiments of the present invention, not all embodiments. Based on the spirit of the present invention, other embodiments obtained by ordinary technicians in this field without creative work are all within the protection scope of the present invention.

[0043] In view of the shortcomings of the prior art, the present invention proposes a photovoltaic power prediction method and system based on Bayesian parameter optimization. Firstly, the DKASC historical photovoltaic data set is used for experiments, and the relevant algorithms are used to screen important features of the data set, detect and process abnormal data, and smooth and normalize the data; then the preprocessed data set is divided into three parts: training set, validation set and test set, and the established CNN-LSTM-Attention model is used to realize model training and power data prediction; finally, the Bayesian optimization algorithm is introduced to optimize the hyperparameters of the initially established model, and the prediction results of the final optimized model are obtained and evaluated.

[0044] The photovoltaic power prediction method based on Bayesian parameter optimization disclosed in the present invention comprises the following steps:

[0045] like Figure 1 As shown, step 1: obtain a historical photovoltaic data set, preprocess the historical photovoltaic data set, and divide the historical photovoltaic data set into a training set, a validation set, and a test set.

[0046] First, the DKASC historical photovoltaic data set is used for experiments. The original data related to photovoltaic power generation from August 2013 to February 2014 is used. The data collection frequency is 5 minutes, with 288 sampling points per day, totaling 49,998 data. The preprocessing algorithm is used to screen important features of the data set, detect and process abnormal data, and smooth and normalize the data. Figure 1 As shown in the figure, after preprocessing, the data set is divided into three parts: training set, validation set and test set.

[0047] Step 2: Construct a photovoltaic power generation prediction model, which includes an input layer, a convolutional layer, a first dropout layer, an LSTM layer, a second dropout layer, an attention layer and a fully connected layer in sequence, initialize the model hyperparameters, use the hyperparameters and the training set to train the photovoltaic power generation prediction model, and based on the trained model, predict the photovoltaic power data for the test set.

[0048] The advantage of CNN is that it can effectively extract features from input data, and is especially suitable for data with local properties. However, because the convolution operation will destroy the time series relationship, it is not suitable for processing time series data. LSTM overcomes the gradient vanishing problem of the standard recurrent neural network (RNN), can handle long-term dependencies, has good memory ability, and is suitable for processing time series data, but if the training time is long, it is prone to overfitting problems. The attention mechanism is equivalent to a combination function, which can assign different attention weights to different parts of the input sequence at different time steps or positions. Compared with other models, it can not only better capture the long-term dependencies in historical data, but also adapt to different time and space scales. Based on the above characteristics analysis, the present invention proposes a combined prediction model that combines CNN, LSTM and attention mechanism, giving full play to the respective advantages of the three network models to achieve high-precision prediction of photovoltaic power generation. The structural diagram of the CNN-LSTM-Attention prediction model is shown in the figure. Figure 2 shown.

[0049] like Figure 2As shown, the CNN-LSTM-Attention prediction model of the present invention includes an input layer, a convolutional layer, an LSTM layer, a dropout layer, an attention layer, and a fully connected layer. Each network layer will be described in detail below.

[0050] The input layer is used to convert the input data into an input sequence that meets the requirements, so the number of nodes in the input layer is related to the feature dimension of the input sequence;

[0051] The convolution layer uses a one-dimensional convolution method to capture local features at different positions of the input sequence. Its principle is based on the convolution operation. The convolution layer uses multiple convolution kernels (which can be regarded as small filters) to slide on the input data for convolution operations, multiply the convolution kernels by the input data element by element, and sum the results to obtain the value of the corresponding position representing a certain local feature of the data. In principle, the number of convolution kernels, the size of the convolution kernels, and the value of the sliding step are all related to the final effect of the convolution layer data processing.

[0052] The model designed by the present invention uses multiple convolution kernels of size 1 to perform convolution operations (also known as point convolutions), and it is expected that while reducing the dimension of the input data, multiple features can be integrated and interacted, so as to achieve the purpose of reducing the complexity of the model and improving the network representation ability. In order to further enhance the network's understanding and representation ability of the input data, the present invention adds a nonlinear activation function after the convolution operation to increase the network's nonlinear expression ability and feature differentiation ability. In the point convolution operation, the sliding step size is no longer of practical significance, so the selection of the number of convolution kernels is very important. In a specific example, the number of convolution kernels is obtained by trial and error. If the number is too small, the feature extraction ability of the convolution layer will be impaired. If the number is too large, the complexity of the model will be increased, and it is easy to cause the overfitting problem of the model, resulting in a decrease in the generalization ability of the model. The LSTM (Long Short-Term Memory Network) layer is used to process the feature sequence output from the convolution layer, effectively modeling the long-term dependencies in the sequence data. The LSTM unit consists of a forget gate, an input gate, and an output gate. The three gates enable the LSTM unit to protect and control the memory unit and selectively retain or forget information. Irrelevant information in the propagation process will be forgotten and discarded. The forget gate determines which information in the cell state needs to be forgotten based on the current input and the hidden state at the previous moment; the input gate determines which information needs to be updated and stored in the state based on the current input and the hidden state at the previous moment; the output gate determines the hidden state and output at the current moment based on the current input and the hidden state at the previous moment, as well as the updated state. The number of LSTM units or the size of the hidden layer also affects the performance of the LSTM layer. In the specific example, the number of LSTM units is obtained by trial and error. If the number of LSTM units is too small, the model may be underfitted and unable to fully learn the complexity of the data. On the contrary, if the number of LSTM units is too large, it may lead to overfitting, making the model overly dependent on the training data and unable to generalize to new data.

[0053] The first and second dropout layers are used to prevent the network model from overfitting. During each training, the dropout layer will randomly delete some neurons and their connections from the neural network with a certain probability (dropout regularization parameter), that is, the weights of these neurons and their connections are set to 0, and then training is performed. This can break the dependency between neurons, so that each neuron has a chance to play a role and improve the generalization ability of the model. In the above process, the setting of the dropout regularization parameter is closely related to the final model training effect. The appropriate dropout regularization parameter can reduce the overfitting of the neural network to the training data and reduce the dependency between neurons, but if it is improperly set, it will slow down the model training speed and even cause underfitting. In a specific example, the dropout regularization parameter is obtained by trial and error. The present invention adds the first and second dropout layers after the convolutional layer and the LSTM layer, respectively, and therefore includes two dropout regularization parameters, denoted as drop_C (regularization parameter of the dropout layer after the convolutional layer) and drop_L (regularization parameter of the dropout layer after the LSTM).

[0054] The attention layer calculates the attention weights for each time step or position based on the LSTM output to enhance the model's ability to focus on different parts of the input sequence and extract key information. The attention layer multiplies the input sequence with the weight matrix and applies the softmax function to convert the vector into a probability distribution σ, and then weights the probability distribution and the corresponding value to get the final output. The probability distribution represents the weight or attention score of each position, the sum of the weights of all positions is equal to 1, and the weight of each position is in the range of 0 to 1.

[0055]

[0056] in is the input vector, z i and z j are the elements of the i-th and j-th input vectors in the K set; e is a natural constant; K is the number of real numbers in the vector set;

[0057] The fully connected layer maps the output of the attention layer to the final output space to obtain the final output result. The network structure designed by the present invention uses the fully connected layer as the final output layer, and its dimension is the same as the output data dimension.

[0058] After building the prediction model, define the hyperparameters that need to be optimized and set the parameter space, i.e. the value range.

[0059] The initialized hyperparameters are substituted into the photovoltaic power prediction model, namely the above-mentioned CNN-LSTM-Attention model. The training set is first input for model training, and then the test set is input to use the trained model to predict power data. The mean absolute error (MAE) between the true value and the predicted value is returned as the loss value, which is used as the objective function in the optimization process.

[0060]

[0061] Where N is the number of data, Y i is the real value of photovoltaic power data, is the predicted value of photovoltaic power data, and MAE is the mean absolute error.

[0062] Step 3: Utilize the Bayesian optimization algorithm to optimize the hyperparameters of the photovoltaic power generation prediction model, input the optimized hyperparameters into the photovoltaic power generation prediction model, re-predict the photovoltaic power data, and output the prediction results.

[0063] The core idea of ​​the Bayesian optimization algorithm is to combine Bayesian statistics and probability modeling when a limited number of sample points are known, and to find the optimal solution of the function by constructing the posterior probability of the output of the black box function within a limited number of iterations.

[0064]

[0065] Where D = {(x 1 ,y 1 ),…,(x i ,y i )} represents a known sample point. p(y) and p(y|D) represent the prior probability distribution and likelihood distribution of y, respectively, and p(y|D) represents the posterior probability distribution.

[0066] The Bayesian optimization algorithm mainly consists of two key components: the probabilistic surrogate model and the acquisition function. The probabilistic surrogate model is used to establish a probabilistic model to estimate the approximate value of the objective function. The acquisition function is used to balance between the unknown area and the area where the optimal result has been observed to select appropriate sample points to obtain the maximum or minimum value of the objective function. Figure 3 This is a schematic diagram of the basic principle of Bayesian optimization. Figure 3As shown in the figure, the actual distribution of the objective function is unknown. First, a number of actual sampling points are randomly selected on the objective function, and the probabilistic proxy model obtains an estimate of the objective function based on the limited sampling points; the acquisition function measures the influence of the sampling points on the estimated objective function, and selects the point with the greatest influence as the next sampling point to perform the next observation, and generally selects the point with the largest acquisition function value; when a new sampling point is obtained, the proxy model can be updated and the acquisition function can be recalculated to determine the next sampling point again; the above process is repeated until the termination condition is reached, and finally a distribution that is highly approximate to the actual objective function is obtained, and the approximate maximum or minimum value of the objective function is determined.

[0067] Traditional probabilistic proxy models usually choose Gaussian process models, but the computational cost is very high and the optimization performance is poor for large data sets and high-dimensional spaces. The tree-structured probability density estimation (TPE) algorithm is more efficient, robust and adaptable than the Gaussian process due to its unique tree structure. The present invention chooses the TPE algorithm as the probabilistic proxy model for Bayesian optimization. TPE redefines the likelihood distribution p(D|y) as:

[0068]

[0069] Where n * =min{(x 1 ,y 1 ),...,(x i ,y i )} is the optimal value in the sample domain, l(m) represents the loss function corresponding to the observation value m is less than n * The density estimate of g(m) represents the loss function corresponding to the observation m greater than or equal to n * The density estimate of .

[0070] Using expected improvement (EI) as the acquisition function, substituting p(m,n) into the EI formula is:

[0071]

[0072] Let γ=p(n<n * ),but:

[0073] p(m)=∫ R p(m|n)p(n)dn=γl(m)-(1-γ)g(m)

[0074]

[0075] Substituting in, we get:

[0076]

[0077] The symbol ∝ indicates that the value of EI is proportional to l(m) / g(m), that is, when parameter m has the maximum probability of l(m) and the minimum probability of g(m), the maximum EI value is obtained. The TPE algorithm returns the m that can achieve the maximum EI value in each iteration. * :

[0078] m*=argmax EI y* (m) The Bayesian optimization algorithm is used to find the minimum mean absolute error to determine the optimal parameter combination that gives the model the highest prediction accuracy.

[0079] The maximum number of iterations and early termination condition parameters of the objective function are defined; the posterior probability distribution and hyperparameter combination of the objective function are iteratively updated until the iteration termination condition or the early termination condition is met. Figure 4 This is a flowchart for optimizing the hyperparameters of the photovoltaic power generation prediction model based on the TPE Bayesian optimization algorithm. Using the optimized hyperparameters, the final optimized model prediction results are determined and evaluated.

[0080] The beneficial effect of the present invention is that, compared with the prior art, the present invention provides a photovoltaic power prediction method and system based on Bayesian parameter optimization, which combines CNN, LSTM and attention mechanism to form a combined prediction model through Bayesian parameter optimization, CNN and LSTM extract the spatial relationship and time series information of photovoltaic power data and related feature data, and the attention mechanism highlights the important influencing factors at the current moment. The Bayesian optimization algorithm continuously iterates and updates the model through the two parts of the probability proxy function and the acquisition function, efficiently realizes the hyperparameter combination optimization work, gives full play to the respective advantages of the three network models, and realizes the high-precision prediction of photovoltaic power generation.

[0081] The present invention may be a system, a method and / or a computer program product. The present invention also discloses a photovoltaic power prediction system based on Bayesian parameter optimization based on the aforementioned photovoltaic power prediction method based on Bayesian parameter optimization, comprising:

[0082] A data set acquisition module, used to acquire a historical photovoltaic data set, preprocess the historical photovoltaic data set, and divide the historical photovoltaic data set into a training set, a validation set, and a test set;

[0083] A prediction model construction module is used to construct a photovoltaic power prediction model, wherein the photovoltaic power prediction model includes an input layer, a convolution layer, a first dropout layer, an LSTM layer, a second dropout layer, an attention layer, and a fully connected layer in sequence, initialize the model hyperparameters, train the photovoltaic power prediction model using the hyperparameters and the training set, and perform photovoltaic power data prediction on the test set based on the trained model;

[0084] The model parameter optimization module is used to optimize the hyperparameters of the photovoltaic power generation prediction model using a Bayesian optimization algorithm, input the optimized hyperparameters into the photovoltaic power generation prediction model to re-predict the photovoltaic power data and output the prediction results.

[0085] Based on the spirit of the present invention, those skilled in the art can easily think that a computer program product can be obtained based on the aforementioned photovoltaic power prediction method based on Bayesian parameter optimization. The computer program product may include a computer-readable storage medium, which carries computer-readable program instructions for enabling a processor to implement various aspects of the present invention. That is, the present application also includes a terminal, including a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute the steps of the aforementioned photovoltaic power prediction method based on Bayesian parameter optimization.

[0086] Computer readable storage medium can be a tangible device that can keep and store the instructions used by the instruction execution device. Computer readable storage medium can be, for example, - but not limited to - electrical storage device, magnetic storage device, optical storage device, electromagnetic storage device, semiconductor storage device or any suitable combination of the above. More specific examples (non-exhaustive list) of computer readable storage medium include: portable computer disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, for example, punch card or groove protrusion structure with instructions stored thereon and any suitable combination of the above. Computer readable storage medium used here is not interpreted as instantaneous signal itself, such as radio wave or other free propagating electromagnetic wave, electromagnetic wave propagated by waveguide or other transmission medium (for example, light pulse by optical fiber cable) or electrical signal transmitted by wire.

[0087] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0088] The computer program instructions for performing the operation of the present invention may be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.

[0089] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A photovoltaic power prediction method based on Bayesian parameter optimization, characterized in that: The following steps are involved: Acquire a historical photovoltaic data set, preprocess the historical photovoltaic data set, and divide the historical photovoltaic data set into a training set, a validation set, and a test set; Constructing a photovoltaic power generation prediction model, the photovoltaic power generation prediction model sequentially comprising an input layer, a convolutional layer, a first dropout layer, an LSTM layer, a second dropout layer, an attention layer, and a fully connected layer, initializing model hyperparameters, training the photovoltaic power generation prediction model using the hyperparameters and the training set, and predicting photovoltaic power data for the test set based on the trained model; The photovoltaic power generation prediction model is optimized for hyperparameters using a Bayesian optimization algorithm, and the optimized hyperparameters are input into the photovoltaic power generation prediction model to re-predict the photovoltaic power data and output a prediction result.

2. The photovoltaic power prediction method based on Bayesian parameter optimization according to claim 1 is characterized in that: The attention layer multiplies the input sequence by the weight matrix and applies the softmax function to convert the vector into a probability distribution σ, and then weighted sums the probability distribution with the corresponding value to obtain the final output; The probability distribution represents the weight or attention score of each position, the sum of the weights of all positions is equal to 1, and the weight of each position is in the range of 0 to 1; in is the input vector, z i and z j are the elements of the i-th and j-th input vectors in the K set; e is a natural constant; K is the number of real numbers in the vector set.

3. The photovoltaic power prediction method based on Bayesian parameter optimization according to claim 2 is characterized in that: After predicting photovoltaic power data for the test set, the method further includes: The mean absolute error MAE between the true value and the predicted value is used as the loss value and used as the objective function in the optimization process: Where N is the number of data, Y i is the real value of photovoltaic power data, is the predicted value of photovoltaic power data, and MAE is the mean absolute error.

4. The photovoltaic power prediction method based on Bayesian parameter optimization according to claim 3 is characterized in that: The method of using the Bayesian optimization algorithm to optimize the hyperparameters of the photovoltaic power generation prediction model further includes: Using the TPE algorithm as a probabilistic proxy model for Bayesian optimization, the likelihood distribution is redefined as: where n * =min{(x1,y1),…,(x i ,y i )} is the optimal value in the sample domain, l(m) represents the loss function corresponding to the observation value m is less than n * The density estimate of g(m) represents the loss function corresponding to the observation m greater than or equal to n * Density estimation of ; Using expected improvement EI as the acquisition function, substituting p(m,n) into the EI formula is: Where γ=p(n<n * ); The maximum EI value is obtained when the parameter m has the maximum probability l(m) and the minimum probability g(m); the TPE algorithm returns the m that can achieve the maximum EI value in each iteration process. * : m * =argmax EI y* (m); The Bayesian optimization algorithm is used to find the minimum mean absolute error to determine the optimal parameter combination that makes the model prediction most accurate. The posterior probability distribution and the hyperparameter combination of the objective function are iteratively updated until a predefined iteration termination condition or an early termination condition is met.

5. A photovoltaic power prediction system based on Bayesian parameter optimization, characterized in that: include: A data set acquisition module, used to acquire a historical photovoltaic data set, preprocess the historical photovoltaic data set, and divide the historical photovoltaic data set into a training set, a validation set, and a test set; A prediction model construction module is used to construct a photovoltaic power prediction model, wherein the photovoltaic power prediction model includes an input layer, a convolution layer, a first dropout layer, an LSTM layer, a second dropout layer, an attention layer, and a fully connected layer in sequence, initialize the model hyperparameters, train the photovoltaic power prediction model using the hyperparameters and the training set, and perform photovoltaic power data prediction on the test set based on the trained model; The model parameter optimization module is used to optimize the hyperparameters of the photovoltaic power generation prediction model using a Bayesian optimization algorithm, input the optimized hyperparameters into the photovoltaic power generation prediction model to re-predict the photovoltaic power data and output the prediction results.

6. The photovoltaic power prediction system based on Bayesian parameter optimization according to claim 5, characterized in that: The attention layer multiplies the input sequence by the weight matrix and applies the softmax function to convert the vector into a probability distribution σ, and then weighted sums the probability distribution with the corresponding value to obtain the final output; The probability distribution represents the weight or attention score of each position, the sum of the weights of all positions is equal to 1, and the weight of each position is in the range of 0 to 1; in is the input vector, z i and z j are the elements of the i-th and j-th input vectors in the K set; e is a natural constant; K is the number of real numbers in the vector set.

7. The photovoltaic power prediction system based on Bayesian parameter optimization according to claim 6, characterized in that: The prediction model building module is further used to: The mean absolute error MAE between the true value and the predicted value is used as the loss value and used as the objective function in the optimization process: Where N is the number of data, Y i is the real value of photovoltaic power data, is the predicted value of photovoltaic power data, and MAE is the mean absolute error.

8. The photovoltaic power prediction system based on Bayesian parameter optimization according to claim 7, characterized in that: The model parameter optimization module is further used to: Using the TPE algorithm as a probabilistic proxy model for Bayesian optimization, the likelihood distribution is redefined as: where n * =min{(x1,y1),…,(x i ,y i )} is the optimal value in the sample domain, l(m) represents the loss function corresponding to the observation value m is less than n * The density estimate of g(m) represents the loss function corresponding to the observation m greater than or equal to n * Density estimation of ; Using expected improvement EI as the acquisition function, substituting p(m,n) into the EI formula is: Where γ=p(n<n * ); The maximum EI value is obtained when the parameter m has the maximum probability l(m) and the minimum probability g(m); the TPE algorithm returns the m that can achieve the maximum EI value in each iteration process. * : m * =argmax EI y* (m); The Bayesian optimization algorithm is used to find the minimum mean absolute error to determine the optimal parameter combination that makes the model prediction most accurate. The posterior probability distribution and the hyperparameter combination of the objective function are iteratively updated until a predefined iteration termination condition or an early termination condition is met.

9. A terminal comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is used to operate according to the instruction to execute the steps of the photovoltaic power prediction method based on Bayesian parameter optimization according to any one of claims 1 to 4.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the photovoltaic power prediction method based on Bayesian parameter optimization described in any one of claims 1 to 4 are implemented.

Citation Information

Cited By

  • Short-term photovoltaic power generation power prediction method based on BO-TCN-BiLSTM

    CN119204736A

  • Short-term power prediction method and system based on Bayesian optimization hybrid neural network

    CN119340980A

  • Water plant ultra-short-term water supply quantity prediction method and system based on time multi-scale characteristics

    CN119599159A

  • Photovoltaic power generation power prediction method and system based on multi-source heterogeneous feature fusion

    CN119627883A

  • Photovoltaic power generation power prediction method and system based on multi-source heterogeneous feature fusion

    CN119627883B