Methods and devices for predicting power generation, storage media, and electronic devices.
By combining the Long Short-Term Memory (LSTM) network model with a sliding window and meta-learning algorithm, and utilizing historical operation data and meteorological data of wind turbines, the problem of low accuracy in wind turbine power generation prediction was solved. This achieved efficient and accurate power generation prediction, reduced operation and maintenance costs, and improved the operating efficiency of the power system.
Patent Information
- Application Number
- CN202411743173.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-11-29
AI Technical Summary
Existing methods for predicting wind turbine power generation have low accuracy, especially in the absence of historical data. Traditional models are computationally expensive and difficult to maintain long-term accuracy, while artificial intelligence methods require frequent iterative training, resulting in insufficient economy and stability.
We employ a Long Short-Term Memory (LSTM) network model, combined with historical operating data of wind turbines and meteorological data, and train the model using a sliding window and meta-learning algorithm to improve prediction accuracy and robustness.
It enables accurate and efficient prediction of wind turbine power generation, reduces operation and maintenance costs, and improves the operating efficiency of the power system and the dispatching capability of wind farms.
Smart Images

Figure CN119825643B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a method and apparatus for predicting power generation, a storage medium, and an electronic device. Background Technology
[0002] Predicting the power generation of wind turbines is crucial for the stable operation of power systems, especially in the context of newly built wind farms. Most existing prediction methods are based on traditional wind power prediction models, which mainly include physical models, statistical models, and artificial intelligence models.
[0003] However, due to the lack of historical data, traditional statistical models often fail to make accurate predictions. Physical models rely on complex parameter adjustments, resulting in high computational costs. Algorithm-based single prediction methods also struggle to maintain high accuracy over long periods. Even when using cutting-edge methods such as artificial intelligence, after a certain period of use, iterative retraining is required to ensure model accuracy, with little consideration given to economic efficiency and stability.
[0004] There is currently no effective solution to the problem of low accuracy in predicting the power generation of wind turbines in related technologies.
[0005] Therefore, it is necessary to improve the relevant technology to overcome the aforementioned defects. Summary of the Invention
[0006] This application provides a method and apparatus for predicting power generation, a storage medium, and an electronic device to at least address the problem of low accuracy in predicting the power generation of wind turbines.
[0007] According to one aspect of the embodiments of this application, a method for predicting power generation is provided, comprising: acquiring L historical data, wherein the m-th historical data in the L historical data includes the operation data of a wind turbine and meteorological data at the m-th historical time, m is an integer greater than or equal to 1 and less than or equal to L, the time interval between any two adjacent times in the L historical times is a target time interval, and L is an integer greater than or equal to 2; inputting the L historical data into a target Long Short-Term Memory (LSTM) network model to obtain the power generation of the wind turbine at time L+1, wherein the time interval between time L+1 and the L-th historical time is the target time interval.
[0008] In an exemplary embodiment, before inputting the L historical data into the target Long Short-Term Memory (LSTM) network model to obtain the power generation of the wind turbine at time L+1, the method further includes: acquiring Z sets of sample data, wherein the z-th set of sample data in the Z sets of sample data includes the z-th set of historical data and the z-th power, wherein the z-th power is the power generation of the wind turbine corresponding to the z-th set of historical data, and the z-th set of historical data includes the operating data and meteorological data of the wind turbine at L historical times; and using the Z sets of sample data to train a general LSTM model to obtain a target LSTM model.
[0009] In an exemplary embodiment, acquiring Z sets of sample data includes: acquiring N historical data points, wherein the nth historical data point includes the wind turbine's operating data and meteorological data at the nth historical moment, where n is an integer greater than or equal to 1 and less than or equal to N, the time interval between any two adjacent moments in the N historical moments is the target time interval, and N is an integer greater than L; dividing the N historical data points into N-L+1 data groups using a sliding window, wherein each data group in the N-L+1 data groups includes data from L historical moments; determining the N-L+1 power values corresponding to the N-L+1 data groups, and determining the Z sets of sample data based on the N-L+1 data groups and the N-L+1 power values, where Z equals N-L+1.
[0010] In an exemplary embodiment, training a general LSTM model using the Z sets of sample data to obtain a target LSTM model includes: dividing the Z sets of sample data into Z-H+1 datasets using a sliding window, wherein each dataset in the Z-H+1 datasets includes H sets of sample data, where H is an integer greater than or equal to 2; training the general LSTM model using the Z-H+1 datasets respectively to obtain Z-H+1 training error data; and updating the model parameters of the general LSTM model based on the Z-H+1 training error data to obtain the target LSTM model.
[0011] In an exemplary embodiment, the Z-H+1 datasets are used to train a general LSTM model to obtain Z-H+1 training error data points. This includes obtaining the i-th training error data point from the Z-H+1 training error data points through the following method: dividing the i-th dataset into a first data set and a second data set, wherein both the first and second data sets include one or more sets of sample data; and calculating intermediate error data using the first data set using the following formula (Formula 1). The intermediate error data, Let θ be the first dataset, θ be the model parameters of the general LSTM model, x be a set of historical data from the sample data in the first dataset, y be the power in the corresponding sample data, and f be the power in the sample data. θ For a general LSTM model with parameter θ: Formula 1: Update the model parameters of the general LSTM model based on the intermediate error data to obtain the updated LSTM model; Calculate the i-th training error data using the second data set using Formula 2, where, For the i-th training error data, For the second data set, θ T Here are the updated LSTM model parameters, where x is a set of historical data from the second dataset, y is the power in the corresponding sample data, and f is the power in the second dataset. θT For the LSTM model with the updated parameters:
[0012] In an exemplary embodiment, updating the model parameters of the general LSTM model based on the intermediate error data includes updating the model parameters of the general LSTM model using the following formula: Where θ represents the model parameters before the update, θ T The updated model parameters are given, where α is the first preset threshold. This is the second preset threshold.
[0013] In an exemplary embodiment, updating the model parameters of the general LSTM model based on the Z-H+1 training error data includes obtaining the updated model parameters of the general LSTM model using the following formula: Where θ represents the model parameters of the general LSTM model before the update, θ' represents the model parameters of the general LSTM model after the update, and β represents the third preset threshold. The second preset threshold, It is the sum of Z-H+1 training error data.
[0014] According to another aspect of the embodiments of this application, a power generation prediction device is also provided, comprising: an acquisition module, configured to acquire L historical data, wherein the m-th historical data in the L historical data includes the operation data of the wind turbine and meteorological data at the m-th historical time, m is an integer greater than or equal to 1 and less than or equal to L, the time interval between any two adjacent times in the L historical times is a target time interval, and L is an integer greater than or equal to 2; and an input module, configured to input the L historical data into a target Long Short-Term Memory (LSTM) network model to obtain the power generation of the wind turbine at time L+1, wherein the time interval between time L+1 and the L-th historical time is the target time interval.
[0015] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored program, wherein the program is configured to execute the above-described power generation prediction method when running.
[0016] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-described method for predicting power generation through the computer program.
[0017] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program, wherein the above-mentioned method for predicting power generation is executed by a processor.
[0018] This application obtains historical data of wind turbines and then uses a target long short-term memory network (LSTM) model to predict the power generation of wind turbines based on the historical data. Since the historical data used by the target long short-term memory network (LSTM) model includes the operating data of wind turbines at historical times and meteorological data, it comprehensively considers the data of multiple sources of parameters at multiple times, and thus can accurately and efficiently predict the power generation of wind turbines, solving the problem of low accuracy in predicting the power generation of wind turbines. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a hardware structure block diagram of a mobile terminal for a method of predicting power generation according to an embodiment of this application.
[0022] Figure 2 This is a flowchart of a method for predicting power generation according to an embodiment of this application;
[0023] Figure 3 This is an overall flowchart of an optional power generation prediction method according to an embodiment of this application;
[0024] Figure 4 This is a structural block diagram of a power generation prediction device according to an embodiment of this application. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a method of predicting power generation according to an embodiment of this application. For example... Figure 1 As shown, a mobile terminal may include one or more ( Figure 1Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor (MP) or a field-programmable gate array (FPGA)) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0028] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the power generation prediction method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and 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 memory remotely located relative to the processor 102, and these remote memories can be connected to a mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0029] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0030] To address the aforementioned issues, this embodiment provides a method for predicting power generation, including but not limited to applications in the aforementioned mobile terminal. Figure 2 This is a flowchart of a power generation prediction method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps S202-S204:
[0031] Step S202: Obtain L historical data, wherein the m-th historical data in the L historical data includes the wind turbine's operating data and meteorological data at the m-th historical time, where m is an integer greater than or equal to 1 and less than or equal to L, and the time interval between any two adjacent times in the L historical times is the target time interval, where L is an integer greater than or equal to 2.
[0032] Optionally, the operating data includes, but is not limited to: data directly related to the operating status of the wind turbine, such as the wind turbine speed; and meteorological data, including but not limited to: environmental factors such as wind speed, temperature, humidity, and air pressure.
[0033] Optionally, historical data can be collected every 1 minute or every 10 minutes to capture the temporal dependencies between data, ensuring the continuity of data and the integrity of the time series.
[0034] Step S204: Input the L historical data into the target Long Short-Term Memory (LSTM) network model to obtain the power generation of the wind turbine at time L+1, wherein the time interval between time L+1 and the Lth historical time is the target time interval.
[0035] It should be noted that the target Long Short-Term Memory network (LSTM) model is a special type of Recurrent Neural Network (RNN) architecture. By introducing memory units and gating mechanisms (input gate, forget gate, and output gate), it can effectively learn and utilize long-term dependency information. It is especially suitable for processing sequential data because it can remember long-term dependency information and overcome the gradient vanishing problem of traditional RNNs. This is particularly important in applications such as wind power forecasting that require consideration of long-term temporal relationships.
[0036] Optionally, when L historical data are input into the target Long Short-Term Memory (LSTM) network model, the model processes these data through its internal gating mechanism (input gate, forget gate, and output gate) to learn and predict the power generation of the wind turbine at time L+1.
[0037] It should be noted that the time interval between the (L+1)th time point and the Lth historical time point is the target time interval. This means that the model predicts the next time point in a closely sequential time series, ensuring the continuity and real-time nature of the prediction. For example, if the target time interval is 15 minutes, and data from four times within the past hour is available, the target Long Short-Term Memory (LSTM) network model will predict the power generation of the wind turbine 15 minutes later; if only data from the first four times within the past 1.5 hours is available, the target LSTM network model will predict the power generation of the wind turbine 15 minutes ago.
[0038] It should be noted that through the above steps, operational data and meteorological data of wind turbines are collected, enabling the system to more comprehensively consider various factors affecting power generation, including environmental conditions and equipment status. The Target Long Short-Term Memory (LSTM) model, with its ability to process time-series data, can capture long-term dependencies between data points. Especially in scenarios like wind power forecasting, which heavily rely on time-series analysis, it can significantly improve the accuracy and robustness of predictions. Furthermore, accurate power generation forecasting helps wind farms plan and adjust their power generation strategies in advance, reducing frequent adjustments and excessive maintenance caused by inaccurate forecasts, thereby lowering wind farm operation and maintenance costs and improving the operational efficiency of the power system.
[0039] The above steps acquire historical data of wind turbines, and then use the Target Long Short-Term Memory (LSTM) network model to predict the power generation of wind turbines based on the historical data. Since the historical data used by the Target Long Short-Term Memory (LSTM) network model includes the operating data of wind turbines at historical moments and meteorological data, it comprehensively considers the data of multiple sources of parameters at multiple moments, and thus can accurately and efficiently predict the power generation of wind turbines, solving the problem of low accuracy in predicting the power generation of wind turbines.
[0040] In an exemplary embodiment, before inputting the L historical data into the target Long Short-Term Memory (LSTM) network model to obtain the power generation of the wind turbine at time L+1, the method further includes the following steps S11-S12:
[0041] Step S11: Obtain Z sets of sample data, wherein the z-th set of sample data in the Z sets of sample data includes the z-th set of historical data and the z-th power, wherein the z-th power is the power generation of the wind turbine corresponding to the z-th set of historical data, and the z-th set of historical data includes the operating data and meteorological data of the wind turbine at L historical moments;
[0042] Optionally, assuming nine sample data points are obtained, each data point includes operational data such as wind speed, wind direction, temperature, and generator speed, as well as meteorological data, and the corresponding power generation for that data point. These data points can be divided into Z groups of sample data (each group contains three data points), with each group containing three consecutive records of operational and meteorological data, and the average power generation as the target value for that group. The average power generation is the average power generation of the wind turbine over L historical time points. This target value is used to train a general LSTM model. In this way, each data point not only includes changes in the environment and equipment over a period of time but also clarifies how these changes affect the final power generation, providing a strong data foundation for model training.
[0043] Step S12: Use the Z sets of sample data to train the general LSTM model to obtain the target LSTM model.
[0044] Optionally, after collecting and organizing the Z sets of sample data, a general LSTM model is trained using supervised learning on the Z sets of sample data. This allows the general LSTM model to learn the relationship between wind turbine power generation and historical operating data and meteorological data. The training process involves adjusting the model's parameters so that the model can extract meaningful features from the input data and predict the correct power generation.
[0045] It should be noted that the final model is the target LSTM model, which is the target long short-term memory network LSTM model used in step S204. This model has been adapted to the operating characteristics and meteorological conditions of a specific wind farm and can more accurately predict power generation.
[0046] It should be noted that by using Z sets of sample data for training, the model can learn and memorize the operating modes and environmental conditions of specific wind farms, enabling model personalization and improving prediction accuracy. After the model training is complete, real-time collected data can be input into the model, allowing it to quickly and accurately predict the power generation at the next time point based on its learned knowledge. This significantly improves the real-time scheduling of wind farms and the balanced operation capability of the power system.
[0047] In an exemplary embodiment, obtaining Z groups of sample data can be achieved through the following steps S21-S23:
[0048] Step S21: Obtain N historical data points, wherein the nth historical data point includes the wind turbine's operating data and meteorological data at the nth historical moment, where n is an integer greater than or equal to 1 and less than or equal to N, and the time interval between any two adjacent moments in the N historical moments is the target time interval, where N is an integer greater than L.
[0049] Optionally, the system retrieves N historical data points from the historical records of the wind farm where the wind turbine is located. Each data point (e.g., the nth historical data point) contains the wind turbine's operational data at a specific time point (the nth historical moment) and the corresponding meteorological data. N is set to an integer greater than L, meaning that the historical data sequence is longer than the sequence required for training the model, providing richer information for model training.
[0050] Step S22: Divide the N historical data into N-L+1 groups of data using a sliding window, wherein each group of data in the N-L+1 groups includes data from L historical moments;
[0051] Optionally, a sliding window method can be used to divide the N historical data points into several groups, each containing L consecutive historical time points. This means there are L sliding windows, which slide from the beginning of the sequence (the first historical data point in the N data points) to the end of the sequence (the Nth historical data point in the N data points). The window size is fixed at L data points, and the window slides one data point at a time until the end of the sequence. In this way, N-L+1 data groups can be obtained from the N historical data points, each representing the operation and weather conditions at L consecutive time points, providing the sequence samples needed for model training.
[0052] Step S23: Determine the N-L+1 power values corresponding to the N-L+1 sets of data, and determine the Z sets of sample data based on the N-L+1 sets of data and the N-L+1 power values, where Z equals N-L+1.
[0053] Optionally, after dividing the data into N-L+1 groups, the system will determine the power corresponding to each group, for a total of N-L+1 power values. The power of each group is the power of the wind turbine at the next time (L+1) after the last time of each group. For example, when the sliding window includes data from 3 historical time points, the first group includes historical data from the first time point (3 PM), the second time point (4 PM), and the third time point (5 PM). The power corresponding to the first group of data is the power generation of the wind turbine at 6 PM (known). That is, the power generation of the next time point that the model needs to predict after giving the data from the previous L time points.
[0054] Optionally, each set of data (i.e., operational and meteorological data from L historical moments) and its corresponding power generation at moment L+1 together constitute Z sets of sample data (where Z equals N-L+1). These sample data are used to train a general LSTM model, enabling it to learn and understand the past operating patterns of wind turbines and the impact of meteorological conditions on power generation, thereby more accurately predicting future power generation in subsequent online forecasts.
[0055] It should be noted that by using the sliding window method, the system can extract N-L+1 sets of effective sample data from N consecutive historical data, which maximizes the utilization efficiency of historical data and ensures the richness and comprehensiveness of data during model training. By constructing Z sets of sample data (Z equals N-L+1), the model can learn based on a longer historical sequence, which helps to capture more complex temporal dependencies and patterns, thereby improving the accuracy of prediction.
[0056] It should be noted that through the above steps, the system extracts a sample dataset for training from historical data, which not only improves the efficiency of data utilization but also enhances the predictive ability and adaptability of the model, providing strong technical support for accurate prediction and optimized scheduling of wind farm power generation.
[0057] In an exemplary embodiment, the target LSTM model is obtained by training the general LSTM model using the Z sets of sample data, which can be achieved through the following steps S31-S33:
[0058] Step S31: Divide the Z groups of sample data into Z-H+1 groups of datasets using a sliding window, wherein each group of datasets in the Z-H+1 groups includes H groups of sample data, where H is an integer greater than or equal to 2;
[0059] Optionally, the system further divides the collected and prepared Z sets of sample data into smaller subsets, namely Z-H+1 datasets, using a sliding window method. Each dataset contains H sets of sample data. Here, H is an integer greater than or equal to 2, representing the amount of sample data contained in each subset or task. The purpose of this step is to create multiple similar but distinct "meta-tasks," each consisting of H sets of sample data, which can be viewed as a small training set used to independently train the model.
[0060] It's important to note that the Z-H+1 tasks created using a sliding window each contain a sufficient amount of continuous sample data to train the model and learn temporal dependencies. This approach helps the model learn common features and patterns from different but related tasks during training, enhancing its generalization ability.
[0061] Step S32: Use the Z-H+1 datasets to train the general LSTM model respectively, and obtain Z-H+1 training error data;
[0062] Optionally, for each created dataset (i.e., each meta-task), the system uses that dataset to train a general LSTM model and records the training error data. This means the model will undergo Z-H+1 training cycles, each for a specific subset of the dataset. After each training cycle, the system evaluates the model's accuracy in predicting power generation on that subset, calculates the model's training error, and records these errors for use in subsequent meta-learning updates.
[0063] Step S33: Update the model parameters of the general LSTM model based on the Z-H+1 training error data to obtain the target LSTM model.
[0064] Optionally, the system updates the parameters of the general LSTM model based on all error data obtained from Z-H+1 training iterations. This update process is the core of meta-learning. The goal of meta-learning is to enable the model to quickly adapt to new tasks, i.e., to quickly learn and predict the power generation of wind farms under different conditions. Through meta-learning algorithms (such as Model-Agnostic Meta-Learning (MAML)), the model parameters are updated to minimize the average prediction error across all tasks. The resulting model parameters (i.e., the target LSTM model) will have stronger generalization capabilities and be better able to handle the practical problem of wind farm power generation prediction.
[0065] It should be noted that, through the above steps, the system employs a meta-learning strategy to create multiple tasks from the Z sets of sample data, independently train the model, and finally optimize the model parameters by integrating the error data from all tasks, resulting in a target LSTM model that can more accurately and quickly adapt to wind farm power generation prediction. This meta-learning-based training method can significantly improve the model's predictive performance and stability when dealing with complex and variable wind farm data.
[0066] In an exemplary embodiment, a general LSTM model is trained using Z-H+1 datasets to obtain Z-H+1 training error data points. This can be achieved through the following steps: obtaining the i-th training error data point from the Z-H+1 training error data points through steps S41-S44, thus obtaining the Z-H+1 training error data points:
[0067] Step S41: Divide the i-th dataset in the Z-H+1 dataset to obtain a first data set and a second data set, wherein the first data set and the second data set each include one or more sets of sample data.
[0068] Optionally, the i-th dataset is selected from the created Z-H+1 datasets and randomly divided into two subsets: a first dataset and a second dataset. The first dataset is used to train the model, while the second dataset is used to evaluate the model's predictive performance on unseen data after training, i.e., to evaluate the model's generalization ability. This partitioning method is based on the concepts of "Support Set" and "Query Set" in meta-learning, where the first dataset is equivalent to the support set and the second dataset is equivalent to the query set.
[0069] Step S42: Calculate the intermediate error data using the first dataset according to the following formula, wherein, The intermediate error data, Let θ be the first dataset, θ be the model parameters of the general LSTM model, x be a set of historical data from the sample data in the first dataset, y be the power in the corresponding sample data, and f be the power in the sample data. θ For a general LSTM model with parameter θ:
[0070]
[0071] Optionally, the general LSTM model can be trained using data from the first dataset. Formula 1 calculates the prediction error of the model on the first dataset, i.e., the intermediate error data, which is the error between the prediction result of the trained model on the first dataset and the actual power generation.
[0072] Step S43: Update the model parameters of the general LSTM model based on the intermediate error data to obtain the LSTM model with updated parameters;
[0073] Optionally, after calculating the intermediate error data of the model on the first dataset, this error data needs to be used to update the model parameters, resulting in an updated LSTM model. The parameter update process is typically implemented using a backpropagation algorithm (such as gradient descent) to adjust the model parameters to minimize the prediction error. The updated model parameters will serve as the basis for subsequent steps to further evaluate model performance and ultimately determine the target model parameters.
[0074] Step S44: Calculate the i-th training error data using the second dataset according to the following formula two, where, For the i-th training error data, For the second data set, θ T Here are the updated LSTM model parameters, where x is a set of historical data from the second dataset, y is the power in the corresponding sample data, and f is the power in the second dataset. θT For the LSTM model with the updated parameters:
[0075]
[0076] Optionally, the data in the second dataset is used to evaluate the performance of the LSTM model after parameter updates, and the i-th training error data is calculated. The training error data is an important indicator for evaluating the generalization ability of the model, reflecting the prediction error of the model on data not used for training.
[0077] It's important to note that through the meta-learning framework, the LSTM model can learn from multiple similar but independent tasks (i.e., the Z-H+1 datasets), which helps improve the model's generalization performance on new data. Using Equations 1 and 2, the model can not only learn on the training set (the first dataset) but also adjust its parameters by evaluating its performance on the evaluation set (the second dataset). This reduces the risk of overfitting and improves the model's robustness. The LSTM model with updated parameters will be more accurate in predicting wind farm power generation, especially when dealing with new scenarios or data, as it can adapt quickly and reduce prediction errors.
[0078] It should be noted that the above steps effectively utilize historical datasets, improve data utilization efficiency, enhance the model training process, and provide a more accurate and reliable model for wind power prediction, which is particularly effective for handling complex and variable wind farm environmental data.
[0079] In an exemplary embodiment, updating the model parameters of the general LSTM model based on the intermediate error data can be achieved through the following steps: updating the model parameters of the general LSTM model using the following formula three:
[0080]
[0081] Where θ represents the model parameters before the update, θ T The updated model parameters are given, where α is the first preset threshold. This is the second preset threshold.
[0082] Optionally, θ represents the model parameters before the update, which is the model's state before the current training iteration; θ T The updated model parameters represent the state of the model after the current training iteration, adjusted based on intermediate error data. The intermediate error data represents the extent to which the model performs poorly on the current task (i.e., using the first dataset), and is used to guide the direction and magnitude of model parameter updates; α is the first preset threshold, which is usually a lower limit, used to restrict the minimum magnitude of parameter updates, ensuring that the model can still make some learning adjustments even when the error is small. The second preset threshold, usually an upper limit, is used to control the maximum magnitude of parameter updates, preventing excessive updates when the error is large, which could cause the model state to jump too much and potentially damage the model's stability.
[0083] It's important to note that α is the step size in single-task training, referring to the magnitude or speed of model parameter updates when processing a single task. In each training iteration for a specific task, the model adjusts its parameters based on the calculated gradient (i.e., the derivative of the error with respect to the parameters). α determines the magnitude of the gradient direction in which parameter adjustments are based, i.e., the distance the model parameters move in the gradient descent direction with each update. The setting of α directly affects the model's learning efficiency and stability on a single task. If α is chosen too large, the model parameters may update too quickly in the gradient direction, causing the model to "jump" in the parameter space, potentially missing the optimal solution or falling into an unstable state. Conversely, if α is too small, the model's learning speed will slow down, increasing the number of iterations required to reach the optimal solution and prolonging training time.
[0084] It should be noted that during the parameter update process, the update amount is constrained by introducing a first preset threshold and a second preset threshold, ensuring that the parameter update is neither too small (avoiding learning stagnation) nor too large (avoiding learning instability). By setting appropriate thresholds, the system can balance the model's rapid adaptability and stability, thereby achieving better generalization ability and prediction accuracy when dealing with short-term predictions of wind farm power generation.
[0085] It should be noted that Equation 3 describes how to update the model parameters of the general LSTM model based on intermediate error data to obtain the updated model parameters. This update process is a key step in the meta-learning strategy, aiming to enable the model to better generalize to new and unseen tasks by rapidly adjusting the model parameters across multiple tasks.
[0086] In an exemplary embodiment, updating the model parameters of the general LSTM model based on the Z-H+1 training error data can be achieved through the following steps: obtaining the updated model parameters of the general LSTM model using the following formula four:
[0087]
[0088] Where θ represents the model parameters of the general LSTM model before the update, θ' represents the model parameters of the general LSTM model after the update, and β represents the third preset threshold. The second preset threshold, It is the sum of Z-H+1 training error data.
[0089] Optionally, θ represents the model parameters of the general LSTM model before the update, which is the state of the model before the current meta-learning iteration; θ' represents the model parameters of the general LSTM model after the update, which is the state of the model after comprehensive adjustment based on the training error data of all tasks. The sum of Z-H+1 training error data points summarizes the model's prediction errors across all tasks, reflecting the overall performance of the model; β is the third preset threshold, typically used to limit the minimum magnitude of model parameter updates, ensuring that the model can make some learning adjustments even when the overall error is small. The second preset threshold, in Formula 4, is used to control the upper limit of the overall update magnitude.
[0090] It's important to note that β is the step size used to update the base model parameters (i.e., meta-initialization parameters) during meta-learning. In meta-learning, the model first performs a small number of iterations on multiple tasks (often called "fast adaptation"), and then updates the model's base parameters based on the learning results from all tasks to improve the model's generalization ability on new tasks. β determines the magnitude of these base parameter updates, i.e., the size of parameter adjustments during meta-learning. The setting of β affects how the general knowledge learned by the model across multiple tasks is integrated, and how the model "learns how to learn" from these tasks. If β is chosen too large, the model may adjust its base parameters too quickly, causing information learned from one task to overwrite information learned from other tasks, which may degrade the model's performance on some tasks. Conversely, if β is too small, the model's base parameters may be updated slowly, failing to effectively extract and apply common patterns from multiple tasks, thus limiting the model's generalization ability.
[0091] Optionally, firstly, the model parameter update amount is calculated based on the sum of training errors across all tasks. This update amount reflects the overall direction and magnitude of the model adjustments needed across all tasks to achieve better performance. Then, the update amount is constrained according to a third and a second preset threshold to ensure that the parameter updates are within a reasonable range—neither too small (avoiding learning stagnation) nor too large (avoiding compromising model stability or causing the model to overfit to certain tasks).
[0092] It should be noted that by comprehensively considering the training errors of all tasks, the system ensures that the model not only performs well on a single task but also adapts quickly to new tasks, improving prediction accuracy. Simultaneously, by setting reasonable thresholds, the system balances the model's learning speed and stability, avoiding overfitting or underfitting, and providing a more reliable and robust model for short-term wind farm power generation prediction.
[0093] Obviously, the embodiments described above are merely some embodiments of the present invention, and not all embodiments. To better understand the above method, the following description, in conjunction with embodiments, illustrates the process, but is not intended to limit the technical solutions of the embodiments of the present invention. Figure 3 The flowchart illustrating the overall process of a power generation prediction method according to an embodiment of the application is shown below. Specifically:
[0094] First, offline data is acquired, algorithm parameters are trained, and a trained model is obtained. Then, using runtime data and meteorological data, the trained meta-learning-LSTM model is used to obtain short-term wind power forecast results.
[0095] The specific implementation methods and processes are as follows:
[0096] Offline phase:
[0097] Step S301: Training data preprocessing, collect historical operation data and historical meteorological data of wind farms, including wind speed, temperature, etc., and perform data cleaning and processing on the raw data, including normalization data processing;
[0098] Step S302: Decompose the training task. Decompose each feature (a total of K features) in the training data into (N-L+1) groups through a sliding window, where K is the total number of features, N is the total number of training data, and L is the number of groups contained in the sliding window.
[0099] Optionally, all features constitute a data sequence S = {X1, X2, ..., X...} t ,…,X N}, where X t X is the value of each feature at time t. t ={x 1t ,x 2t ,…,x kt ,…,x Kt}, t∈[1,N], N is the total number of training data, k∈[1,K], K is the total number of features;
[0100] Optionally, S can be decomposed into multiple smaller windows W using a sliding window (containing L data points). i ={X i ,Xi+1 ,…,X i+L-1}, i∈[1,N-L+1], where N is the total number of training data and L is the number of elements contained in the sliding window. W i This refers to the sample input to the model, and the label corresponding to this sample is the wind power y at time (i+L). i+L That is, the wind power value at the next moment of the sliding window;
[0101] Optionally, each group of samples W i and tag y i+L This constitutes a sample combination P i Continue constructing new sliding windows (each containing H elements) to form a new sliding window dataset D. j ={P j ,P j+1 ,…,P j+H-1},j∈[1,(N-L+1)-H+1],N is the total number of training data,L is the number of data contained in the previous step when constructing the sliding window W,(N-L+1) is the number of small windows W, andH is the number of data contained in each sliding window when constructing the sliding window D.
[0102] Optionally, each training task dataset D corresponds to a task T, and the training data is eventually decomposed into (NL-H+2) tasks.
[0103] Step S303: Model training, which involves dividing each training dataset D into a support set (D... S and query set (D) Q ), randomly assign θ, and θ will be all the parameters that the LSTM model will use when predicting wind power later;
[0104] Optionally, based on the data in the support set, the training error for each task T is calculated using the following formula:
[0105]
[0106] It is an LSTM model with parameter θ in task T with D S The training error, f θ This is an LSTM model with parameter θ.
[0107] And update the parameter θ using the following formula:
[0108]
[0109] Where, θ T These are the model parameters after updating task T, and α is the step size for single-task training. It is the gradient of θ.
[0110] Then in mission T's D Q Calculate the test error:
[0111]
[0112] f θT To update the parameters to θ T The subsequent LSTM model.
[0113] After calculating the test errors for all tasks, the parameter θ is updated using the following formula:
[0114]
[0115] Where β is the step size of the meta-training.
[0116] Step S304: Model Storage. Store the trained model parameters and structure for short-term wind power prediction during the online phase.
[0117] Online phase:
[0118] Step S311: Real-time monitoring and data updates. Real-time acquisition of wind farm operational data and meteorological data; data cleaning and processing of the raw data, including data normalization.
[0119] Step S312: Output the results. Input the LSTM model trained in step S304 of the offline stage to obtain short-term predictions of wind power.
[0120] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0121] This embodiment also provides a power generation prediction device, which is used to implement the above embodiments and preferred embodiments, and will not be repeated as already described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0122] Figure 4 This is a structural block diagram of a power generation prediction device according to an embodiment of this application. The device includes:
[0123] The acquisition module 402 is used to acquire L historical data, wherein the m-th historical data in the L historical data includes the operation data of the wind turbine and meteorological data at the m-th historical time, where m is an integer greater than or equal to 1 and less than or equal to L, and the time interval between any two adjacent times in the L historical times is the target time interval, where L is an integer greater than or equal to 2.
[0124] The input module 404 is used to input the L historical data into the target long short-term memory network LSTM model to obtain the power generation of the wind turbine at time L+1, wherein the time interval between time L+1 and the Lth historical time is the target time interval.
[0125] The aforementioned device acquires historical data of wind turbines and then uses a target long short-term memory network (LSTM) model to predict the power generation of wind turbines based on the historical data. Since the historical data used by the target long short-term memory network (LSTM) model includes the operating data of wind turbines at historical moments and meteorological data, it comprehensively considers the data of multiple sources of parameters at multiple moments, thus accurately and efficiently predicting the power generation of wind turbines and solving the problem of low accuracy in predicting the power generation of wind turbines.
[0126] In an exemplary embodiment, the acquisition module 402 is further configured to acquire Z sets of sample data before inputting the L historical data into the target Long Short-Term Memory (LSTM) network model to obtain the power generation of the wind turbine at time L+1. The z-th set of sample data in the Z sets includes the z-th set of historical data and the z-th power, where the z-th power is the power generation of the wind turbine corresponding to the z-th set of historical data. The z-th set of historical data includes the operating data and meteorological data of the wind turbine at L historical times. The device further includes a training module, configured to train a general LSTM model using the Z sets of sample data to obtain a target LSTM model.
[0127] In an exemplary embodiment, the acquisition module 402 is further configured to acquire N historical data, wherein the nth historical data includes the wind turbine's operating data and meteorological data at the nth historical moment, where n is an integer greater than or equal to 1 and less than or equal to N, the time interval between any two adjacent moments in the N historical moments is the target time interval, and N is an integer greater than L; the N historical data are divided into N-L+1 groups of data using a sliding window, wherein each group of data in the N-L+1 groups includes data from L historical moments; the N-L+1 power corresponding to the N-L+1 groups of data are determined, and the Z groups of sample data are determined based on the N-L+1 groups of data and the N-L+1 power, where Z equals N-L+1.
[0128] In an exemplary embodiment, the training module is further configured to divide the Z groups of sample data into Z-H+1 datasets using a sliding window, wherein each dataset in the Z-H+1 datasets includes H groups of sample data, where H is an integer greater than or equal to 2; train the general LSTM model using the Z-H+1 datasets respectively to obtain Z-H+1 training error data; and update the model parameters of the general LSTM model according to the Z-H+1 training error data to obtain the target LSTM model.
[0129] In an exemplary embodiment, the training module is further configured to obtain the i-th training error data among Z-H+1 training error data in the following manner, to obtain the Z-H+1 training error data: dividing the i-th dataset in the Z-H+1 dataset to obtain a first data set and a second data set, wherein both the first data set and the second data set include one or more sets of sample data; and calculating intermediate error data using the first data set using the following formula, wherein... The intermediate error data, Let θ be the first dataset, θ be the model parameters of the general LSTM model, x be a set of historical data from the sample data in the first dataset, y be the power in the corresponding sample data, and f be the power in the sample data. θ For a general LSTM model with parameter θ: The model parameters of the general LSTM model are updated based on the intermediate error data to obtain the updated LSTM model; the i-th training error data is calculated using the second data set using the following formula two, where, For the i-th training error data, For the second data set, θ THere are the updated LSTM model parameters, where x is a set of historical data from the second dataset, y is the power in the corresponding sample data, and f is the power in the second dataset. θT For the LSTM model with the updated parameters:
[0130] In an exemplary embodiment, the training module is further configured to update the model parameters of the general LSTM model using the following formula three: Where θ represents the model parameters before the update, θ T The updated model parameters are given, where α is the first preset threshold. This is the second preset threshold.
[0131] In an exemplary embodiment, the training module is further configured to obtain the updated model parameters of the general LSTM model using the following formula: Where θ represents the model parameters of the general LSTM model before the update, θ' represents the model parameters of the general LSTM model after the update, and β represents the third preset threshold. The second preset threshold, It is the sum of Z-H+1 training error data.
[0132] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.
[0133] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0134] S1, acquire L historical data, wherein the m-th historical data in the L historical data includes the wind turbine's operating data and meteorological data at the m-th historical time, where m is an integer greater than or equal to 1 and less than or equal to L, and the time interval between any two adjacent times in the L historical times is the target time interval, where L is an integer greater than or equal to 2.
[0135] S2, input the L historical data into the target Long Short-Term Memory (LSTM) network model to obtain the power generation of the wind turbine at time L+1, wherein the time interval between time L+1 and the Lth historical time is the target time interval.
[0136] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0137] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0138] Embodiments of this application also provide a computer program product, including a computer program, wherein the computer program, when executed by a processor, performs the steps in any of the above method embodiments.
[0139] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0140] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0141] S1, acquire L historical data, wherein the m-th historical data in the L historical data includes the wind turbine's operating data and meteorological data at the m-th historical time, where m is an integer greater than or equal to 1 and less than or equal to L, and the time interval between any two adjacent times in the L historical times is the target time interval, where L is an integer greater than or equal to 2.
[0142] S2, input the L historical data into the target Long Short-Term Memory (LSTM) network model to obtain the power generation of the wind turbine at time L+1, wherein the time interval between time L+1 and the Lth historical time is the target time interval.
[0143] In one 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.
[0144] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0145] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0146] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for predicting power generation, characterized in that, include: Obtain L historical data points, wherein the m-th historical data point in the L historical data points includes the wind turbine's operating data and meteorological data at the m-th historical time point, where m is an integer greater than or equal to 1 and less than or equal to L, and the time interval between any two adjacent times in the L historical times is the target time interval, where L is an integer greater than or equal to 2. The L historical data are input into the target Long Short-Term Memory (LSTM) network model to obtain the power generation of the wind turbine at time L+1, wherein the time interval between time L+1 and the Lth historical time is the target time interval. Before inputting the L historical data into the target Long Short-Term Memory (LSTM) network model to obtain the power generation of the wind turbine at time L+1, the method further includes: acquiring Z sets of sample data, wherein the z-th set of sample data in the Z sets of sample data includes the z-th set of historical data and the z-th power, wherein the z-th power is the power generation of the wind turbine corresponding to the z-th set of historical data, and the z-th set of historical data includes the operating data and meteorological data of the wind turbine at L historical times; and using the Z sets of sample data to train a general LSTM model to obtain the target LSTM model. The process of training a general LSTM model using the Z sets of sample data to obtain a target LSTM model includes: dividing the Z sets of sample data into Z-H+1 datasets using a sliding window, wherein each dataset in the Z-H+1 datasets includes H sets of sample data, where H is an integer greater than or equal to 2; training the general LSTM model using the Z-H+1 datasets respectively to obtain Z-H+1 training error data; and updating the model parameters of the general LSTM model based on the Z-H+1 training error data to obtain the target LSTM model. The general LSTM model is trained using Z-H+1 datasets to obtain Z-H+1 training error data points. This includes obtaining the i-th training error data point from the Z-H+1 training error data points through the following method: dividing the i-th dataset into a first data set and a second data set, where each data set includes one or more sets of sample data; and calculating intermediate error data using the first data set using the following formula (Formula 1). The intermediate error data, For the first data set, The model parameters of the general LSTM model are... Let y be a set of historical data from the sample data in the first dataset, where y represents the power in the corresponding sample data. For parameters The general LSTM model: Formula 1; The model parameters of the general LSTM model are updated based on the intermediate error data to obtain the LSTM model with updated parameters; The i-th training error data is calculated using the second dataset through the following formula two, where, For the i-th training error data, For the second data set, The updated LSTM model parameters. Let y be a set of historical data from the sample data in the second dataset, where y represents the power in the corresponding sample data. For the LSTM model with the updated parameters: Formula 2.
2. The method according to claim 1, characterized in that, Obtain Z sets of sample data, including: Obtain N historical data points, wherein the nth historical data point includes the wind turbine's operating data and meteorological data at the nth historical moment, where n is an integer greater than or equal to 1 and less than or equal to N, and the time interval between any two adjacent moments in the N historical moments is the target time interval, where N is an integer greater than L. The N historical data points are divided into N-L+1 groups using a sliding window, where each group of data includes data from L historical moments. Determine the N-L+1 power values corresponding to the N-L+1 sets of data, and determine the Z sets of sample data based on the N-L+1 sets of data and the N-L+1 power values, where Z equals N-L+1.
3. The method according to claim 1, characterized in that, Update the model parameters of the general LSTM model based on the intermediate error data, including: The model parameters of the general LSTM model are updated using the following formula three: Formula 3; in, These are the model parameters before the update. For the updated model parameters, The first preset threshold, This is the second preset threshold.
4. The method according to claim 1, characterized in that, The model parameters of the general LSTM model are updated based on the Z-H+1 training error data, including: The updated model parameters of the general LSTM model are obtained using the following formula: Formula 4; in, To update the model parameters of the general LSTM model before updating, To update the model parameters of the general LSTM model, The third preset threshold, The second preset threshold, It is the sum of Z-H+1 training error data.
5. A device for predicting power generation, characterized in that, include: The acquisition module is used to acquire L historical data, wherein the m-th historical data in the L historical data includes the wind turbine's operating data and meteorological data at the m-th historical time, where m is an integer greater than or equal to 1 and less than or equal to L, and the time interval between any two adjacent times in the L historical times is the target time interval, where L is an integer greater than or equal to 2. The input module is used to input the L historical data into the target Long Short-Term Memory (LSTM) network model to obtain the power generation of the wind turbine at time L+1, wherein the time interval between time L+1 and the Lth historical time is the target time interval. The acquisition module is further configured to acquire Z sets of sample data before inputting the L historical data into the target long short-term memory network LSTM model to obtain the power generation of the wind turbine at time L+1. The z-th set of sample data in the Z sets of sample data includes the z-th set of historical data and the z-th power, wherein the z-th power is the power generation of the wind turbine under the z-th set of historical data, and the z-th set of historical data includes the operating data and meteorological data of the wind turbine at L historical times. The device further includes a training module, configured to train a general LSTM model using the Z sets of sample data to obtain a target LSTM model by: dividing the Z sets of sample data into Z-H+1 datasets using a sliding window, wherein each dataset in the Z-H+1 datasets includes H sets of sample data, where H is an integer greater than or equal to 2; training the general LSTM model using the Z-H+1 datasets respectively to obtain Z-H+1 training error data; and updating the model parameters of the general LSTM model based on the Z-H+1 training error data to obtain the target LSTM model. The training module is further configured to obtain the i-th training error data from the Z-H+1 training error data in the following manner: The i-th dataset in the Z-H+1 dataset is divided into a first data set and a second data set, wherein both the first and second data sets include one or more sets of sample data; intermediate error data is calculated using the first data set using the following formula: The intermediate error data, For the first data set, The model parameters of the general LSTM model are... Let y be a set of historical data from the sample data in the first dataset, where y represents the power in the corresponding sample data. For parameters The general LSTM model: Formula 1; The model parameters of the general LSTM model are updated based on the intermediate error data to obtain the updated LSTM model; the i-th training error data is calculated using the second data set using the following formula two, where, For the i-th training error data, For the second data set, The updated LSTM model parameters. Let y be a set of historical data from the sample data in the second dataset, where y represents the power in the corresponding sample data. For the LSTM model with the updated parameters: Formula 2.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 4.
7. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1 to 4 through the computer program.
Citation Information
Patent Citations
Method and apparatus for predicting power of wind farm in ultra-short time, and wind generating set
CN107909227A
Power generation power prediction method of optical storage power grid based on model agnostic meta learning method
CN116384539A