Short-term power prediction method and device, storage medium and electronic device
By constructing and training a short-term power prediction model, using the environmental data of the new energy station for prediction, and adjusting the model parameters to improve the prediction accuracy, the problem of poor prediction effect during peak periods of new energy stations is solved and the assessment cost is reduced.
Patent Information
- Application Number
- CN202411863429.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-22
AI Technical Summary
In the prior art, the short-term power forecast of new energy stations has poor prediction effect on peak periods, resulting in high assessment costs and lack of effective solutions.
By obtaining the first environmental data of the new energy station, building the first characteristic variable, and processing it using the short-term power prediction model, the first short-term power prediction result is obtained. The model has different prediction accuracy for different time characteristics and is used to indicate the predicted output power of the new energy station in the second time period. At the same time, a lightweight elevator algorithm is used for model training, and the model parameters are adjusted through mean square error loss to obtain the optimal model parameters.
By considering the time-dividing prediction error weight of the new energy short-term power prediction model, we highlight the importance of accurate prediction in key periods, further improve the adaptability of model prediction, and reduce the assessment costs caused by power prediction.
Smart Images

Figure CN119862546A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of new energy, and specifically, to a short-term power prediction method and device, a storage medium and an electronic device. Background Art
[0002] New energy power forecasting technology is a key technical means to deal with the volatility and randomness of wind farm and photovoltaic power generation output, and can provide data support for grid dispatching and station operation decisions. The power grid company requires new energy stations to report short-term forecast power for the next three days every day and assess the forecast deviation. With the rapid growth of wind power and photovoltaic power generation capacity connected to the grid, the dispatching pressure on the grid side is increasing day by day, and the assessment regulations for power forecasts of new energy stations are becoming more and more stringent. Different assessment coefficients are set during peak and valley periods, and the assessment intensity of forecast deviations in different periods is different. During the period of large-scale new energy generation, the actual power generation of new energy stations is generally higher, and the assessment coefficient corresponding to the lower power generation forecast result is higher. During the peak power consumption period, the power demand is higher, and the assessment coefficient corresponding to the higher power generation forecast result is higher.
[0003] Existing power prediction technologies generally use a unified model for prediction in each time period, and there is room for further optimization.
[0004] Regarding the related technologies, the existing power prediction technologies generally adopt a unified model for prediction in each time period, which has poor prediction effect for peak time periods, resulting in high assessment costs. No effective solution has been proposed yet.
[0005] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the invention
[0006] The embodiments of the present application provide a short-term power prediction method and device, a storage medium and an electronic device to at least solve the problem in the related art that the current power prediction technology generally adopts a unified model for prediction for each time period, has poor prediction effect for peak time periods, and leads to high assessment costs.
[0007] According to one aspect of an embodiment of the present application, a short-term power prediction method is provided, including: acquiring first environmental data of a new energy station within a first time period; constructing a first characteristic variable based on the first environmental data, wherein the first characteristic variable includes a first time feature corresponding to the first time period; processing the first characteristic variable through a short-term power prediction model to obtain a first short-term power prediction result, wherein the short-term power prediction model has different prediction accuracies for different time features, and the first short-term power prediction result is used to indicate the predicted output power of the new energy station in a second time period, and the second time period is located after the first time period.
[0008] In an exemplary embodiment, before processing the first characteristic variable through the short-term power prediction model, the method also includes: constructing a second characteristic variable based on historical data of the new energy station in a third time period, wherein the historical data includes: the actual output power of the new energy station, the second environmental data of the new energy station, and the second characteristic variable includes the second time feature corresponding to the third time period; taking the second characteristic variable as input and the actual output power as output, a lightweight hoist algorithm is used to train the short-term power prediction model to obtain the first model parameters of the short-term power prediction model and the second short-term power prediction result corresponding to the second characteristic variable; calculating the mean square error loss corresponding to the second short-term power prediction result according to the weight information of different time features, and adjusting the first model parameters according to the mean square error loss and the second short-term power prediction result to obtain the optimal model parameters; determining the short-term power prediction model according to the optimal model parameters.
[0009] In an exemplary embodiment, calculating the mean square error loss corresponding to the second short-term power prediction result according to the weight information of different time characteristics includes: using the formula
[0010] The mean square error loss is calculated, wherein WMSE is the mean square error loss, n1 is the number of data points of the plurality of first data points that meet the first classification condition, n2 is the number of data points of the plurality of second data points that meet the second classification condition, and n3 is the number of data points of the plurality of third data points that do not meet the first classification condition and the second classification condition. for calculating a first mean square error loss of the plurality of first data points, for calculating a second mean square error loss for the plurality of second data points, For calculating the third mean square error loss of the plurality of third data points, the first classification condition includes: the time feature belongs to the first preset time period and The second classification condition includes: the time feature belongs to the second preset time period and α is the first weight information corresponding to the first preset time period, and β is the second weight information corresponding to the second preset time period.
[0011] In an exemplary embodiment, a second characteristic variable is constructed based on the historical data of the new energy station in a third time period, including: time-aligning the historical data according to the time resolution of the short-term power prediction model to obtain aligned historical data; performing data cleaning on the aligned historical data to remove abnormal data in the aligned historical data to obtain cleaned historical data; and constructing the second characteristic variable based on the cleaned historical data.
[0012] In an exemplary embodiment, the first model parameters are adjusted according to the mean square error loss and the second short-term power prediction results to obtain optimal model parameters, including: smoothing the second short-term power prediction results corresponding to different time characteristics by a local weighted regression smoothing method to obtain multiple smooth and continuous short-term power prediction results; evaluating the multiple short-term power prediction results according to the mean square error loss to obtain a first evaluation result corresponding to the first model parameters; searching for optimal model parameters for multiple model parameters and multiple evaluation results corresponding to the multiple model parameters by a grid search method and a K-fold cross-validation method to obtain the optimal model parameters, wherein the multiple model parameters include the first model parameters, and the multiple evaluation results include the first evaluation result.
[0013] In an exemplary embodiment, the second short-term power prediction results corresponding to different time characteristics are smoothed by a local weighted regression smoothing method to obtain multiple smooth and continuous short-term power prediction results, including: determining a third short-term power prediction result among multiple second short-term power prediction results, wherein the time characteristic corresponding to the third short-term power prediction result is a time intersection point of adjacent time periods with different weight information; determining multiple fourth short-term power prediction results among multiple second short-term power prediction results according to a smoothing parameter, wherein the multiple fourth short-term power prediction results are neighbor data points of the third short-term power prediction result; assigning weights to the multiple fourth short-term power prediction results according to the time distance between the multiple fourth short-term power prediction results and the third short-term power prediction result; performing weighted least squares estimation based on the multiple fourth short-term power prediction results and the weights of the multiple fourth short-term power prediction results to obtain a smoothed value of the third short-term power prediction result; and updating the third short-term power prediction result among multiple second short-term power prediction results according to the smoothed value to obtain the multiple smooth and continuous short-term power prediction results.
[0014] According to another aspect of an embodiment of the present application, a short-term power prediction device is also provided, including: an acquisition module, used to acquire first environmental data of a new energy station within a first time period; a construction module, used to construct a first characteristic variable based on the first environmental data, wherein the first characteristic variable includes a first time feature corresponding to the first time period; a processing module, used to process the first characteristic variable through a short-term power prediction model to obtain a first short-term power prediction result, wherein the short-term power prediction model has different prediction accuracy for different time features, and the first short-term power prediction result is used to indicate the predicted output power of the new energy station in a second time period, and the second time period is located after the first time period.
[0015] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned short-term power prediction method when running.
[0016] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the short-term power prediction method through the computer program.
[0017] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.
[0018] Through the present application, a short-term power prediction method is provided, which first obtains first environmental data of a new energy site within a first time period, and constructs a first characteristic variable based on the first environmental data, wherein the first characteristic variable includes a first time feature corresponding to the first time period; then the first characteristic variable is processed by a short-term power prediction model to obtain a first short-term power prediction result, wherein the prediction accuracy of the short-term power prediction model for different time features is different, and the first short-term power prediction result is used to indicate the predicted output power of the new energy site in a second time period, and the second time period is located after the first time period; by adopting the above scheme, a new energy short-term power prediction model that considers the weight of time period prediction error is provided, which assigns different weights to the prediction errors at different time points, highlights the importance of accurate prediction of key time periods, further improves the adaptability of model prediction, and reduces the assessment cost caused by power prediction; thereby solving the problem in the related technology that the existing power prediction technology generally adopts a unified model for prediction for each time period, has poor prediction effect for peak time periods, and leads to high assessment costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0021] Figure 1 It is a hardware structure block diagram of a computer terminal of a short-term power prediction method according to an embodiment of the present application;
[0022] Figure 2 is a flow chart of a short-term power prediction method according to an embodiment of the present application;
[0023] Figure 3 It is a structural block diagram of a short-term power prediction device according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal of a short-term power prediction method according to an embodiment of the present application. Figure 1As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor (Central Processing Unit, CPU) or a programmable logic device (Field Programmable Gate Array, FPGA)) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0027] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the short-term power prediction method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0028] A wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0029] In this embodiment, a short-term power prediction method is provided. Figure 2 is a flow chart of a short-term power prediction method according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0030] Step S202, obtaining first environmental data of the new energy station within a first time period;
[0031] Step S204, constructing a first characteristic variable according to the first environmental data, wherein the first characteristic variable includes a first time characteristic corresponding to the first time period;
[0032] Step S206: Process the first characteristic variable through a short-term power prediction model to obtain a first short-term power prediction result, wherein the short-term power prediction model has different prediction accuracy for different time characteristics, and the first short-term power prediction result is used to indicate the predicted output power of the new energy station in a second time period, and the second time period is located after the first time period.
[0033] Through the present application, first environmental data of a new energy station within a first time period is obtained, and a first characteristic variable is constructed according to the first environmental data, wherein the first characteristic variable includes a first time feature corresponding to the first time period; then the first characteristic variable is processed by a short-term power prediction model to obtain a first short-term power prediction result, wherein the prediction accuracy of the short-term power prediction model for different time features is different, and the first short-term power prediction result is used to indicate the predicted output power of the new energy station in a second time period, and the second time period is located after the first time period; by adopting the above scheme, a new energy short-term power prediction model that considers the weight of time period prediction error is provided, which assigns different weights to the prediction errors at different time points, highlights the importance of accurate prediction of key time periods, further improves the adaptability of model prediction, and reduces the assessment costs caused by power prediction; thereby solving the problem in the related technology that the existing power prediction technology generally adopts a unified model for prediction for each time period, has poor prediction effect for peak time periods, and results in high assessment costs.
[0034] In an exemplary embodiment, before processing the first characteristic variable through the short-term power prediction model, the method also includes: constructing a second characteristic variable based on historical data of the new energy station in a third time period, wherein the historical data includes: the actual output power of the new energy station, the second environmental data of the new energy station, and the second characteristic variable includes the second time feature corresponding to the third time period; taking the second characteristic variable as input and the actual output power as output, a lightweight hoist algorithm is used to train the short-term power prediction model to obtain the first model parameters of the short-term power prediction model and the second short-term power prediction result corresponding to the second characteristic variable; calculating the mean square error loss corresponding to the second short-term power prediction result according to the weight information of different time features, and adjusting the first model parameters according to the mean square error loss and the second short-term power prediction result to obtain the optimal model parameters; determining the short-term power prediction model according to the optimal model parameters.
[0035] The training process of the above short-term power prediction model includes: first obtaining the historical data of the new energy station in the third time period, the historical data including the actual output power, actual wind speed and weather forecast data of the new energy station (i.e., the above-mentioned second environmental data). For weather forecast data, the wind farm at least includes the wind speed and wind direction near the height of the wind turbine hub, the temperature, humidity and atmospheric pressure of the ground, and the photovoltaic power station at least includes the total solar radiation, the temperature, humidity and pressure of the ground. The above data are aligned in time, with a time resolution of 15 minutes and a time span of not less than 12 months. Then, the feature is constructed according to the historical data to obtain the second feature variable. Then, the second feature variable is used as input and the actual output power is used as output, and the model is trained using the Light GBM algorithm to obtain the prediction result (i.e., the above-mentioned second short-term power prediction result) and a set of model parameters (i.e., the above-mentioned first model parameters); the mean square error loss corresponding to the second short-term power prediction result is calculated according to the full information of different time features, and then the mean square error loss and the second short-term power prediction result are used to adjust the first model parameters to obtain the optimal model parameters, and then the trained short-term power prediction model is obtained.
[0036] Optionally, calculating the mean square error loss corresponding to the second short-term power prediction result according to the weight information of different time characteristics includes: using the formula The mean square error loss is calculated, wherein WMSE is the mean square error loss, n1 is the number of data points of the plurality of first data points that meet the first classification condition, n2 is the number of data points of the plurality of second data points that meet the second classification condition, and n3 is the number of data points of the plurality of third data points that do not meet the first classification condition and the second classification condition. for calculating a first mean square error loss of the plurality of first data points, for calculating a second mean square error loss for the plurality of second data points, For calculating the third mean square error loss of the plurality of third data points, the first classification condition includes: the time feature belongs to the first preset time period and The second classification condition includes: the time feature belongs to the second preset time period and α is the first weight information corresponding to the first preset time period, and β is the second weight information corresponding to the second preset time period.
[0037] The commonly used prediction algorithm loss function in related technologies is the mean square error loss (MSE), and the formula is: This formula uses a unified coefficient to calculate the error for each point, without considering the differences in different time periods, nor the differences between positive and negative deviations. Therefore, in the embodiment of the present application, a weighted error assessment mechanism is adopted, using the mean square error loss function (WMSE) formula To calculate the mean square error loss, the first item in the above brackets is the new energy peak period and satisfies The mean square error calculation is performed when α is the weight coefficient, n1 is the time period when new energy is generated and satisfies The second term in the brackets above is the peak power consumption period and satisfies The mean square error calculation is performed when α is the weight coefficient, n2 is the period of high-energy generation of new energy and satisfies The third item in the brackets of the above formula is the mean square error calculation of the data points that do not meet the first two conditions, n3 is the corresponding number of data points, and the weight coefficient is 1 at this time, which is the same as the traditional mean square error calculation. The weight coefficients α and β can be selected according to the assessment rules, data characteristics and experience. In the embodiment of the present application, the assessment coefficient under the first two conditions is doubled from 0.2 points / 10,000 kWh to 0.4 points / 10,000 kWh compared to the third item. Therefore, the values of α and β in this example can be taken as 2, indicating that the error weight in the first two cases is twice that of the third item.
[0038] Specifically, the assessment coefficient table for different time periods is shown in Table 1:
[0039] Table 1
[0040]
[0041] Among them, the new energy generation period is 10:00-16:00 every day, the peak power consumption period is 6:00-9:00 and 17:00-22:00, and the other periods are 0:00-6:00, 9:00-10:00, 16:00-17:00 and 22:00-24:00. As can be seen from the table, the assessment coefficient is 0.2 points / 10,000 kWh in general, and the assessment coefficient increases to 0.4 points / 10,000 kWh when the new energy generation period forecast is low and the peak power consumption period forecast is high.
[0042] Optionally, a second characteristic variable is constructed based on the historical data of the new energy station in a third time period, including: time aligning the historical data according to the time resolution of the short-term power prediction model to obtain aligned historical data; performing data cleaning on the aligned historical data to remove abnormal data in the aligned historical data to obtain cleaned historical data; and constructing the second characteristic variable based on the cleaned historical data.
[0043] After collecting historical data, it is first necessary to time-align the historical data according to the time resolution of the short-term power prediction model, for example, the time resolution is 15 minutes and the time span is not less than 12 months; then the aligned historical data is cleaned, and the 3σ criterion and the quartile method are used to identify and remove outliers in each data item. For the scatter plot of actual power and actual wind speed, the k-nearest neighbor clustering method is used to further remove outliers. Finally, for the data after removing outliers, the elements in the weather forecast data are used as characteristic variables for short-term power prediction. In order to consider the weights of different time periods, the time characteristics of each data point are further extracted as characteristic variables for short-term power prediction. The extracted time features include month, day and hour.
[0044] It should be noted that after collecting historical data, time alignment is a key step to ensure that the data can be used for effective model training. Different types of sensors or data sources may provide data at different timestamps, so these data need to be unified into the same time series framework. The following are the general steps for time alignment:
[0045] 1. Determine the time reference: First, select a time reference, which is usually the minimum time interval for data collection or the expected time resolution of model prediction (15 minutes in this embodiment of the application). This will serve as the time reference point for all data.
[0046] 2. Data timestamp conversion: Convert the timestamps of all historical data to a format consistent with the time base. If the data is recorded in seconds or minutes, make sure they are all converted to 15-minute time intervals.
[0047] 3. Timeline creation: Build a timeline from the start time to the end time of the historical data, with a time interval of 15 minutes. This will serve as the time frame for all data to align.
[0048] 4. Data filling and interpolation: For each time point on the timeline, find the most recent record from the original data. If there is no data at a certain time point, you can do one of the following: Interpolation: Use linear interpolation, polynomial interpolation, or other interpolation methods to estimate missing values based on the nearest and farthest data points. Forward or backward filling: Fill missing values with the data value of the previous time point (forward filling) or the next time point (backward filling). Average filling: For some data sources (such as weather data), you can use the average of the previous and next to fill missing values, or use the average of a specific time period. Fill using a predictive model: If the data missing situation is serious, you can use a data prediction model to fill the missing values, which is usually done after preliminary data cleaning and model training.
[0049] 5. Data merging: Merge all aligned data (actual power, wind speed, weather forecast data, etc.) into one dataset. This can be done by using the merge or concat function in pandas (Python’s data analysis library), ensuring that all data is based on the same timeline.
[0050] 6. Check and adjust: Finally, check the results of data alignment to ensure that the data is consistent in time and there are no errors or abnormal timing. If necessary, make further data adjustments based on the specific situation.
[0051] Through the above steps, we can ensure that all historical data are aligned in time, providing consistent time series data for model training. This step is crucial for accurately predicting the power generation of new energy sites, because it ensures the temporal continuity and consistency of the model input data, thereby improving the model's prediction performance.
[0052] Optionally, the first model parameters are adjusted according to the mean square error loss and the second short-term power prediction results to obtain optimal model parameters, including: smoothing the second short-term power prediction results corresponding to different time characteristics by a local weighted regression smoothing method to obtain multiple smooth and continuous short-term power prediction results; evaluating the multiple short-term power prediction results according to the mean square error loss to obtain a first evaluation result corresponding to the first model parameters; searching for optimal model parameters for multiple model parameters and multiple evaluation results corresponding to the multiple model parameters by a grid search method and a K-fold cross-validation method to obtain the optimal model parameters, wherein the multiple model parameters include the first model parameters, and the multiple evaluation results include the first evaluation result.
[0053] In order to avoid the mutation effect of the weighted mean square loss function on the prediction results of the handover time points during the period of large-scale new energy generation, peak power consumption, and other time periods, the second short-term power prediction result is post-processed, and the handover time point prediction result is post-processed by the local weighted regression smoothing method to obtain a relatively smooth and continuous prediction result. In this embodiment, the handover time points include 6:00, 9:00, 10:00, 16:00, 17:00 and 22:00. Then, the weighted mean square error loss is used to evaluate these multiple short-term power prediction results, and the grid search method and the K-fold (for example, 5-fold) cross-validation method are used to search for the optimal prediction model parameters (i.e., the above-mentioned optimal model parameters).
[0054] It should be noted that parameter optimization grid search (Grid Search): This is a systematic parameter search method that searches for the best model parameters by testing all possible parameter combinations in a predefined parameter space. In this process, WMSE is used as a criterion for measuring the performance of parameter settings. Grid search can ensure that the optimization of model parameters is based on a comprehensive search strategy, but it may be time-consuming, especially when the parameter space is large. K-fold cross validation: In order to more reliably evaluate and optimize model parameters, 5-fold cross validation can be used. This method divides the dataset into K equal subsets, taking turns to use one of the subsets as the test set and the remaining subsets as the training set. In this way, the model will be trained and tested in each fold, and the final performance evaluation is based on the average results of all K tests. Using cross validation can reduce the risk of overfitting and ensure that the selection of model parameters is based on stable prediction performance on different data subsets.
[0055] Combining grid search and cross validation, this application can find a set of optimal parameters that minimize WMSE among a series of candidate parameters. This process may require a lot of computing resources because the model needs to be trained and cross-validated for each parameter combination in the grid search. But in the end, the optimal parameters determined by this method will greatly improve the prediction accuracy and stability of the model, especially in those critical periods with strict assessment criteria for the prediction results.
[0056] Through model evaluation and parameter optimization in the above process, this application ensures that the final model can predict the short-term power of new energy stations in the best state, thereby providing more reliable data support for power grid dispatching in practical applications and reducing assessment costs caused by prediction errors.
[0057] Optionally, the second short-term power prediction results corresponding to different time characteristics are smoothed by a local weighted regression smoothing method to obtain multiple smooth and continuous short-term power prediction results, including: determining a third short-term power prediction result among multiple second short-term power prediction results, wherein the time characteristic corresponding to the third short-term power prediction result is a time intersection point of adjacent time periods with different weight information; determining multiple fourth short-term power prediction results among multiple second short-term power prediction results according to a smoothing parameter, wherein the multiple fourth short-term power prediction results are neighbor data points of the third short-term power prediction result; assigning weights to the multiple fourth short-term power prediction results according to the time distance between the multiple fourth short-term power prediction results and the third short-term power prediction result; performing weighted least squares estimation based on the multiple fourth short-term power prediction results and the weights of the multiple fourth short-term power prediction results to obtain a smoothed value of the third short-term power prediction result; and updating the third short-term power prediction result among multiple second short-term power prediction results according to the smoothed value to obtain the multiple smooth and continuous short-term power prediction results.
[0058] Locally Weighted Scatterplot Smoothing (LOWESS or Loess) is a nonparametric regression technique used to smooth the data in the scatter plot to make it more continuous and in line with the actual situation. This method is particularly effective when dealing with the prediction results of the time period intersection in the short-term power forecast of renewable energy, because it can flexibly adapt to the local changes of the data while reducing the mutation effect. The following are the basic steps of the local weighted regression smoothing method to process data:
[0059] 1. Determine the smoothing parameter: First, you need to choose a smoothing parameter, which is usually expressed as a percentage of data points (for example, the nearest 10% or 20% of data points). This parameter determines how many neighboring data points are considered around each point for local regression.
[0060] 2. Weight assignment: For each data point i, calculate the weight of its neighboring points. The weight is usually determined based on the distance from point i. The closest point has the highest weight, and the weight decreases as the distance increases. The weight function can be a Gaussian kernel function or a trigonometric function, etc.
[0061] 3. Local weighted regression: At each data point i, use its surrounding neighboring points and their corresponding weights to perform weighted least squares estimation to build a local linear or polynomial model. This model is used to predict the smoothed value at point i.
[0062] 4. Iterative process: Local weighted regression is usually an iterative process. The initial weights can be assigned based on the distance, and then the weights are readjusted according to the size of the model residual. The local regression is repeated until certain stopping conditions are met, such as the reduction in the residual is less than a certain threshold.
[0063] 5. Obtain smooth results: Through the above steps, each original data point is assigned a smoother estimate, and finally a continuous and smooth prediction curve is formed.
[0064] In the embodiment of the present application, the local weighted regression smoothing method is mainly used to process the prediction results of the intersection points of the time periods, so as to reduce the prediction errors caused by the sudden changes or discontinuities that may occur in the prediction model at these points, thereby obtaining a smooth prediction curve that is more in line with the actual situation and improving the quality of the prediction results. This method is particularly suitable for processing data with periodic or seasonal changes because it can capture the patterns of these local changes while suppressing the influence of abnormal points.
[0065] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0066] Optionally, a short-term power prediction device is also provided in the present embodiment, and the device is applied to the above-mentioned system embodiment and preferred implementation mode, and the description has been made no further. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the equipment described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceivable.
[0067] Figure 3 : is a structural block diagram of a short-term power prediction device according to an embodiment of the present application, the device comprising:
[0068] An acquisition module 32 is used to acquire first environmental data of a new energy station within a first time period;
[0069] A construction module 34, configured to construct a first characteristic variable according to the first environmental data, wherein the first characteristic variable includes a first time characteristic corresponding to the first time period;
[0070] The processing module 36 is used to process the first characteristic variable through a short-term power prediction model to obtain a first short-term power prediction result, wherein the short-term power prediction model has different prediction accuracy for different time characteristics, and the first short-term power prediction result is used to indicate the predicted output power of the new energy station in a second time period, and the second time period is located after the first time period.
[0071] Through the above scheme, the first environmental data of the new energy station in the first time period is first obtained, and the first characteristic variable is constructed according to the first environmental data, wherein the first characteristic variable includes the first time feature corresponding to the first time period; then the first characteristic variable is processed by the short-term power prediction model to obtain the first short-term power prediction result, wherein the prediction accuracy of the short-term power prediction model for different time features is different, and the first short-term power prediction result is used to indicate the predicted output power of the new energy station in the second time period, and the second time period is located after the first time period; by adopting the above scheme, a new energy short-term power prediction model that considers the weight of the prediction error of each time period is provided, different weights are given to the prediction errors at different time points, the importance of accurate prediction of key time periods is highlighted, the adaptability of the model prediction is further improved, and the assessment cost caused by power prediction is reduced; thereby solving the problem in the related technology that the existing power prediction technology generally adopts a unified model for prediction for each time period, the prediction effect for the peak time period is poor, and the high assessment cost is generated.
[0072] In an exemplary embodiment, the processing module 36 is also used to construct a second characteristic variable based on historical data of the new energy station in a third time period, wherein the historical data includes: the actual output power of the new energy station, the second environmental data of the new energy station, and the second characteristic variable includes the second time feature corresponding to the third time period; taking the second characteristic variable as input and the actual output power as output, a lightweight lifting machine algorithm is used to train a short-term power prediction model to obtain first model parameters of the short-term power prediction model and a second short-term power prediction result corresponding to the second characteristic variable; calculating the mean square error loss corresponding to the second short-term power prediction result according to the weight information of different time features, and adjusting the first model parameters according to the mean square error loss and the second short-term power prediction result to obtain the optimal model parameters; determining the short-term power prediction model according to the optimal model parameters.
[0073] In an exemplary embodiment, the processing module 36 is further configured to: The mean square error loss is calculated, wherein WMSE is the mean square error loss, n1 is the number of data points of the plurality of first data points that meet the first classification condition, n2 is the number of data points of the plurality of second data points that meet the second classification condition, and n3 is the number of data points of the plurality of third data points that do not meet the first classification condition and the second classification condition. for calculating a first mean square error loss of the plurality of first data points, for calculating a second mean square error loss for the plurality of second data points, For calculating the third mean square error loss of the plurality of third data points, the first classification condition includes: the time feature belongs to the first preset time period and The second classification condition includes: the time feature belongs to the second preset time period and α is the first weight information corresponding to the first preset time period, and β is the second weight information corresponding to the second preset time period.
[0074] In an exemplary embodiment, the above-mentioned construction module 34 is also used to time align the historical data according to the time resolution of the short-term power prediction model to obtain aligned historical data; perform data cleaning on the aligned historical data to remove abnormal data in the aligned historical data to obtain cleaned historical data; and construct the second characteristic variable based on the cleaned historical data.
[0075] In an exemplary embodiment, the above-mentioned processing module 36 is also used to smooth the second short-term power prediction results corresponding to different time characteristics through a local weighted regression smoothing method to obtain multiple smooth and continuous short-term power prediction results; evaluate the multiple short-term power prediction results according to the mean square error loss to obtain a first evaluation result corresponding to the first model parameter; search for the optimal model parameters for multiple model parameters and multiple evaluation results corresponding to the multiple model parameters through a grid search method and a K-fold cross-validation method to obtain the optimal model parameters, wherein the multiple model parameters include the first model parameters, and the multiple evaluation results include the first evaluation result.
[0076] In an exemplary embodiment, the processing module 36 is also used to determine a third short-term power prediction result among multiple second short-term power prediction results, wherein the time feature corresponding to the third short-term power prediction result is a time intersection point of adjacent time periods with different weight information; determine multiple fourth short-term power prediction results among multiple second short-term power prediction results according to a smoothing parameter, wherein the multiple fourth short-term power prediction results are neighbor data points of the third short-term power prediction result; assign weights to the multiple fourth short-term power prediction results according to the time distance between the multiple fourth short-term power prediction results and the third short-term power prediction result; perform weighted least squares estimation based on the multiple fourth short-term power prediction results and the weights of the multiple fourth short-term power prediction results to obtain a smoothed value of the third short-term power prediction result; and update the third short-term power prediction result among multiple second short-term power prediction results according to the smoothed value to obtain the multiple smooth and continuous short-term power prediction results.
[0077] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0078] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0079] S1, obtaining first environmental data of a new energy station in a first time period;
[0080] S2, constructing a first characteristic variable according to the first environmental data, wherein the first characteristic variable includes a first time characteristic corresponding to the first time period;
[0081] S3. Process the first characteristic variable through a short-term power prediction model to obtain a first short-term power prediction result, wherein the short-term power prediction model has different prediction accuracy for different time characteristics, and the first short-term power prediction result is used to indicate the predicted output power of the new energy station in a second time period, and the second time period is located after the first time period.
[0082] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0083] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0084] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0085] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0086] S1, obtaining first environmental data of a new energy station in a first time period;
[0087] S2, constructing a first characteristic variable according to the first environmental data, wherein the first characteristic variable includes a first time characteristic corresponding to the first time period;
[0088] S3. Process the first characteristic variable through a short-term power prediction model to obtain a first short-term power prediction result, wherein the short-term power prediction model has different prediction accuracy for different time characteristics, and the first short-term power prediction result is used to indicate the predicted output power of the new energy station in a second time period, and the second time period is located after the first time period.
[0089] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0090] An embodiment of the present application further provides a computer program product, comprising a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program product, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.
[0091] Optionally, in this embodiment, the above computer program may be configured to implement the following steps when executed by a processor:
[0092] S1, obtaining first environmental data of a new energy station in a first time period;
[0093] S2, constructing a first characteristic variable according to the first environmental data, wherein the first characteristic variable includes a first time characteristic corresponding to the first time period;
[0094] S3. Process the first characteristic variable through a short-term power prediction model to obtain a first short-term power prediction result, wherein the short-term power prediction model has different prediction accuracy for different time characteristics, and the first short-term power prediction result is used to indicate the predicted output power of the new energy station in a second time period, and the second time period is located after the first time period.
[0095] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0096] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0097] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A short-term power prediction method, characterized in that: include: Acquire first environmental data of the new energy station within a first time period; Constructing a first characteristic variable according to the first environmental data, wherein the first characteristic variable includes a first time characteristic corresponding to the first time period; The first characteristic variable is processed by a short-term power prediction model to obtain a first short-term power prediction result, wherein the short-term power prediction model has different prediction accuracy for different time characteristics, and the first short-term power prediction result is used to indicate the predicted output power of the new energy station in a second time period, and the second time period is located after the first time period.
2. The method according to claim 1, characterized in that Before processing the first characteristic variable by using the short-term power prediction model, the method further includes: Constructing a second characteristic variable according to historical data of the new energy station in a third time period, wherein the historical data includes: actual output power of the new energy station, second environmental data of the new energy station, and the second characteristic variable includes a second time characteristic corresponding to the third time period; Taking the second characteristic variable as input and the actual output power as output, a lightweight hoist algorithm is used to train a short-term power prediction model to obtain a first model parameter of the short-term power prediction model and a second short-term power prediction result corresponding to the second characteristic variable; Calculating the mean square error loss corresponding to the second short-term power prediction result according to the weight information of different time characteristics, and adjusting the first model parameters according to the mean square error loss and the second short-term power prediction result to obtain optimal model parameters; The short-term power prediction model is determined according to the optimal model parameters.
3. The method according to claim 2, characterized in that Calculating the mean square error loss corresponding to the second short-term power prediction result according to the weight information of different time features includes: By formula Calculate the mean square error loss, where WMSE is the mean square error loss, n1 is the number of data points of the first data points that meet the first classification condition, n2 is the number of data points of the second data points that meet the second classification condition, and n3 is the number of data points of the third data points that do not meet the first classification condition and the second classification condition. for calculating a first mean square error loss of the plurality of first data points, for calculating a second mean square error loss for the plurality of second data points, For calculating the third mean square error loss of the plurality of third data points, the first classification condition includes: the time feature belongs to the first preset time period and The second classification condition includes: the time feature belongs to the second preset time period and α is the first weight information corresponding to the first preset time period, and β is the second weight information corresponding to the second preset time period.
4. The method according to claim 2, characterized in that: The second characteristic variable is constructed according to the historical data of the new energy station in the third time period, including: Performing time alignment on the historical data according to the time resolution of the short-term power prediction model to obtain aligned historical data; Performing data cleaning on the aligned historical data to remove abnormal data in the aligned historical data to obtain cleaned historical data; The second characteristic variable is constructed according to the cleaned historical data.
5. The method according to claim 2, characterized in that: The first model parameters are adjusted according to the mean square error loss and the second short-term power prediction result to obtain optimal model parameters, including: Smoothing the second short-term power prediction results corresponding to different time characteristics by a local weighted regression smoothing method to obtain a plurality of smooth and continuous short-term power prediction results; Evaluate the multiple short-term power prediction results according to the mean square error loss to obtain a first evaluation result corresponding to the first model parameter; An optimal model parameter search is performed on multiple model parameters and multiple evaluation results corresponding to the multiple model parameters through a grid search method and a K-fold cross-validation method to obtain the optimal model parameters, wherein the multiple model parameters include the first model parameters, and the multiple evaluation results include the first evaluation results.
6. The method according to claim 5, characterized in that The second short-term power prediction results corresponding to different time characteristics are smoothed by a local weighted regression smoothing method to obtain a plurality of smooth and continuous short-term power prediction results, including: Determine a third short-term power prediction result among the plurality of second short-term power prediction results, wherein the time feature corresponding to the third short-term power prediction result is a time intersection point of adjacent time periods with different weight information; Determine a plurality of fourth short-term power prediction results from the plurality of second short-term power prediction results according to a smoothing parameter, wherein the plurality of fourth short-term power prediction results are neighboring data points of the third short-term power prediction result; Allocating weights for the plurality of fourth short-term power prediction results according to time distances between the plurality of fourth short-term power prediction results and the third short-term power prediction result; Performing weighted least squares estimation according to the plurality of fourth short-term power prediction results and weights of the plurality of fourth short-term power prediction results to obtain a smoothed value of the third short-term power prediction result; The third short-term power prediction result among the plurality of second short-term power prediction results is updated according to the smoothing value to obtain the plurality of smooth and continuous short-term power prediction results.
7. A short-term power prediction device, characterized in that: include: An acquisition module, used to acquire first environmental data of a new energy station within a first time period; A construction module, configured to construct a first characteristic variable according to the first environmental data, wherein the first characteristic variable includes a first time characteristic corresponding to the first time period; A processing module is used to process the first characteristic variable through a short-term power prediction model to obtain a first short-term power prediction result, wherein the short-term power prediction model has different prediction accuracy for different time characteristics, and the first short-term power prediction result is used to indicate the predicted output power of the new energy station in a second time period, and the second time period is located after the first time period.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 6 when executed.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.