Construction method and device of power prediction model, computer equipment and storage medium

By constructing a double-layer optimized wind power power prediction model based on reweighting strategy, the problem of poor prediction results in extreme weather is solved, and good prediction results and economical wind power prediction are achieved in extreme weather.

CN120408182APending Publication Date: 2025-08-01GUIZHOU POWER GRID CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510303986.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

The existing deep learning model has poor wind power power prediction under complex extreme weather conditions, and the traditional method has high computational cost and limited efficiency.

Method used

Build a power prediction model, obtain historical meteorological data and historical power data of the target wind farm, perform sample annotation and feature screening, build a preset power prediction model, and perform double-layer optimization based on reweighting strategy, adjust the penalty weight to focus on extreme weather samples, and optimize model parameters.

Benefits of technology

It improves the sensitivity of the model to extreme weather events, can have good prediction results in both normal and extreme weather, reduces the calculation cost of separately modeling under different weather conditions, and provides economical and reliable wind power prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120408182A_ABST
    Figure CN120408182A_ABST
Patent Text Reader

Abstract

The invention discloses a power prediction model construction method and device, computer equipment and a storage medium, and belongs to the technical field of clean energy, and the method comprises the steps: obtaining historical meteorological data and historical power data of a target wind power station; performing sample labeling and feature screening on the historical meteorological data and the historical power data to obtain a feature data set composed of target historical meteorological data and corresponding target historical power data; constructing a preset power prediction model based on the feature data set and performing model training to obtain a power prediction basic model; and performing double-layer optimization based on a re-weighting strategy on the power prediction basic model to obtain a power prediction model. According to the method, the penalty weight is automatically adjusted by adopting a double-layer optimization mode of a re-weighting strategy, so that the model can adaptively pay attention to an extreme weather sample, and the sensitivity of the model to an extreme weather event is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of clean energy, and particularly to a method, apparatus, computer device, and storage medium for constructing a power prediction model. Background Art

[0002] Deep learning algorithms exhibit superior performance in feature extraction and reconstruction. They can learn feature information based on the massive data of a wind farm. By inputting optimized samples and fusing information, the algorithms specifically represent historical data according to rules, thereby constructing a coupling relationship between features and power for future power prediction tasks.

[0003] The wind power prediction method based on deep learning depends on the availability of rich and high-quality data sets. However, due to the existence of complex extreme weather, the wind power historical data set under complex extreme weather is unbalanced, and it is necessary to process a small number of samples.

[0004] Currently, deep learning models have not directly addressed the challenges of wind power prediction under rare complex extreme weather events. The common approach is to distinguish extreme weather samples from normal weather samples through methods such as weather clustering, and train models separately to meet the prediction requirements under different weather conditions. Although this method can obtain good prediction results, its computational cost is high and the efficiency is limited. Summary of the Invention

[0005] To solve the above technical problems, a method for constructing a power prediction model is proposed, including obtaining historical meteorological data and historical power data of a target wind farm;

[0006] Performing sample annotation and feature screening on the historical meteorological data and the historical power data to obtain a feature data set composed of target historical meteorological data and corresponding target historical power data; wherein, the actual correlation degree between the target historical meteorological data and the historical power data is greater than a preset correlation degree, and the feature data set includes the first historical meteorological data and the first historical power data corresponding to the first preset weather type;

[0007] Constructing a preset power prediction model based on the feature data set and performing model training to obtain a power prediction basic model;

[0008] Performing double-layer optimization on the power prediction basic model based on a reweighting strategy. During the double-layer optimization process, updating the weighted loss function and model parameters of the power prediction basic model based on the prediction error of the power prediction basic model to minimize the loss function of the power prediction basic model, and updating the weights and model parameters during the prediction of the power prediction basic model to minimize the prediction error of the power prediction basic model, thereby obtaining a power prediction model.

[0009] As a preferred solution of the method for constructing the power prediction model according to the present invention, wherein: the double-layer optimization of the power prediction basic model based on the reweighting strategy includes:

[0010] Partition the feature data set to obtain an evaluation set; wherein, the evaluation set at least includes any one of the first historical meteorological data and the corresponding first historical power data;

[0011] Initialize the weights of each training sample in the feature data set to obtain initial weights; wherein, the initial weights are positively correlated with the preset errors of each training sample when the model is trained in a mini-batch mode;

[0012] Perform an inner loop on the power prediction basic model. During the inner loop, optimize the weighted loss function of the power prediction basic model based on the stochastic gradient descent method, and update the model parameters of the power prediction basic model;

[0013] Perform an outer loop on the power prediction basic model. During the outer loop, perform gradient descent in a mini-batch mode based on the evaluation set to adjust the initial weights to obtain corrected weights; wherein, the corrected weights are not less than zero;

[0014] Update the power prediction basic model based on the corrected weights to obtain the power prediction model.

[0015] As a preferred solution of the method for constructing the power prediction model according to the present invention, wherein: the optimization of the weighted loss function of the power prediction basic model based on the stochastic gradient descent method includes:

[0016] In each training iteration process t, sample a mini-batch training sample of size n, and n << N, denoted as,

[0017]

[0018] where N is the size of the total data set, n is the size of a mini-batch training sample D batch and i represents the i-th sample in D batch ;

[0019] Optimize the weighted loss function of the power prediction basic model based on the stochastic gradient descent method using Equation (1):

[0020] l i,w (θ) = w i ·l i (θ) (1)

[0021] Among them, l i,w (θ) represents the optimized weighted loss function, and w i represents the weight of the prediction error of the i-th training sample, and l i (θ) represents the current loss function of the power prediction basic model;

[0022] The model parameters are updated based on the random gradient descent method using Equation (2):

[0023]

[0024] Among them, represents the model parameters updated by the random gradient descent method in the (t + 1)-th iteration, and θ t represents the model parameters of the t-th iteration of the power prediction basic model, and w i,t ·l i (θ t ) represents the optimized weighted loss function, φ represents the learning rate, represents the gradient of the loss function.

[0025] As a preferred solution of the method for constructing the power prediction model according to the present invention, wherein: the gradient descent is performed on the evaluation set in a mini-batch mode to adjust the initial weight to obtain a corrected weight, including:

[0026] Gradient descent is performed on each of the training samples in the feature dataset based on the evaluation set to obtain the first weight of each of the training samples; specifically, the initial weight is updated using Equation (3) to obtain the first weight of each sample in the evaluation set:

[0027]

[0028] Among them, w i,t represents the initial weight of the i-th training sample, represents the first weight of the i-th training sample, η represents the descent step size, m represents the total number of samples included in the evaluation set, j represents the j-th sample included in the evaluation set, is the loss of the evaluation sample under the updated model parameters;

[0029] The first weight is non-negatively corrected to obtain a second weight; specifically, the first weight is corrected using Equation (4):

[0030]

[0031] Among them, represents the second weight, Represents the first weight;

[0032] Normalize the second weight to obtain the corrected weight; specifically, use Equation (5) to normalize the second weight:

[0033]

[0034] where w i,t+1 represents the corrected weight, represents the second weight, δ is a constant term, and j represents the j-th sample included in the evaluation set;

[0035] Updating the power prediction basic model based on the corrected weight includes: updating the model parameters using Equation (6):

[0036]

[0037] where θ t+1 represents the updated model parameters, θ t represents the model parameters before the previous update, w i,t+1 ·l i (θ t ) represents the weighted loss function obtained based on the corrected weight.

[0038] As a preferred solution of the method for constructing the power prediction model of the present invention, wherein: after performing the two-layer optimization of the power prediction basic model based on the reweighting strategy, the method for constructing the power prediction model further includes:

[0039] Obtain the first historical meteorological data and the first historical power data corresponding to the preset weather type;

[0040] [[ID=4l]]Input the first historical meteorological data into the power prediction model, freeze the first preset module of the power prediction basic model, and adjust the module parameters of the second preset module of the power prediction model so that the prediction result of the adjusted power prediction model has an actual error less than the preset error with the first historical power data; wherein, the first preset module is composed of the first N layers of the power prediction model, and the second preset module is composed of the last M layers of the power prediction model.

[0041] As a preferred solution of the method for constructing the power prediction model of the present invention, wherein: the sample annotation and feature screening of the historical meteorological data and the historical power data include:

[0042] Obtain the preset meteorological judgment factors corresponding to the first preset weather types; wherein, the first preset weather types include cold snaps, low-temperature icing, and strong winds, and the preset meteorological judgment factors include the meteorological judgment characteristics and meteorological judgment values corresponding to each of the preset weather types;

[0043] Based on the preset meteorological judgment factors, divide the historical meteorological data to obtain the first historical meteorological data corresponding to the first preset weather type and the second historical meteorological data corresponding to the second weather type;

[0044] Based on the timestamps of the first historical meteorological data and the second historical meteorological data respectively, label the historical power data to obtain a labeling result;

[0045] Conduct a correlation analysis on the historical meteorological data and the historical power data to obtain a correlation analysis result;

[0046] Based on the correlation analysis result, extract the historical meteorological data and the historical power data to obtain the feature dataset.

[0047] As a preferred solution of the method for constructing the power prediction model of the present invention, wherein: the conducting a correlation analysis on the historical meteorological data and the historical power data to obtain a correlation analysis result includes:

[0048] Conduct a correlation analysis on the historical meteorological data based on the minimum redundancy-maximum correlation method to obtain the correlation analysis result.

[0049] Another object of the present invention is to provide a device for constructing a power prediction model, and the present invention solves the problems existing in the prediction of complex weather samples in the related art.

[0050] As a preferred solution of the device for constructing the power prediction model of the present invention, it is characterized by including an acquisition module for acquiring the historical meteorological data and historical power data of a target wind farm;

[0051] A feature dataset extraction module for performing sample labeling and feature screening on the historical meteorological data and the historical power data to obtain a feature dataset composed of target historical meteorological data and corresponding target historical power data; wherein, the actual correlation degree between the target historical meteorological data and the historical power data is greater than a preset correlation degree, and the feature dataset includes the first historical meteorological data and the first historical power data corresponding to the first preset weather type;

[0052] A first model training module for constructing a preset power prediction model based on the feature dataset and performing model training to obtain a power prediction basic model;

[0053] The second model training module is used to perform two-layer optimization on the power prediction basic model based on a reweighting strategy. During the two-layer optimization process, the weighted loss function and model parameters of the power prediction basic model are updated based on the prediction error of the power prediction basic model, so that the loss function of the power prediction basic model is minimized. Moreover, the weights and model parameters during the prediction of the power prediction basic model are updated to minimize the prediction error of the power prediction basic model, thereby obtaining a power prediction model.

[0054] A computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the method for constructing the power prediction model as described above are implemented.

[0055] A computer-readable storage medium stores a computer program thereon. When the computer program is executed by a processor, the steps of the method for constructing the power prediction model as described above are implemented.

[0056] Advantages of the present invention: Obtain historical meteorological data and historical power data of a target wind farm; perform sample annotation and feature screening on the historical meteorological data and the historical power data to obtain a feature data set composed of target historical meteorological data and corresponding target historical power data; wherein, the actual correlation degree between the target historical meteorological data and the historical power data is greater than a preset correlation degree, and the feature data set includes first historical meteorological data and first historical power data corresponding to a first preset weather type; construct a preset power prediction model based on the feature data set and perform model training to obtain a power prediction basic model; perform two-layer optimization on the power prediction basic model based on a reweighting strategy. During the two-layer optimization process, the weighted loss function and model parameters of the power prediction basic model are updated based on the prediction error of the power prediction basic model, so that the loss function of the power prediction basic model is minimized. Moreover, the weights and model parameters during the prediction of the power prediction basic model are updated to minimize the prediction error of the power prediction basic model, thereby obtaining a power prediction model; adopt the method of performing two-layer optimization on the power prediction basic model based on a reweighting strategy, and automatically adjust the penalty weight through the two-layer optimization based on the reweighting strategy, so that the model can adaptively focus on extreme weather samples, thereby improving the sensitivity of the model to extreme weather events, enabling the finally obtained model to not only have a good prediction effect under normal weather, but also have good performance under complex extreme weather, being able to perform wind power prediction under normal weather and extreme weather conditions through a unified model, having a certain universality, being able to reduce the computational cost of separately modeling according to different weather conditions, and providing a more economical and reliable power prediction for the wind farm. Description of the Drawings

[0057] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.

[0058] Figure 1 It is the overall flowchart of the method for constructing a power prediction model provided by an embodiment of the present invention.

[0059] Figure 2 It is the overall structure diagram of the device for constructing a power prediction model provided by an embodiment of the present invention.

[0060] Figure 3 It is the schematic diagram of the hardware structure of a computer device for the method of constructing a power prediction model provided by an embodiment of the present invention. Detailed implementation manners

[0061] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following will describe the detailed implementation manners of the present invention in conjunction with the accompanying drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0062] Embodiment 1, referring to Figure 1 , which is the first embodiment of the present invention. This embodiment provides a method for constructing a power prediction model, including:

[0063] As Figure 1 shown, this process includes the following steps:

[0064] Step S101, obtain the historical meteorological data and historical power data of the target wind farm.

[0065] In this embodiment, the historical meteorological data of the target wind farm can be obtained by collecting historical NWP data, and the historical power data can be obtained by collecting the power data corresponding to the time series of the historical NWP data.

[0066] In one embodiment, after obtaining the historical meteorological data and historical power data, preprocess the historical meteorological data and historical power data; preliminarily clean and reconstruct the abnormal values such as zero power values and unreasonable values in the original data.

[0067] Among them, as a possible implementation method, after obtaining the historical meteorological data and historical power data, according to the wind speed-wind power output relationship, using the cut-in wind speed, cut-out wind speed and the corresponding wind power, the abnormal data in the data set are preliminarily excluded.

[0068] Step S102: Perform sample annotation and feature screening on the historical meteorological data and the historical power data to obtain a feature data set composed of target historical meteorological data and corresponding target historical power data; wherein, the actual correlation degree between the target historical meteorological data and the historical power data is greater than a preset correlation degree, and the feature data set includes the first historical meteorological data and the first historical power data corresponding to the first preset weather type.

[0069] In this embodiment, sample annotation and feature screening are performed on the historical meteorological data and the historical power data to obtain data samples corresponding to the first preset weather type such as extreme weather conditions like low temperature and freezing, strong wind, etc. and the second preset weather type corresponding to normal weather. Further, target historical meteorological data with an actual correlation degree greater than the preset correlation degree with the historical power data is extracted from the data samples, and the target historical meteorological data and the corresponding historical power data are combined to obtain a feature data set.

[0070] In one embodiment, the sample annotation of the historical meteorological data and the historical power data can be realized by constructing a judgment standard for extreme weather scenarios; specifically, construct a judgment standard for extreme weather scenarios, and screen data samples corresponding to the first preset weather type such as extreme weather conditions like cold snap, low temperature and freezing, strong wind, etc. and the second preset weather type corresponding to normal weather from the initial data set.

[0071] As a possible implementation method, the performing sample annotation and feature screening on the historical meteorological data and the historical power data includes: obtaining a preset meteorological judgment factor corresponding to the first preset weather type; wherein, the first preset weather type includes cold snap, low temperature and freezing, strong wind, and the preset meteorological judgment factor includes meteorological judgment characteristics and meteorological judgment values corresponding to each of the preset weather types; dividing the historical meteorological data based on the preset meteorological judgment factor to obtain the first historical meteorological data corresponding to the first preset weather type and the second historical meteorological data corresponding to the second weather type; respectively annotating the historical power data based on the timestamps of the first historical meteorological data and the second historical meteorological data to obtain an annotation result; performing a correlation analysis on the historical meteorological data and the historical power data to obtain a correlation analysis result.

[0072] In one embodiment, the Pearson coefficient and the Minimum Redundancy Maximum Relevance (mRMR) method can be used to perform correlation analysis on the historical meteorological data and the historical power data.

[0073] As an exemplary embodiment, performing correlation analysis on the historical meteorological data and the historical power data to obtain a correlation analysis result includes: performing correlation analysis on the historical meteorological data based on the minimum redundancy-maximum correlation method to obtain the correlation analysis result.

[0074] In this embodiment, mRMR aims to select a set of features that have both maximum correlation and minimum redundancy. First, mutual information is used to calculate the correlation between each meteorological feature and the power data. Then, the redundancy between meteorological features is calculated. A meteorological feature with the highest correlation with the power data is selected as the initial feature set. Among the remaining unselected features, other meteorological features with the minimum redundancy with the selected feature set and the maximum correlation with the meteorological features are found, and the found features are added to the feature set. Iterative feature selection is performed in turn until a preset standard is met.

[0075] Step S103, constructing a preset power prediction model based on the feature dataset and performing model training to obtain a basic power prediction model.

[0076] In this embodiment, the preset power prediction model is used to extract the temporal variation information of the meteorological data in the feature dataset and output a power prediction result based on the temporal variation information.

[0077] As a possible implementation, the preset power model can be a Recurrent Neural Network (RNN) or a Long Short-Term Memory (LSTM) network.

[0078] In this embodiment, taking the preset power model as an LSTM as an example, the technical solution of the present application will be described:

[0079] In one embodiment, an LSTM-based power prediction model is built based on the feature dataset. First, the qualitative input and output are defined, and the LSTM network structure is designed, including the number of LSTM layers, the number of units in each layer, the fully connected layer, etc., to build the model architecture. Appropriate hyperparameters are set, and the dataset is used for model training to form the basic power prediction model.

[0080] Exemplarily, the key hyperparameters of the LSTM are set as follows: the hidden layer size is 64, the number of units is 2, the learning rate is 0.001, the optimizer is selected as Adam, the dropout ratio is 0.3, the batch size is 64, and the loop length is 16.

[0081] Step S104: Perform a two-layer optimization on the power prediction basic model based on a reweighting strategy. During the two-layer optimization process, update the weighted loss function and model parameters of the power prediction basic model based on the prediction error of the power prediction basic model, so that the loss function of the power prediction basic model is minimized. Moreover, update the weights and model parameters during the prediction of the power prediction basic model, so that the prediction error of the power prediction basic model is minimized, and a power prediction model is obtained.

[0082] In the related art, the wind power prediction method based on deep learning relies on the availability of rich and high-quality data sets. However, on the one hand, due to the existence of complex extreme weather, when mixing samples corresponding to complex extreme weather and samples corresponding to normal weather for model training, since the number of extreme weather samples is scarce, the trained model cannot pay more attention to the characteristics of extreme weather samples and performs poorly under extreme weather conditions during subsequent power prediction. On the other hand, the wind power historical data set under complex extreme weather is unbalanced. A common approach is to separate extreme weather samples from normal weather samples through methods such as weather clustering and train models separately to meet the prediction requirements under different weather conditions. Although this method can obtain better prediction results, its computational cost is high and the efficiency is limited.

[0083] To solve the above problems, in this embodiment, a two-layer optimization based on a reweighting strategy is performed on the basis of the power prediction basic model, and the power prediction basic model is retrained to make the power prediction basic model pay more attention to the samples corresponding to extreme weather conditions.

[0084] The two-layer optimization based on the reweighting strategy can be regarded as a meta-learning task. In this meta-learning task, the initial weights of the first weather type and the second weather type samples are first determined using meta-learning. Further, during model training, the weighted loss function and model parameters of the power prediction basic model are updated based on the prediction error of the power prediction basic model, so that the loss function of the power prediction basic model is minimized. Moreover, the weights and model parameters during the prediction of the power prediction basic model are updated to minimize the prediction error of the power prediction basic model, obtaining a power prediction model. The method for performing two-layer optimization on the power prediction basic model based on the reweighting strategy does not rely on prior knowledge of the data distribution, but autonomously learns the penalty weights inside the power prediction basic model. The reweighting task is constructed as a two-layer optimization problem. The inner-layer optimization focuses on minimizing the loss function during the training process, while the outer-layer optimization focuses on minimizing the prediction error on the data samples corresponding to extreme weather types, so as to guide the learning of the penalty weights.

[0085] In the above embodiments, the penalty weights are automatically adjusted through two-layer optimization based on the reweighting strategy, enabling the model to adaptively focus on extreme weather samples, thereby improving the sensitivity of the model to extreme weather events. This can ensure that the finally obtained model not only has good prediction performance under normal weather, but also performs well under complex extreme weather. Moreover, the trained power prediction model can perform wind power prediction under normal weather and extreme weather conditions through a unified model, which has a certain universality and can reduce the computational cost of separately modeling according to different weather conditions, providing a more economical and reliable power prediction for wind farms.

[0086] In the wind power prediction method of this embodiment, historical meteorological data and historical power data of a target wind farm are obtained; the historical meteorological data and the historical power data are subjected to sample annotation and feature screening to obtain a feature dataset composed of target historical meteorological data and corresponding target historical power data; wherein, the actual correlation degree between the target historical meteorological data and the historical power data is greater than a preset correlation degree, and the feature dataset includes the first historical meteorological data and the first historical power data corresponding to the first preset weather type; a preset power prediction model is constructed based on the feature dataset and model training is performed to obtain a power prediction basic model; the power prediction basic model is subjected to two-layer optimization based on a reweighting strategy. During the two-layer optimization process, the weighted loss function and model parameters of the power prediction basic model are updated based on the prediction error of the power prediction basic model, so that the loss function of the power prediction basic model is minimized, and the weights and model parameters during the prediction of the power prediction basic model are updated, so that the prediction error of the power prediction basic model is minimized, and a power prediction model is obtained; by adopting the method of performing two-layer optimization based on a reweighting strategy on the power prediction basic model, the penalty weight is automatically adjusted through two-layer optimization based on a reweighting strategy, so that the model can adaptively focus on extreme weather samples, thereby improving the sensitivity of the model to extreme weather events, enabling the finally obtained model to not only have a good prediction effect under normal weather, but also have good performance under complex extreme weather, enabling wind power prediction under normal weather and extreme weather conditions through a unified model, having a certain universality, and being able to reduce the computational cost of separately modeling according to different weather conditions, and providing a more economical and reliable power prediction for the wind farm.

[0087] As an exemplary embodiment, the two-layer optimization based on a reweighting strategy for the power prediction basic model includes: dividing the feature dataset to obtain an evaluation set; wherein, the evaluation set at least includes the first historical meteorological data and the first historical power data; initializing the weights of each training sample in the feature dataset to obtain initial weights; wherein, the initial weights are positively correlated with the preset errors of each training sample when the model is trained in a mini-batch mode; performing an inner loop on the power prediction basic model, and during the inner loop, optimizing the weighted loss function of the power prediction basic model based on the stochastic gradient descent method to obtain the updated model parameters of the power prediction basic model; performing an outer loop on the power prediction basic model, and during the outer loop, performing gradient descent on the initial weights in a mini-batch mode based on the evaluation set to obtain corrected weights; wherein, the corrected weights are not less than zero; updating the power prediction basic model based on the corrected weights to obtain the power prediction model.

[0088] In this embodiment, first, the feature data set is divided to obtain an evaluation set; wherein, the evaluation set at least includes any one of the first historical meteorological data and the corresponding first historical power data; and subsequently, the optimization effect of the model is evaluated using the evaluation set and the model is updated; it should be understood that the evaluation set at least includes meteorological data and power data under any one extreme weather condition.

[0089] In this embodiment, the power prediction basic model is updated by means of an inner loop and an outer loop; wherein, the inner loop aims to optimize the weighted loss function through stochastic gradient descent; the outer loop aims to adaptively correct the initial weights so that the actual prediction error of the power prediction model is less than the preset prediction error.

[0090] Exemplarily, in the process of the inner loop, the weighted loss function of the power prediction basic model is optimized based on the stochastic gradient descent method, and the model parameters of the power prediction basic model are updated.

[0091] In each training iteration process t, a mini-batch training sample of size n is sampled where n is the size of the mini-batch, and n << N, N is the size of the total data set, each sample consists of an input feature xi and a corresponding label yi, and ":=" is used to represent the assignment operation. This means that D batch is assigned to a set consisting of n samples. This representation method emphasizes that D batch is dynamically generated in each step of training, rather than a static, pre-defined set. At each training iteration, a new mini-batch is regenerated as needed for gradient calculation and model update, and xi and yi represent the input feature and the corresponding label respectively.

[0092] Exemplarily, the weighted loss function of the power prediction basic model is optimized based on the stochastic gradient descent method using Equation (1):

[0093] l i,w (θ) = w i ·l i (θ) (1)

[0094] In Equation (1), l i,w (θ) represents the optimized weighted loss function, w i represents the initial weight, and l i (θ) represents the loss function of the power prediction basic model;

[0095] The model parameters are updated based on the stochastic gradient descent method using Equation (2):

[0096]

[0097] In Equation (2), denotes the model parameters after being updated using the stochastic gradient descent method, θ t denotes the current model parameters of the power prediction basic model, w i,t ·l i (θ t ) represents the optimized weighted loss function, φ represents the learning rate, denotes the gradient of the loss function, n is the size of a mini-batch training sample D batch and i represents the i-th sample in D batch .

[0098] During the inner-layer optimization process, the above method for updating the loss function and model parameters can minimize the loss function by continuously updating the weighted loss function.

[0099] Exemplarily, during the outer-layer loop, gradient descent is performed in mini-batch mode based on the evaluation set to adjust the initial weights and obtain corrected weights; wherein, the corrected weights are not less than zero.

[0100] Exemplarily, adjusting each of the initial weights based on the gradient descent method to obtain adjusted weights includes:

[0101] Performing gradient descent on each sample in the evaluation set to obtain the corrected weights of each sample in the evaluation set; specifically, updating the initial weights using Equation (3):

[0102]

[0103] where w i,t denotes the initial weight of the i-th training sample, denotes the first weight of the i-th training sample, η represents the step size of descent, m represents the total number of samples included in the evaluation set, j represents the j-th sample included in the evaluation set, is the loss of the evaluation sample under the updated model parameters.

[0104] Performing non-negative correction on the first weight to obtain a second weight; specifically, correcting the first weight using Equation (4):

[0105]

[0106] where denotes the second weight, denotes the first weight;

[0107] Normalize the second weight to obtain the corrected weight. Specifically, normalize the second weight using Equation (5):

[0108]

[0109] where ω i,t+1 represents the corrected weight, represents the second weight, δ is a constant term, and j represents the j-th sample included in the evaluation set;

[0110] Updating the power prediction basic model based on the corrected weight includes: updating the model parameters using Equation (6):

[0111]

[0112] where θ t+1 represents the updated model parameters, θ t represents the model parameters before the previous update, w i,t+1 ·l i (θ t ) represents the weighted loss function obtained based on the corrected weight.

[0113] In the above embodiment, the reweighting strategy is applied to make the model pay more attention to extreme weather samples and retrain the model; meta-learning is used to determine the initial weights of normal and extreme weather samples. During the model training process, a weighted loss function is used to minimize the prediction error, and at the same time, the initial weights are updated to make the model adaptively focus on the change characteristics under extreme weather, thereby improving the sensitivity of the model to extreme weather events.

[0114] In the above method applying the reweighting strategy, the penalty weights are automatically adjusted through meta-learning, enabling the model to adaptively focus on extreme weather samples, thereby improving the sensitivity of the model to extreme weather events; to further enhance the prediction ability of the power prediction model under extreme weather conditions, the model can be further adjusted.

[0115] In one embodiment, after obtaining the first historical meteorological data and the first historical power data, the mapping relationship between the first historical meteorological data and the first historical power data can be used for expansion to obtain expanded meteorological data and expanded power data, and the power prediction model is adjusted based on the first historical meteorological data and the first historical power data, so that the actual error between the prediction result of the adjusted power prediction model and the first historical power data is less than the preset error.

[0116] In one embodiment, the parameters of the module that can adopt the retention of the original comprehensive knowledge of the majority of normal and minority extreme samples in the freezing power prediction model can be used to adjust the last M layers of the power prediction model, so as to improve the prediction ability of the power prediction model under extreme weather conditions; specifically, as an exemplary embodiment, after the double-layer optimization of the power prediction basic model based on the reweighting strategy, the construction method of the power prediction model further includes: inputting the first historical meteorological data into the power prediction model, freezing the first preset module of the power prediction basic model, and adjusting the module parameters of the second preset module of the power prediction model, so that the prediction result of the adjusted power prediction model and the actual error of the first historical power data are less than the preset error; wherein, the first preset module is composed of the first N layers of the power prediction model, and the second preset module is composed of the last M layers of the power prediction model.

[0117] In this embodiment, after applying the reweighting strategy, the power prediction model can learn the corresponding relationship between the first historical meteorological data and the first historical power data under normal weather conditions and the corresponding relationship between the second historical meteorological data and the second historical power data under extreme weather conditions based on the first N layers; therefore, freezing the first preset module of the power prediction basic model can enable the power prediction model to retain the original comprehensive knowledge of the majority of normal and minority extreme samples; and on the basis of freezing the first preset module, adjusting the module parameters of the second preset module according to the first historical meteorological data and the first historical power data can enable the model to be more adaptable to the power prediction under extreme weather conditions on the basis of retaining the original comprehensive knowledge of the majority of normal and minority extreme samples.

[0118] On the one hand, the above method of this embodiment adopts the method of double-layer optimization of the power prediction basic model based on the reweighting strategy, and automatically adjusts the penalty weight through the double-layer optimization based on the reweighting strategy, so that the model can adaptively focus on extreme weather samples, thereby improving the sensitivity of the model to extreme weather events; on the other hand, on the basis of freezing the first preset module, adjusting the module parameters of the second preset module according to the first historical meteorological data and the first historical power data can enable the model to be more adaptable to the power prediction under extreme weather conditions on the basis of retaining the original comprehensive knowledge of the majority of normal and minority extreme samples; the finally obtained power prediction model not only has a good prediction effect under normal weather, but also has a good performance under complex extreme weather, and can perform wind power prediction under normal weather and extreme weather conditions through a unified model, has a certain universality, can reduce the calculation cost of separately modeling according to different weather conditions, and provides a more economical and reliable power prediction for the wind farm.

[0119] As a possible implementation, after obtaining the adjusted power prediction model, the adjusted power prediction model is evaluated using two parameters, namely, the mean square error and the mean absolute error, based on the meteorological data and power data corresponding to both extreme weather types and normal weather types, to obtain a model evaluation result.

[0120] As a possible implementation, after obtaining the model evaluation result, the adjusted power prediction model is further optimized based on the model evaluation result.

[0121] It should be noted that the method of this embodiment uses two models (the first model and the second model) to process global and local representations respectively, optimizes the models by dynamically adjusting the weights of the loss function, combines historical photovoltaic power generation data and meteorological data to improve the prediction accuracy, uses a third model for weight fusion, and involves various neural network structures such as TCN, RNN, LSTM, etc.; adopts a two-layer optimization method with a reweighting strategy, optimizes the model parameters through the inner loop, and adjusts the sample weights through the outer loop to make the model pay more attention to extreme weather samples. Uses meta-learning to automatically adjust the penalty weights and enhance the sensitivity of the model to extreme weather.

[0122] Example 2, referring to Figure 2 , which is the second embodiment of the present invention, provides a construction system for a power prediction model, including:

[0123] An acquisition module 501, configured to acquire historical meteorological data and historical power data of a target wind farm station;

[0124] A feature data set extraction module 502, configured to perform sample annotation and feature screening on the historical meteorological data and the historical power data to obtain a feature data set composed of target historical meteorological data and corresponding target historical power data; wherein, the actual correlation degree between the target historical meteorological data and the historical power data is greater than a preset correlation degree, and the feature data set includes first historical meteorological data and first historical power data corresponding to a first preset weather type;

[0125] A first model training module 503, configured to construct a preset power prediction model based on the feature data set and perform model training to obtain a power prediction basic model;

[0126] The second model training module 504 is used to perform a two-layer optimization on the power prediction basic model based on a reweighting strategy. During the two-layer optimization process, the weighted loss function and model parameters of the power prediction basic model are updated based on the prediction error of the power prediction basic model, so that the loss function of the power prediction basic model is minimized. Moreover, the weights and model parameters during the prediction of the power prediction basic model are updated to minimize the prediction error of the power prediction basic model, thereby obtaining a power prediction model.

[0127] It should be noted here that the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the content disclosed in the above embodiments.

[0128] It should be noted that the above modules, as part of the device, can be implemented by software or by hardware, where the hardware environment includes a network environment.

[0129] Embodiment 3, referring to Figure 3 , is the third embodiment of the present invention. What is different from the first two embodiments is:

[0130] The embodiment of the present invention further provides a computer device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus. The memory is used to store a computer program; the processor is used to execute the method in any of the above embodiments by running the computer program stored on the memory.

[0131] Figure 3 is a structural block diagram of an optional computer device according to an embodiment of the present application. As Figure 3 shown, it includes a processor 10, a communication interface 20, a memory 30, and a communication bus 40. Among them, the processor 10, the communication interface 20, and the memory 30 complete mutual communication through the communication bus 40. Among them,

[0132] The memory 30 is used to store a computer program;

[0133] When the processor 10 is used to execute the computer program stored on the memory 30, the method in any of the above embodiments is implemented.

[0134] Optionally, in this embodiment, the above communication bus may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation,Figure 3 It is represented by only one thick line, but it does not mean that there is only one bus or one type of bus.

[0135] The communication interface is used for communication between the above-mentioned computer device and other devices.

[0136] The memory may include RAM, or may also include non-volatile memory, for example, at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.

[0137] The above-mentioned processor may be a general-purpose processor, which may include but is not limited to: CPU (Central Processing Unit, central processor), NP (Network Processor, network processor), etc.; it may also be a DSP (Digital Signal Processing, digital signal processor), ASIC (Application Specific Integrated Circuit, application-specific integrated circuit), FPGA (Field-Programmable Gate Array, field programmable gate array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0138] Optionally, specific examples in this embodiment may refer to the examples described in the above embodiments, and will not be repeated here.

[0139] Those of ordinary skill in the art can understand that Figure 3 The structure shown is only schematic. The device for implementing the method of any one of the above embodiments may be a terminal device, and the terminal device may be a smart phone (such as an Android phone, an IOS phone, etc.), a tablet computer, a palm computer, and a mobile Internet device (Mobile Internet Devices, MID), a PAD and other terminal devices. Figure 3 It does not limit the structure of the above-mentioned electronic device. For example, the terminal device may further include more or fewer components (such as a network interface, a display device, etc.) than those shown in Figure 3 or have a different configuration from that shown in Figure 3 shown.

[0140] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware of the terminal device through a program, and the program can be stored in a computer-readable storage medium. The storage medium may include: a flash drive, a ROM, a RAM, a magnetic disk or an optical disc, etc.

[0141] As an exemplary embodiment, the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the method steps of any one of the embodiments when running.

[0142] Optionally, in this embodiment, the above storage medium may be used for the program code for executing the method steps of the embodiments of the present application.

[0143] Optionally, in this embodiment, the above storage medium may be located on at least one of the multiple network devices in the network shown in the above embodiment.

[0144] Optionally, in this embodiment, the storage medium is configured to store for executing the method in the above embodiment.

[0145] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and will not be elaborated herein.

[0146] Optionally, in this embodiment, the above storage medium may include but is not limited to: various media such as USB flash drives, ROMs, RAMs, mobile hard disks, magnetic disks, or optical discs that can store program code.

[0147] The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.

[0148] If the integrated unit in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product. The computer software product is stored in the storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the method in the above embodiment.

[0149] In several embodiments provided by the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces. The indirect coupling or communication connection of units or modules can be in an electrical or other form.

[0150] The unit described as a separation component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place or distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.

[0151] In addition, each functional unit in various embodiments of the present application may be integrated into a processing unit, may exist separately as individual physical units, or two or more units may be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0152] In the above embodiments of the present application, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0153] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.

Claims

1. A method for constructing a power prediction model, characterized in that: including obtaining historical meteorological data and historical power data of a target wind farm performing sample annotation and feature screening on the historical meteorological data and the historical power data to obtain a feature data set composed of target historical meteorological data and corresponding target historical power data; wherein, the actual correlation degree between the target historical meteorological data and the historical power data is greater than a preset correlation degree, and the feature data set includes first historical meteorological data and first historical power data corresponding to a first preset weather type constructing a preset power prediction model based on the feature data set and performing model training to obtain a power prediction basic model performing two-layer optimization on the power prediction basic model based on a reweighting strategy. During the two-layer optimization process, the weighted loss function and model parameters of the power prediction basic model are updated based on the prediction error of the power prediction basic model, so that the loss function of the power prediction basic model is minimized, and the weights and model parameters during the prediction of the power prediction basic model are updated to minimize the prediction error of the power prediction basic model, thereby obtaining a power prediction model 2. The method for constructing the power prediction model according to claim 1, wherein: The two-layer optimization of the power prediction basic model based on the reweighting strategy includes dividing the feature data set to obtain an evaluation set; wherein, the evaluation set includes at least any one of the first historical meteorological data and the corresponding first historical power data initializing the weights of each training sample in the feature data set to obtain initial weights; wherein, the initial weights are positively correlated with the preset errors of each training sample during model training in a mini-batch mode performing an inner loop on the power prediction basic model. During the inner loop process, the weighted loss function of the power prediction basic model is optimized based on the stochastic gradient descent method, and the model parameters of the power prediction basic model are updated performing an outer loop on the power prediction basic model. During the outer loop process, gradient descent is performed on the initial weights in a mini-batch mode based on the evaluation set to obtain corrected weights; wherein, the corrected weights are not less than zero updating the power prediction basic model based on the corrected weights to obtain the power prediction model 3. The method for constructing the power prediction model according to claim 2, wherein: The optimization of the weighted loss function of the power prediction basic model based on the stochastic gradient descent method includes in each training iteration process t, sampling a mini-batch training sample with a size of n, and n << N, denoted as where N is the size of the total dataset, n is the size of a mini-batch training sample D batch and i represents the i-th sample in D batch ; optimizing the weighted loss function of the power prediction basic model based on the stochastic gradient descent method using Equation (1) l i,w f(θ) = w i ·l i f(θ)(1) where, l i,w (θ) represents the optimized weighted loss function, and w i represents the weight of the prediction error of the i-th training sample, and l i (θ) represents the current loss function of the power prediction basic model; updating the model parameters based on the stochastic gradient descent method using Equation (2) Among them, represents the model parameters updated by using the stochastic gradient descent method in the (t + 1)-th iteration, θ t represents the model parameters of the t-th iteration of the power prediction basic model, w i,t ·l i (θ t ) represents the optimized weighted loss function, φ represents the learning rate, represents the gradient of the loss function.

4. The method for constructing the power prediction model according to claim 3, wherein: The adjustment of the initial weights by performing gradient descent on the evaluation set in a mini-batch mode to obtain corrected weights includes performing gradient descent on each training sample in the feature data set based on the evaluation set to obtain first weights of each training sample; specifically, updating the initial weights using Equation (3) to obtain the first weights of each sample in the evaluation set where \(w_{i,t}\) represents the initial weight of the \(i\)-th training sample, represents the first weight of the \(i\)-th training sample, \(\eta\) represents the step size of descent, \(m\) represents the total number of samples included in the evaluation set, and \(j\) represents the \(j\)-th sample included in the evaluation set, is the loss of the evaluation sample under the updated model parameters; Perform non - negative correction on the first weight to obtain the second weight. Specifically, correct the first weight using Equation (4): Among them, represents the second weight, represents the first weight; Perform normalization on the second weight to obtain the corrected weight. Specifically, normalize the second weight using Equation (5): where w i,t+1 represents the corrected weight, represents the second weight, δ is a constant term, and represents the j-th sample included in the evaluation set; Updating the power prediction basic model based on the corrected weight includes: updating the model parameters using Equation (6): Among them, θ t+1 represents the updated model parameters, θ t represents the model parameters before the previous update, w i,t+1 ·l i (θ t ) represents the weighted loss function obtained based on the corrected weights.

5. The method for constructing a power prediction model according to claim 4, wherein: After performing the two - layer optimization of the power prediction basic model based on the re - weighting strategy, the method for constructing the power prediction model further includes: Obtain the first historical meteorological data and the first historical power data corresponding to the preset weather type; Input the first historical meteorological data into the power prediction model, freeze the first preset module of the power prediction basic model, and adjust the module parameters of the second preset module of the power prediction model so that the prediction result of the adjusted power prediction model has an actual error less than the preset error compared with the first historical power data. Among them, the first preset module is composed of the first N layers of the power prediction model, and the second preset module is composed of the last M layers of the power prediction model.

6. The method for constructing a power prediction model according to claim 4, wherein: The sample annotation and feature screening of the historical meteorological data and the historical power data include: Obtain the preset meteorological judgment factors corresponding to the first preset weather type. Among them, the first preset weather types include cold wave, low - temperature freezing, and strong wind, and the preset meteorological judgment factors include the meteorological judgment characteristics and meteorological judgment values corresponding to each preset weather type; Based on the preset meteorological judgment factors, divide the historical meteorological data to obtain the first historical meteorological data corresponding to the first preset weather type and the second historical meteorological data corresponding to the second weather type; Based on the timestamps of the first historical meteorological data and the second historical meteorological data respectively, label the historical power data to obtain the labeling result; Perform correlation analysis on the historical meteorological data and the historical power data to obtain the correlation analysis result; Based on the correlation analysis result, extract the historical meteorological data and the historical power data to obtain the feature dataset.

7. The method for constructing a power prediction model according to claim 4, characterized in that: The correlation analysis of the historical meteorological data and the historical power data to obtain the correlation analysis result includes: Perform correlation analysis on the historical meteorological data based on the minimum redundancy - maximum correlation method to obtain the correlation analysis result.

8. A device for constructing a power prediction model, applying the method for constructing a power prediction model according to any one of claims 1 to 7, characterized in that Includes: An acquisition module for acquiring the historical meteorological data and the historical power data of the target wind farm; A feature dataset extraction module for performing sample annotation and feature screening on the historical meteorological data and the historical power data to obtain a feature dataset composed of target historical meteorological data and corresponding target historical power data. Among them, the actual correlation degree between the target historical meteorological data and the historical power data is greater than the preset correlation degree, and the feature dataset includes the first historical meteorological data and the first historical power data corresponding to the first preset weather type; The first model training module is used to construct a preset power prediction model based on the feature data set and perform model training to obtain a basic power prediction model; The second model training module is used to perform double-layer optimization on the basic power prediction model based on a reweighting strategy. During the double-layer optimization process, the weighted loss function and model parameters of the basic power prediction model are updated based on the prediction error of the basic power prediction model, so that the loss function of the basic power prediction model is minimized. Moreover, the weights and model parameters during the prediction of the basic power prediction model are updated to minimize the prediction error of the basic power prediction model, thereby obtaining a power prediction model.

9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method for constructing the power prediction model according to any one of claims 1 to 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 steps of the method for constructing the power prediction model according to any one of claims 1 to 7.

Citation Information

Cited By

  • New energy power prediction method based on heavy tail distribution modeling

    CN122026323A

  • New energy power prediction method based on heavy-tailed distribution modeling

    CN122026323B