Photovoltaic ultra-short-term power prediction method and device based on error compensation
By using a CNN-BiLSTM network and a bias feedback compensator, the problems of limited model representation ability and numerical weather forecast bias in photovoltaic power prediction are solved, achieving high-precision ultra-short-term photovoltaic power prediction and improving the stability of grid dispatch and photovoltaic absorption capacity.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CYG SUNRI CO LTD
- Filing Date
- 2025-12-22
- Publication Date
- 2026-04-17
AI Technical Summary
Existing photovoltaic power prediction technologies are unable to fully depict the complex nonlinear variation of photovoltaic output, and numerical weather prediction data have inherent biases, resulting in insufficient accuracy and timeliness of ultra-short-term photovoltaic power prediction.
We employ a CNN-BiLSTM-based feature extraction network and a bias feedback compensator. Through self-attention and cross-attention mechanisms, we capture the spatiotemporal variation patterns of numerical weather forecasts and actively correct biases, thereby improving forecast accuracy.
It improves the accuracy and timeliness of ultra-short-term photovoltaic power forecasting, effectively responds to sudden weather changes, and enhances the decision-making buffer capacity of power grid dispatching.
Smart Images

Figure CN121886352A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power prediction technology, and in particular to a photovoltaic ultra-short-term power prediction method and apparatus based on error compensation. Background Technology
[0002] Renewable energy power forecasting is of great significance for ensuring the stable operation of the power grid. With the continuous increase in the proportion of photovoltaic power generation, its intermittency and volatility caused by factors such as sunshine and cloud cover pose significant challenges to the power balance and safe regulation of the power system. Achieving high-precision ultra-short-term photovoltaic power forecasting (0-4 hours ahead) can provide a critical decision-making buffer for grid dispatch and is an important technical support for improving the capacity for renewable energy absorption.
[0003] Currently, photovoltaic (PV) power prediction mainly relies on data from numerical weather forecasts and other sources, combined with mathematical models for estimation. Mainstream technical approaches include physical models based on physical mechanisms, statistical models based on historical data patterns (such as support vector machines and random forests), and deep learning models with powerful learning capabilities (such as CNNs and LSTMs). However, these methods all face core bottlenecks: on the one hand, a single prediction model cannot fully characterize the complex nonlinear variations in PV output; on the other hand, numerical weather forecast data, which is highly dependent on prediction performance, suffers from inherent biases and insufficient spatiotemporal resolution, failing to accurately describe minute-level drastic fluctuations in local weather, leading to a decline in predictive ability under scenarios of abrupt power changes.
[0004] Therefore, overcoming model limitations and effectively correcting input data biases are key issues that urgently need to be addressed to achieve high-precision and high-reliability photovoltaic ultra-short-term power prediction. Summary of the Invention
[0005] This application provides a method and apparatus for ultra-short-term photovoltaic power prediction based on error compensation. It can effectively capture the complex spatiotemporal variation patterns in numerical weather prediction through a feature extraction network, improving the model's representation capability. Furthermore, it actively corrects the inherent biases of numerical weather prediction data through a bias feedback compensator. This solves the problems of limited model representation capability, inherent biases in numerical weather prediction data, and insufficient predictive ability for sudden fluctuations in traditional technical solutions, thereby improving the accuracy and timeliness of ultra-short-term photovoltaic power prediction.
[0006] Firstly, this application provides a photovoltaic ultra-short-term power prediction method based on error compensation. The method includes: acquiring numerical weather forecast data and historical operating power sequences corresponding to photovoltaic power plants; extracting spatiotemporal features from the numerical weather forecast data using a preset feature extraction network to obtain spatiotemporal fusion features; inputting the spatiotemporal fusion features, numerical weather forecast data, and historical operating power sequences into a preset deviation feedback compensator to obtain a compensated predicted power data sequence; and performing real-time correction on the compensated predicted power data sequence based on measured power data to obtain a target predicted power data sequence. The target predicted power data sequence contains multiple consecutive photovoltaic power prediction values within a preset time period, with the start time of the preset time period being the current time.
[0007] In some implementations, the feature extraction network is a CNN-BiLSTM network, which includes a convolutional neural network module and a bidirectional long short-term memory network module. Based on the preset feature extraction network, spatiotemporal features are extracted from numerical weather forecast data to obtain spatiotemporal fusion features. This includes: extracting regional spatial features from the numerical weather forecast data using the convolutional neural network module; and extracting the forward and backward temporal dependencies in the regional spatial features using the bidirectional long short-term memory network module to obtain the spatiotemporal fusion features.
[0008] In some implementations, the bias feedback compensator includes a self-attention module and a cross-attention module. The spatiotemporal fusion features, numerical weather prediction data, and historical operating power sequences are input into a preset bias feedback compensator to obtain a compensated predicted power data sequence. This includes: performing global context-aware processing on the numerical weather prediction data using the self-attention module to obtain an enhanced meteorological feature sequence; initializing feature encoding of the spatiotemporal fusion features using the self-attention module to obtain a spatiotemporal feature sequence, the dimension of which is the same as the dimension of the enhanced meteorological feature sequence; determining the spatiotemporal feature sequence as the query sequence for the cross-attention module, and determining the enhanced meteorological feature sequence as the key-value pair sequence for the cross-attention module; and compensating the spatiotemporal feature sequence based on the historical operating power sequence using the cross-attention module to obtain the compensated predicted power data sequence.
[0009] In some implementations, based on historical operating power sequences, a cross-attention module is used to compensate the spatiotemporal feature sequences to obtain a compensated predicted power data sequence. This includes: linearly mapping the query sequence to obtain an initial reference point in a high-dimensional feature space; determining the offset between the query sequence and the historical operating power sequences; moving the initial reference point according to the offset to obtain a reference point; fusing contextual information into the key-value pair sequence of the reference point using a dynamic weight aggregation algorithm to obtain a nonlinear compensation term; fusing the nonlinear compensation term with the spatiotemporal feature sequences through residual connections; and performing layer normalization on the fusion result to obtain the compensated predicted power data sequence.
[0010] In some implementations, the compensated predicted power data sequence is corrected in real time based on measured power data to obtain a target predicted power data sequence. This includes: obtaining the photovoltaic power prediction value and the measured photovoltaic power value at the previous time step. If both the photovoltaic power prediction value and the measured photovoltaic power value are greater than or equal to a preset threshold, the ratio of the measured photovoltaic power value to the photovoltaic power prediction value is determined as a correction coefficient. A weighting coefficient is determined for each photovoltaic power prediction data point in the compensated predicted power data sequence, resulting in multiple weighting coefficients. The weighting coefficient for each photovoltaic power prediction data point is negatively correlated with its corresponding order in the compensated predicted power data sequence. Based on the weighting coefficient for each photovoltaic power prediction data point, the compensated predicted power data sequence is corrected to obtain the target predicted power data sequence.
[0011] In some implementations, if the predicted photovoltaic power is less than a preset threshold, or the measured photovoltaic power is less than a preset threshold, then the compensated predicted power data sequence is determined as the target predicted power data sequence.
[0012] In some implementations, before determining the weighting coefficient corresponding to each photovoltaic power prediction data in the compensated prediction power data sequence, the method further includes: if the correction coefficient is greater than a preset coefficient threshold, then updating the correction coefficient to the preset coefficient threshold.
[0013] Secondly, this application provides a photovoltaic ultra-short-term power prediction device based on error compensation, comprising: The acquisition module is used to acquire numerical weather forecast data and historical operating power sequences corresponding to photovoltaic power stations; The feature extraction module is used to extract spatiotemporal features from numerical weather forecast data based on a preset feature extraction network to obtain spatiotemporal fusion features; The dynamic compensation module is used to input spatiotemporal fusion features, numerical weather forecast data and historical operating power sequences into a preset deviation feedback compensator to obtain a compensated predicted power data sequence. The correction processing module is used to correct the compensated predicted power data sequence in real time based on the measured power data to obtain the target predicted power data sequence. The target predicted power data sequence contains multiple consecutive photovoltaic power prediction values within a preset time period, with the start time of the preset time period being the current time.
[0014] Thirdly, this application provides a chip for performing the methods described in any of the first aspects above.
[0015] Fourthly, this application provides an electronic device including a processor and a memory, the processor being configured to execute a computer program stored in the memory to implement the method as described in any of the first aspects above. Alternatively, Electronic devices include chips, as described in the third aspect.
[0016] Fifthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method as described in any of the first aspects above.
[0017] In a sixth aspect, this application provides a computer program product storing a computer program that, when executed by a processor, implements the method as described in any of the first aspects above.
[0018] In the technical solution provided in this application, the power prediction device can first acquire numerical weather forecast data and historical operating power sequences corresponding to photovoltaic power plants. Then, based on a preset feature extraction network, it extracts spatiotemporal features from the numerical weather forecast data to obtain spatiotemporal fusion features. The spatiotemporal fusion features, numerical weather forecast data, and historical operating power sequences are input into a preset deviation feedback compensator to obtain a compensated predicted power data sequence. Then, based on measured power data, the compensated predicted power data sequence is corrected in real time to obtain a target predicted power data sequence. The target predicted power data sequence contains multiple consecutive photovoltaic power prediction values within a preset time period, with the start time of the preset time period being the current time. In the technical solution provided in this application, the power prediction device can effectively capture the complex spatiotemporal variation patterns in numerical weather forecasts through the feature extraction network, improving the model's representation capability. Furthermore, it actively corrects the inherent deviations of numerical weather forecast data through the deviation feedback compensator, solving the problems of limited model representation capability, inherent deviations in numerical weather forecast data, and insufficient prediction capability for sudden fluctuations in traditional technical solutions, thereby improving the accuracy and timeliness of ultra-short-term photovoltaic power prediction. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, 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 this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of a power prediction system structure for a photovoltaic ultra-short-term power prediction method based on error compensation, provided in an embodiment of this application. Figure 2 This is a schematic diagram of the structure of a convolutional neural network module for a photovoltaic ultra-short-term power prediction method based on error compensation, provided in an embodiment of this application. Figure 3 This is a schematic diagram of a deformable attention mechanism compensation process for a photovoltaic ultra-short-term power prediction method based on error compensation provided in an embodiment of this application; Figure 4 This is a schematic diagram of a modified algorithm for a photovoltaic ultra-short-term power prediction method based on error compensation, provided in an embodiment of this application. Figure 5 This is a schematic diagram of a power prediction process for a photovoltaic ultra-short-term power prediction method based on error compensation, provided in an embodiment of this application. Figure 6 This is a schematic diagram of the structure of a power prediction device provided in an embodiment of this application; Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0021] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0022] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0023] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0024] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0025] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0026] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0027] In the field of new energy power generation, new energy power prediction technology can predict changes in electricity volume in advance. The results of new energy power prediction can help the power grid dispatching department adjust the power consumption strategy in advance, ensure real-time power balance, and avoid frequency fluctuations or power outages.
[0028] The accuracy of renewable energy power forecasting is crucial for the stability of power grid operation and the effectiveness of power consumption strategy dispatching. With the continuous growth of installed photovoltaic (PV) power generation capacity, PV power is accounting for an increasingly larger share of renewable energy generation. However, the output power of PV power generation is affected by meteorological factors such as solar irradiance and cloud cover, exhibiting intermittent and fluctuating characteristics. Large-scale grid connection of PV power significantly increases the difficulty of power system power forecasting, thereby increasing the difficulty of power system power balance and security control. Large-scale grid-connected ultra-short-term PV power forecasting refers to predicting the power of the power grid from 0 to 4 hours in the future, providing a decision-making buffer for the grid dispatching department. This allows the dispatching system to adjust power generation plans in advance and call upon reserve capacity, effectively mitigating fluctuations in PV output. Developing high-precision, high-reliability PV ultra-short-term power forecasting technology is of great significance for optimizing grid dispatching decisions, ensuring the safe and stable operation of the system, and improving the absorption capacity of PV power generation.
[0029] Photovoltaic power prediction technology generally refers to a technical system that uses numerical weather prediction data, historical power data, and real-time operating status of power plants, combined with physical models and artificial intelligence methods, to predict the output power of photovoltaic power plants in the future. The final prediction accuracy of photovoltaic power prediction technology is mainly determined by the performance of the selected prediction model and the accuracy of the numerical weather prediction data it relies on. Existing technical solutions mainly revolve around constructing a mapping relationship between input variables (such as meteorological data) and output power. Based on differences in modeling principles, they can be mainly divided into the following three technical routes: Category 1: Photovoltaic ultra-short-term power prediction method based on error compensation and physical model.
[0030] This method, based on the physical mechanisms of photovoltaic power generation, uses mathematical equations to correlate numerical weather forecast data with the physical parameters of photovoltaic modules (such as installation tilt angle, conversion efficiency, and installed capacity) to construct a deterministic model independent of historical training data. Such models possess a certain predictive capability under stable weather and ideal lighting conditions. However, their fixed structure and lack of adaptive adjustment mechanisms result in insufficient generalization ability and robustness, leading to significant prediction biases when facing complex and variable weather conditions such as cloudy or rainy weather. Furthermore, factors such as module performance degradation, ambient temperature changes, and instantaneous fluctuations in irradiance during actual operation can exacerbate prediction errors, limiting their application in engineering practice.
[0031] The second category: photovoltaic ultra-short-term power prediction methods based on statistical models and error compensation.
[0032] This method analyzes the statistical patterns inherent in historical meteorological data and power station operation data to establish a mapping relationship between input variables and output power, thereby achieving photovoltaic power prediction. Common statistical models include LR (Linear Regression), ARIMA (AutoRegressive Integrated Moving Average), SVG (Support Vector Regression), RFR (Random Forest Regression), and XGBoost (eXtreme Gradient Boosting) models. Statistical models, due to their flexible modeling and ability to optimize parameters based on historical data, generally outperform physical models in prediction performance. However, photovoltaic power output time series exhibit high non-stationarity and non-linearity, and traditional statistical models often only capture shallow mapping relationships in the data, making it difficult to effectively extract deeper discriminative features such as trends and periods. Meanwhile, the performance of traditional statistical models is highly dependent on a large amount of complete and accurate historical data. However, in actual engineering scenarios, there are common problems such as missing data and noise. In addition, the dynamic changes in the operating mode further restrict the generalization ability and the upper limit of prediction accuracy of statistical methods.
[0033] The third category: Photovoltaic ultra-short-term power prediction methods based on error compensation and deep learning models.
[0034] The error-compensated photovoltaic (PV) ultra-short-term power prediction method based on deep learning models possesses powerful automatic feature learning capabilities and adaptability to massive amounts of data. This method is suitable for PV power prediction in complex nonlinear scenarios. Common deep learning models include: CNN (Convolutional Neural Network) models, LSTM (Long Short-Term Memory) models, and Transformer models (a deep learning model based on an attention mechanism).
[0035] Convolutional neural network (CNN) models focus on extracting spatial features, but their ability to model long-term temporal dependencies is limited. Long short-term memory (LSTM) network models focus on capturing temporal dynamics, but lack sufficient perception of spatial relationships between variables. Transformer models, when processing long text data, are limited by memory constraints and efficiency issues due to their positional encoding and attention mechanisms.
[0036] Numerical weather prediction (NWP) refers to a method that, based on actual atmospheric conditions and under certain initial and boundary conditions, uses large-scale computers to perform numerical calculations to solve the fluid dynamics and thermodynamic equations describing weather evolution, predicting atmospheric motion and weather phenomena over a future period. Numerical weather prediction is one of the key inputs to power prediction models. However, due to initial field observation errors, imperfect parameterization of physical processes, and numerical calculation approximations, numerical weather prediction data inherently contains systematic biases. These biases are directly transmitted to the power prediction models driven by them, limiting the prediction accuracy of photovoltaic power prediction models.
[0037] Furthermore, numerical weather prediction data typically reflects macroscopic weather trends in a smoothed form, making it difficult to accurately capture local intraday real-time weather fluctuations. In ultra-short-term photovoltaic power forecasting, which requires minute-level dynamic tracking, sudden cloud formations or abrupt local weather changes can cause drastic fluctuations in actual solar irradiance, leading to sharp increases or decreases in power generation. The low resolution and smoothed nature of numerical weather prediction data prevents it from accurately describing such rapid dynamic processes, resulting in a decline in the performance of prediction models under highly volatile scenarios.
[0038] In summary, traditional photovoltaic (PV) ultra-short-term power prediction methods based on error compensation suffer from limitations. Due to the nonlinear and stochastic fluctuations inherent in PV, a single prediction model cannot comprehensively and accurately characterize its complex dynamic patterns. Furthermore, numerical weather prediction data, a crucial input for PV power prediction models, contains inherent biases that severely impact the accuracy of these models, further reducing the accuracy of PV power predictions. Moreover, ultra-short-term PV power prediction requires minute-level fine-grained dynamic tracking of power, but existing methods lack the ability to predict drastic power fluctuations caused by sudden weather changes.
[0039] In view of this, this application provides a photovoltaic ultra-short-term power prediction method based on error compensation. It can effectively capture the complex spatiotemporal variation patterns in numerical weather forecasts through feature extraction networks, improve the model's representation ability, and actively correct the inherent bias of numerical weather forecast data through a bias feedback compensator. This solves the problems of limited model representation ability, inherent bias of numerical weather forecast data, and insufficient ability to predict sudden fluctuations in traditional technical solutions, thereby improving the accuracy and timeliness of ultra-short-term photovoltaic power prediction.
[0040] Figure 1 This is a schematic diagram of a power prediction system structure for a photovoltaic ultra-short-term power prediction method based on error compensation, provided in an embodiment of this application. Figure 1 As shown, the power prediction system provided in this application embodiment may include a preset feature extraction network and a preset deviation feedback compensator.
[0041] The feature extraction network can be a CNN-BiLSTM network, which includes a convolutional neural network (CNN) module and a bidirectional long short-term memory (BiLSTM) network module. The CNN module is used to extract features (regional spatial feature extraction) from numerical weather prediction (NWP) data to obtain regional spatial features. NWP data can include, but is not limited to, data on irradiance, temperature, humidity, and cloud cover. The input dimension of the NWP data can be N×M, where N represents the time period and M represents the feature variables. Before inputting the NWP data into the CNN module, the error-compensated photovoltaic ultra-short-term power prediction device (referred to as the "power prediction device") can further preprocess the NWP data (including one or more of outlier handling, missing value imputation, and standardization) to obtain the regional spatial features. The regional spatial features are then input into a bidirectional long short-term memory (BiLSTM) network module for temporal dependency feature extraction (including forward LSTM and backward LSTM) to extract the forward and backward temporal dependencies in the regional spatial features and obtain spatiotemporal fusion features.
[0042] In the technical solutions provided in the embodiments of this application, the convolutional neural network module (CNN) may include at least a convolutional layer. Figure 2 This is a schematic diagram of the structure of a convolutional neural network module for a photovoltaic ultra-short-term power prediction method based on error compensation, provided in an embodiment of this application. Figure 2 As shown, the convolutional neural network module may include a one-dimensional convolutional layer for feature extraction. Specifically, the one-dimensional convolutional layer is used to extract regional spatial features (spatial features of the photovoltaic area) from numerical weather prediction (NWP) data. It should be understood that, without considering the time dimension, the NWP data in this application can be regarded as a one-dimensional array input. The convolutional neural network module in this application does not rely on the temporal correlation of the sequence. Introducing pooling operations for dimensionality reduction may lead to the loss of key spatial structure information. Therefore, the convolutional neural network module in this application does not include a pooling layer. The one-dimensional convolutional layer is configured with C convolutional filters of size 1 (conv_filters), which perform convolution operations on the NWP sequence with an input dimension of N×M. Each filter slides along the time dimension (length N), performing weighted fusion on the M meteorological factor dimensions, and finally outputting a spatial feature map (regional spatial features) with a dimension of C×M.
[0043] It should be understood that, to suppress covariate shift within the Convolutional Neural Network (CNN) module, a Batch Normalization (BN) layer is introduced after the convolutional layers. This layer independently normalizes the C feature channels of the output to improve training stability and ensure the consistency of the distribution of domain spatial features during training. The entire computation process of the convolutional module is as follows: Formula (1) in, Used to indicate the first A set of input sequence fields in the layer, Used to indicate the first The first in the layer Each input feature. and They are the first Layer convolution kernel weights and biases. Used to represent activation functions employing the modified linear unit (ReLU). Used to represent batch normalization layers. Used to indicate the first The output of a convolutional layer.
[0044] In the technical solution provided in this application, the Long Short-Term Memory (BiLSTM) network module can be used to process long-term sequence tasks. Its internal structure includes, but is not limited to, an input gate, a forget gate, and an output gate. The forget gate stores the weight vector of old information, the input gate obtains the weight vector of new information, and the output gate outputs candidate vectors. The internal computation process of the BiLSTM network module is as follows: Formula (2) in, , , and These are used to represent the input, forgetting, output, and modulation gate of the Long Short-Term Memory (BiLSTM) network module at time t, respectively. Used to represent the Sigmoid activation function , , and These are used to represent the weights of the input, forget, output, and modulation gate, respectively. , , and These are used to represent the bias matrices for input, forgetting, output, and modulation gate, respectively, and tanh represents the bidirectional tangent function. Used to represent spatiotemporal fusion features.
[0045] It should be understood that, since a single LSTM model only considers information in one direction of the sequence, it is difficult to effectively extract the long-range time dependence information of seasonality and trends contained in NWP sequence data. The technical solution provided in this application embodiment can use a variant Bi-LSTM to capture the past and future nonlinear fluctuation relationship between NWP data and power data.
[0046] The bidirectional architecture in the Bi-LSTM model enables simultaneous processing of sequence context information from both forward and backward directions. Specifically, the model contains two independent LSTM layers: one following the original order of the input sequence... One is processed in the forward direction, while the other is processed in reverse order. Back-end processing is then performed. After spatial feature extraction, forward and backward LSTMs are used to fuse the temporal dimension of the spatial features at each time step to form the final integrated output (spatiotemporal fusion features). : Formula (3) Bi-LSTM achieves the fusion of forward and backward timing information based on the above formula. Among them, and These are the outputs of the forward and backward LSTMs, respectively. This refers to the fusion operation operator for neural networks.
[0047] The bias feedback compensator, based on the Transformer architecture, can be used to focus on the inherent bias in the interaction between numerical weather prediction and actual power. Through an internal attention mechanism, it captures multi-source meteorological elements and their dynamic impact on power output, constructing an end-to-end, learnable, nonlinear bias dynamic compensation system to achieve dynamic adaptive compensation for nonlinear biases in predicted power. (See also...) Figure 1 This subsystem achieves fine reconstruction of the predicted power through the collaborative workflow of the self-attention module and the cross-attention module, and obtains the compensated predicted power data sequence.
[0048] Self-Attention Module: Constructs a global meteorological context perception and spatiotemporal feature encoding mapping. The self-attention module can be used to calculate global dependencies, dynamically weight all meteorological elements, identify key patterns, and encode the spatiotemporal fusion features extracted by the Long Short-Term Memory Network (BiLSTM) module, providing query input for the subsequent cross-attention module.
[0049] Specifically, the self-attention module can perform global context-aware processing on numerical weather forecast data that has undergone embedding (a technique for mapping high-dimensional discrete data (such as text, images, and audio) to a low-dimensional continuous vector space) to obtain enhanced meteorological feature sequences. .
[0050] The self-attention module can serve as a "meteorological feature importance evaluator." Through a multi-head attention mechanism, it calculates the internal correlation strength between different meteorological elements at different time points, forming an enhanced meteorological feature sequence (global meteorological context-aware map). ).
[0051] The self-attention module can automatically identify and focus on key meteorological events. For example, in a cloudy weather scenario, this module can keenly capture the event of a "sudden drop in irradiance" and accordingly assign higher weights to relevant features such as cloud cover and temperature at the time points before and after the event. This process outputs a high-quality meteorological feature sequence (enhanced meteorological feature sequence) that has been filtered and enhanced based on importance for subsequent processing. .
[0052] The specific process is as follows: First, the original NWP data is processed through the Embedding operation. Embedding initialization is performed to generate NWP feature query sequences, which are then used as input to the self-attention module (denoted as ). The feature dimension is ): Formula (4) Then, use trigonometric functions to... Perform position encoding and add the corresponding position embedding vector. To eliminate ambiguity in different spatial locations: Formula (5) in, Used to represent the position index of a sequence element. Used to represent the dimension of an element vector. Take the integer part.
[0053] Finally, a multi-head attention mechanism is employed. Attention weights are obtained by calculating the relevance between query-key pairs, and the outputs of multiple attention heads are weighted and fused to achieve dynamic focusing on the intrinsic correlations of multi-source meteorological elements. In the self-attention module, the input is... After internal multi-head attention module calculations, the final output is a high-quality meteorological feature sequence (enhanced meteorological feature sequence) that has undergone importance filtering and enhancement. , can be represented as: Formula (6) in, Used to represent NWP feature query sequences Used to represent position embedding vectors The weight matrix used to represent the multi-head attention module. A mapping matrix used to represent linear transformations. ( (Total number of attention heads). The internal calculation process for multi-head attention is as follows: Given a query sequence Key-value sequences Passing the exam Weight matrix of each attention head The output of this attention head can be expressed as: Formula (7) in, These are weight matrices with three different dimensions. and This represents the location embedding vector. Based on the interaction mechanism between query (Q), key (K), and value (V), Each element can be observed All elements, the first The output of each attention head can be represented as a weighted sum of attention weights: Formula (8) in, , It is the index of the key-value sequence. The outputs of each attention head are concatenated along the feature dimension and integrated through a linear transformation layer to obtain the final output of the multi-head attention: Formula (9) Formula (10) in, Used to represent spliced tensor functions. Used to represent the concatenation of multiple attention head outputs. The weight matrix used to represent the multi-head attention module. A mapping matrix used to represent linear transformations.
[0054] The self-attention module is also used to initialize feature encoding of spatiotemporal fusion features to obtain spatiotemporal feature sequences. Spatiotemporal feature sequences Dimensions and Enhanced Meteorological Feature Sequences They have the same dimensions.
[0055] The self-attention module is used for spatiotemporal fusion features. Initial feature encoding is performed to ensure efficient computation of the subsequent cross-attention module. Spatiotemporal features are then transformed into query sequences for the cross-attention module through a separate Self-Attention module layer. The mapping process can be represented as: Formula (11) in, This is a trainable projection matrix. This process explicitly maps the spatiotemporal features of the "baseline prediction" output by the CNN-BiLSTM to a matrix associated with the enhanced meteorological feature sequence. In the query space corresponding to the dimension, a deeper baseline representation enhanced by global context is generated, providing richer and more structurally matched query input for subsequent accurate deviation localization and feature crossing.
[0056] As can be seen, the self-attention module, through the above dual processing, not only generates enhanced meteorological features containing global context, but also generates baseline query features that are adapted to them, together providing accurate input for the collaborative work of the cross-attention module.
[0057] The cross-attention module is used to compensate for the spatiotemporal feature sequence, resulting in a compensated predicted power data sequence. It should be understood that in the cross-attention module, the query input originates from the spatiotemporal fusion features extracted by the CNN-BiLSTM network. This feature sequence represents the "baseline prediction" made by the model based on historical patterns. The key and value are taken from the enhanced meteorological feature sequence output by the self-attention module mentioned above. .
[0058] The Cross-Attention module generates a set of learnable offsets for each query element using Deformable Attention (an attention mechanism used in neural networks). These offsets guide the model to dynamically and sparsely focus on a few key meteorological context points in the meteorological feature sequence that have the greatest impact on the deviation of the current "baseline prediction" result.
[0059] Figure 3 This diagram illustrates a deformable attention mechanism compensation process for a photovoltaic ultra-short-term power prediction method based on error compensation, as provided in an embodiment of this application. Figure 3 As shown, the method for power prediction based on historical power sequences, and compensating the spatiotemporal feature sequences using a cross-attention module to obtain the compensated predicted power data sequence, includes the following steps: Baseline generation and initialization: Spatiotemporal fusion features from CNN-BiLSTM output As a query sequence, it constitutes the "baseline prediction features," which are then transformed into a high-dimensional feature space after linear mapping, serving as the initial reference point. .
[0060] Actual power sequence initialization: Initialize the actual power sequence (historical operating power sequence). After linear mapping, it is also transformed into a high-dimensional feature space, which facilitates the subsequent calculation of the offset.
[0061] Deviation Localization and Dynamic Focusing: Deformable Attention Mechanism Based on this Query and the Actual Power Sequence Through a light quantum network Adaptively calculate the offset These offsets guide the reference point to its new location (reference point). This allows it to be dynamically and sparsely sampled from the key-value sequence generated by the Self-Attention module. The prediction focuses on a few key meteorological anomalies that may cause significant errors in the current "baseline prediction" (such as sudden troughs in irradiance or peaks in cloud cover), rather than on the vast original meteorological sequence.
[0062] Compensation calculation and feature interaction: Model at sampling points (comparison with reference points) Features are extracted from K and V using bilinear interpolation to capture the complex internal correlation between meteorological elements and output power. The calculation of attention weights no longer relies on the complete K, but is based on these local key features: Formula (12) The calculated attention features are directly used as nonlinear compensation terms, and then interacted and fused with the original baseline prediction features through a residual connection, thereby directly correcting the baseline prediction results end-to-end.
[0063] Result Synthesis and End-to-End Compensation: The final output is an effective synthesis of the baseline predicted features and the calculated compensation features. This is essentially equivalent to adding a data-driven, dynamically adjusted nonlinear compensation term to the baseline predictions. The process can be characterized as follows: Formula (13) Output represents the compensated predicted power data sequence, with the initial reference point values derived from the baseline results, and the learnable offset... By continuously adjusting the baseline through gradient descent during model training, the compensation for prediction errors has been successfully transformed from a static post-processing step into an end-to-end learnable process integrated within the model.
[0064] In the technical solution provided in this application embodiment, the power prediction device can also perform real-time correction on the compensated predicted power data sequence based on the measured power data to obtain a target predicted power data sequence. The target predicted power data sequence contains multiple consecutive photovoltaic power prediction values within a preset time period, and the start time of the preset time period is the current time. For example, the predicted power data sequence may contain predicted power values for 16 future time points (future 0–4 hours).
[0065] In the technical solution provided in this application embodiment, the power prediction device performs real-time correction on the compensated predicted power data sequence, which can solve the problem of decreased accuracy of ultra-short-term prediction caused by sudden weather changes.
[0066] For example, to get from Starting from a certain time, if the predicted power data sequence includes predicted power values for the next 16 time points (next 0–4 hours)... . and These are used to characterize the actual power (measured photovoltaic power) and predicted power (predicted photovoltaic power) at the previous moment, respectively. The power prediction device can calculate correction coefficients from the actual power (measured photovoltaic power) and predicted power (predicted photovoltaic power) at the previous moment, and determine the weighting coefficients corresponding to the next 16 time points in the predicted power data sequence using the correction coefficients. Based on the correction coefficients and the weighting coefficients corresponding to the next 16 time points, the predicted power correction coefficients for the next 16 time points are determined. Thus, the target predicted power data sequence is calculated. .
[0067] Figure 4 This is a schematic diagram of a modified algorithm for a photovoltaic ultra-short-term power prediction method based on error compensation, provided in an embodiment of this application. Figure 4 As shown, the correction algorithm flow executed by the power prediction device includes: Step S401: Obtain the predicted photovoltaic power value and the measured photovoltaic power value corresponding to the previous moment.
[0068] The power prediction device can extract the predicted power data sequence from the output of the deviation feedback compensator at the current time. The predicted power values from now until 16 future time points are denoted as follows: The photovoltaic power prediction value corresponding to the previous moment is... The measured photovoltaic power value corresponding to the previous moment is obtained from the photovoltaic area acquisition system and recorded as follows: .
[0069] Step S402: If the photovoltaic power prediction value is less than the preset threshold, or the photovoltaic power measured value is less than the preset threshold, then the compensated prediction power data sequence is determined as the target prediction power data sequence.
[0070] The preset threshold can be 0.1% of the rated capacity.
[0071] Step S403: If both the predicted photovoltaic power value and the measured photovoltaic power value are greater than or equal to the preset threshold, then the ratio of the measured photovoltaic power value to the predicted photovoltaic power value is determined as the correction coefficient.
[0072] Correction coefficient The calculation formula is: Formula (14) Step S404: If the correction coefficient is greater than the preset coefficient threshold, then update the correction coefficient to the preset coefficient threshold.
[0073] It should be understood that, in order to prevent overcorrection due to individual abnormal fluctuations, the power prediction device can impose the following constraints on the correction coefficient:
[0074] That is, the correction factor is no greater than 3. If the ratio of the measured photovoltaic power to the predicted photovoltaic power is greater than 3, the power prediction device can determine the correction factor to be 3. It should be understood that the preset coefficient threshold can be other smaller values, and this application does not limit it here.
[0075] Step S405: Determine the weighting coefficient corresponding to each photovoltaic power prediction data in the compensated predicted power data sequence, and obtain multiple weighting coefficients. The weighting coefficient corresponding to each photovoltaic power prediction data is negatively correlated with its corresponding order in the compensated predicted power data sequence.
[0076] Calculate the weighting coefficients for the 16 predicted values. For the first 4 predicted time points ( to Using a decay factor that decreases over time. The weighting is performed in the following form: For the last 12 prediction points ( to Using a fixed attenuation factor The weighted coefficients for each point are obtained by combining the results. Formula (15) Step S406: Based on the weighting coefficients corresponding to each photovoltaic power prediction data, correct the compensated predicted power data sequence to obtain the target predicted power data sequence.
[0077] The power prediction device can determine the product of each photovoltaic power prediction data point and its corresponding weighting coefficient, which is the photovoltaic power prediction value corresponding to the target predicted power data sequence, that is: Formula (16) Step S407: Output the correction result.
[0078] Output the corrected 16-point power prediction sequence .
[0079] It should be understood that the accuracy of the first four prediction points (i.e., within the next hour) has a significant impact on the assessment results. Therefore, the technical solution provided in this application sets a high correction range for the first four points, which gradually decreases over time to better respond to recent changes. At the same time, by setting an upper limit on the initial correction coefficient, the risk of over-correction caused by sudden measurement noise or abnormal fluctuations is effectively suppressed, thereby improving the robustness and practicality of the algorithm.
[0080] Figure 5 This document presents a schematic diagram of a power prediction process for a photovoltaic ultra-short-term power prediction method based on error compensation, as provided in an embodiment of this application. The process includes the following steps: Step S501: Obtain numerical weather forecast data and historical operating power sequence corresponding to the photovoltaic power station.
[0081] Numerical weather forecast data (NWP) may include, but is not limited to, data on irradiance, temperature, humidity, and cloud cover.
[0082] Step S502: Based on the preset feature extraction network, perform spatiotemporal feature extraction on the numerical weather forecast data to obtain spatiotemporal fusion features.
[0083] The feature extraction network is a CNN-BiLSTM network, which includes a convolutional neural network module and a bidirectional long short-term memory network module.
[0084] Based on a pre-defined feature extraction network, spatiotemporal features are extracted from numerical weather forecast data to obtain spatiotemporal fusion features. This includes: extracting regional spatial features from the numerical weather forecast data using a convolutional neural network module; and extracting the forward and backward temporal dependencies in the regional spatial features using a bidirectional long short-term memory network module to obtain spatiotemporal fusion features.
[0085] Step S503: Input the spatiotemporal fusion features, numerical weather forecast data and historical operating power sequence into the preset deviation feedback compensator to obtain the compensated predicted power data sequence.
[0086] The bias feedback compensator includes a self-attention module and a cross-attention module.
[0087] The spatiotemporal fusion features, numerical weather prediction data, and historical operating power sequences are input into a preset bias feedback compensator to obtain a compensated predicted power data sequence. This includes: performing global context-aware processing on the numerical weather prediction data using a self-attention module to obtain an enhanced meteorological feature sequence; initializing feature encoding of the spatiotemporal fusion features using a self-attention module to obtain a spatiotemporal feature sequence, the spatiotemporal feature sequence having the same dimension as the enhanced meteorological feature sequence; determining the spatiotemporal feature sequence as the query sequence for the cross-attention module, and determining the enhanced meteorological feature sequence as the key-value pair sequence for the cross-attention module; and compensating the spatiotemporal feature sequence based on the historical operating power sequence using the cross-attention module to obtain the compensated predicted power data sequence.
[0088] The spatiotemporal feature sequence is compensated using a cross-attention module to obtain a compensated predicted power data sequence. This process includes: linearly mapping the query sequence to obtain an initial reference point in a high-dimensional feature space; determining the offset between the query sequence and historical running power sequences; moving the initial reference point based on the offset to obtain a reference point; fusing contextual information into the key-value pair sequence of the reference point using a dynamic weight aggregation algorithm to obtain a nonlinear compensation term; fusing the nonlinear compensation term with the spatiotemporal feature sequence through residual connections; and performing layer normalization on the fusion result to obtain the compensated predicted power data sequence.
[0089] Step S504: Based on the measured power data, the compensated predicted power data sequence is corrected in real time to obtain the target predicted power data sequence. The target predicted power data sequence contains multiple consecutive photovoltaic power prediction values within a preset time period, and the start time of the preset time period is the current time.
[0090] In the technical solution provided in this application, the method for calculating the target predicted power data sequence using numerical weather forecast data and historical operating power sequences corresponding to photovoltaic power stations is similar to the above-mentioned... Figure 1 In the corresponding embodiments, the method by which the power prediction device calculates the target predicted power data sequence has the same or similar calculation principle, which will not be elaborated here.
[0091] In the technical solution provided in this application embodiment, the power prediction device can first acquire numerical weather forecast data and historical operating power sequences corresponding to the photovoltaic power station. Then, based on a preset feature extraction network, it extracts spatiotemporal features from the numerical weather forecast data to obtain spatiotemporal fusion features. The spatiotemporal fusion features, numerical weather forecast data, and historical operating power sequences are input into a preset deviation feedback compensator to obtain a compensated predicted power data sequence. Then, based on measured power data, the compensated predicted power data sequence is corrected in real time to obtain a target predicted power data sequence. The target predicted power data sequence contains multiple consecutive photovoltaic power prediction values within a preset time period, with the start time of the preset time period being the current time. In the technical solution provided in this application embodiment, the power prediction device can effectively capture the complex spatiotemporal variation patterns in numerical weather forecasts through the feature extraction network, improving the model's representation capability. Furthermore, it actively corrects the inherent deviations of numerical weather forecast data through the deviation feedback compensator, solving the problems of limited model representation capability, inherent deviations in numerical weather forecast data, and insufficient prediction capability for sudden fluctuations in traditional technical solutions, thereby improving the accuracy and timeliness of ultra-short-term photovoltaic power prediction.
[0092] It should be understood that, provided there are no logical conflicts, the above-described embodiments can be combined and implemented to adapt to actual application needs. These combined embodiments or implementation schemes are still within the scope of protection of this application.
[0093] Corresponding to the error-compensated photovoltaic ultra-short-term power prediction method in the above embodiments, this application provides a power prediction device 60. The power prediction device 60 can be implemented by software, hardware or a combination of both as part or all of a computer device, and is used to execute the steps in the error-compensated photovoltaic ultra-short-term power prediction method in the above embodiments.
[0094] Figure 6 A schematic diagram of the structure of a power prediction device 60 provided in an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiment of this application are shown.
[0095] Reference Figure 6 The power prediction device 60 includes an acquisition module 610, a feature extraction module 620, a dynamic compensation module 630, and a correction processing module 640.
[0096] The acquisition module 610 is used to acquire numerical weather forecast data and historical operating power sequences corresponding to photovoltaic power stations.
[0097] The feature extraction module 620 is used to extract spatiotemporal features from numerical weather forecast data based on a preset feature extraction network to obtain spatiotemporal fusion features.
[0098] The dynamic compensation module 630 is used to input spatiotemporal fusion features, numerical weather forecast data and historical operating power sequences into a preset deviation feedback compensator to obtain a compensated predicted power data sequence.
[0099] The correction processing module 640 is used to correct the compensated predicted power data sequence in real time based on the measured power data to obtain the target predicted power data sequence. The target predicted power data sequence contains multiple consecutive photovoltaic power prediction values within a preset time period, and the start time of the preset time period is the current time.
[0100] In some embodiments, the feature extraction network is a CNN-BiLSTM network, which includes a convolutional neural network module and a bidirectional long short-term memory network module. The feature extraction module 620 is specifically used to: extract features from numerical weather forecast data using the convolutional neural network module to obtain regional spatial features; and extract the forward and backward temporal dependencies in the regional spatial features using the bidirectional long short-term memory network module to obtain spatiotemporal fusion features.
[0101] In some embodiments, the bias feedback compensator includes a self-attention module and a cross-attention module. The dynamic compensation module 630 is specifically configured to: perform global context-aware processing on numerical weather prediction data using the self-attention module to obtain an enhanced meteorological feature sequence; initialize feature encoding of spatiotemporal fusion features using the self-attention module to obtain a spatiotemporal feature sequence, the dimension of which is the same as the dimension of the enhanced meteorological feature sequence; determine the spatiotemporal feature sequence as the query sequence for the cross-attention module, and determine the enhanced meteorological feature sequence as the key-value pair sequence for the cross-attention module; and compensate the spatiotemporal feature sequence based on the historical operating power sequence using the cross-attention module to obtain a compensated predicted power data sequence.
[0102] In some embodiments, the correction processing module 640 is specifically used for: performing a linear mapping on the query sequence to obtain an initial reference point in a high-dimensional feature space; determining the offset between the query sequence and the historical running power sequence; moving the initial reference point according to the offset to obtain a reference point; fusing contextual information in the key-value pair sequence of the reference point using a dynamic weight aggregation algorithm to obtain a nonlinear compensation term; fusing the nonlinear compensation term with the spatiotemporal feature sequence through residual connections, and performing layer normalization on the fusion result to obtain the compensated predicted power data sequence.
[0103] In some embodiments, the correction processing module 640 is specifically used to: obtain the photovoltaic power prediction value and the photovoltaic power measured value corresponding to the previous time step. If both the photovoltaic power prediction value and the photovoltaic power measured value are greater than or equal to a preset threshold, the ratio of the photovoltaic power measured value to the photovoltaic power prediction value is determined as the correction coefficient. The weighting coefficient corresponding to each photovoltaic power prediction data point in the compensated predicted power data sequence is determined, resulting in multiple weighting coefficients. The weighting coefficient corresponding to each photovoltaic power prediction data point is negatively correlated with its corresponding order in the compensated predicted power data sequence. Based on the weighting coefficient corresponding to each photovoltaic power prediction data point, the compensated predicted power data sequence is corrected to obtain the target predicted power data sequence.
[0104] In some embodiments, if the predicted photovoltaic power value is less than a preset threshold, or the measured photovoltaic power value is less than a preset threshold, then the compensated predicted power data sequence is determined as the target predicted power data sequence.
[0105] In some embodiments, the correction processing module 640 is further configured to: if the correction coefficient is greater than a preset coefficient threshold, update the correction coefficient to the preset coefficient threshold.
[0106] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0107] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0108] Based on the same inventive concept, embodiments of this application also provide an electronic device.
[0109] Figure 7 This is a schematic diagram of the structure of the electronic device provided in an embodiment of this application. For example... Figure 7 As shown, the electronic device 70 of this embodiment includes: at least one processor 710 ( Figure 7 Only one is shown in the diagram), memory 720, and communication module 730. Memory 720 stores a computer program 740 that may run on processor 710. When processor 710 executes computer program 740, it implements the steps in the above-described embodiment of the photovoltaic ultra-short-term power prediction method based on error compensation, for example... Figure 5 Steps S501 to S504 are shown. Alternatively, when the processor 710 executes the computer program 740, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 6 The functions of the acquisition module 610 to the correction processing module 640 are shown. The communication module 730 can be a separate communication unit used to communicate with external servers or terminal devices.
[0110] Electronic device 70 may include, but is not limited to, a processor 710 and a memory 720. Those skilled in the art will understand that... Figure 7 This is merely an example of electronic device 70 and does not constitute a limitation on electronic device 70. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 70 may also include input transmitting devices, network access devices, buses, etc.
[0111] The processor 710 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0112] In some embodiments, memory 720 may be an internal storage unit of electronic device 70, such as a hard disk or memory of electronic device 70. Memory 720 may also be an external storage device of electronic device 70, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on electronic device 70. Memory 720 may include both internal and external storage units of electronic device 70. Memory 720 is used to store operating system, applications, bootloader, data, and other programs, such as the program code of computer program 740. Memory 720 may also be used to temporarily store data that has been sent or will be sent.
[0113] Furthermore, those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. In the various embodiments of this application, each functional unit can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0114] This application provides a computer-readable storage medium storing a computer program that, when run on an electronic device, causes the electronic device to perform the steps described in the various method embodiments above.
[0115] This application provides a chip, which includes a processor and a memory. The memory stores a computer program, which, when executed by the processor, implements the steps in the various method embodiments described above.
[0116] This application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the steps described in the various method embodiments above.
[0117] It should be understood that the processor mentioned in the embodiments of this application can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0118] It should also be understood that the memory mentioned in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0119] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0120] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0121] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0122] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0123] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0124] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0125] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a large-screen device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0126] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A photovoltaic ultra-short-term power prediction method based on error compensation, characterized in that, The method includes: Acquire numerical weather forecast data and historical operating power sequences for photovoltaic power plants; Based on a preset feature extraction network, spatiotemporal features are extracted from the numerical weather forecast data to obtain spatiotemporal fusion features. The spatiotemporal fusion features, the numerical weather forecast data, and the historical operating power sequence are input into a preset deviation feedback compensator to obtain a compensated predicted power data sequence. The compensated predicted power data sequence is corrected in real time based on the measured power data to obtain the target predicted power data sequence. The target predicted power data sequence contains multiple consecutive photovoltaic power prediction values within a preset time period, and the start time of the preset time period is the current time.
2. The photovoltaic ultra-short-term power prediction method based on error compensation according to claim 1, characterized in that, The feature extraction network is a CNN-BiLSTM network, which includes a convolutional neural network module and a bidirectional long short-term memory network module. The method uses a preset feature extraction network to extract spatiotemporal features from the numerical weather forecast data to obtain spatiotemporal fusion features, including: The convolutional neural network module is used to extract features from the numerical weather forecast data to obtain regional spatial features. The spatiotemporal fusion features are obtained by extracting the forward and backward temporal dependencies in the regional spatial features through the bidirectional long short-term memory network module.
3. The photovoltaic ultra-short-term power prediction method based on error compensation according to claim 1, characterized in that, The deviation feedback compensator includes a self-attention module and a cross-attention module; The spatiotemporal fusion features, the numerical weather forecast data, and the historical operating power sequence are input into a preset deviation feedback compensator to obtain a compensated predicted power data sequence, including: The numerical weather forecast data is processed by the self-attention module to obtain an enhanced meteorological feature sequence. The spatiotemporal fusion features are initialized and encoded using the self-attention module to obtain a spatiotemporal feature sequence, wherein the dimension of the spatiotemporal feature sequence is the same as that of the enhanced meteorological feature sequence. The spatiotemporal feature sequence is determined to be the query sequence of the cross-attention module, and the enhanced meteorological feature sequence is determined to be the key-value pair sequence of the cross-attention module; Based on the historical operating power sequence, the spatiotemporal feature sequence is compensated by the cross-attention module to obtain the compensated predicted power data sequence.
4. The photovoltaic ultra-short-term power prediction method based on error compensation according to claim 3, characterized in that, The step of compensating the spatiotemporal feature sequence based on the historical operating power sequence using the cross-attention module to obtain the compensated predicted power data sequence includes: A linear mapping is performed on the query sequence to obtain an initial reference point in a high-dimensional feature space; Determine the offset between the query sequence and the historical operating power sequence; The initial reference point is moved according to the offset to obtain a reference point for comparison; By using a dynamic weight aggregation algorithm, contextual information is fused into the key-value pair sequence of the reference point to obtain a nonlinear compensation term; The nonlinear compensation term and the spatiotemporal feature sequence are fused through residual connection, and the fusion result is subjected to layer normalization to obtain the compensated predicted power data sequence.
5. The photovoltaic ultra-short-term power prediction method based on error compensation according to claim 1, characterized in that, The real-time correction of the compensated predicted power data sequence based on measured power data to obtain the target predicted power data sequence includes: Obtain the predicted photovoltaic power value and the measured photovoltaic power value corresponding to the previous moment; If both the predicted photovoltaic power value and the measured photovoltaic power value are greater than or equal to a preset threshold, then the ratio of the measured photovoltaic power value to the predicted photovoltaic power value is determined as a correction coefficient. In the compensated predicted power data sequence, the weighting coefficient corresponding to each photovoltaic power prediction data is determined, and multiple weighting coefficients are obtained. The weighting coefficient corresponding to each photovoltaic power prediction data is negatively correlated with its corresponding order in the compensated predicted power data sequence. The compensated predicted power data sequence is corrected based on the weighting coefficients corresponding to each photovoltaic power prediction data to obtain the target predicted power data sequence.
6. The photovoltaic ultra-short-term power prediction method based on error compensation according to claim 5, characterized in that, If the predicted photovoltaic power value is less than the preset threshold, or the measured photovoltaic power value is less than the preset threshold, then the compensated predicted power data sequence is determined to be the target predicted power data sequence.
7. The photovoltaic ultra-short-term power prediction method based on error compensation according to claim 5, characterized in that, Before the step of determining the weighting coefficient corresponding to each photovoltaic power prediction data in the compensated predicted power data sequence, the method further includes: If the correction coefficient is greater than the preset coefficient threshold, then the correction coefficient is updated to the preset coefficient threshold.
8. A photovoltaic ultra-short-term power prediction device based on error compensation, characterized in that, include: The acquisition module is used to acquire numerical weather forecast data and historical operating power sequences corresponding to photovoltaic power stations; The feature extraction module is used to extract spatiotemporal features from the numerical weather forecast data based on a preset feature extraction network to obtain spatiotemporal fusion features; The dynamic compensation module is used to input the spatiotemporal fusion features, the numerical weather forecast data and the historical operating power sequence into a preset deviation feedback compensator to obtain a compensated predicted power data sequence. The correction processing module is used to correct the compensated predicted power data sequence in real time based on the measured power data to obtain a target predicted power data sequence. The target predicted power data sequence contains multiple consecutive photovoltaic power prediction values within a preset time period, and the start time of the preset time period is the current time.
9. An electronic device, characterized in that, It includes a processor and a memory, the processor being used to execute a computer program stored in the memory to implement the error-compensated photovoltaic ultra-short-term power prediction method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the photovoltaic ultra-short-term power prediction method based on error compensation as described in any one of claims 1 to 7.