Power prediction model construction method, power prediction method

By constructing an encoding and decoding network based on an attention mechanism, the problems of insufficient utilization of historical information and inconsistent input distribution in new energy power prediction are solved, and high-precision ultra-short-term power prediction is achieved, which is applicable to power prediction of wind power and photovoltaic power plants.

CN123117465APending Publication Date: 2026-11-17ZHEJIANG FENGYUN DEEP BLUE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611414287.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-11
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing new energy power prediction methods do not make full use of historical power sequences in the decoding process of ultra-short-term prediction, cannot dynamically focus on key periods, and the inconsistent distribution of training and prediction inputs leads to exposure bias and error accumulation.

Method used

An attention-based encoder-decoder network is adopted, which constructs a sequence-to-sequence prediction model through encoding, decoding and fusion units. The historical information is dynamically weighted by the attention mechanism, and the network is trained using a planned sampling strategy to gradually transition from the dependence on the true value to its own output. The mean absolute value loss function and adaptive moment estimation optimizer are used for optimization.

Benefits of technology

It significantly improves the prediction accuracy of far-end times in multi-step prediction, eliminates exposure bias caused by inconsistency between training and prediction input distribution, ensures the reliability and accuracy of prediction results, and adapts to the data characteristics of different site types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123117465A_ABST
    Figure CN123117465A_ABST
Patent Text Reader

Abstract

This invention discloses a power prediction model construction method and a power prediction method. The construction method includes: acquiring a normalized historical power sample sequence of new energy power plants, meteorological sample features corresponding one-to-one with the prediction time, and the true power value; constructing training samples using a sliding window of the reporting time, retaining samples when preset conditions are met; constructing a prediction network, where the encoding calculation unit outputs a hidden state sequence, and the decoding calculation unit concatenates the power value of the previous time with the meteorological sample features of the current time and outputs the predicted value after dynamic weighting by attention; training using a planned sampling strategy, where the decoding calculation unit selects either the true value or its own predicted value as input at each step with a preset probability, and this probability transitions from the true value to its own predicted value with each training round; and obtaining the corresponding power prediction model. This invention suppresses the accumulation of multi-step prediction errors through a planned sampling strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of new energy power generation prediction technology, and in particular to a method for constructing an ultra-short-term power prediction model for new energy power plants based on an attention mechanism encoding and decoding network, and a power prediction method. Background Technology

[0002] In renewable energy (wind power and photovoltaic) power forecasting, ultra-short-term forecasting refers to power prediction for the next 15 minutes to 4 hours from the time of reporting. A forecast point is output every 15 minutes, for a total of 16 time points. This is a crucial foundation for grid dispatching, renewable energy consumption, and electricity market transactions. Currently commonly used forecasting methods mainly include physical methods, statistical and traditional machine learning methods, and conventional neural network methods.

[0003] The physical method is based on numerical weather prediction (NWP) and unit power conversion curves. It calculates power from meteorological elements and has clear physical meaning. However, it is highly dependent on the accuracy of the forecast meteorological field and the parameters of the equipment model. It has poor adaptability to local factors such as terrain, wake, and component dust accumulation. In addition, the calculation link is long and the error is amplified step by step.

[0004] In statistical and traditional machine learning methods, persistent forecasting uses current power directly as a future prediction, which is effective in a very short period of time, but the error diverges rapidly as the forecast duration increases; linear or shallow models such as autoregressive integral moving average models, support vector machines, and random forests are difficult to characterize the strong nonlinearity between power and meteorology.

[0005] Conventional neural network methods employ multilayer perceptrons to output multiple sequences at once, or utilize single recurrent neural networks to directly output future sequences, which to some extent improves the nonlinear fitting capability. Summary of the Invention

[0006] This invention addresses the shortcomings of existing technologies, such as insufficient utilization of historical power sequences during the decoding process, inability to dynamically focus on key periods in history at different prediction times, and exposure bias caused by inconsistent training and prediction input distributions. It provides a method for constructing an ultra-short-term power prediction model for new energy power plants and a power prediction method based on an attention mechanism encoding / decoding network.

[0007] To solve the above-mentioned technical problems, the present invention provides the following technical solution: The first aspect is a power prediction model construction method, used for constructing power prediction models for renewable energy power plants, which includes the following steps: Acquire training data, which includes several sample data with a reporting start time. The sample data includes the corresponding historical power sample sequence, as well as meteorological sample features and power true values ​​that correspond one-to-one with the prediction time. A sequence-to-sequence prediction network is constructed, comprising an encoding computation unit, a decoding computation unit, and a fusion unit. The input of the encoding computation unit is the historical power sample sequence, and the output is the corresponding hidden state sequence. The input of the decoding computation unit is the meteorological sample features corresponding to the current prediction time and the power feedback value corresponding to the previous time, and the output is the corresponding decoded hidden state. The power feedback value is either the true power value at the previous time or the power prediction value output by the decoding computation unit itself at the previous time. The fusion unit uses an attention mechanism to dynamically weight the hidden state sequence to obtain a context vector, and then fuses the decoded hidden state with the context vector to output the power prediction value corresponding to the current prediction time. The sequence-to-sequence prediction network is trained using a planned sampling strategy to obtain a corresponding power prediction model. The planned sampling strategy is that during the training process, the decoding calculation unit selects one of the corresponding true power value and its own output predicted power value as input at each step with a preset probability. The value of the preset probability transitions from biased towards the true power value to biased towards the power prediction value of its own output as the training rounds increase.

[0008] As one possible implementation method: The preset probability is the teacher-forced ratio, which linearly decays from 1.0 to 0.0 in the early stage of training. After the decay is completed, the teacher-forced ratio remains constant at 0.0 in the remaining training rounds.

[0009] In this implementation, the teacher-forced ratio linearly decreases from 1.0 to 0.0, allowing the network to quickly establish basic mapping relationships using real values ​​as guidance in the early stages of training, and gradually decouple from the real values ​​in the later stages, autonomously completing sequence expansion. The introduction of linear decay makes the transition process smooth and controllable, avoiding training oscillations caused by abrupt switching, and ensuring the stable adjustment of network parameters during the autoregressive adaptation process.

[0010] As one possible implementation method: The decoding calculation unit scores the correlation between the hidden state sequence and the current decoded hidden state at each step, normalizes the obtained score using the flexible maximum function to obtain the attention weight, and then uses the attention weight to weight and sum the hidden state sequence to obtain the context vector. The correlation score is used to measure the importance of the hidden state at each historical moment to the current prediction moment; the flexible maximum function is used to normalize the elements of the score vector.

[0011] In this implementation, the relevance scoring uses a trainable alignment matrix to perform a bilinear mapping between the historical hidden state and the current decoded hidden state. The flexible maximum function transforms the scores into a weight distribution that sums to 1, enabling the network to achieve soft selection of historical information in a differentiable mathematical form. Historical moments with larger weights contribute more to the current prediction, while moments with weights approaching zero are automatically ignored. The entire selection process is end-to-end differentiable and adapts to backpropagation optimization.

[0012] As one possible implementation method: The new energy power stations include wind farms and photovoltaic power stations; The historical power sample sequence was cleaned, and the wind farms and photovoltaic power plants were processed separately: For the wind farm, a scatter plot of nacelle wind speed and actual power is drawn for each unit. The power envelope sub-zone is calculated according to wind speed. Power points that exceed the sub-zone range are judged as abnormal and removed. For the photovoltaic power station, a scatter plot of the measured horizontal solar shortwave radiation and the actual total power is plotted. The power envelope sub-band is calculated according to the radiation sub-bins. Power points that exceed the sub-band range are judged as abnormal and removed.

[0013] In this implementation, wind power and photovoltaic power are respectively classified into separate bins based on wind speed and irradiance, directly linking the anomaly judgment criteria to the physical driving elements of each site. The bin-based elimination method does not set fixed upper and lower power limits, but dynamically determines the normal range based on the actual distribution within each operating condition interval. This allows the cleaning rules to adapt to the differences in power fluctuation amplitude under different wind speed or irradiance ranges, avoiding the problem of excessive elimination of high variance intervals or insufficient elimination of low variance intervals by a single global threshold.

[0014] As one possible implementation method: The wind farm and the photovoltaic power station use different historical window lengths, with the historical window of the wind farm being shorter than that of the photovoltaic power station.

[0015] In this implementation, the historical window length is set according to the time scale of the power generation characteristics of the wind farm, so that the length of the input sequence received by the encoding calculation unit matches the physical memory cycle of the wind farm. Photovoltaics require a long window to capture daily cycle patterns, while wind power uses a short window to focus on recent trends. The two sets of window lengths are configured independently and do not interfere with each other, enabling the same network architecture to adapt to the data characteristics of different wind farm types.

[0016] As one possible implementation method: The sequence-to-sequence prediction network is trained using the average absolute value loss function and an adaptive moment estimation optimizer. The learning rate uses a cosine annealing strategy, and gradient pruning and early stopping mechanisms are employed.

[0017] In this implementation, the mean absolute value loss provides a constant gradient magnitude, ensuring that the update step size of each parameter does not fluctuate drastically due to the error magnitude; the adaptive moment estimation optimizer assigns differentiated learning rates to different parameters, accelerating the convergence of sparse gradients; the cosine annealing learning rate is finely searched in the later stages of training; gradient clipping sets safety boundaries at the numerical level; and the early stopping mechanism automatically determines the convergence time by monitoring the validation set. These five measures work together across five independent dimensions—loss function, optimization algorithm, learning rate scheduling, numerical safety, and termination conditions—to jointly ensure the stability and reproducibility of training.

[0018] Secondly, the power prediction method, used for power prediction at renewable energy power plants, includes the following steps: Obtain the corresponding historical power sample sequence and meteorological feature sequence, wherein the meteorological feature sequence includes meteorological features that correspond one-to-one with the prediction time; The power prediction model outputs the power prediction value corresponding to each prediction time based on the historical power sample sequence and meteorological feature sequence, wherein the power prediction model is the power prediction model constructed by the construction method of any one of claims 1 to 6.

[0019] In this implementation, the fixed coefficients determined in the training phase are directly reused in the prediction phase. After the input data undergoes the same preprocessing as in the training phase, the outputs for all prediction times can be obtained through a single forward computation, without involving iterative optimization or parameter updates. The reuse of fixed coefficients makes the computational load of the prediction process much lower than that of the training process, meeting the response speed requirements of online prediction.

[0020] As one possible implementation method: When the new energy power station has a photovoltaic power generation unit, the solar altitude angle is calculated based on the geographical latitude of the new energy power station and the predicted time. When the solar altitude angle is not greater than zero, the power prediction value corresponding to the predicted time is set to zero.

[0021] In this implementation, astronomical geometric calculations replace fixed-time thresholds for determining nighttime conditions, and the solar altitude angle is jointly determined by geographical latitude and solar hour angle. This criterion can correctly identify periods without effective sunshine in all latitude zones and on all dates, eliminating the need for manual maintenance of threshold lists and reducing the configuration complexity of photovoltaic power station deployment.

[0022] As one possible implementation method: The solar altitude angle is calculated using the celestial coordinate formula based on the geographical latitude, solar declination, and hour angle of the new energy power station. The formula for celestial coordinates is as follows: multiply the sine of the geographical latitude of the new energy power station by the sine of the solar declination, and then multiply the cosine of the geographical latitude of the new energy power station, the cosine of the solar declination, and the cosine of the hour angle by the same product. The result is the sine of the solar altitude angle.

[0023] In this implementation, the three input variables of the celestial coordinate formula correspond to the spatial location of the field station, the season, and the intraday time, respectively. These three variables are independent and orthogonal, with no redundant coupling. After network output, the determination can be completed based solely on the current time and the field station coordinates without relying on any additional data source, making the zeroing operation self-contained and spatiotemporally adaptive.

[0024] As one possible implementation method: The predicted power value is denormalized and truncated to a physically permissible range, which is from zero to the installed capacity of the new energy power station; the installed capacity is the sum of the rated power of all power generation units of the new energy power station.

[0025] In this implementation, denormalization restores the per-unit predicted value to the active power dimension, thus restoring the physical unit; the truncation operation forces the predicted value to fall within the physically permissible range, ensuring that the numerical range of the output result is consistent with the physical limits of the power generation equipment. Through the combination of denormalization and truncation, the predicted value is aligned with the actual needs of power grid dispatch on three levels: dimension, numerical range, and physical meaning, eliminating potential dimensional confusion and physical misunderstanding that may arise from the per-unit value in subsequent operational use.

[0026] This invention, by adopting the above technical solutions, has significant technical effects: This invention constructs a sequence-to-sequence prediction network with encoding, decoding, and fusion units. The decoding unit receives meteorological sample features corresponding to the current prediction time and the power feedback value from the previous time step at each step. This allows the network to learn the joint mapping relationship between meteorological conditions and power temporal changes during training, avoiding prediction trajectory deviations caused by simply relying on historical power sequence extrapolation. By using the true power value from the previous time step or the power prediction value output by the decoding unit itself as the power feedback value, the network can achieve rapid convergence using true values ​​and also access its own output distribution during training, providing a training foundation for input distribution adaptation for the subsequent autoregressive expansion in the prediction stage. The fusion unit, combined with an attention mechanism, addresses the implicit nature of the output from the encoding unit. Dynamic weighting of the state sequence enables the decoding computation unit to adaptively extract the most relevant historical information from the complete historical sequence at each step, overcoming the problem that fixed-length context vectors cannot dynamically focus on key time periods, and effectively improving the prediction accuracy of far-end times in multi-step prediction. By employing a planned sampling strategy during training, the decoding computation unit selects either the true power value or its own output predicted power value as input in the later stages of training with a preset probability. This probability transitions from biased towards the true power value to biased towards its own output predicted power value as the training rounds increase, allowing the network to gradually adapt to the pure autoregressive prediction environment during the training phase. This eliminates exposure bias caused by the inconsistency between training and prediction input distributions, effectively suppressing the monotonic accumulation of multi-step prediction errors along the prediction time domain, and significantly improving the prediction accuracy of far-end times. The power prediction model obtained after training can be directly used for prediction, providing a reliable power prediction basis for power grid dispatch. Attached Figure Description

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

[0028] Figure 1 This is a schematic diagram of the overall process of the power prediction model construction method of the present invention; Figure 2 This is a schematic diagram of the overall process of the power prediction method of the present invention; Figure 3 This is a schematic diagram of a sequence-to-sequence prediction network structure based on the Luong attention mechanism; Figure 4 This is a schematic diagram showing the curves of the baseline model and the mean absolute error (MAE) of this invention as a function of the number of prediction steps. Detailed Implementation

[0029] The present invention will be further described in detail below with reference to the embodiments. The following embodiments are explanations of the present invention, but the present invention is not limited to the following embodiments.

[0030] In existing methods, multi-step prediction often employs a recursive approach. During the training phase, the actual power from the previous moment is used as the input for the next moment, while the prediction phase uses the model's own predicted values ​​as input. This results in inconsistent input distributions between training and prediction, leading to a monotonically accumulating and amplifying error along the prediction steps. The decoding process does not fully utilize historical power sequences, failing to dynamically focus on key historical periods at different prediction times, and the prediction trajectory is prone to drift during autoregressive unfolding. Since photovoltaic power generation is absent at night, existing methods often produce non-zero predicted values, typically using fixed time periods or empirical thresholds to determine nighttime. Fixed time periods and thresholds fail to reflect the impact of the site's geographical location and seasonal variations on sunshine duration.

[0031] To address the aforementioned deficiencies, this application provides a solution through the method proposed in the following embodiments; Example 1: A method for constructing a power prediction model, implemented based on an attention mechanism encoder-decoder network, for power prediction at renewable energy power plants, such as... Figure 1 As shown, it includes the following steps: This embodiment (hereinafter referred to as the "training phase") iteratively adjusts all trainable coefficients in the sequence prediction network using historical data to determine a set of fixed numerical coefficients for use in subsequent embodiment 2. The training phase is executed once before the system is put into operation, or re-executed after the data accumulation reaches a preset update cycle.

[0032] S100, Data Acquisition: This embodiment provides raw foundational data for subsequent sequence-to-sequence (Seq2Seq) prediction networks by collecting historical active power (EPW) sequences and NWP data from renewable energy power plants (hereinafter referred to as "power plants"). The renewable energy power plants include wind farms and photovoltaic power plants.

[0033] S110. Collect historical active power sequence: Historical instantaneous active power values ​​at the grid-connected points of power plants are collected at fixed time intervals to form a continuous time series. Specifically: Historical active power sequences of the power station are collected, using instantaneous values ​​at fixed time intervals. Power data originates from the power station monitoring system or electricity metering device, and the unit is MW. In this embodiment, the time interval is 15 minutes. The specific selection and configuration of the power station monitoring system or electricity metering device can be determined by those skilled in the art based on the existing equipment conditions of the power station; this invention does not impose any limitations on this.

[0034] S120, Collect NWP data: The system collects future weather fields from the NWP (Natural Weather Prediction) data. The meteorological elements included in these future weather fields are determined based on the type of weather station: wind farms collect wind speed and direction at multiple heights, while photovoltaic power stations collect global horizontal irradiance (GHI) and direct normal irradiance (DNI). NWP releases have a fixed production timeframe, using only the most recent batch of numerical weather prediction data generated before the initial reporting time to ensure temporal causality. Specifically, "generated before the initial reporting time" means that the NWP data production time, i.e., the data release time, is earlier than or equal to the power prediction's initial reporting time. This ensures that the NWP data used in power prediction already exists in chronological order, avoiding the logical paradox of "using future weather information to predict future power." If NWP batches generated after the initial reporting time are used, future meteorological information unavailable in actual prediction scenarios will be introduced during training, leading to artificially high training evaluation accuracy and a significant decrease in actual prediction accuracy after deployment. "The most recent batch" refers to the NWP system updating forecast results on a fixed release cycle. There may have been multiple release batches before the start time of the report. The latest batch is selected to ensure the best timeliness of meteorological information while still meeting the time causality constraint.

[0035] For wind farms, wind speed and wind direction are collected, and it is preferable to collect wind speeds at multiple heights covering the wind turbine surface, including three layers: the lower edge of the wind turbine, the hub height, and the upper edge of the wind turbine. For photovoltaic power plants, GHI and DNI are collected, and the coded values ​​of temperature, air pressure and recording time can be collected preferentially. The coded values ​​include the sine and cosine codes of the time within a day and the day sequence within a year.

[0036] The time resolution of the NWP should be consistent with the power sampling interval or aligned by interpolation.

[0037] In this embodiment, wind speeds are collected at three heights: the lower edge of the wind turbine, the hub height, and the upper edge of the wind turbine, such as 10m, 100m, and 200m. The 100m height is close to the hub height and is strongly correlated with power output. The 10m and 200m heights provide wind speed information at the upper and lower boundaries of the wind turbine surface. The combination of these three data can more accurately approximate the integral effect of the average wind energy flux on the wind turbine surface. The original time resolution of the NWP data is 1 hour, which is interpolated to a 15-minute interval to align with the 15-minute sampling interval for power.

[0038] S200, Data Preprocessing: This embodiment cleans the original power sequence, distinguishing between wind power and photovoltaic power, and using different physical driving forces to remove anomalies, ensuring the signal-to-noise ratio of the data used in subsequent calculations. The wind farms and photovoltaic power plants are processed separately.

[0039] S210, Exclusion of Abnormal Historical Power Generation in Wind Power: Based on the scatter plot distribution of nacelle wind speed and actual power, the power envelope quantile is calculated by wind speed, and abnormal power points exceeding the normal fluctuation range are eliminated. Specifically: For wind farms, a scatter plot of nacelle wind speed and actual power is generated for each turbine. The turbines are divided into boxes at preset intervals based on wind speed. For each box, a preset quantile of the power envelope is calculated. Power points exceeding this range are considered abnormal and removed. This operation filters out outliers caused by non-natural wind conditions such as sensor malfunctions, communication interruptions, or turbine power limitations, while retaining normal power fluctuation information within different wind speed ranges. In this embodiment, wind speeds are divided into boxes at 0.5 m / s intervals, and the 5% to 95% quantile of the power envelope is calculated for each box.

[0040] S220, Exclusion of Abnormal Historical Power Output of Photovoltaics: Based on the scatter distribution of GHI and actual total power, the power envelope quantile is calculated by binning according to GHI, and abnormal power points exceeding the normal fluctuation range are eliminated. Specifically: For photovoltaics, a scatter plot of the measured GHI and the actual total power is drawn. The grid is divided into boxes at preset intervals according to GHI. For each box, a preset quantile zone of the power envelope is calculated. Power points exceeding this range are considered abnormal and removed. This operation distinguishes normal output ranges under different irradiance intensities, avoiding misjudging low power points under cloudy weather or zero power values ​​at night as abnormal. In this embodiment, GHI is set at 50 W / m². 2 The power envelope is divided into several sub-segments, with each sub-segment representing 5% to 95% of the power envelope.

[0041] It should be noted that no interpolation is performed on missing power values ​​during the training phase, and samples with missing values ​​in historical windows or future time periods are discarded as a whole. See step S400 for details.

[0042] After the aforementioned differentiated binning and removal process for wind and solar power, outliers in the historical power series were effectively filtered out. Unlike traditional global threshold truncation methods, binning and removal can retain normal power fluctuation information within different wind speed or irradiance ranges, avoiding misjudging high power values ​​in high wind speed ranges as anomalies, and also avoiding misjudging and removing low power values ​​(such as normal zero values ​​at night) in low irradiance ranges as anomalies. The cleaned power series retains the true power output fluctuation characteristics while eliminating outliers caused by sensor failures, communication interruptions, or equipment malfunctions, providing a high signal-to-noise ratio data foundation for subsequent normalization, feature engineering, and training.

[0043] S300, Feature Engineering and Normalization: This embodiment converts the original meteorological elements into feature vectors that can be effectively learned by the Seq2Seq prediction network, and unifies the power scale so that wind power and photovoltaic power are in the same numerical space.

[0044] S310. Decompose the wind direction into orthogonal horizontal components: The wind direction angle is decomposed into two orthogonal components, east-west and north-south, eliminating numerical jumps in the angle around 0° and 360° while preserving vector information.

[0045] In this embodiment, the wind speed s at each altitude is decomposed into an east-west component u according to the World Meteorological Organization standard: ; According to the World Meteorological Organization standard, wind power decomposes the wind direction d at various altitudes into a north-south component v: ; In this system, wind speed s is expressed in m / s; wind direction d is expressed in degrees; u represents the east-west component with positive value for east; and v represents the north-south component with positive value for north. After this decomposition, the values ​​that originally abruptly changed around 0° and 360° are smoothly mapped to a continuous vector space, which is beneficial for neural networks to learn the continuous mapping relationship between wind direction and power.

[0046] S320, power normalized according to installed capacity: The active power is divided by the installed capacity of the power plant to convert it into a dimensionless per-unit value, thus eliminating the dimensional differences between power plants with different installed capacities.

[0047] The total power value is normalized according to the installed capacity, as shown in the following formula: p norm =p / C cap ; Where p is the current original active power, in MW; C cap The installed capacity of the power station is expressed in MW; p norm The normalized power value is a dimensionless per-unit value. The installed capacity is the sum of the rated power of all generating units in the power station, reflecting the maximum output capacity of the power station, and is the benchmark value for power normalization and denormalization.

[0048] S330, Feature selection criteria: For wind power and photovoltaic power, NWP elements with clear physical driving relationships are selected to form the input feature vector at each time step. The feature selection follows the physical driving principle.

[0049] The core driving equation for wind power is: P=½ρAC p v 3 ; Where P is the active power output of the wind turbine, ρ is the air density, A is the swept area of ​​the wind turbine, and C is the active power output of the wind turbine. pLet P be the wind energy utilization coefficient and v be the wind speed. This formula shows that wind speed v is the most crucial factor determining wind power output, and the power P is cubically related to wind speed v; even small changes in wind speed can lead to significant fluctuations in power. MW-class wind turbines have rotor diameters on the order of hundreds of meters, and the rotor's swept area covers a vast space from the lower edge to the upper edge of the rotor. Wind shear causes differences in wind speed at different heights. Therefore, the wind speed at a single point at the hub height cannot fully represent the average wind energy flux across the entire rotor surface. Thus, it is preferable to collect wind speeds at multiple heights covering the lower edge of the rotor, the hub height, and the upper edge of the rotor.

[0050] Photovoltaics are characterized by GHI and DNI as irradiance categories. Horizontal solar shortwave radiation refers to the total solar radiation received on a horizontal plane, including both direct and diffuse radiation; normal direct radiation refers to the direct solar radiation received on a plane perpendicular to the direction of sunlight.

[0051] The core driving relationship of photovoltaic power is: P PV ∝GHI·η(T)·A PV ; Among them, P PV GHI represents the active power output of the photovoltaic power plant; η(T) represents the horizontal shortwave solar radiation; and η(T) represents the photovoltaic cell efficiency, which decreases as temperature T increases. PV The area is the projected area of ​​the photovoltaic array on a horizontal plane. The photovoltaic array is composed of multiple photovoltaic modules connected in series and parallel.

[0052] The following relationship exists between GHI, DNI, and diffuse horizontal irradiance (DHI): GHI = DHI + DNI·cosθ; Where θ is the solar zenith angle, i.e., the angle between the incident ray and the local zenith direction. DNI is the normal direct irradiance, which refers to the direct solar radiation power received per unit area perpendicular to the direction of sunlight. When projected onto a horizontal surface, it needs to be multiplied by the cosine of the zenith angle to obtain the horizontal component of the direct radiation; DHI is the scattered radiation received by the horizontal surface; the sum of the two is the total radiation received by the horizontal surface, GHI. Therefore, with GHI and DNI known, the irradiance information can be completely characterized, and there is no need to input DHI separately.

[0053] Preferably, temperature, air pressure, and time codes are further incorporated (sin / cos codes for time of day and day sequence within a year).

[0054] Temperature and air pressure are converted using the air density formula and then used for air density correction in wind power generation. ρ=P0 / (RT); Where ρ is air density, P0 is air pressure, R is the gas constant, and T is absolute temperature. Changes in temperature and air pressure alter air density, thus affecting the power output of wind turbines. Time-based encoding allows the Seq2Seq prediction network to indirectly obtain prior information on intraday cycles, seasonal cycles, and diurnal atmospheric stability determined by solar geometry.

[0055] This embodiment transforms the original collected meteorological data into feature representations that can be effectively learned by the Seq2Seq prediction network, and the selection of different features is supported by clear physical evidence.

[0056] In summary, the feature engineering in this embodiment follows two core principles: first, physical driving—all features included in the Seq2Seq prediction network have clear physical driving relationships as their basis, avoiding the forced introduction of irrelevant or weakly correlated variables into the input space; second, unified scale—the power of wind power and photovoltaic power is normalized to a per-unit value range according to the installed capacity, and the outputs of different types of power plants are at the same numerical scale, so that the encoding and decoding computing units will not cause training instability due to differences in units when shared between different power plants. These principles ensure the high efficiency of subsequent Seq2Seq prediction network training and the reliability of cross-power plant generalization.

[0057] S400, Obtain training data: The training data includes several sample data with a reporting start time. Each sample data includes a corresponding historical power sample sequence, as well as meteorological sample features and power true values ​​that correspond one-to-one with the prediction time. The sample data in this embodiment is a leak-proof sample: This embodiment uses a sliding window enumeration rule to ensure that each training sample is strictly causal in time, preventing future information from being mixed into the training set.

[0058] S410, Set window parameters and slide enumeration: Set the historical window length and prediction steps, take the reporting start time as the anchor point, extract the historical power segment forward, extract the future feature segment and the future power true value segment backward, and enumerate all possible samples.

[0059] This embodiment elaborates on the specific operational process of obtaining training data: The historical window length and prediction steps are set. Using the reporting start time as the anchor point, historical power segments are extracted forward, and future feature segments and future power truth value segments are extracted backward. By enumerating all possible time positions, several sample triples are constructed. In this embodiment, enumerating all possible samples means that the window, using the reporting start time as the anchor point, slides from the earliest feasible position to the latest feasible position on the timeline. At each position, a corresponding set of historical power segments, future feature segments, and future power truth value segments is extracted, forming a set of sample triples. After the sliding is complete, all usable training samples are obtained.

[0060] Wind power and photovoltaic (PV) power utilize different historical window lengths. PV output is determined by solar geometry and exhibits a strong diurnal cycle, requiring multiple complete diurnal cycles to learn intraday patterns and circadian rhythms; short windows are insufficient to establish stable periodic priors. Wind power, on the other hand, is driven by near-surface wind fields, with an autocorrelation timescale on the hourly level, and is modulated by intraday thermal circulation (sea and land breezes, valley breezes, etc.). Shorter historical windows can cover the main intraday cycle variations, while longer windows may introduce noise and overfitting. For each feasible reporting start time, an original sample triplet is constructed, including a historical power window, a future meteorological characteristic window, and a future power true value window. In this embodiment, the historical window length is denoted as seq_len; the wind power historical window is 12 hours, and the PV historical window is 72 hours.

[0061] S420, Four-Item Conditional Verification and Sample Retention: A sample is retained only if the historical power data is complete, the future numerical weather forecast features are complete, the true future power values ​​are complete, and the batch of numerical weather forecasts is timely; otherwise, the entire sample is discarded.

[0062] For each candidate sample enumerated in step S410, verify the following four conditions one by one: All power points are present in the historical window; All NWP features are complete within the future prediction period; All true power values ​​are available for the entire forecast period. Only the most recent batch of NWPs generated before the reporting start time is selected to prevent future information leaks.

[0063] Of the four conditions mentioned above, the first two ensure the integrity of features at the input of the Seq2Seq prediction network; the third ensures the availability of training target values; and the fourth is the core of preventing leakage, eliminating future information contamination from the data source. The second and fourth conditions refer to the same batch of NWP data, but they are checked at different levels: the second checks the integrity of the data content, ensuring that feature values ​​such as wind speed and irradiance for the next 16 time points are not missing; the fourth checks the legality of the data's timeliness, ensuring that the batch of NWPs was published before the initial reporting time. Both are indispensable. Samples with complete features but outdated batches will lead to inflated training evaluations, while samples with legal batches but missing features cannot constitute complete input.

[0064] If any one of the four conditions is not met, the entire sample is discarded without interpolation or completion. Unlike the traditional data processing strategy of "preserving as many samples as possible", this embodiment adopts the strict principle of "preferring to discard rather than introduce false causality", which fundamentally ensures the temporal causal consistency of the training data and eliminates the possibility of future information infiltrating the training process through the data preprocessing stage.

[0065] It should be noted that for sites with critically low data quality, linear interpolation or relaxed outlier removal requirements may be considered to improve sample survival rates. However, sites with extremely low data quality are not conducive to learning algorithms, and prioritizing data quality is recommended.

[0066] Together, S410 and S420 form a complete implementation for acquiring training data: S410 is responsible for "how to construct samples", and S420 is responsible for "which samples can be retained".

[0067] S500 and Seq2Seq prediction networks were constructed and trained to obtain the corresponding power prediction models. This embodiment constructs a Seq2Seq prediction network based on Luong attention (hereinafter referred to as the prediction network) and introduces a planned sampling strategy for training to fundamentally suppress the accumulation of autoregressive errors.

[0068] In this embodiment, the prediction network includes an encoding computation unit, a decoding computation unit, and a fusion unit. The specific construction method is as follows: S510, Constructing the encoding calculation unit: The input to the encoding calculation unit is the historical power sample sequence, and the output is the corresponding hidden state sequence; In this embodiment, a multi-layer long short-term memory network is used to encode the historical power sequence into a hidden state sequence and a final state for global reference by the decoding calculation unit.

[0069] The encoding computation unit is a multi-layer Long Short-Term Memory (LSTM) network. The unit takes a normalized historical power sequence as input, iterates through the sequence, and outputs a complete hidden state sequence `enc_out` and the final hidden state. Based on this, and combined with the S400's leak-proof sample construction rules, strict control is exercised over the timeliness and feature completeness of the NWP (Network Power Buffer), forming a dual causal consistency guarantee from sample input to the prediction network structure: the former ensures that the input data of the prediction network does not contain any future information, and the latter ensures that the prediction network will not utilize future context that does not exist in the input sequence during prediction. This dual guarantee ensures that the training evaluation results can truly reflect the prediction performance of the prediction network in actual deployment. In this embodiment, the hidden state sequence `enc_out` has a shape of `seq_len×H`, where `seq_len` is the length of the historical window, and the hidden dimension H=128; the encoding computation unit has two LSTM layers, with a random dropout ratio of 0.2 between layers.

[0070] S520, constructing a decoding computation unit and a fusion unit using the Luong attention mechanism: The input to the decoding calculation unit is the meteorological sample features corresponding to the current prediction time and the power feedback value corresponding to the previous time. The output is the corresponding decoding hidden state. The power feedback value is the actual power value at the previous time or the power prediction value output by the decoding calculation unit itself at the previous time. In this embodiment, the decoding computation unit performs time-by-time autoregressive prediction. At each step, Luong's general form of attention is used to dynamically weight the entire sequence of the encoding computation unit, extracting the most relevant historical context and combining it with the current numerical weather forecast features to output the predicted value. Specifically: The Luong attention mechanism, proposed by Luong et al. in 2015, is an attention computation method based on an encoder-decoder architecture, suitable for the time-series prediction scenario of this invention. The Luong attention mechanism provides three scoring formats: dot, general, and concat. This embodiment uses the general format.

[0071] The decoding computation unit is a single-layer LSTM, with a hidden dimension H=128 in this embodiment. At each prediction time, the input to the decoding computation unit is the concatenation of the power from the previous step and the NWP meteorological features at the current time, with the concatenation order being power first and NWP meteorological features last. The current decoded hidden state dec_h is then calculated by the LSTM of the decoding computation unit. The NWP meteorological features are the meteorological feature vectors extracted and processed from the original NWP data in S330.

[0072] In this embodiment, the hidden dimension H of the encoding and decoding computation units is the same, and the same dimensional configuration is maintained across different stations to ensure that the vector dimensions of the hidden state sequence enc_out of the encoding computation unit and the hidden state dec_h of the decoding computation unit match during attention alignment. The network parameters of the encoding and decoding computation units are trained independently without parameter sharing to preserve their respective modeling capabilities. The encoding computation unit focuses on compressing historical power sequences into a fixed-dimensional contextual representation, while the decoding computation unit focuses on generating predicted values ​​under the joint guidance of the historical context at the current prediction time and future weather conditions. Dropout layers are used between layers in the encoding computation unit to prevent overfitting, while the decoding computation unit, due to its single-layer structure, does not use dropout.

[0073] The fusion unit dynamically weights the hidden state sequence using an attention mechanism to obtain a context vector. After fusing the decoded hidden state with the context vector, it outputs the power prediction value corresponding to the current prediction time. Alignment is then performed using the general form of the Luong attention mechanism, calculated as follows: score=enc_out·W a ·dec_h; Where enc_out is the hidden state sequence output by the encoding computation unit; dec_h is the hidden state of the decoding computation unit at the current time; W a W is a trainable alignment matrix with shape (H, H). a `enc_out` is the only trainable scoring parameter in Luong attention, used to learn the correlation between each historical encoding state and the current decoding state; `score` is the attention score vector obtained by performing bilinear scoring on each historical encoding state and the current decoding state, with a length equal to the historical window length. In the above operations, `enc_out` and `W`... a The operation between them is matrix multiplication, W a The operation between dec_h and matrix multiplication is performed.

[0074] Feed the score into the maximum flexibility function: align=softmax(score); The normalized attention weight vector align is obtained, with the sum of its elements being 1. The value of each element is between (0,1), representing the contribution weight of the encoding state at the corresponding historical moment to the current prediction moment.

[0075] The decoding computation unit scores the correlation between the hidden state sequence and the current decoded hidden state at each step. The obtained scores are normalized using a flexible maximum function to obtain attention weights. These attention weights are then used to weight and sum the hidden state sequences to obtain the context vector. The correlation score measures the importance of the hidden state at each historical moment to the current prediction moment. The flexible maximum function normalizes the elements of the score vector. The obtained weights are then used to weight and sum the hidden state sequences of the encoding computation unit. context=align T ·enc_out; The resulting context vector is a weighted sum of the hidden state sequences of the encoding computational units, calculated using the align operator. It represents the aggregation of historical information most relevant to the current prediction time. In the above calculation, align... T The transpose of the attention weight vector align. T The operation between `enc_out` and `enc_out` involves multiplication of a vector and a matrix.

[0076] The role of the attention mechanism is to dynamically extract the most relevant information from the entire historical power encoding sequence at each step of decoding, so that the prediction network always maintains a global historical anchor point during the autoregressive unfolding process, effectively curbing the drift of the prediction trajectory.

[0077] After concatenating the current decoded hidden state dec_h with the context vector context ([dec_h⊕context]), and then performing tanh activation and linear mapping calculations, the normalized power prediction value at the current time step is output. Where ⊕ represents the vector concatenation operation; tanh is the hyperbolic tangent activation function; These are dimensionless per-unit values, meaning the prediction network always makes predictions in a normalized numerical space. p in S320 norm Consistent definitions.

[0078] S530, Introduction of planned sampling strategy and parameter iterative adjustment: During training, the input decay rate of the decoding computation unit transitions from the true value to the predicted value, allowing the prediction network to adapt to pure autoregressive prediction from the source. A mean absolute value loss function and an adaptive moment estimation optimizer are employed, supplemented by a cosine annealing learning rate, gradient pruning, and early stopping mechanisms. Specifically: The sequence-to-sequence prediction network is trained using a planned sampling strategy. During the training process, each step of the decoding calculation unit selects one of the corresponding true power value and its own output predicted power value as input with a preset probability. The value of the preset probability transitions from biased towards the true power value to biased towards the power prediction value of its own output as the training rounds increase.

[0079] The preset probability is the teacher-forced ratio, which indicates the probability that the decoding unit will use the true power value as input at each step. The teacher-forced ratio linearly decays from 1.0 to 0.0 in the early stages of training, with the decay rate serving as a preset hyperparameter. After decay, the teacher-forced ratio remains constant at 0.0 for the remaining training rounds. Teacher-forced means that during training, the true power value from the previous moment is used as the input to the decoding unit at the next moment; during prediction, only the prediction network's own predicted value can be used as input. This difference in input distribution between training and prediction is the exposure bias. Planned sampling gradually transitions the input to the decoding unit from the true value to the prediction network's own predicted value during training, allowing the prediction network to adapt to the pure autoregressive prediction environment in advance during the training phase, suppressing error accumulation caused by exposure bias from the training source. After decaying to 0.0, the teacher-forced ratio remains constant at 0.0 for the remaining training rounds, meaning that training is entirely autoregressive, which is the most thorough way to suppress autoregressive error accumulation.

[0080] Comparing the input differences between the training and prediction phases reveals that, guided by the planned sampling strategy, the decoding computation unit in later training rounds no longer relies on the previous step's true value as input, but instead uses the previous step's predicted value as the current step's input. The prediction phase directly employs the same autoregressive expansion method. This "training as prediction" transition design avoids inconsistencies between training and prediction behaviors during deployment. Compared to traditional teacher-mandated training, while planned sampling slightly slows convergence in the early training stages, it significantly improves the stability of the prediction trajectory in the prediction phase, effectively controlling error accumulation at later time points.

[0081] The sequence-to-sequence prediction network is trained using the average absolute value loss function and an adaptive moment estimation optimizer. The learning rate uses a cosine annealing strategy, and gradient pruning and early stopping mechanisms are employed. Training employs the Mean Absolute Error (MAE) function. MAE calculates the average absolute deviation between the predicted and actual power values ​​in each parameter iteration, using this deviation scalar as the optimization signal for backpropagation, allowing the optimizer to adjust all trainable coefficients of the prediction network layer by layer. The optimizer uses an Adaptive Moment Estimator (IME), a standard optimizer in deep learning. The learning rate employs a cosine annealing strategy, indicating that after warm-up, the learning rate monotonically decays to the minimum learning rate according to a cosine curve. Gradient clipping is used to scale the gradient vector of the trainable parameters before each parameter update. When the L2 norm of the gradient vector (the square root of the sum of the squares of the gradient elements) exceeds a preset threshold, it is compressed proportionally to within that threshold, thus preventing training instability caused by gradient explosion. Early stopping is used to prevent overfitting, indicating that training will terminate early when the validation set loss no longer decreases within a preset number of epochs. These training stability measures collectively ensure that the prediction network can converge stably under various random seeds.

[0082] After training, the corresponding power prediction model is obtained.

[0083] Example 2: A power prediction method, implemented based on an attention mechanism encoder-decoder network, is used for power prediction at renewable energy power plants, such as... Figure 2 As shown, it includes the following steps: Obtain the corresponding historical power sample sequence and meteorological feature sequence, wherein the meteorological feature sequence includes meteorological features that correspond one-to-one with the prediction time; Based on the historical power sample sequence and meteorological feature sequence, the preset power prediction model outputs the power prediction value corresponding to each prediction time.

[0084] This embodiment (hereinafter referred to as the "prediction phase") utilizes the fixed coefficients determined in the training phase to perform pure forward propagation calculations on the data collected in real time at the current reporting time. In the prediction phase, all trainable coefficients of the prediction network remain unchanged, and only forward propagation calculations are performed.

[0085] Steps S100 to S300 also need to be executed to obtain the historical power sample sequence and meteorological feature sequence corresponding to the current reporting time. The historical power sample sequence undergoes the same data cleaning (S200) and normalization (S320) processes as in the training phase to obtain a normalized historical power sequence; the meteorological feature sequence undergoes the same feature engineering (S300) processes as in the training phase to obtain a meteorological feature vector that can be directly input into the prediction network. The difference between the prediction phase and the training phase is that the prediction phase only processes the data once for the current reporting time, and the data source is the latest historical power sequence collected before the current reporting time and the numerical weather forecast data generated before the reporting time. Preferably, the missing parts of the input historical power are linearly interpolated over time, with a zero-based fill-in for complete missing data. This is an engineering feature to ensure uninterrupted production output, deliberately different from the "complete loss of missing data" in training. The remaining specific implementation methods are consistent with the training phase and will not be repeated here.

[0086] After the preprocessing and feature engineering are completed, the normalized historical power sequence is fed into the encoding calculation unit, which encodes and outputs the hidden state sequence enc_out. The decoding calculation unit uses the future meteorological feature sequence generated before the reporting time and its own predicted value from the previous step as power input, and generates normalized predicted values ​​for multiple future times in an autoregressive manner. This forward calculation process is consistent with the forward calculation logic described in training phases S510 to S520, except that no parameter updates are performed in the prediction phase, and all coefficients retain the fixed values ​​determined in the training phase.

[0087] Then, the normalized predicted values ​​are mapped back to the physical space through the S600's physical constraint post-processing.

[0088] S600, Post-processing of physical constraints: This embodiment maps the per-unit prediction value of the prediction network back to the physical space and applies an upper limit on the installed capacity and a constraint that photovoltaic power returns to zero at night to ensure that the output conforms to the basic physical laws.

[0089] S610, inverse normalization and power cutoff: The predicted power value is denormalized and truncated to a physically permissible range, which is [0, installed capacity]; the installed capacity is the sum of the rated power of all power generation units in the new energy power station. Specifically, the predicted value is denormalized and truncated to a physically permissible range as follows: The formula for inverse normalization is: ; in, The normalized predicted value for the network output is a dimensionless per-unit value. The active power prediction value is after inverse normalization, in MW; With C cap The operations between them are scalar multiplications. The truncation operation ensures that the predicted value does not violate the physical upper bound.

[0090] The physical meaning of the cutoff operation is that active power cannot be negative, nor can it exceed the installed capacity of the power station. In wind power scenarios, negative power has no physical meaning, while excess power is limited by the rated power of the unit; in photovoltaic scenarios, power is zero during the night when there is no irradiance, and during the day it is limited by both irradiance intensity and photovoltaic array capacity, with installed capacity also constituting a physical upper bound on power. Constraining the predicted value within the physically permissible range of [0, installed capacity] ensures that the output is consistent with the physical laws of new energy power generation, avoiding deviations in subsequent grid dispatch decisions caused by the predicted value exceeding the physical upper limit.

[0091] S620, astronomical geometric constraints on zero photovoltaic output at night: When the new energy power station has photovoltaic power generation units, the solar altitude angle is calculated based on the geographical latitude of the new energy power station and the predicted time. When the solar altitude angle is not greater than zero, the predicted power value corresponding to the predicted time is set to zero. For photovoltaic power stations, based on the above-mentioned inverse normalization and truncation operations, a nighttime zeroing physical constraint based on astronomical geometry is further applied.

[0092] For photovoltaic (PV) power plants, the solar altitude angle is calculated in real time based on the plant's latitude and longitude and the predicted time. When the altitude angle is not greater than zero, the predicted value for the corresponding time is forcibly set to zero, completely eliminating false alarms at night. After applying physical constraints based on astronomical geometry to the PV power plant, the solar altitude angle h is calculated using the plant's latitude φ and the predicted time. sin h=sinφsinδ+cosφcosδcosω; Where φ is the geographical latitude of the station, δ is the solar declination, and ω is the hour angle.

[0093] The solar declination δ is calculated from the intra-annual sequence N using the following formula: ; Wherein, the yearly sequence N is the day number calculated from January 1st of each year, with January 1st corresponding to N=1 and December 31st corresponding to N=365. The unit of δ is degrees.

[0094] The hour angle ω is calculated from the local true solar time t using the following formula: ; Where t represents local true solar time, in 24-hour time; 12:00 noon corresponds to t=12, and 8:00 AM corresponds to t=8. ω is in degrees. Local true solar time t is obtained by converting local clock time through longitude correction and a time difference equation, which is a function relating the time difference to the day sequence within the year. This time difference equation is a well-known astronomical calculation method used to correct for time deviations caused by uneven Earth orbit speed.

[0095] When the solar altitude angle h ≤ 0, it means that the sun is below the horizon and there is no effective radiation. The photovoltaic power station will inevitably have no output. At this time, the prediction for this moment is set to zero.

[0096] This embodiment aligns the prediction results of the data-driven prediction network with the physical laws of photovoltaic power generation through post-processing. A necessary condition for photovoltaic power generation is that the sun is above the horizon. Traditional methods often determine nighttime based on fixed time periods or empirical thresholds, without linking them to the actual solar radiation geometry of the site's geographical location and season. This invention calculates the solar altitude angle in real time based on the site's latitude and longitude and the prediction time, replacing empirical thresholds with strict astronomical geometric criteria. This automatically resets the predicted value for nighttime periods without radiation to zero, eliminating false alarms of non-zero solar radiation at night. Furthermore, this criterion automatically adapts to any latitude and seasonal changes without manual adjustment.

[0097] After two post-processing steps—inverse normalization and truncation, and photovoltaic nighttime zeroing—the final output power prediction sequence is restored to the original active power value in terms of dimensions, constrained within the physically permissible range in terms of numerical value, and consistent with the diurnal rhythm of photovoltaic power generation in terms of physical logic. The above post-processing operations do not change the prediction results of the prediction network in the normalized space; rather, they map the predicted values ​​back to the physical world and apply constraints consistent with the generator's mechanism. This decoupled design—first performing predictions in the normalized space by the prediction network, and then applying physical constraints for post-processing—ensures that the prediction network is not disturbed by physical constraints during training, while guaranteeing the physical rationality of the output results during post-processing.

[0098] S700, Prediction Result Output: This embodiment outputs a sequence of active power predictions for multiple moments within a fixed future prediction period, which can be used for power grid dispatching, renewable energy consumption, and electricity market transactions.

[0099] The predicted values ​​obtained in step S620 are arranged in ascending order of time, and the time corresponding to each predicted moment is clearly marked. This embodiment outputs a predicted sequence of active power for the next 4 hours, with 16 moments at 15-minute intervals.

[0100] The input to this embodiment is the physical constraint prediction sequence and its corresponding time label processed in step S620; the output is the final ultra-short-term power prediction result for the user.

[0101] In this embodiment, the above steps are illustrated using actual data: To verify the effectiveness of the method proposed in this invention, ultra-short-term power prediction experiments were conducted in wind farms and photovoltaic power plants, and the results were compared with various baseline models.

[0102] The prediction task is to output the active power at 16 time points in 15-minute intervals for the next 4 hours. Figure 3 This paper demonstrates the Seq2Seq prediction network structure based on Luong attention used in this invention. The encoding computation unit compresses the historical power sequence into a hidden state sequence, and the decoding computation unit dynamically weights and aligns the entire sequence of the encoding computation unit with attention at each step before outputting the prediction for the current time step. All subsequent experiments are conducted based on this network structure. All experiments follow the sample construction rules described in S400 to ensure that the training set, validation set, and test set are strictly divided in chronological order to prevent future information leakage. The evaluation metrics used are MAE and Root Mean Square Error (RMSE).

[0103] To comprehensively verify the effectiveness of each module of this invention, multiple sets of comparative experiments were set up in this embodiment. In the wind farm experiment, a Seq2Seq model without attention was selected as the baseline. This model also adopts an encoder-decoder computation unit architecture, the same number of LSTM layers, and the same number of training epochs. The only difference is that it does not include the Luong attention mechanism, which is used to separately verify the effect of the attention mechanism on improving prediction accuracy. The differences between this baseline model and the present invention in terms of encoding and decoding structure and training strategy have been kept to a minimum to ensure that the attribution of the comparison results is clear.

[0104] The encoding computation unit uses a 2-layer LSTM with a hidden dimension H=128 and an inter-layer dropout of 0.2; the decoding computation unit uses a single-layer LSTM with a hidden dimension H=128. Training employs a planned sampling strategy, with the teacher-forced ratio linearly decreasing from 1.0 to 0.0 over the first 100 training epochs. Pure autoregressive expansion is used in the prediction phase. The optimizer is the Adam optimizer with a learning rate of 5e-4 and a batch size of 512. The learning rate uses a cosine annealing strategy, decreasing from the initial value to a minimum learning rate of 4e-5 over 500 training epochs. The gradient pruning threshold is 1.0, and the early stopping patience value is 30. Experimental results show that the MAE of this invention decreases from 4.11MW to 3.73MW over the next 16 time steps, a reduction of approximately 9.1%; the RMSE decreases from 6.29MW to 5.70MW, a reduction of approximately 9.3%.

[0105] To further analyze the variation of error with the prediction time domain, the MAE of the baseline model and the present invention at each prediction step was statistically analyzed. Figure 4The curve showing the change in prediction error with the number of prediction steps is presented. The horizontal axis represents the prediction time sequence, corresponding to the next 15 minutes to 4 hours, and the vertical axis represents the MAE value. From Figure 4 It can be clearly seen that the error of the baseline model increases monotonically with the increase of the number of prediction steps, while the error curve of the present invention is lower than the baseline in the entire time domain, and the rate of increase slows down significantly. Figure 4 The distance between the two curves gradually increases with the number of steps. Specifically, at the near end of the time interval (times 1 to 4), corresponding to the next 15 to 60 minutes, the error decreases by approximately 4.4%; at the far end of the time interval (times 13 to 16), corresponding to the next 3 to 4 hours, the error decreases by approximately 11.9%, with the MAE at time 16 decreasing from 5.07 MW to approximately 4.44 MW. These results indicate that the present invention is particularly effective in suppressing long-term autoregressive drift, and the phenomenon of error monotonically accumulating and amplifying with the number of prediction steps is effectively suppressed.

[0106] The photovoltaic power plant experiment adopted the same baseline and comparison settings as the wind farm experiment, using a Seq2Seq model without attention mechanism as the baseline. Both comparisons employed the same data partitioning, post-processing, and evaluation methods. Experimental results show that the overall MAE of this invention decreased from the baseline of 0.68MW to 0.65MW, a reduction of approximately 5%.

[0107] In terms of prediction efficiency, a single end-to-end prediction takes approximately 195 milliseconds, meeting the real-time requirements of minute-level online response for ultra-short-term prediction. Regarding training stability, repeated training with three different random seeds yielded a MAE of 3.724 ± 0.020 MW, with extremely small variance, indicating that the invention converges smoothly, has good reproducibility, and possesses the engineering conditions for direct online deployment.

[0108] Based on this invention, the following substitutions or extensions still fall within the scope of protection of this invention: The recurrent units of the encoding and decoding computation units can be replaced by long short-term memory networks with gated recurrent units or other recurrent structures. Gated recurrent units have fewer parameters and higher computational efficiency, and may achieve similar or even better results in scenarios with small amounts of data.

[0109] The attention mechanism can be replaced by Luong's general form, either as a dot product or concatenation form, or by Bahdanau's additive attention mechanism, or by introducing a multi-head self-attention mechanism onto the encoded sequence. The difference between the different attention mechanisms lies in the design of the scoring function, but all of them can achieve dynamic weighted alignment of the historical encoded sequence at each step of decoding.

[0110] The historical window length, hidden dimension, number of network layers, prediction steps, and sampling interval can all be adjusted according to the characteristics of the site. Different sites may have different climate characteristics, power output characteristics, and data acquisition conditions. The above hyperparameters can be adapted according to specific application scenarios without departing from the basic concept of this invention.

[0111] The annealing curve for planned sampling can be linear, cosine, inverse sigmoid, etc. The choice of annealing curve affects the rate at which the teacher forced ratio decreases as training progresses; different curve shapes can adapt to training needs with different data scales and model complexities.

[0112] The nighttime zeroing criterion can be automatically adapted to the station's latitude and longitude and seasonal changes by calculating the solar altitude angle, or it can be reduced to a simplified criterion based on local time period or empirical threshold. The criterion based on the solar altitude angle has the highest accuracy and requires no manual adjustment, while the simplified time period criterion is suitable for application scenarios with low accuracy requirements or lack of latitude and longitude information.

[0113] In addition to its application in new energy power prediction, this invention can also be applied to other time-series multi-step prediction scenarios such as power load prediction and electricity price prediction. Any time-series prediction task that includes encoding / decoding structures and attention mechanisms can leverage the core concepts of this invention to improve prediction accuracy.

[0114] Those skilled in the art, upon reading this specification, can conceive of the above-mentioned alternatives and equivalent transformations without any creative effort, and these do not depart from the scope of protection of this invention.

[0115] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0116] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0117] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0118] This invention is described with reference to flowchart illustrations and / or block diagrams of the method, terminal device (system), and computer program product according to the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0119] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0120] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0121] It should be noted that: The phrase "an embodiment" or "an embodiment" used in this specification means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the invention. Therefore, the phrase "an embodiment" or "an embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment.

[0122] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.

[0123] Furthermore, it should be noted that the shapes and names of the parts and components described in the specific embodiments described in this specification may differ. All equivalent or simple variations made to the structure, features, and principles described in this patent concept are included within the protection scope of this patent. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to replace them, as long as they do not depart from the structure of this invention or exceed the scope defined in these claims, they should all fall within the protection scope of this invention.

Claims

1. A method for constructing a power prediction model, used for constructing a power prediction model of a new energy station, characterized in that, Includes the following steps: Acquire training data, which includes several sample data with a reporting start time. The sample data includes the corresponding historical power sample sequence, as well as meteorological sample features and power true values ​​that correspond one-to-one with the prediction time. A sequence-to-sequence prediction network is constructed, comprising an encoding computation unit, a decoding computation unit, and a fusion unit. The input of the encoding computation unit is the historical power sample sequence, and the output is the corresponding hidden state sequence. The input of the decoding computation unit is the meteorological sample features corresponding to the current prediction time and the power feedback value corresponding to the previous time, and the output is the corresponding decoded hidden state. The power feedback value is either the true power value at the previous time or the power prediction value output by the decoding computation unit itself at the previous time. The fusion unit uses an attention mechanism to dynamically weight the hidden state sequence to obtain a context vector, and then fuses the decoded hidden state with the context vector to output the power prediction value corresponding to the current prediction time. The sequence-to-sequence prediction network is trained using a planned sampling strategy to obtain a corresponding power prediction model. The planned sampling strategy is that during the training process, the decoding calculation unit selects one of the corresponding true power value and its own output predicted power value as input at each step with a preset probability. The value of the preset probability transitions from biased towards the true power value to biased towards the power prediction value of its own output as the training rounds increase.

2. The power prediction model construction method according to claim 1, characterized in that: The preset probability is the teacher-forced ratio, which linearly decays from 1.0 to 0.0 in the early stage of training. After the decay is completed, the teacher-forced ratio remains constant at 0.0 in the remaining training rounds.

3. The power prediction model construction method according to claim 1, characterized in that: The decoding calculation unit scores the correlation between the hidden state sequence and the current decoded hidden state at each step, normalizes the obtained score using the flexible maximum function to obtain the attention weight, and then uses the attention weight to weight and sum the hidden state sequence to obtain the context vector. The correlation score is used to measure the importance of the hidden state at each historical moment to the current prediction moment; the flexible maximum function is used to normalize the elements of the score vector.

4. The power prediction model construction method according to claim 1, characterized in that: The new energy power stations include wind farms and photovoltaic power stations; The historical power sample sequence was cleaned, and the wind farms and photovoltaic power plants were processed separately: For the wind farm, a scatter plot of nacelle wind speed and actual power is drawn for each unit. The power envelope sub-zone is calculated according to wind speed. Power points that exceed the sub-zone range are judged as abnormal and removed. For the photovoltaic power station, a scatter plot of the measured horizontal solar shortwave radiation and the actual total power is plotted. The power envelope sub-band is calculated according to the radiation sub-bins. Power points that exceed the sub-band range are judged as abnormal and removed.

5. The power prediction model construction method according to claim 4, characterized in that: The wind farm and the photovoltaic power station use different historical window lengths, with the historical window of the wind farm being shorter than that of the photovoltaic power station.

6. The power prediction model construction method according to claim 1, characterized in that: The sequence-to-sequence prediction network is trained using the average absolute value loss function and an adaptive moment estimation optimizer. The learning rate uses a cosine annealing strategy, and gradient pruning and early stopping mechanisms are employed.

7. A power prediction method for power prediction of a new energy station, characterized in that, Includes the following steps: Obtain the corresponding historical power sample sequence and meteorological feature sequence, wherein the meteorological feature sequence includes meteorological features that correspond one-to-one with the prediction time; The power prediction model outputs the power prediction value corresponding to each prediction time based on the historical power sample sequence and meteorological feature sequence, wherein the power prediction model is the power prediction model constructed by the construction method of any one of claims 1 to 6.

8. The power prediction method according to claim 7, characterized in that: When the new energy power station has a photovoltaic power generation unit, the solar altitude angle is calculated based on the geographical latitude of the new energy power station and the predicted time. When the solar altitude angle is not greater than zero, the power prediction value corresponding to the predicted time is set to zero.

9. The power prediction method according to claim 8, characterized in that: The solar altitude angle is calculated using the celestial coordinate formula based on the geographical latitude, solar declination, and hour angle of the new energy power station. The formula for celestial coordinates is as follows: multiply the sine of the geographical latitude of the new energy power station by the sine of the solar declination, and then multiply the cosine of the geographical latitude of the new energy power station, the cosine of the solar declination, and the cosine of the hour angle by the same product. The result is the sine of the solar altitude angle.

10. The power prediction method according to claim 7, characterized in that: The predicted power value is denormalized and truncated to a physically permissible range, which is from zero to the installed capacity of the new energy power station; the installed capacity is the sum of the rated power of all power generation units of the new energy power station.