Photovoltaic power ultra-short-term prediction method and system based on attention mechanism
Patent Information
- Application Number
- CN202611187357.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-06
- Publication Date
- 2026-10-23
AI Technical Summary
[0003]本申请提供了基于注意力机制的光伏发电功率超短期预测方法及系统,旨在解决现有光伏发电功率超短期预测缺乏实际运行约束适配,难以同时兼顾精度与实时性的技术问题
通过多阶段自适应数据清洗与分类缺失插补策略,从物理边界、波动特性、耦合关联多维度精准识别剔除异常数据,并针对不同缺失模式采用差异化插补方式结合平滑滤波处理,全面提升输入时序数据的质量与连续性;构建包含三级编码器的时间感知稀疏注意力机制,由近及远依次挖掘局部短时波动、中期变化趋势、全局长周期规律的多尺度时序依赖,通过时间感知的稀疏化计算有效降低运算复杂度,在保障超短期预测实时响应能力的同时,实现了多尺度时序信息的完整捕捉;进一步搭建特征门控融合注意力机制,通过特征外积运算建模跨特征耦合交互强度,动态生成各特征的重要性权重并完成自适应加权融合,深度挖掘多源特征的协同关联信息,提升特征利用效率;最终引入逆变器运行状态、并网状态、限电调度三类实时运行约束,对初始预测结果进行动态校正,使输出结果更贴合电站实际运行工况,最终提升复杂气象与运行工况下预测精度与实时性。
Smart Images

Figure CN122968931A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of photovoltaic power generation, and more specifically to a method and system for ultra-short-term prediction of photovoltaic power generation based on an attention mechanism. Background Technology
[0002] With the continuous advancement of the construction of new power systems, the grid-connected capacity and proportion of photovoltaic power generation are rapidly increasing. Its output is affected by multiple factors such as solar irradiance, ambient temperature and humidity, component temperature, cloud disturbance and equipment operating conditions, exhibiting strong randomness, volatility and intermittency. The ultra-short-term accurate prediction of photovoltaic power generation at the minute level is required. In existing ultra-short-term photovoltaic (PV) power generation prediction technologies, mainstream deep learning prediction schemes mostly directly adopt a general global self-attention architecture for time series modeling. This makes it difficult to simultaneously meet the prediction accuracy and real-time response requirements of ultra-short-term scenarios. Furthermore, single-layer attention structures cannot simultaneously capture multi-scale variations, including fine-grained instantaneous fluctuations and long-term change patterns. Additionally, the commonly used coarse-grained cleaning with fixed thresholds and single-mode missing data imputation are insufficient to effectively identify various types of hidden anomalies, such as those exceeding physical boundaries, instantaneous changes, and violations of coupling rules. They also cannot achieve precise differentiated imputation for different missing data patterns, such as isolated missing data, continuous missing data, and compound missing data. Moreover, the prediction results are not dynamically corrected based on actual operational constraints, resulting in significant deviations from the actual executable output of the power plant. This leads to insufficient practicality for engineering applications, making it difficult to simultaneously achieve high accuracy and high real-time performance in ultra-short-term PV power generation prediction. Furthermore, the lack of adaptation to actual operational constraints fails to meet the needs of refined scheduling and operation management of power plants under complex operating conditions. Summary of the Invention
[0003] This application provides a method and system for ultra-short-term photovoltaic power generation prediction based on an attention mechanism, aiming to solve the technical problem that existing ultra-short-term photovoltaic power generation prediction lacks adaptation to actual operational constraints and is difficult to simultaneously achieve both accuracy and real-time performance.
[0004] In view of the above problems, this application provides a method and system for ultra-short-term prediction of photovoltaic power generation based on attention mechanism.
[0005] The first aspect disclosed in this application provides a method for ultra-short-term prediction of photovoltaic power generation based on an attention mechanism, the method comprising: Multi-source time-series data from a photovoltaic power plant is acquired and cleaned to obtain first preprocessed data. Missing values are imputed in the first preprocessed data to obtain second preprocessed data. A time-aware sparse attention mechanism is constructed to encode the second preprocessed data, generating time-dimensional attention features. A feature-gated fusion attention mechanism is constructed to decode the time-dimensional attention features, generating a fused feature vector. Based on the fused feature vector, ultra-short-term regression prediction of photovoltaic power generation is performed to generate ultra-short-term prediction results for photovoltaic power generation.
[0006] Another aspect disclosed in this application provides an ultra-short-term photovoltaic power generation prediction system based on an attention mechanism, the system comprising: The processing module is used to acquire multi-source time-series data from a photovoltaic power station, perform data cleaning to obtain first preprocessed data, and impute missing values in the first preprocessed data to obtain second preprocessed data. The encoding module is used to construct a time-aware sparse attention mechanism, encode the second preprocessed data through the time-aware sparse attention mechanism, and generate time-dimensional attention features. The decoding module is used to construct a feature-gated fusion attention mechanism, decode the time-dimensional attention features through the feature-gated fusion attention mechanism, and generate a fused feature vector. The prediction module is used to perform ultra-short-term regression prediction of photovoltaic power generation based on the fused feature vector, and generate ultra-short-term prediction results of photovoltaic power generation.
[0007] One or more technical solutions provided in this application have at least the following technical effects or advantages: Through a multi-stage adaptive data cleaning and classification-based missing data imputation strategy, abnormal data is accurately identified and removed from multiple dimensions such as physical boundaries, fluctuation characteristics, and coupling correlations. Differentiated imputation methods combined with smoothing filtering are used for different missing patterns to comprehensively improve the quality and continuity of input time series data. A time-aware sparse attention mechanism with a three-level encoder is constructed to mine multi-scale time series dependencies from near to far, including local short-term fluctuations, medium-term change trends, and global long-term patterns. Time-aware sparse computation effectively reduces computational complexity, ensuring real-time response capability for ultra-short-term predictions while achieving complete capture of multi-scale time series information. Furthermore, a feature-gated fusion attention mechanism is built, which models the cross-feature coupling interaction strength through feature outer product operations, dynamically generates importance weights for each feature, and completes adaptive weighted fusion to deeply mine the collaborative correlation information of multi-source features and improve feature utilization efficiency. Finally, three types of real-time operation constraints are introduced: inverter operating status, grid connection status, and power curtailment scheduling, to dynamically correct the initial prediction results, making the output results more consistent with the actual operating conditions of the power plant, ultimately improving the prediction accuracy and real-time performance under complex weather and operating conditions.
[0008] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0009] Figure 1 A flowchart illustrating the ultra-short-term photovoltaic power generation prediction method based on an attention mechanism is provided for embodiments of this application. Figure 2 A schematic diagram of the structure of a photovoltaic power generation ultra-short-term prediction system based on an attention mechanism is provided for embodiments of this application.
[0010] Explanation of reference numerals in the attached diagram: Processing module 11, Encoding module 12, Decoding module 13, Prediction module 14. Detailed Implementation
[0011] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.
[0012] The overall concept of the technical solution provided in this application is as follows: This application provides a method and system for ultra-short-term photovoltaic power generation prediction based on an attention mechanism. It comprehensively improves the quality of input data through multi-stage adaptive data cleaning and classification missing imputation strategies, and achieves efficient encoding of multi-scale temporal dependencies by adopting a hierarchical architecture time-aware sparse attention mechanism. It combines feature-gated fusion attention mechanism to deeply model cross-feature coupling and correlation and achieve adaptive weighted fusion. Finally, it is supplemented by a dynamic correction mechanism based on operating state constraints. While effectively reducing computational complexity and ensuring real-time response capability of ultra-short-term prediction, it improves the prediction accuracy and real-time performance under complex weather and operating conditions.
[0013] After introducing the basic principles of this application, various non-limiting embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0014] Example 1, as Figure 1 As shown in the embodiments of this application, a method for ultra-short-term prediction of photovoltaic power generation based on an attention mechanism is provided. The method includes: S100: Obtain multi-source time-series data from the photovoltaic power station, perform data cleaning to obtain first preprocessed data, and impute missing values in the first preprocessed data to obtain second preprocessed data.
[0015] Specifically, the first step is to acquire multi-source time-series data of photovoltaic power plants. Multi-source time-series data refers to multi-dimensional time series data that covers the influencing factors of the entire power generation chain of photovoltaic power plants and is collected in an orderly manner according to a unified time granularity. It usually includes synchronous time-series records from multiple sources such as solar irradiance, ambient temperature and humidity, photovoltaic module backsheet temperature, real-time output power, inverter AC / DC side operating parameters, and grid connection measurement data. It serves as the original input carrier for subsequent attention models to perform feature learning and power prediction.
[0016] Subsequently, multi-stage adaptive data cleaning is performed on the multi-source time-series data to obtain the first preprocessed data. This multi-stage adaptive data cleaning abandons the coarse cleaning logic of a fixed single threshold and instead employs a refined cleaning strategy that combines the physical boundary attributes, temporal fluctuation patterns, and multivariate coupling characteristics of photovoltaic data, using a three-stage progressive approach to identify anomalies. Specifically, the physical characteristics of the multi-source time-series data are first extracted to set a dynamic physical threshold range. This dynamic physical threshold range refers to a reasonable numerical range that is adaptively and dynamically adjusted based on the physical meaning of each monitoring parameter, the natural rhythms of day-night and seasonal changes, and the real-time operating conditions of the power plant. For example, the irradiance threshold will... The system adjusts its temperature range according to sunrise and sunset, and uses differentiated temperature ranges for winter and summer instead of a fixed threshold throughout the year. Data points exceeding this dynamic range are marked as anomalous data. Local fluctuation analysis is then performed on continuous data points, and the local rate of change is calculated. The local rate of change refers to the magnitude and rate of change of data within a sliding time window, which is used to quantify the intensity of instantaneous fluctuations in time series data. Continuous data points with local rates of change exceeding a multiple of the rate of change threshold are marked as anomalous data, thereby identifying unreasonable sharp increases and decreases in data caused by sensor malfunctions, electromagnetic interference, and data transmission packet loss and distortion.
[0017] Next, the data coupling relationship of the multi-source time series data is extracted. The data coupling relationship refers to the natural physical correlation and numerical correspondence between photovoltaic multi-source parameters. For example, under the same operating conditions, irradiance and power generation are positively correlated, and the intrinsic correlation is that the module temperature changes synchronously with the ambient temperature and irradiance intensity. According to the data coupling relationship, the multi-source time series data is cross-validated, and data points that violate the coupling law are marked as coupling anomalies. This is used to identify abnormal data that does not conform to physical logic due to single-channel sensor distortion. Finally, the three types of abnormal data are uniformly removed from the original multi-source time series data, and the first pre-processed data after removing anomalies is obtained after cleaning.
[0018] After obtaining the first preprocessed data, the first preprocessed data is first aligned according to the time dimension to generate aligned data. Time dimension alignment refers to unifying asynchronous data from different data sources caused by differences in sampling frequency and timestamp offsets to the same time step and reference time axis, ensuring that each time step corresponds to synchronous data of all feature dimensions, and eliminating the interference of time misalignment on subsequent time series modeling.
[0019] Subsequently, the aligned data is traversed point by point to locate missing values and determine their specific positions. Then, based on the spatial distribution characteristics of the missing values, the missing value distribution pattern is identified, and the missing value distribution pattern parameter is output. The missing value distribution pattern parameter is a feature parameter used to quantitatively describe the distribution form, consecutive missing length, frequency of occurrence, and dispersion of missing values in the time series. It is used to accurately distinguish different missing patterns. Based on this distribution pattern parameter and the location information of the missing values, the aligned data is classified into missing types, resulting in multiple types of missing data including isolated missing values, consecutive missing values, and compound missing values. Among them, isolated missing values refer to discrete single-point missing data that appears independently in a single time step and has valid data before and after it; consecutive missing values refer to fragmented consecutive missing data that appears consecutively in multiple time steps; and compound missing values refer to mixed missing data where discrete single-point missing values and consecutive fragmented missing values coexist and the missing pattern is complex.
[0020] Subsequently, differentiated imputation strategies were employed to fill the three types of missing data: For isolated missing values, linear imputation was used to generate the first imputed data. Linear imputation uses the values of two adjacent valid time steps before and after the missing point to calculate the estimated value of the missing point using a linear interpolation formula, adapting to the smooth transition characteristics of data under single-point missing values. For consecutive missing values, mean imputation was used to generate the second imputed data. Mean imputation selects valid data within a set window before and after the consecutive missing segment to calculate the statistical mean, thereby filling the entire consecutive missing interval, adapting to the need to preserve the overall data trend under long-segment missing values. For complex missing values... The missing values are filled by indirect calculation to generate the third imputation data. Indirect calculation filling refers to relying on other valid features of the same period that have a strong physical coupling relationship with the missing features, and indirectly calculating the value of the missing position through the correlation fitting relationship between the two. This is adapted to the need to improve the imputation accuracy under mixed and complex missing values. Finally, the three types of imputed data are uniformly processed by smoothing filtering. Smoothing filtering refers to eliminating the abrupt change and residual high-frequency noise fluctuations in the imputed data through the sliding window smoothing algorithm, so that the data sequence is more in line with the real physical law of continuous change of photovoltaic power with meteorological conditions. Finally, the second preprocessed data with regularity, completeness and controllable noise is obtained.
[0021] S200: Construct a time-aware sparse attention mechanism, and encode the second preprocessed data through the time-aware sparse attention mechanism to generate time-dimensional attention features.
[0022] Specifically, a time-aware sparse attention mechanism adapted to the characteristics of photovoltaic time-series data is first constructed. This mechanism addresses the characteristics of strong local correlation and sparse long-range dependence in photovoltaic power generation time-series data by introducing time distance-aware weights into the attention calculation. It performs sparse attention calculation only on associated time steps with different time spans, thus preserving the ability to capture key time-series dependencies while significantly reducing computational redundancy, thus meeting the real-time requirements of ultra-short-term forecasting.
[0023] Subsequently, the second preprocessed data is encoded using this mechanism to generate temporal attention features. Specifically, the second preprocessed data is first divided into multiple time-step input sequences according to a preset time window length. The preset time window length refers to the historical data backtracking duration pre-set according to the time scale of ultra-short-term prediction. The time step is the smallest time granularity unit of time series data. The multi-time-step input sequence after division contains all monitoring feature data under each time granularity within the corresponding window, which is the basic input unit for subsequent attention encoding.
[0024] Based on this, all time step data are traversed one by one to generate a coding sequence by position encoding. Position encoding is to make up for the deficiency that the attention mechanism itself does not carry temporal order information. It injects the corresponding time position identification information into the feature data of each time step. Usually, sine and cosine encoding methods are used to give different time steps unique position features, so that the model can accurately identify the time sequence and time interval and avoid the loss of temporal arrangement information.
[0025] After location encoding is completed, the encoded sequence is stacked with multiple layers of features through an encoding module using a time-aware sparse attention mechanism. This encoding module adopts a hierarchical architecture, including a first-layer encoder, a second-layer encoder, and a deep encoder. During the encoding process, the encoded sequence is first input into the first-layer encoder. The first-layer encoder performs local temporal dependency analysis on the encoded sequence according to the nearest time step, and outputs shallow temporal features. The nearest time step refers to the short-distance time node adjacent to the current time step position. The local temporal dependency analysis focuses on short-term fine-grained fluctuations at the minute level, capturing short-range correlation patterns such as irradiance jumps and instantaneous power fluctuations at adjacent times. The resulting shallow temporal features carry the finest local temporal details.
[0026] Next, the shallow time series features are input into the second layer encoder. The second layer encoder performs trend change analysis on the shallow time series features according to the medium time span, and outputs the medium time series features. The medium time span corresponds to a time range of tens of minutes. The trend change analysis is used to capture the power gradual change trend caused by factors such as cloud movement and temperature change. The obtained medium time series features carry the change trend information of the medium time series.
[0027] The intermediate-level temporal features are then input into the deep encoder. The deep encoder performs long-period feature analysis on the intermediate-level temporal features according to the global time range, and outputs deep temporal features. The global time range is the complete time span of the entire preset time window. The long-period feature analysis is used to mine global temporal patterns such as the overall rise and fall patterns and daily cycle characteristics within the window. The resulting deep temporal features carry long-range dependency information at the global scale. Finally, the shallow, intermediate, and deep temporal features are aggregated across layers. Cross-layer feature aggregation refers to integrating the three temporal features at different scales through feature splicing or weighted fusion to achieve complementary superposition of local details, intermediate trends, and global patterns, and finally generate time-dimensional attention features that fuse multi-scale temporal dependencies.
[0028] S300: Construct a feature-gated fusion attention mechanism to decode the time-dimensional attention features and generate a fusion feature vector.
[0029] Specifically, the first step is to construct a feature-gated fusion attention mechanism adapted to the multi-source feature coupling characteristics of photovoltaics. This feature-gated fusion attention mechanism uses gated attention as a carrier to dynamically calculate the importance weight of each feature by modeling the interaction and correlation between features, thereby achieving selective weighted fusion of multi-dimensional features, rather than using simple feature stacking with fixed weights. This can accurately match the strong coupling of multiple variables such as irradiance, temperature, and power in photovoltaic data.
[0030] Subsequently, this mechanism is used to decode the previously generated temporal attention features to generate a fused feature vector. Specifically, the temporal attention features are first decomposed according to the feature dimension to obtain multiple feature sub-vectors with a single feature dimension. Feature dimension decomposition refers to splitting the multi-channel fused features that have completed temporal encoding into different physical feature dimensions such as irradiance, ambient temperature, component temperature, and operating parameters. Each feature sub-vector corresponds to a complete high-dimensional temporal feature sequence after multiple layers of temporal encoding of an original monitoring variable. After splitting, each feature can be deeply encoded separately to avoid the weakening of correlation information caused by the mixing of different features.
[0031] Based on this, feature encoding branches corresponding one-to-one with feature dimensions are constructed. Nonlinear transformations are performed on each feature sub-vector through the feature encoding branches to extract deep semantic encoding features. The feature encoding branches are independent encoding paths composed of multilayer perceptrons and nonlinear activation functions. Each feature sub-vector corresponds to a dedicated encoding branch. Nonlinear transformation refers to the high-dimensional mapping operation completed by the activation function, which can transform shallow numerical time-series features into high-dimensional abstract features containing physical change laws. The final deep semantic encoding features are high-dimensional feature representations that carry deep physical semantics such as the change trend and fluctuation rhythm of each feature.
[0032] After completing the single-feature deep encoding, all deep semantic encoded features are synchronized to the feature gating fusion attention mechanism for cross-feature interaction modeling to generate a feature interaction matrix. Cross-feature interaction modeling refers to quantifying the strength and correlation of mutual influence between different features and mining the physical coupling law between photovoltaic multivariates. The specific implementation process is as follows: First, the deep semantic encoded features are concatenated in the channel dimension to obtain the joint feature representation parameters. Channel dimension concatenation refers to concatenating the high-dimensional features output by each feature branch along the feature channel direction into a unified feature tensor. The joint feature representation parameters are the overall feature carrier that integrates all feature dimension information.
[0033] Subsequently, pooling compression is applied to the joint feature representation parameters to obtain a global statistical feature vector. The pooling compression uses global average pooling to compress the temporal dimension information of each feature channel into a global statistic, eliminating fine-grained temporal fluctuations and preserving the overall attributes of the features. The global statistical feature vector is a one-dimensional vector composed of the global statistical values of each feature, representing the overall representation of each feature within the entire time window. Next, the global statistical feature vectors are combined pairwise to generate multiple sets of feature vector combinations. All feature vector combinations are traversed and an outer product operation is performed to generate a feature interaction strength matrix. The outer product operation refers to the operation of generating a two-dimensional matrix by multiplying two one-dimensional vectors. The value of each element in the matrix corresponds to the interaction correlation strength between the two features. The higher the value, the stronger the coupling between the two features and the more significant the synergistic effect on power prediction. The feature interaction strength matrix is a two-dimensional matrix used to quantify the degree of mutual influence between any two features.
[0034] Finally, all feature interaction intensity matrices are concatenated and integrated according to feature dimensions to obtain a feature interaction matrix that fully records the pairwise interactions of all features. After obtaining the feature interaction matrix, weight aggregation calculation is performed on the interaction matrix according to the feature dimensions to obtain the importance weight corresponding to each feature. The importance weight refers to the contribution coefficient dynamically generated by the gating mechanism based on the feature interaction intensity. Features with greater impact on power prediction and stronger coupling with other features are assigned higher weights, realizing automatic focus on key features and adaptive suppression of redundant features. This is also the core characteristic of the gating attention mechanism. Finally, based on the obtained multiple importance weights, the deep semantic encoding features corresponding to each feature are weighted and fused to generate a fused feature vector. Weighted fusion refers to multiplying the deep semantic encoding features of each feature with its corresponding importance weight element by element, and then concatenating and integrating them along the feature dimensions. The final fused feature vector not only retains the deep temporal semantic information of each feature, but also highlights the core influencing features through weight allocation, while fully incorporating the coupling interaction information between features.
[0035] S400: Perform ultra-short-term regression prediction of photovoltaic power generation based on the fused feature vector, and generate ultra-short-term prediction results of photovoltaic power generation.
[0036] Specifically, a regression prediction module adapted to ultra-short-term power regression tasks is first constructed. This module adopts a deep neural network architecture of input layer-double hidden layer-output layer, including an input layer, a first hidden layer, a second hidden layer, and an output layer. The input layer is responsible for feature access and dimensionality adaptation, the double hidden layer undertakes the core nonlinear feature transformation and prediction information extraction, and the output layer completes the final power value output. The overall architecture takes into account both complex nonlinear fitting capabilities and computational efficiency. When performing prediction, the previously generated fusion feature vector is first synchronized to the first hidden layer through the input layer for dimensionality upscaling mapping to obtain the first hidden feature. Here, dimensionality upscaling mapping refers to mapping the relatively limited-dimensional fusion feature to a higher-dimensional feature space through the weight matrix operation of the fully connected layer. Its function is to transform the originally linearly inseparable feature relationship into a separable pattern in a high-dimensional space through dimensional expansion, fully activating the multi-scale temporal regularity and cross-feature coupling information contained in the fusion feature, and deeply mining the complex nonlinear correlation between photovoltaic power and various meteorological and operating condition influencing factors.
[0037] After completing the dimensionality-upgrading mapping, the first hidden feature is nonlinearly activated to obtain the activated feature. Nonlinear activation refers to performing element-wise nonlinear transformation on the dimensionality-upgrading feature using nonlinear activation functions such as ReLU, breaking the limitations of purely linear transformations. This allows the network to fit the nonlinear power fluctuation patterns under complex scenarios such as cloud cover and sudden irradiance changes, giving the feature representation a stronger ability to adapt to complex scenarios. Subsequently, the activated feature is randomly discarded according to a preset probability to obtain regularized features. This random data discarding is the Dropout regularization strategy in deep learning. The preset probability refers to the pre-set proportion of neurons that are randomly deactivated. During training, the output of some neurons is randomly blocked according to this probability, forcing the network not to rely on the feature responses of individual neurons. This avoids the model overfitting local noise and random fluctuations in the training data, effectively improving the model's generalization robustness under different photovoltaic power plants and different meteorological conditions.
[0038] After obtaining the regularized features, the second hidden layer is used to perform dimensionality reduction mapping on the regularized features to obtain the second hidden features. Dimensionality reduction mapping refers to compressing the high-dimensional regularized features to a lower-dimensional space through a fully connected layer. In this process, redundant information and invalid noise in the high-dimensional features are filtered out, and the core representations directly related to photovoltaic power generation prediction are extracted. While simplifying the feature dimensions and reducing the subsequent computation, the core objective of the prediction task is further focused on, ensuring the information purity of the output features.
[0039] Finally, the second hidden feature is synchronized to the output layer for linear transformation to generate ultra-short-term photovoltaic power prediction results. The output layer adopts a linearly activated fully connected structure. Linear transformation refers to directly mapping the condensed core features to continuous power values through a linear weight matrix. Since ultra-short-term power prediction is a typical continuous value regression task, the output result is a continuous power value for several future time steps. The linear output structure can accurately output continuous prediction values that conform to the physical magnitude, and finally obtain the photovoltaic power prediction sequence corresponding to the ultra-short-term time scale.
[0040] Furthermore, in the method provided in this application embodiment, multi-source time-series data from a photovoltaic power station is acquired, cleaned, and a first preprocessed data is obtained. Missing value imputation is performed on the first preprocessed data to obtain a second preprocessed data. The method includes: performing multi-stage adaptive data cleaning on the multi-source time-series data to obtain the first preprocessed data; aligning the first preprocessed data according to the time dimension to generate aligned data; traversing the aligned data to locate missing data, determining the position of missing values, and identifying the missing value distribution according to the position of missing values to obtain missing value distribution morphology parameters; classifying the missing types of the aligned data based on the missing value distribution morphology parameters and the position of missing values to obtain multiple types of missing data, including isolated missing values, continuous missing values, and composite missing values; performing linear imputation filling based on the isolated missing values to generate first imputed data; performing mean imputation filling based on the continuous missing values to generate second imputed data; performing indirect calculation filling based on the composite missing values to generate third imputed data; and performing smoothing filtering on the first imputed data, the second imputed data, and the third imputed data to obtain the second preprocessed data.
[0041] Specifically, the first step is to perform multi-stage adaptive data cleaning on the acquired multi-source time-series data of the photovoltaic power plant to obtain the first preprocessed data. This multi-stage adaptive data cleaning abandons the crude cleaning logic of a single fixed threshold and instead employs a refined cleaning strategy that combines the physical attributes, temporal fluctuation patterns, and multivariate coupling characteristics of the photovoltaic data to identify and remove anomalies in a three-stage progressive manner. In practice, the physical characteristics of the multi-source time-series data are extracted first to set a dynamic physical threshold range. This dynamic physical threshold range refers to a reasonable numerical range that is adaptively adjusted based on the physical meaning of each monitoring parameter, the natural rhythms of day-night and seasonal changes, and the real-time operating conditions of the power plant. For example, the irradiance threshold will change with sunrise and sunset. Instead of using a fixed threshold that remains constant throughout the year, differentiated temperature ranges are used for the whole year and the winter and summer seasons. Data points that exceed this dynamic range are marked as abnormal data, completing the first stage of boundary anomaly identification. Subsequently, local fluctuation analysis is carried out based on continuous data points, and the local rate of change is calculated. The local rate of change refers to the magnitude and rate of change of data within a sliding time window, which is used to quantify the intensity of instantaneous fluctuations in time series data. Continuous data points with local rates of change exceeding the rate of change multiplied by a threshold are marked as abrupt abnormal data, thereby identifying unreasonable sharp increases and decreases in data caused by sensor instantaneous failures, electromagnetic interference, and data transmission distortion, completing the second stage of fluctuation anomaly identification.
[0042] Next, the data coupling relationship of the multi-source time series data is extracted. The data coupling relationship refers to the natural physical correlation and numerical correspondence between photovoltaic multi-source parameters. For example, under the same operating conditions, irradiance and power generation are positively correlated, and the intrinsic correlation is that the module temperature changes synchronously with the ambient temperature and irradiance intensity. According to the data coupling relationship, the multi-source time series data is cross-validated, and data points that violate the coupling law are marked as coupling anomalies. This is used to identify abnormal data that does not conform to physical logic due to single-channel sensor distortion, completing the third stage of correlation-type anomaly identification. Finally, the three types of abnormal data, namely abnormal data, mutation abnormal data, and coupling abnormal data, are uniformly removed from the original multi-source time series data to obtain the first pre-processed data after anomaly cleaning.
[0043] After obtaining the first preprocessed data, the first preprocessed data is first aligned according to the time dimension to generate aligned data. Time dimension alignment refers to unifying asynchronous data from different data sources caused by differences in sampling frequency and timestamp offsets to the same time step and reference time axis, ensuring that each time step corresponds to synchronous data of all feature dimensions, eliminating the interference of time misalignment on subsequent time series modeling, and solving the problem of inconsistent sampling periods for different monitoring parameters such as irradiance, temperature, and power. Then, the aligned data is traversed point by point to locate missing data to determine the specific coordinate position of missing values. Then, the missing value distribution is identified according to the spatial distribution characteristics of missing values on the time axis, and the missing value distribution morphology parameters are output. The missing value distribution morphology parameters are feature parameters used to quantitatively describe the distribution form, continuous missing length, frequency of occurrence and dispersion of missing values on the time series, which can accurately distinguish different missing patterns and missing severity.
[0044] Based on this, the missing data is classified into missing types according to the missing value distribution morphology parameters and the missing value location information, resulting in multiple types of missing data including isolated missing values, continuous missing values, and compound missing values. Among them, isolated missing values refer to discrete single-point missing data that appears independently in a single time step and has valid data before and after it, which is mostly caused by instantaneous packet loss during transmission. Continuous missing values refer to fragmented continuous missing data that appears consecutively in multiple time steps, which is mostly caused by short-term sensor failures or communication interruptions. Compound missing values refer to mixed missing data where discrete single-point missing values and continuous fragment missing values coexist and the missing pattern is complex, which is mostly caused by phased equipment failures.
[0045] Subsequently, differentiated imputation strategies were employed to fill the three types of missing data: For isolated missing values, linear imputation was used to generate the first imputation data. Linear imputation uses the values of two adjacent effective time steps before and after the missing point to calculate the estimated value of the missing point using a linear interpolation formula, adapting to the smooth transition characteristics of data under single-point missing values and preserving the slope of local temporal changes to the greatest extent. For continuous missing values, mean imputation was used to generate the second imputation data. Mean imputation selects effective data within a set window before and after the continuous missing segment to calculate the statistical mean, thereby filling the entire continuous missing interval, adapting to the need to preserve the overall data trend under long-segment missing values and avoiding large deviations in the imputation results. For complex missing values, indirect calculation was used to generate the third imputation data. Indirect calculation relies on other effective features of the same period that have a strong physical coupling relationship with the missing feature, and indirectly calculates the value at the missing position through the historical correlation fitting relationship between the two. For example, the missing power data can be calculated using the irradiance data collected normally at the same time, adapting to the need to improve the imputation accuracy under mixed and complex missing values.
[0046] Finally, the first, second, and third interpolated data are uniformly processed by smoothing filtering. This smoothing filtering uses a sliding window smoothing algorithm to eliminate the abrupt changes and residual high-frequency noise fluctuations in the interpolated data, making the data sequence more closely resemble the true physical law of continuous changes in photovoltaic power with meteorological conditions. This avoids the interference of interpolation breakpoints on the subsequent time-dependent learning of the attention mechanism, ultimately resulting in well-organized, complete, noise-controlled, and time-continuous second preprocessed data. Furthermore, in the method provided in this application embodiment, multi-stage adaptive data cleaning is performed on the multi-source time-series data to obtain first preprocessed data. The method includes: extracting the physical characteristics of the multi-source time-series data and setting a dynamic physical threshold range; extracting multiple data points exceeding the dynamic physical threshold range and marking them as anomalies to obtain abnormal data; performing local fluctuation analysis based on multiple data points, calculating the local rate of change, extracting continuous data points whose local rate of change exceeds a multiple of the rate of change threshold and marking them as anomalies to obtain abruptly anomalous data; extracting the data coupling relationship of the multi-source time-series data, calculating the local rate of change of the multi-source time-series data according to the data coupling relationship, extracting data points that do not conform to the data coupling relationship and marking them as anomalies to obtain coupled anomalous data; and removing data from the multi-source time-series data containing the abnormal data, the abruptly anomalous data, and the coupled anomalous data to generate the first preprocessed data.
[0047] Specifically, a multi-stage adaptive data cleaning strategy is adopted to perform hierarchical anomaly identification and precise removal of multi-source time-series data from photovoltaic power plants. This multi-stage adaptive data cleaning involves progressively identifying anomalies at three levels: single-variable physical boundaries, single-variable time-series fluctuations, and multi-variable physical correlations. The criteria for each level can be dynamically adjusted according to the power plant's operating conditions, seasonal rhythms, and diurnal cycles. This refined cleaning method ultimately generates the first pre-processed data after removing various anomalies. The first stage involves boundary verification: extracting the physical characteristics of the multi-source time-series data and setting dynamic physical threshold ranges. These dynamic physical threshold ranges refer to the ranges that combine the physical characteristics of each monitoring parameter. The system considers the natural laws of day and night alternation and seasonal changes, and dynamically updates the reasonable range of values for the real-time operation status of the power station. This is different from fixed thresholds that remain constant throughout the year. For example, the reasonable range of solar irradiance will dynamically contract and expand with sunrise and sunset. Different judgment standards will be used for the upper limit of module temperature in winter and summer. The threshold of photovoltaic power output will be matched with the current installed capacity and the number of units in operation of the power station in real time to ensure that the threshold always fits the actual physical boundary of the current operating conditions. Then, all data points are traversed, and multiple data points with values exceeding the dynamic physical threshold range are extracted and marked as anomalies to obtain abnormal data that exceeds the physical boundary, thus completing the preliminary screening of explicit boundary-type anomalies.
[0048] Next, we proceed to the second stage of fluctuation verification: Based on multiple consecutive data points, we conduct local fluctuation analysis and calculate the local rate of change. Local fluctuation analysis involves focusing on local segments of time-series data through a sliding time window to quantify the intensity of instantaneous fluctuations. The local rate of change is a quantitative indicator characterizing the magnitude of data change per unit time, used to identify unreasonable abrupt changes in the data. The detailed calculation process is as follows: A sliding time window of length m is pre-set, covering monitoring data for m consecutive time steps. The time-series data sequence within the window is denoted as... ,in For the monitored value at the current time step, first calculate the absolute change between every two adjacent time steps within the window. Then calculate the mean of the data within the window. As the baseline value for fluctuation, the formula for calculating the local rate of change at the current time step is: ; The maximum relative rate of change within the window is taken as the local rate of change at the current moment, thereby eliminating the influence of differences in the magnitude of different monitoring parameters on the judgment result.
[0049] Based on this, a threshold for the rate of change is set. This threshold is obtained by multiplying the statistical mean of the fluctuation rate of the corresponding parameter under normal operating conditions by a preset multiplication factor. For example, three times the average power fluctuation under normal weather conditions is taken as the threshold for sudden change. Then, continuous data points with local rates of change exceeding the threshold of the rate of change are extracted and marked as anomalies to obtain anomalous data. These anomalies are mostly caused by factors such as instantaneous sensor jumps, on-site electromagnetic interference, and data transmission distortion. They are manifested as unreasonable sharp increases and decreases in data within a short period of time. By requiring the judgment rule that the threshold is exceeded for multiple consecutive time steps, the abnormal sudden change can be effectively distinguished from the normal power fluctuation caused by cloud cover, and the probability of misjudgment can be greatly reduced.
[0050] The third stage, correlation verification, then proceeds: extracting the data coupling relationships from multi-source time-series data. These relationships refer to the inherent physical correlations between multi-source monitoring parameters of a photovoltaic power plant. Examples include a positive correlation between solar irradiance and power generation under the same operating conditions, synchronous changes in photovoltaic module temperature with ambient temperature and irradiance, and a fixed conversion efficiency range between the DC input power and AC output power of the inverter. Based on these coupling relationships, the multi-source time-series data undergoes cross-verification. This involves calculating the reasonable value range of another related parameter from the normal value of a certain parameter, and identifying data points that do not conform to the coupling relationship or deviate from the reasonable range beyond the allowable error range. These are then marked as anomalies, resulting in coupled anomaly data. Such anomalies are typically caused by single-channel sensor distortion or acquisition channel failures and cannot be identified solely through single-variable threshold and fluctuation analysis; multi-variable cross-verification is necessary to detect these latent anomalies. Finally, the three types of anomalies—abnormal data, sudden change anomaly data, and coupled anomaly data—are uniformly removed from the original multi-source time-series data, completing the entire cleaning process and generating the first pre-processed data.
[0051] Furthermore, in the method provided in this application embodiment, the second preprocessed data is encoded using the time-aware sparse attention mechanism to generate time-dimensional attention features. The method includes: dividing the second preprocessed data into multiple time-step input sequences according to a preset time window length, wherein the multiple time-step input sequences contain multiple time-step data; traversing the multiple time-step data to perform position encoding to generate an encoding sequence; and performing multi-layer feature stacking on the encoding sequence through the encoding module of the time-aware sparse attention mechanism to generate the time-dimensional attention features.
[0052] Specifically, the second preprocessed data is first divided into multiple time-step input sequences according to a preset time window length. This preset time window length is a historical data backtracking duration pre-set based on the time scale of ultra-short-term prediction and the model input requirements. Typically, a historical monitoring window of the corresponding length is selected for ultra-short-term prediction needs ranging from minutes to hours. A time step is the smallest sampling unit of time-series data. The divided input sequence contains a fixed number of continuous time-step data. Each time step corresponds to all preprocessed feature dimensions such as irradiance, ambient temperature, component temperature, and operating parameters, forming a regular two-dimensional time-series tensor, which serves as the standard input unit for subsequent encoding operations. After sequence division, all time-step data are traversed and position-encoded one by one to generate a sequence. The code sequence, in which positional encoding is an information injection operation designed to compensate for the lack of temporal sequence perception capability of the self-attention mechanism itself. Since attention calculation only focuses on the numerical similarity between features and cannot naturally identify the order and interval distance of time steps, a sine and cosine positional encoding method is adopted. By generating a unique positional feature vector for each time step through sine and cosine functions of different frequencies, low-frequency components are used to represent long-range positional relationships and high-frequency components are used to represent short-range positional differences. After adding the position vector to the original feature vector of the corresponding time step element by element, the feature sequence carries a clear temporal positional identifier, and finally obtains an encoded sequence that combines the original monitoring feature information and temporal positional information, ensuring that the model can accurately distinguish the order of time and the distance of time intervals.
[0053] Building upon this, a time-aware sparse attention mechanism is used in the encoding module to stack multiple layers of features in the encoded sequence, generating temporal attention features. This time-aware sparse attention mechanism differs from the traditional global self-attention model, which indiscriminately calculates attention weights for all time steps. It introduces a temporal distance awareness factor, assigning higher attention computation priority and basic weights to time steps with closer time intervals, while using sparse sampling computation for distant time steps. This preserves the ability to capture key temporal correlations while significantly reducing computational redundancy, adapting to the real-time requirements of ultra-short-term predictions. The encoding module employs a hierarchical architecture, including a first-layer encoder, a second-layer encoder, and a deep encoder. When performing multi-layer feature stacking, the encoded sequence is first input into the first-layer encoder. The first-layer encoder focuses on neighboring time steps to perform local temporal dependency analysis, outputting shallow temporal features. A time step refers to several short-distance time nodes adjacent to the current time step position. Local time series dependency analysis focuses on fine-grained fluctuations at the minute level, capturing short-range correlation patterns such as irradiance jumps and instantaneous power fluctuations between adjacent moments. This layer uses high-density neighbor attention computation to fully explore the details of local short-term fluctuations. The resulting shallow time series features carry the most refined local time series change information. The shallow time series features are then input into the second-layer encoder, which performs trend change analysis on medium time spans, outputting medium-layer time series features. Medium time spans correspond to time ranges of tens of minutes. Trend change analysis is used to capture the gradual power change trend caused by factors such as cloud movement and gradual changes in ambient temperature. This layer uses medium-density sparse attention computation to accurately capture the trend of medium-term time series while controlling the amount of computation. The resulting medium-layer time series features carry the trend information of medium-term power changes.
[0054] The mid-level temporal features are then input into the deep encoder, which performs long-term feature analysis over the global time range, outputting deep temporal features. The global time range is the complete time span of the entire preset time window. Long-term feature analysis is used to mine global temporal patterns such as the overall rise and fall patterns and intraday cyclical characteristics within the window. This layer uses low-density global sparse attention computation, performing long-range correlation modeling only on key time nodes, efficiently capturing the long-range dependencies of the entire window. The resulting deep temporal features carry global-scale temporal pattern information. Finally, the shallow, mid-level, and deep temporal features are aggregated across layers. Cross-layer feature aggregation refers to integrating the attention features of three different time scales through feature concatenation and weighted fusion, achieving complementary superposition of local details, intermediate trends, and global patterns, ultimately generating time-dimensional attention features that integrate multi-scale temporal dependency information.
[0055] Furthermore, in the method provided in this application embodiment, the encoding sequence is stacked with multiple layers of features through the encoding module of the time-aware sparse attention mechanism to generate the time-dimensional attention features. The method includes: the encoding module of the time-aware sparse attention mechanism includes a first-layer encoder, a second-layer encoder, and a deep encoder; the encoding sequence is input to the first-layer encoder, and the first-layer encoder performs local temporal dependency analysis on the encoding sequence according to adjacent time steps to output shallow temporal features; the shallow temporal features are input to the second-layer encoder, and the second-layer encoder performs trend change analysis on the shallow temporal features according to a medium time span to output medium-layer temporal features; the medium-layer temporal features are input to the deep encoder, and the deep encoder performs long-period feature analysis on the medium-layer temporal features according to a global time range to output deep temporal features; the shallow temporal features, the medium-layer temporal features, and the deep temporal features are aggregated across layers to generate time-dimensional attention features.
[0056] Specifically, its encoding module adopts a hierarchical three-level encoder architecture, including a first-level encoder, a second-level encoder, and a deep encoder. It gradually mines the temporal dependency patterns at different time scales through a multi-layer feature stacking approach from near to far and from fine to coarse, and finally aggregates and generates temporal attention features that combine detailed and global information. In specific execution, the encoded sequence with injected positional information is first input into the first-level encoder. The first-level encoder performs local temporal dependency analysis on the encoded sequence according to the nearest time step and outputs shallow temporal features, where the nearest time step refers to the short-distance time node directly adjacent to the current time step position. Typically, this layer covers the range of several minimum time steps before and after the current moment, corresponding to the instantaneous fluctuation scale of photovoltaic power at the minute level. Local time series dependency analysis focuses on high-density attention calculations within a fine-grained neighborhood, focusing on capturing short-range correlation patterns such as irradiance jumps between adjacent moments and instantaneous power fluctuations caused by rapid cloud cover. Since photovoltaic time series data has the strongest correlation and the highest information value in neighboring time steps, this layer adopts a low-sparseness attention calculation mode with near-neighbor fully connected layers, fully preserving the detailed changes in local time series. The final output shallow time series features carry the most refined short-term fluctuation information and the fine-grained change features of the original time series.
[0057] After shallow feature extraction, the shallow time-series features are input into the second-layer encoder. The second-layer encoder performs trend analysis on the shallow time-series features over a medium time span and outputs the medium-layer time-series features. The medium time span corresponds to a time range of tens of minutes, which is the main scale of change in photovoltaic power affected by factors such as cloud movement and gradual changes in ambient temperature. The trend analysis focuses on the overall rise and fall and gradual change pattern of the data at this scale, rather than the instantaneous fluctuations at a single point. This layer adopts a medium-density sparse attention calculation mode, which performs attention association calculation only on key time nodes with fixed intervals. While filtering out local high-frequency noise, it accurately captures the change trend of the medium-term time series, which controls computational redundancy and retains the core information of the medium-term changes. The final output medium-layer time-series features carry the power change trend and pattern of the medium time scale within the window.
[0058] Subsequently, the intermediate-level temporal features are input into the deep encoder. The deep encoder performs long-term feature analysis on the intermediate-level temporal features according to the global time range and outputs deep-level temporal features. The global time range is the complete time span of the preset time window, covering the long-range range of all input time steps. Long-term feature analysis is used to mine macro-temporal patterns such as the overall rise and fall rules and intraday cycle characteristics within the entire backtracking window, corresponding to the long-term variation characteristics of photovoltaic power output with the solar altitude angle. Since the temporal correlation between distant time steps is significantly weakened, full calculation of attention weights will generate a lot of invalid computations. Therefore, this layer adopts a highly sparse attention calculation mode, selecting only a few representative key anchor time steps for long-range correlation modeling. While ensuring the ability to capture long-range dependencies, the computational complexity is greatly reduced. The final output deep-level temporal features carry the macro-temporal patterns and long-term variation rules at the global scale.
[0059] After completing the three-layer feature extraction, the shallow, mid-level, and deep temporal features are aggregated across layers to generate the final temporal attention features. Cross-layer feature aggregation refers to splicing and fusing features from three different time scales along the feature dimension, and achieving complementary advantages of features at different scales through adaptive weight adjustment. This integrates the fine-grained fluctuation details of the shallow layer, the trend of the mid-level layer, and the global regularity of the deep layer, solving the problem that single-layer attention mechanisms cannot simultaneously take into account both local accuracy and global vision.
[0060] Furthermore, in the method provided in this application embodiment, the temporal attention features are decoded through the feature-gated fusion attention mechanism to generate a fused feature vector. The method includes: decomposing the temporal attention features according to the feature dimension to obtain multiple feature sub-vectors of a single feature dimension; constructing a feature encoding branch, performing a nonlinear transformation on the feature sub-vectors through the feature encoding branch to extract deep semantic encoding features; synchronizing the deep semantic encoding features to the feature-gated fusion attention mechanism for cross-feature interaction modeling to generate a feature interaction matrix; calculating the weights of the feature dimensions according to the feature interaction matrix to obtain multiple importance weights; and performing weighted fusion of the deep semantic encoding features based on the multiple importance weights to generate a fused feature vector.
[0061] Specifically, the temporal attention features are first decomposed according to the feature dimension to obtain multiple feature sub-vectors with a single feature dimension. Feature dimension decomposition refers to splitting the temporal attention tensor, which has the shape of the number of time steps × the total feature dimension, into multiple independent feature sequences that correspond one-to-one with the original monitoring variables. Each feature sub-vector corresponds to the complete temporal feature of a single physical variable such as irradiance, ambient temperature, component temperature, and operating parameters after temporal encoding. After decomposition, the temporal change patterns of each feature are independent of each other, avoiding the problem of weakening the semantics of a single feature caused by the mixing of multiple features, and providing independent input for the deep encoding of the subsequent branch architecture.
[0062] Based on this, feature encoding branches are constructed that correspond one-to-one with the feature dimensions. The feature encoding branches are used to perform nonlinear transformations on each feature sub-vector to extract deep semantic encoding features. The feature encoding branches are independent encoding paths composed of fully connected layers and nonlinear activation functions. Each feature sub-vector corresponds to a dedicated encoding branch to avoid information interference from different features. Nonlinear transformation refers to high-dimensional space mapping operations completed by activation functions such as ReLU, which can transform shallow numerical time series features into high-dimensional abstract features that contain physical laws such as their own fluctuation rhythms and changing trends. The resulting deep semantic encoding features are high-dimensional time series representations that carry the independent deep semantics of each feature.
[0063] After completing the single-feature deep encoding, all deep semantic encoded features are synchronized to the feature gating fusion attention mechanism for cross-feature interaction modeling, generating a feature interaction matrix. Cross-feature interaction modeling refers to quantifying the strength of mutual influence and coupling correlation between different features to restore the physical linkage law between photovoltaic multivariates. Specifically, the deep semantic encoded features are first concatenated along the channel dimension to obtain joint feature representation parameters. Channel dimension concatenation refers to concatenating the high-dimensional time-series features output by each feature branch along the feature channel direction into a unified feature tensor. The joint feature representation parameters are the overall feature carrier that integrates the time-series information of all feature dimensions.
[0064] Subsequently, global average pooling is applied to the joint feature representation parameters to obtain a global statistical feature vector. Global average pooling can compress the temporal dimension information of each feature channel into a global statistic, eliminating fine-grained temporal fluctuations and preserving the overall attributes of the features. The global statistical feature vector is a one-dimensional vector composed of the global statistical values of each feature, representing the overall representation of each feature within the entire time window. Then, the global statistical feature vectors are combined pairwise to generate multiple sets of feature vector combinations. The outer product operation is performed on all feature vector combinations to generate a feature interaction strength matrix. The outer product operation can transform two one-dimensional feature vectors into a two-dimensional matrix. The value of each element in the matrix corresponds to the interaction correlation strength between the two features. The higher the value, the more significant the synergistic effect of the two features on power prediction. Finally, all feature interaction strength matrices are concatenated and integrated according to the feature dimension order to obtain a feature interaction matrix that completely records the pairwise interaction relationships of all features.
[0065] After obtaining the feature interaction matrix, the interaction matrix is weighted and aggregated according to the feature dimension to obtain the importance weight corresponding to each feature. The importance weight refers to the contribution coefficient dynamically generated by the gating mechanism based on the feature interaction strength. Features with greater impact on power prediction and stronger coupling with other features will be assigned higher weights. In the specific calculation, all interaction strengths corresponding to each feature in the feature interaction matrix are summed and aggregated, and then the aggregated value is mapped to the (0,1) interval through the Sigmoid gating function to obtain the normalized importance weight, thereby realizing automatic focusing on key features and adaptive suppression of redundant features.
[0066] Subsequently, the deep semantic coding features are weighted and fused based on multiple importance weights to generate a fused feature vector. This process consists of two stages: feature weighting and feature fusion. Let there be K feature dimensions in total, and the deep semantic coding feature corresponding to the k-th feature is denoted as . L is the time step length, and D is the encoding dimension of a single feature. The corresponding importance weights are: ; in This represents the interaction strength value in the k-th row and j-th column of the feature interaction matrix. Using the Sigmoid activation function, the first stage involves feature-wise weighted enhancement: each deep semantic encoding feature is element-wise multiplied by its corresponding importance weight, i.e.: ; This operation numerically amplifies core features strongly correlated with power, such as irradiance, and numerically suppresses redundant noise features, achieving adaptive feature selection through the attention mechanism; the second stage is multi-feature integration pooling: all weighted features... The feature tensors with temporal dimensions are concatenated and integrated along the feature channel dimension, and then global average pooling is performed along the time dimension to compress the feature tensors into a one-dimensional globally fused feature vector. Ultimately, a fused feature vector is obtained that simultaneously carries multi-scale temporal dependency information, cross-feature coupling interaction information, and adaptive weight information.
[0067] Furthermore, in the method provided in this application embodiment, the deep semantic encoding features are synchronized to the feature-gated fusion attention mechanism for cross-feature interaction modeling to generate a feature interaction matrix. The method includes: synchronizing the deep semantic encoding features to the feature-gated fusion attention mechanism and concatenating them along the channel dimension to obtain joint feature representation parameters; pooling and compressing the joint feature representation parameters to obtain a global statistical feature vector; combining the global statistical feature vectors into adjacent pairs to generate a feature vector combination; traversing the feature vector combination and performing an outer product operation to generate a feature interaction intensity matrix; and concatenating and integrating the feature interaction intensity matrix according to the feature dimension order to generate a feature interaction matrix.
[0068] Specifically, firstly, all deep semantic coding features are synchronized to the feature-gated fusion attention mechanism. Then, they are concatenated along the channel dimension to obtain joint feature representation parameters. The channel dimension is the dimension in the feature tensor that carries different feature coding information, corresponding to the independent coding channels output by each feature branch. Channel dimension concatenation means merging multiple scattered single feature tensors into a single overall tensor along this dimension. If the shape of the deep semantic coding feature corresponding to a single feature is "time step L × single feature coding dimension d", and there are K original monitoring feature dimensions, then the shape of the concatenated joint feature representation parameters is "L × K". The parameter "d" fully preserves the encoding information of all features at all time steps, integrating the scattered single-feature temporal representations into a unified multi-feature temporal tensor, providing a unified data carrier for subsequent global statistics and interactive computation.
[0069] Subsequently, pooling compression is applied to the joint feature representation parameters to obtain the global statistical feature vector. This pooling compression employs a global average pooling strategy, averaging the values of each channel across the entire time frame along the time dimension. This eliminates the interference of fine-grained temporal fluctuations, condensing the overall statistical representation of each feature channel within the entire time window. The specific calculation process is as follows: Let the value of the c-th channel at time step t in the joint feature tensor be... Then the global statistical value corresponding to the c-th channel is: ; After traversing all channels, a one-dimensional global statistical feature vector is obtained. This vector discards instantaneous fluctuation noise and retains only the overall attributes of each feature encoding, making it more suitable for characterizing stable physical interaction and coupling relationships between features.
[0070] Next, the global statistical feature vector is combined into adjacent vectors to generate a feature vector combination. Here, adjacent combination refers to splitting the global statistical feature vector into K global sub-vectors corresponding to a single feature, following the physical arrangement order of the original monitored features. Each sub-vector has a length consistent with the single feature encoding dimension d, denoted as . The global statistical representations of the first to Kth features, such as irradiance, ambient temperature, and component temperature, are then paired up to form... There are K-1 sets of feature vector combinations. This adjacent pairing design fits the physical correlation logic of photovoltaic features. Features with stronger physical coupling are closer in position in the arrangement. Prioritizing interactive modeling can balance computational efficiency and physical rationality.
[0071] After pairing, all eigenvector combinations are iterated through and outer product operations are performed to generate the feature interaction strength matrix for each pair. The outer product operation, also called the vector tensor product, is an operation that cross-multiplies the elements of two one-dimensional vectors one by one to generate a two-dimensional matrix. It can finely characterize the pairwise interaction strength between all dimensions of two vectors. The specific formula is: for any pair of adjacent eigenvectors... and The feature interaction strength matrix generated by the outer product of the two satisfy: ; in It is the outer product operator. For vectors The transpose of the matrix, the element in the p-th row and q-th column. The value of this element directly reflects the interaction coupling strength between the p-th dimension encoding of the i-th feature and the q-th dimension encoding of the j-th feature. The larger the value, the more significant the synergistic effect of the two encoding dimensions on power prediction. Thus, each feature interaction strength matrix obtained accurately quantifies the fine-grained interaction relationship between a pair of adjacent features in the high-dimensional encoding space.
[0072] Finally, all feature interaction intensity matrices are concatenated and integrated according to the feature dimension order to generate a complete feature interaction matrix. Here, concatenation and integration refers to concatenating the K-1 groups of interaction intensity matrices, each with a size of d×d, along the column dimension according to the original feature arrangement order, ultimately obtaining a matrix of size d×(K-1). The unified feature interaction matrix of "d" fully covers the dimensional interaction information of the encoding of all adjacent feature pairs, systematically presents the coupling and correlation distribution among all features, and becomes the quantitative basis for subsequent calculation of the importance weight of each feature.
[0073] Furthermore, in the method provided in this application embodiment, photovoltaic power generation ultra-short-term regression prediction is performed based on the fused feature vector to generate ultra-short-term photovoltaic power generation prediction results. The method includes: constructing a regression prediction module, the regression prediction module comprising an input layer, a first hidden layer, a second hidden layer, and an output layer; synchronizing the fused feature vector through the input layer to the first hidden layer for dimensionality upscaling mapping to obtain a first hidden feature; performing nonlinear activation on the first hidden feature to obtain an activated feature; randomly discarding data from the activated feature according to a preset probability to obtain a regularized feature; performing dimensionality downscaling mapping on the regularized feature through the second hidden layer to obtain a second hidden feature; synchronizing the second hidden feature to the output layer for linear transformation to generate the ultra-short-term photovoltaic power generation prediction results.
[0074] Specifically, a regression prediction module adapted for ultra-short-term power regression tasks is first constructed. This module adopts a four-layer fully connected neural network architecture consisting of an input layer, a first hidden layer, a second hidden layer, and an output layer. The input layer is responsible for matching and accessing feature dimensions, the two hidden layers handle the core nonlinear feature transformation and prediction information extraction, and the output layer outputs continuous power prediction values. The overall architecture controls network depth and computational cost while ensuring complex nonlinear fitting capabilities. Specifically, the fused feature vector carrying multi-scale temporal dependencies and cross-feature coupling information is first synchronized to the first hidden layer through the input layer for dimensionality upscaling mapping to obtain the first... Hidden features, or dimensionality-upgrading mapping, refers to the linear transformation of the weight matrix of the fully connected layer to map the relatively limited-dimensional fusion features to a higher-dimensional hidden feature space. Its function is to break the linear inseparability of the original feature space by expanding the dimension, and to transform the complex nonlinear coupling relationship between photovoltaic power and multiple factors such as irradiance and temperature into a separable pattern in a high-dimensional space. This fully activates the temporal fluctuation patterns and feature interaction information contained in the fusion features, allowing fine-grained instantaneous irradiance jumps, multi-factor synergistic effects and other deep features to be fully captured, and accurately adapting to the strong nonlinear characteristics of photovoltaic output driven by multiple factors such as weather and operating conditions.
[0075] After completing the dimensionality-upgrading mapping, nonlinear activation is performed on the first hidden feature to obtain the activated feature. Nonlinear activation usually uses activation functions such as ReLU to perform element-wise nonlinear transformation on the dimensionality-upgrading feature. Since pure linear layer stacking is equivalent to single-layer linear transformation, it cannot fit complex nonlinear laws. Therefore, nonlinear activation is the core operation that gives deep networks nonlinear fitting capabilities. It can break the expression limitations of pure linear transformation, enabling the network to accurately fit the nonlinear power fluctuation laws under complex scenarios such as cloud cover and sudden irradiance, and giving the feature representation a stronger ability to adapt to complex scenarios.
[0076] Subsequently, the activated features are randomly discarded according to a preset probability to obtain regularized features. This random data discarding is the Dropout regularization strategy in deep learning. The preset probability refers to the pre-set proportion of neurons that are randomly deactivated. During model training, the output of some neurons will be randomly blocked according to this probability, so that they do not participate in forward propagation and backward gradient update. The core principle of this operation is to force the network not to rely on the feature response of individual neurons, avoid the model from over-memorizing local noise and random fluctuations in the training data, and effectively solve the overfitting problem caused by the diverse weather conditions and uneven sample distribution of photovoltaic data.
[0077] After obtaining the regularized features, the second hidden features are obtained by performing dimensionality reduction mapping on the regularized features through the second hidden layer. Dimensionality reduction mapping refers to compressing the high-dimensional regularized features to a lower-dimensional space through the weight transformation of the fully connected layer. In this process, redundant information and residual noise that are not related to power prediction in the high-dimensional features are filtered out, and the core representation components that are directly related to the changes in photovoltaic power generation are extracted. While simplifying the feature dimensions and reducing the subsequent computational overhead, the core objective of the prediction task is further focused, ensuring the information purity and task relevance of the output features.
[0078] Finally, the second hidden feature is synchronized to the output layer for linear transformation to generate ultra-short-term photovoltaic power generation prediction results. The output layer adopts a linearly activated fully connected structure. Since ultra-short-term power prediction is a typical continuous value regression task, it is necessary to output continuous power values with physical meaning. The linear transformation can directly map the condensed core features into the continuous power sequence corresponding to the future time step through the linear weight matrix, and finally obtain the photovoltaic power generation prediction results step by step in the future ultra-short-term time scale, which can be directly used for power plant operation scheduling and status management.
[0079] Furthermore, in the method provided in this application embodiment, after generating the ultra-short-term photovoltaic power generation forecast result, the method includes: introducing real-time operating status data of the photovoltaic power station; identifying the photovoltaic power station's status based on the real-time operating status data and the ultra-short-term photovoltaic power generation forecast result, and determining the inverter operating status code identifier, grid-connected status identifier, and power curtailment status identifier; performing an operation determination based on the inverter operating status code identifier, and generating abnormal operating status information when the inverter operating status code identifier is not in the normal operating status range; performing an operation determination based on the grid-connected status identifier, and generating off-grid status information when the grid-connected status identifier is not in the grid-connected operating status range; performing a power curtailment dispatch determination based on the power curtailment status identifier, and generating a power curtailment dispatch instruction when there is power curtailment dispatch demand data; and dynamically correcting the ultra-short-term photovoltaic power generation forecast result based on the abnormal operating status, the off-grid status information, and the power curtailment dispatch instruction.
[0080] Specifically, firstly, real-time operational status data of the photovoltaic power plant is introduced. This data mainly includes real-time inverter operating parameters, grid connection point switch status, and power curtailment instructions issued by the grid dispatch center, reflecting the power plant's current actual operating capacity and external constraints. This data is used to compensate for the limitations of pure data-driven prediction, which relies solely on historical time-series data and does not consider real-time operational constraints. Then, the real-time operational status data is combined with the initial ultra-short-term photovoltaic power generation prediction results to identify the photovoltaic power plant's multi-dimensional operational status. This involves sequentially determining the inverter operational status code, grid connection status code, and power curtailment status code. The inverter operation status code is a status identifier value obtained by digitally encoding various operating states of the inverter, covering multiple operating conditions such as maximum power point tracking operation, load reduction operation, fault shutdown, and standby hibernation. Different operating conditions correspond to exclusive code values, which can accurately distinguish different operating levels of the inverter. The grid connection status identifier is a status identifier that represents the on / off status of the grid connection point of the photovoltaic power station, used to mark whether the power station is currently in grid-connected operation, off-grid islanded operation, or out of grid. The power curtailment status identifier is a status identifier that records whether the power station is currently subject to power curtailment constraints by the grid dispatch, as well as the corresponding power curtailment ratio, used to reflect the output restriction requirements of the grid side.
[0081] After completing the three types of status identifiers, the operation is first determined based on the inverter operation status code identifier. The normal operation status range corresponding to the normal power generation of the inverter is preset, that is, the coding range corresponding to the normal grid-connected power generation and fault-free derating of the inverter. When it is determined that the inverter operation status code identifier is not in the normal operation status range, it indicates that the inverter has abnormal operating conditions such as fault, shutdown or reduced load operation. At this time, abnormal operation status information is generated, recording parameters such as the number of inverters with abnormality and the derating ratio. The theoretical output predicted at the beginning will be constrained by the equipment capacity and cannot be fully realized. Next, the grid connection status identifier is used to determine the grid connection operation. The grid connection operation status range is preset to correspond to the status code of grid connection point closure and the power station formally connected to the grid. When it is determined that the grid connection status identifier is not in the grid connection operation status range, it indicates that the power station is in an off-grid or disconnected state. At this time, off-grid status information is generated, and the corresponding power station cannot transmit power to the grid, and the output mode will change fundamentally.
[0082] Next, power curtailment dispatch is determined based on the power curtailment status indicator. The demand data of the power grid dispatch is read in real time. When power curtailment dispatch demand data is detected, that is, when the power grid requires the power station to limit its output due to insufficient absorption capacity, safety operation constraints, etc., a power curtailment dispatch instruction is generated. The instruction contains the maximum output value or curtailment ratio. The corresponding initial predicted natural output will be forcibly reduced by the grid constraint. Finally, based on the three types of constraint information generated, namely abnormal operation status information, off-grid status information, and power curtailment dispatch instruction, the initial ultra-short-term photovoltaic power generation prediction result is dynamically corrected. The dynamic correction here refers to the adaptive adjustment of the prediction value according to the real-time operating conditions. Specifically, it will calculate the available power generation capacity according to the degree of inverter abnormality, adjust the output mode and output limit according to the off-grid status, and reduce the predicted power by the corresponding proportion according to the power curtailment instruction. Through the superposition and correction of multiple constraints, the theoretical natural output prediction value driven by pure data is corrected into the actual executable output prediction result that conforms to the equipment status, grid connection conditions and dispatch requirements.
[0083] In summary, the ultra-short-term photovoltaic power generation prediction method based on the attention mechanism provided in this application has the following technical effects: Through a multi-stage adaptive data cleaning and classification-based missing data imputation strategy, abnormal data is accurately identified and removed from multiple dimensions, including physical boundaries, fluctuation characteristics, and coupling correlations. Differentiated imputation methods combined with smoothing filtering are used for different missing patterns to comprehensively improve the quality and continuity of the input time series data. A time-aware sparse attention mechanism with a three-level encoder is constructed to mine multi-scale time series dependencies from near to far, including local short-term fluctuations, medium-term change trends, and global long-term patterns. Time-aware sparse computation effectively reduces computational complexity, ensuring real-time response capability for ultra-short-term predictions while achieving complete capture of multi-scale time series information. Furthermore, a feature-gated fusion attention mechanism is built, which models the cross-feature coupling interaction strength through feature outer product operations, dynamically generates importance weights for each feature, and completes adaptive weighted fusion to deeply mine the collaborative correlation information of multi-source features and improve feature utilization efficiency. Finally, three types of real-time operation constraints—inverter operating status, grid connection status, and power curtailment scheduling—are introduced to dynamically correct the initial prediction results, making the output results more consistent with the actual operating conditions of the power plant, ultimately improving the prediction accuracy and real-time performance under complex weather and operating conditions.
[0084] Example 2, based on the same inventive concept as the attention-based photovoltaic power generation ultra-short-term prediction method in the foregoing examples, such as... Figure 2 As shown in the embodiments of this application, a photovoltaic power generation ultra-short-term prediction system based on an attention mechanism is provided. The system includes: The processing module 11 is used to acquire multi-source time-series data of photovoltaic power plants, perform data cleaning to obtain first preprocessed data, and impute missing values in the first preprocessed data to obtain second preprocessed data; the encoding module 12 is used to construct a time-aware sparse attention mechanism, encode the second preprocessed data through the time-aware sparse attention mechanism, and generate time-dimensional attention features; the decoding module 13 is used to construct a feature-gated fusion attention mechanism, decode the time-dimensional attention features through the feature-gated fusion attention mechanism, and generate a fused feature vector; the prediction module 14 is used to perform ultra-short-term regression prediction of photovoltaic power generation based on the fused feature vector, and generate ultra-short-term prediction results of photovoltaic power generation.
[0085] Furthermore, the processing module 11 is also used to perform the following steps: performing multi-stage adaptive data cleaning on the multi-source time-series data to obtain first preprocessed data; aligning the first preprocessed data according to the time dimension to generate aligned data; traversing the aligned data to locate missing data, determining the position of missing values, and identifying the missing value distribution according to the position of missing values to obtain missing value distribution morphology parameters; classifying the missing types of the aligned data based on the missing value distribution morphology parameters and the position of missing values to obtain multiple types of missing data, the multiple types of missing data including isolated missing values, consecutive missing values, and compound missing values; performing linear imputation filling based on the isolated missing values to generate first imputed data, performing mean imputation filling based on the consecutive missing values to generate second imputed data, and performing indirect calculation filling based on the compound missing values to generate third imputed data; and performing smoothing filtering processing on the first imputed data, the second imputed data, and the third imputed data to obtain second preprocessed data.
[0086] Furthermore, the processing module 11 is also used to perform the following steps: extracting the physical characteristics of the multi-source time series data and setting a dynamic physical threshold range; extracting multiple data points that exceed the dynamic physical threshold range and marking them as anomalies to obtain abnormal data; performing local fluctuation analysis based on multiple data points, calculating the local rate of change, extracting continuous data points whose local rate of change exceeds the rate of change multiplied by a threshold and marking them as anomalies to obtain abrupt change abnormal data; extracting the data coupling relationship of the multi-source time series data, performing cross-validation on the multi-source time series data according to the data coupling relationship, extracting data points that do not conform to the data coupling relationship and marking them as anomalies to obtain coupled abnormal data; and removing data from the multi-source time series data containing the abnormal data, the abrupt change abnormal data, and the coupled abnormal data to generate the first preprocessed data.
[0087] Furthermore, the encoding module 12 is also used to perform the following steps: dividing the second preprocessed data into multiple time step input sequences according to a preset time window length, wherein the multiple time step input sequences contain multiple time step data; traversing the multiple time step data to perform position encoding to generate an encoding sequence; and performing multi-layer feature stacking on the encoding sequence through the encoding module of the time-aware sparse attention mechanism to generate the time-dimensional attention feature.
[0088] Furthermore, the encoding module 12 is also used to perform the following steps: the encoding module of the time-aware sparse attention mechanism includes a first-layer encoder, a second-layer encoder, and a deep encoder; the encoded sequence is input to the first-layer encoder, and the first-layer encoder performs local temporal dependency analysis on the encoded sequence according to the nearest time step, outputting shallow temporal features; the shallow temporal features are input to the second-layer encoder, and the second-layer encoder performs trend change analysis on the shallow temporal features according to a medium time span, outputting medium-layer temporal features; the medium-layer temporal features are input to the deep encoder, and the deep encoder performs long-period feature analysis on the medium-layer temporal features according to a global time range, outputting deep temporal features; the shallow temporal features, the medium-layer temporal features, and the deep temporal features are aggregated across layers to generate time-dimensional attention features.
[0089] Furthermore, the decoding module 13 is also used to perform the following steps: decomposing the temporal attention features according to the feature dimensions to obtain multiple feature sub-vectors with single feature dimensions; constructing a feature encoding branch, performing nonlinear transformation on the feature sub-vectors through the feature encoding branch to extract deep semantic encoding features; synchronizing the deep semantic encoding features to the feature gating fusion attention mechanism for cross-feature interaction modeling to generate a feature interaction matrix; calculating the weights of the feature dimensions according to the feature interaction matrix to obtain multiple importance weights; and performing weighted fusion of the deep semantic encoding features based on the multiple importance weights to generate a fused feature vector.
[0090] Furthermore, the decoding module 13 is also used to perform the following steps: synchronizing the deep semantic encoding features to the feature gating fusion attention mechanism, concatenating them along the channel dimension to obtain joint feature representation parameters; pooling and compressing the joint feature representation parameters to obtain a global statistical feature vector; combining the global statistical feature vectors adjacently to generate a feature vector combination, traversing the feature vector combination to perform an outer product operation to generate a feature interaction intensity matrix; and concatenating and integrating the feature interaction intensity matrix according to the feature dimension order to generate a feature interaction matrix.
[0091] Furthermore, the prediction module 14 is also used to perform the following steps: constructing a regression prediction module, the regression prediction module including an input layer, a first hidden layer, a second hidden layer, and an output layer; synchronizing the fused feature vector to the first hidden layer through the input layer for dimensionality upscaling mapping to obtain a first hidden feature; performing nonlinear activation on the first hidden feature to obtain an activated feature; randomly discarding data from the activated feature according to a preset probability to obtain a regularized feature; performing dimensionality downscaling mapping on the regularized feature through the second hidden layer to obtain a second hidden feature; synchronizing the second hidden feature to the output layer for linear transformation to generate the ultra-short-term prediction result of photovoltaic power generation.
[0092] Furthermore, the prediction module 14 is also used to perform the following steps: introducing real-time operating status data of the photovoltaic power station; identifying the photovoltaic power station's status based on the real-time operating status data and the ultra-short-term photovoltaic power generation prediction results, and determining the inverter operating status code identifier, grid-connected status identifier, and power curtailment status identifier; performing an operation judgment based on the inverter operating status code identifier, and generating abnormal operating status information when the inverter operating status code identifier is not in the normal operating status range; performing an operation judgment based on the grid-connected status identifier, and generating off-grid status information when the grid-connected status identifier is not in the grid-connected operating status range; performing a power curtailment dispatch judgment based on the power curtailment status identifier, and generating a power curtailment dispatch instruction when there is power curtailment dispatch demand data; and dynamically correcting the ultra-short-term photovoltaic power generation prediction results based on the abnormal operating status, the off-grid status information, and the power curtailment dispatch instruction.
[0093] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A method for ultra-short-term prediction of photovoltaic power generation based on an attention mechanism, characterized in that, The method includes: Multi-source time-series data from a photovoltaic power station is acquired, cleaned, and first preprocessed data is obtained. Missing values are imputed in the first preprocessed data to obtain second preprocessed data. A time-aware sparse attention mechanism is constructed, and the second preprocessed data is encoded through the time-aware sparse attention mechanism to generate time-dimensional attention features; A feature-gated fusion attention mechanism is constructed to decode the temporal attention features and generate a fusion feature vector. Based on the fused feature vector, ultra-short-term regression prediction of photovoltaic power generation is performed to generate ultra-short-term prediction results of photovoltaic power generation.
2. The ultra-short-term photovoltaic power generation prediction method based on attention mechanism as described in claim 1, characterized in that, The method involves acquiring multi-source time-series data from a photovoltaic power plant, performing data cleaning to obtain first preprocessed data, and then imputing missing values in the first preprocessed data to obtain second preprocessed data. The multi-source time-series data is subjected to multi-stage adaptive data cleaning to obtain the first preprocessed data; The first preprocessed data is aligned according to the time dimension to generate aligned data; Traverse the aligned data to locate missing data, determine the location of missing values, identify the missing value distribution according to the location of missing values, and obtain the missing value distribution morphology parameters. Based on the missing value distribution morphology parameters and the missing value positions, the missing types of the aligned data are classified to obtain multiple types of missing data, including isolated missing values, consecutive missing values, and compound missing values. Linear imputation is performed based on the isolated missing values to generate first imputed data; mean imputation is performed based on the continuous missing values to generate second imputed data; and indirect inference imputation is performed based on the composite missing values to generate third imputed data. The first interpolated data, the second interpolated data, and the third interpolated data are subjected to smoothing filtering to obtain the second preprocessed data.
3. The ultra-short-term photovoltaic power generation prediction method based on attention mechanism as described in claim 2, characterized in that, The method involves performing multi-stage adaptive data cleaning on the multi-source time-series data to obtain first preprocessed data, including: Extract the physical characteristics of the multi-source time-series data and set a dynamic physical threshold range; Extract multiple data points that exceed the dynamic physical threshold range and mark them as anomalies to obtain abnormal data; Local fluctuation analysis is performed based on multiple data points to calculate the local rate of change. Continuous data points with local rates of change exceeding the rate of change multiplied by a threshold are extracted and marked as anomalies to obtain abrupt change anomaly data. Extract the data coupling relationship of multi-source time series data, perform cross-validation on the multi-source time series data according to the data coupling relationship, extract data points that do not conform to the data coupling relationship and mark them as anomalies to obtain coupled anomalous data; The multi-source time-series data containing the anomalous data, the mutational anomalous data, and the coupled anomalous data are processed to remove data, thereby generating the first preprocessed data.
4. The ultra-short-term photovoltaic power generation prediction method based on attention mechanism as described in claim 1, characterized in that, The second preprocessed data is encoded using the time-aware sparse attention mechanism to generate time-dimensional attention features. The method includes: The second preprocessed data is divided into multiple time-step input sequences according to a preset time window length, and the multiple time-step input sequences contain multiple time-step data; The data from the multiple time steps are traversed to perform position encoding, generating an encoded sequence; The encoding module of the time-aware sparse attention mechanism performs multi-layer feature stacking on the encoded sequence to generate the time-dimensional attention features.
5. The ultra-short-term photovoltaic power generation prediction method based on attention mechanism as described in claim 4, characterized in that, The encoding module of the time-aware sparse attention mechanism performs multi-layer feature stacking on the encoded sequence to generate the time-dimensional attention features, the method including: The encoding module of the time-aware sparse attention mechanism includes a first-layer encoder, a second-layer encoder, and a deep encoder. The encoded sequence is input into the first layer encoder, and the first layer encoder performs local temporal dependency analysis on the encoded sequence according to the nearest time step, and outputs shallow temporal features. The shallow time series features are input into the second layer encoder. The second layer encoder performs trend change analysis on the shallow time series features over a medium time span and outputs the medium-level time series features. The intermediate-level temporal features are input into the deep encoder, and the deep encoder performs long-period feature analysis on the intermediate-level temporal features according to the global time range, and outputs the deep-level temporal features. The shallow temporal features, the mid-level temporal features, and the deep temporal features are aggregated across layers to generate temporal attention features.
6. The ultra-short-term photovoltaic power generation prediction method based on attention mechanism as described in claim 1, characterized in that, The temporal attention features are decoded using the feature-gated fusion attention mechanism to generate a fused feature vector. The method includes: The time-dimensional attention features are decomposed according to the feature dimension to obtain multiple feature sub-vectors with a single feature dimension. Construct a feature encoding branch, and perform a nonlinear transformation on the feature sub-vectors through the feature encoding branch to extract deep semantic encoding features; The deep semantic encoding features are synchronized to the feature gating fusion attention mechanism to perform cross-feature interaction modeling and generate a feature interaction matrix. The feature dimensions are weighted according to the feature interaction matrix to obtain multiple importance weights; Based on the aforementioned multiple importance weights, the deep semantic encoding features are weighted and fused to generate a fused feature vector.
7. The ultra-short-term photovoltaic power generation prediction method based on attention mechanism as described in claim 6, characterized in that, The method involves synchronizing the deep semantic encoded features to the feature-gated fusion attention mechanism for cross-feature interaction modeling to generate a feature interaction matrix, including: The deep semantic encoding features are synchronized to the feature gating fusion attention mechanism and concatenated along the channel dimension to obtain joint feature representation parameters; The joint feature representation parameters are pooled and compressed to obtain a global statistical feature vector; The global statistical feature vectors are combined adjacently to generate feature vector combinations. The feature vector combinations are then traversed and outer product operations are performed to generate a feature interaction strength matrix. The feature interaction intensity matrix is concatenated and integrated according to the feature dimension order to generate the feature interaction matrix.
8. The ultra-short-term photovoltaic power generation prediction method based on attention mechanism as described in claim 1, characterized in that, Based on the fused feature vector, ultra-short-term regression prediction of photovoltaic power generation is performed to generate ultra-short-term prediction results of photovoltaic power generation. The method includes: A regression prediction module is constructed, which includes an input layer, a first hidden layer, a second hidden layer, and an output layer; The fused feature vector is synchronized to the first hidden layer through the input layer for dimensionality up-mapping to obtain the first hidden feature; The first hidden feature is non-linearly activated to obtain the activated feature. The activated feature is then randomly discarded according to a preset probability to obtain the regularized feature. The regularized features are dimensionality-reduced and mapped by the second hidden layer to obtain the second hidden features. The second hidden features are then synchronized to the output layer for linear transformation to generate the ultra-short-term prediction result of photovoltaic power generation.
9. The ultra-short-term photovoltaic power generation prediction method based on attention mechanism as described in claim 1, characterized in that, After generating ultra-short-term photovoltaic power generation forecasts, the methods include: Real-time operating status data of photovoltaic power plants are introduced, and the photovoltaic power plants are identified by combining the real-time operating status data with the ultra-short-term forecast results of photovoltaic power generation. The inverter operating status code, grid connection status code, and power curtailment status code are determined. Operation is determined based on the inverter operation status code identifier. When the inverter operation status code identifier is not in the normal operation state range, abnormal operation status information is generated. Operation is determined based on the grid connection status identifier. When the grid connection status identifier is not in the grid connection operation status range, off-grid status information is generated. Based on the power rationing status identifier, a power rationing dispatch determination is made. When there is power rationing dispatch demand data, a power rationing dispatch instruction is generated. The ultra-short-term forecast results of photovoltaic power generation are dynamically corrected based on the abnormal operating status, the off-grid status information, and the power curtailment dispatch instructions.
10. A photovoltaic power generation ultra-short-term prediction system based on attention mechanism, characterized in that, The system is used for implementing the ultra-short-term photovoltaic power generation prediction method based on the attention mechanism according to any one of claims 1 to 9, wherein the system comprises: The processing module is used to acquire multi-source time-series data from photovoltaic power plants, perform data cleaning, obtain first preprocessed data, and impute missing values in the first preprocessed data to obtain second preprocessed data. The encoding module is used to construct a time-aware sparse attention mechanism, which encodes the second preprocessed data to generate time-dimensional attention features. The decoding module is used to construct a feature-gated fusion attention mechanism, which decodes the temporal attention features to generate a fusion feature vector. The prediction module is used to perform ultra-short-term regression prediction of photovoltaic power generation based on the fused feature vector, and generate ultra-short-term prediction results of photovoltaic power generation.