A photovoltaic power prediction method and system based on a two-branch state space
Patent Information
- Application Number
- CN202611162801.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2046-08-03
AI Technical Summary
该类方案虽然能够提升一定预测精度,但在处理多变量长序列数据时,往往存在计算开销较大、长距离依赖提取效率不足、变量间关联建模不充分等问题
[0063]本发明提供一种基于双分支状态空间的光伏功率预测方法及系统,该方法首先获取预设历史输入窗口内的多变量光伏发电时间序列数据,并在预测之前对该多变量光伏发电时间序列数据依次进行归一化处理和趋势-季节分解,使输入序列被分解为反映光伏发电功率整体变化方向的趋势项以及反映周期扰动、天气扰动和局部波动的季节项。其次,本发明不是将趋势变化、季节波动以及多变量耦合关系全部混合输入同一预测主干,而是将趋势项和季节项分别输入光伏发电功率预测模型中的趋势预测分支和季节预测分支,通过趋势预测分支对趋势项进行双向状态空间建模,提取趋势项在历史输入窗口中的双向时间依赖信息;通过季节预测分支对季节项进行补丁嵌入,并在二维联合双向状态空间主干中依次执行时间补丁维双向状态空间建模、变量通道维双向状态空间建模和二维时变融合处理,使季节预测过程能够同时考虑同一变量通道在不同时间补丁之间的时间依赖关系、同一时间补丁位置下不同变量通道之间的协同变化关系以及时间补丁维度与变量通道维度构成的二维局部邻域关系。由此,相较于现有方法中直接对原始多变量序列进行统一建模而容易造成趋势信息、局部波动信息和变量耦合信息相互干扰的问题,本申请能够分别强化趋势变化和季节波动的表达能力,并在长历史窗口和长预测步长场景下提高光伏发电功率预测结果的稳定性和准确性。
Smart Images

Figure CN122659888B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of photovoltaic power generation prediction technology, and particularly relates to a photovoltaic power prediction method and system based on a dual-branch state space. Background Technology
[0002] As the scale of new energy grid connection continues to expand, the volatility and intermittency of photovoltaic power generation place higher demands on grid dispatching, energy storage configuration, and power balance control. In order to predict the output changes of photovoltaic power plants in the future, it is usually necessary to make predictions on future photovoltaic power generation based on multi-source data such as historical power generation, meteorological information, environmental information, and equipment operation information.
[0003] Among existing photovoltaic (PV) power generation forecasting methods, one type of scheme mainly relies on traditional statistical models or shallow machine learning models to establish a mapping relationship between input variables and predicted power. This type of scheme is usually applicable to short-term stable data, but in long-term forecasting scenarios, it is difficult to fully characterize the complex time-series dependence of PV power caused by weather changes, diurnal cycles, and equipment operating status changes. The forecast results are prone to problems such as trend tracking lag or insufficient characterization of local fluctuations.
[0004] Another approach employs deep learning models for photovoltaic power prediction, such as recurrent neural networks, attention mechanism models, or time series Transformer models to extract time dependencies from historical sequences. While this approach can improve prediction accuracy to some extent, it often suffers from high computational costs, insufficient efficiency in extracting long-distance dependencies, and inadequate modeling of inter-variable correlations when dealing with multivariate long-sequence data. Furthermore, photovoltaic power generation sequences typically contain both slowly changing trend components and seasonal fluctuations influenced by periodicity and weather disturbances. Directly modeling the original multivariate sequences in a unified manner can easily lead to interference between trend and fluctuation information, affecting the prediction model's ability to represent different changing components.
[0005] Furthermore, photovoltaic power generation data commonly exhibits a high proportion of samples from nighttime or near-zero power periods. If these low-effectiveness samples are not properly processed during training, the model may overlearn the data distribution in the near-zero power range, weakening its ability to learn the power change characteristics during effective power generation periods, thereby affecting the prediction accuracy and stability in actual prediction scenarios.
[0006] Therefore, there is a need for a photovoltaic power generation prediction method that can simultaneously take into account trend changes, seasonal fluctuations, variable channel coupling relationships, and low-quality sample interference control, in order to improve the stability and accuracy of long-step photovoltaic power generation prediction. Summary of the Invention
[0007] The purpose of this invention is to provide a photovoltaic power prediction method and system based on a dual-branch state space, which can improve the stability and accuracy of photovoltaic power prediction with long step size.
[0008] To achieve the above objectives, the present invention employs the following technical solution:
[0009] In a first aspect, the present invention provides a photovoltaic power prediction method based on a dual-branch state space, comprising:
[0010] Obtain multivariate photovoltaic power generation time series data within a preset historical input window;
[0011] The multivariate photovoltaic power generation time series data were subjected to normalization and trend-seasonal decomposition in sequence to obtain the trend term and seasonal term;
[0012] The trend term and the seasonal term are input into a pre-trained photovoltaic power generation prediction model to obtain trend prediction results and seasonal prediction results. The photovoltaic power generation prediction model includes a trend prediction branch and a seasonal prediction branch. The trend prediction branch is used to perform bidirectional state space modeling on the trend term to obtain the trend prediction result. The seasonal prediction branch is used to perform patch embedding on the seasonal term to obtain seasonal term patch features. The seasonal term patch features are then subjected to time patch dimension bidirectional state space modeling, variable channel dimension bidirectional state space modeling, and two-dimensional time-varying fusion processing sequentially through a two-dimensional joint bidirectional state space backbone to obtain the seasonal prediction result.
[0013] The trend forecast results and the seasonal forecast results are fused to obtain a fused result, and the fused result is then denormalized to obtain the photovoltaic power generation forecast value within the future forecast window.
[0014] Optionally, the multivariate photovoltaic power generation time series data includes a target variable and multiple exogenous variables related to the target variable; the target variable is photovoltaic power generation data; the exogenous variables include meteorological variables, environmental variables, photovoltaic equipment sensor variables, and time variables; wherein, the target variable and each of the exogenous variables corresponds to a variable channel.
[0015] Optionally, before performing normalization and trend-seasonal decomposition on the multivariate photovoltaic power generation time series data, the method further includes:
[0016] Missing values were processed in the multivariate photovoltaic power generation time series data;
[0017] The correlation between the target variable and each exogenous variable in the multivariate photovoltaic power generation time series data after missing values were processed was calculated to obtain the correlation results of each exogenous variable. The exogenous variables whose correlation results meet the preset correlation conditions were selected as the exogenous variables.
[0018] Construct a periodic time feature based on the timestamp of the photovoltaic power generation data;
[0019] The photovoltaic power generation data, the filtered exogenous variables, and the periodic time features are aligned and combined according to timestamps to obtain preprocessed multivariate photovoltaic power generation time series data.
[0020] Optionally, the normalization process includes:
[0021] Based on the preset historical input window, the window mean and window standard deviation of each variable channel in the preprocessed multivariate photovoltaic power generation time series data are statistically analyzed along the time dimension.
[0022] Based on the window mean and window standard deviation corresponding to each variable channel, the preprocessed multivariate photovoltaic power generation time series data is normalized to obtain a normalized input sequence.
[0023] The inverse normalization process includes: inverse normalizing the fusion result based on the window mean and window standard deviation corresponding to the target variable to obtain the predicted value of photovoltaic power generation.
[0024] Optionally, the trend-seasonal decomposition includes:
[0025] The trend term is obtained by performing a moving average process on the normalized input sequence.
[0026] The seasonal term is obtained based on the difference between the normalized input sequence and the trend term;
[0027] Prior to the moving average processing, the sequence boundaries of the normalized input sequence are copied and padded.
[0028] Optionally, the trend prediction branch includes a bidirectional state space modeling unit and a trend output mapping layer arranged sequentially; the bidirectional state space modeling unit includes a forward state space modeling branch and a reverse state space modeling branch arranged in parallel.
[0029] The trend prediction branch is used to perform bidirectional state-space modeling on the trend term to obtain the trend prediction result, including:
[0030] The trend sequence corresponding to each variable channel in the trend item is mapped to a latent space of a preset dimension to obtain a trend feature sequence;
[0031] The trend feature sequence is input into the positive state space modeling branch to obtain the positive trend features;
[0032] The trend feature sequence is flipped along the time dimension and then input into the reverse state space modeling branch. The output of the reverse state space modeling branch is then flipped back to the original time order to obtain the reverse trend feature.
[0033] The positive trend features and the negative trend features are fused together, and the fused trend features are mapped to the prediction window length through the trend output mapping layer to obtain the trend prediction result.
[0034] Optionally, the seasonal prediction branch includes a channel patch embedding layer, a two-dimensional joint bidirectional state space backbone, and a seasonal output mapping layer connected in sequence.
[0035] The channel patch embedding layer is used to adjust the seasonal item into a channel-priority form, and to perform patch segmentation, feature mapping and position encoding on the seasonal item in the channel-priority form along the time axis to obtain the seasonal item patch features;
[0036] The two-dimensional joint bidirectional state space backbone includes at least one two-dimensional joint modeling layer. The two-dimensional joint modeling layer is used to perform time patch dimension bidirectional state space modeling, variable channel dimension bidirectional state space modeling, and two-dimensional time-varying fusion processing on the input seasonal item patch features to obtain the updated seasonal item patch features.
[0037] The seasonal output mapping layer is used to map the updated seasonal item patch features of the output of the two-dimensional joint bidirectional state space backbone to the prediction window length to obtain the seasonal prediction result.
[0038] Optionally, the two-dimensional joint modeling layer includes a first-layer normalization unit, a time-patch dimension state-space modeling sublayer, a first residual unit, a second-layer normalization unit, a variable channel dimension state-space modeling sublayer, a second residual unit, a third-layer normalization unit, a two-dimensional time-varying fusion sublayer, and a third residual unit arranged sequentially.
[0039] The two-dimensional joint modeling layer is used to perform time-patch dimension bidirectional state-space modeling, variable channel dimension bidirectional state-space modeling, and two-dimensional time-varying fusion processing on the input seasonal patch features to obtain updated seasonal patch features, including:
[0040] The seasonal patch features input to the two-dimensional joint modeling layer are subjected to layer normalization processing by the first layer normalization unit to obtain the first normalized features;
[0041] By using the time patch dimension state space modeling sub-layer, multiple time patches corresponding to the same variable channel in the first normalized feature are treated as time patch sequences for bidirectional state space modeling to obtain time patch dimension modeling features.
[0042] The first residual unit performs residual fusion of the time patch dimension modeling feature and the seasonal term patch feature input to the two-dimensional joint modeling layer to obtain the first fused feature.
[0043] The first fused feature is subjected to layer normalization processing by the second layer normalization unit to obtain the second normalized feature;
[0044] By using the variable channel dimension state space modeling sub-layer, multiple variable channels corresponding to the same time patch position in the second normalized feature are used as variable channel sequences for bidirectional state space modeling to obtain variable channel dimension modeling features.
[0045] The variable channel dimension modeling feature is residually fused with the first fusion feature by the second residual unit to obtain the second fusion feature;
[0046] The second fused feature is subjected to layer normalization processing by the third normalization unit to obtain the third normalized feature;
[0047] Through the two-dimensional time-varying fusion sublayer, the third normalized feature is subjected to local neighborhood fusion processing on the two-dimensional feature plane composed of the time patch dimension and the variable channel dimension to obtain the two-dimensional time-varying fusion feature.
[0048] The second fusion feature is residually fused with the two-dimensional time-varying fusion feature by the third residual unit to obtain the updated seasonal item patch feature.
[0049] Optionally, the pre-trained photovoltaic power generation prediction model is trained in the following manner:
[0050] A historical multivariate photovoltaic power generation time series dataset is obtained, and training samples are constructed based on a sliding window. The training samples include a training input window and a training prediction window corresponding to the training input window.
[0051] The quality of the training samples is determined based on the proportion of effective photovoltaic power sampling points within the training input window; wherein, the effective photovoltaic power sampling points are sampling points where the photovoltaic power is greater than a preset power tolerance.
[0052] The training samples are filtered according to the sample quality to obtain the target training sample set;
[0053] The training input windows of each training sample in the target training sample set are sequentially normalized and subjected to trend-seasonal decomposition to obtain the training trend term and the training seasonal term.
[0054] The training trend term and the training seasonal term are input into the photovoltaic power generation prediction model to be trained to obtain the training trend prediction result and the training seasonal prediction result.
[0055] The training trend prediction results and the training seasonal prediction results are fused together to obtain the training fusion result, and the training fusion result is inversely normalized to obtain the training photovoltaic power generation prediction value.
[0056] The training loss is calculated based on the trained photovoltaic power generation prediction value and the real photovoltaic power generation data corresponding to the training prediction window, and the model parameters of the photovoltaic power generation prediction model to be trained are updated according to the training loss to obtain the pre-trained photovoltaic power generation prediction model.
[0057] Secondly, the present invention provides a photovoltaic power prediction system based on a dual-branch state space, comprising:
[0058] The data acquisition module is used to acquire multivariate photovoltaic power generation time series data within a preset historical input window;
[0059] The decomposition processing module is used to perform normalization and trend-seasonal decomposition on the multivariate photovoltaic power generation time series data in sequence to obtain trend and seasonal terms.
[0060] The prediction module is used to input the trend term and the seasonal term into a pre-trained photovoltaic power generation prediction model to obtain trend prediction results and seasonal prediction results. The photovoltaic power generation prediction model includes a trend prediction branch and a seasonal prediction branch. The trend prediction branch is used to perform bidirectional state-space modeling on the trend term to obtain the trend prediction result. The seasonal prediction branch is used to perform patch embedding on the seasonal term to obtain seasonal term patch features, and then sequentially performs time patch dimension bidirectional state-space modeling, variable channel dimension bidirectional state-space modeling, and two-dimensional time-varying fusion processing on the seasonal term patch features through a two-dimensional joint bidirectional state-space backbone to obtain the seasonal prediction result.
[0061] The fusion output module is used to fuse the trend prediction results and the seasonal prediction results to obtain a fusion result, and to perform inverse normalization on the fusion result to obtain the photovoltaic power generation prediction value within the future prediction window.
[0062] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:
[0063] This invention provides a photovoltaic power prediction method and system based on a dual-branch state space. The method first acquires multivariate photovoltaic power generation time series data within a preset historical input window, and then performs normalization and trend-seasonal decomposition on the multivariate photovoltaic power generation time series data before prediction, so that the input series is decomposed into a trend term reflecting the overall change direction of photovoltaic power generation and a seasonal term reflecting periodic disturbances, weather disturbances and local fluctuations. Secondly, this invention does not mix trend changes, seasonal fluctuations, and multivariate coupling relationships into a single prediction backbone. Instead, it inputs the trend term and seasonal term into the trend prediction branch and seasonal prediction branch of the photovoltaic power generation prediction model, respectively. The trend prediction branch performs bidirectional state-space modeling on the trend term, extracting bidirectional time dependency information of the trend term within the historical input window. The seasonal prediction branch performs patch embedding on the seasonal term, and sequentially performs time patch-dimensional bidirectional state-space modeling, variable channel-dimensional bidirectional state-space modeling, and two-dimensional time-varying fusion processing within the two-dimensional joint bidirectional state-space backbone. This allows the seasonal prediction process to simultaneously consider the time dependency relationship of the same variable channel between different time patches, the collaborative change relationship between different variable channels at the same time patch position, and the two-dimensional local neighborhood relationship formed by the time patch dimension and the variable channel dimension. Therefore, compared to existing methods that directly perform unified modeling of the original multivariate sequence, which easily leads to mutual interference between trend information, local fluctuation information, and variable coupling information, this application can respectively enhance the expressive power of trend changes and seasonal fluctuations, and improve the stability and accuracy of photovoltaic power generation prediction results in scenarios with long historical windows and long prediction step sizes.
[0064] This invention provides a photovoltaic power prediction method based on a dual-branch state space. Its seasonal prediction branch performs patching and two-dimensional joint modeling on seasonal terms through a channel patch embedding layer, a two-dimensional joint bidirectional state space backbone, and a seasonal output mapping layer. It can first capture the temporal dependency relationship between different time patches of each variable channel along the time patch dimension, and then capture the cross-variable coupling relationship between different variables at the same time patch position along the variable channel dimension. Thus, while maintaining the stability of the time series structure of each variable, it introduces the information interaction capability between different variable channels, taking into account both the stability of independent channel modeling and the variable collaborative expression capability of mixed channel modeling.
[0065] This invention provides a photovoltaic power prediction method based on a dual-branch state space. Its two-dimensional joint modeling layer updates the seasonal patch features step by step through layer normalization, time patch-dimensional state space modeling, variable channel-dimensional state space modeling, two-dimensional time-varying fusion, and residual fusion. It can perceive the local joint patterns between adjacent time slices and adjacent variables on the two-dimensional feature plane composed of the time patch dimension and the variable channel dimension, thus making up for the problem of insufficient expression of two-dimensional local structure when only a pure sequence state space module is used.
[0066] This invention provides a photovoltaic power prediction method based on a dual-branch state space. During the training process, the photovoltaic power prediction model determines the quality of training samples based on the proportion of effective photovoltaic power sampling points within the training input window and filters the training samples. This reduces the impact of nighttime or near-zero power windows on model parameter updates during the training phase, preventing the model from overlearning output patterns close to zero. The model then focuses more on the prediction patterns of photovoltaic power generation during effective power generation periods, influenced by weather, environment, equipment status, and time cycles. This improves the prediction accuracy and stability of the photovoltaic power prediction model during effective power generation periods. Attached Figure Description
[0067] Figure 1 This is a flowchart illustrating the photovoltaic power prediction method based on a dual-branch state space provided in an embodiment of the present invention.
[0068] Figure 2 This is a schematic diagram of the overall structure of the photovoltaic power generation prediction model provided in an embodiment of the present invention;
[0069] Figure 3 A schematic diagram illustrating the processing procedure of the trend prediction branch provided in an embodiment of the present invention;
[0070] Figure 4 A schematic diagram illustrating the processing procedure of the seasonal prediction branch provided in an embodiment of the present invention;
[0071] Figure 5 This is a schematic diagram of a two-dimensional joint modeling layer structure provided in an embodiment of the present invention;
[0072] Figure 6 This is a comparison chart of prediction results for photovoltaic power prediction tasks according to embodiments of the present invention;
[0073] Figure 7 This is a schematic diagram of the structure of a photovoltaic power prediction system based on a dual-branch state space provided in an embodiment of the present invention. Detailed Implementation
[0074] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.
[0075] Example 1
[0076] like Figure 1 As shown in the figure, this embodiment of the invention introduces a photovoltaic power prediction method based on a dual-branch state space, including:
[0077] S1: Obtain multivariate photovoltaic power generation time series data within the preset historical input window;
[0078] S2: Normalize and decompose the multivariate photovoltaic power generation time series data in sequence to obtain the trend term and seasonal term;
[0079] S3: Input the trend term and seasonal term into the pre-trained photovoltaic power generation prediction model to obtain the trend prediction result and the seasonal prediction result. The photovoltaic power generation prediction model includes a trend prediction branch and a seasonal prediction branch. The trend prediction branch is used to perform bidirectional state space modeling on the trend term to obtain the trend prediction result. The seasonal prediction branch is used to perform patch embedding on the seasonal term to obtain the seasonal term patch features. The seasonal term patch features are then subjected to time patch dimension bidirectional state space modeling, variable channel dimension bidirectional state space modeling and two-dimensional time-varying fusion processing in sequence through the two-dimensional joint bidirectional state space backbone to obtain the seasonal prediction result.
[0080] S4: The trend forecast results and seasonal forecast results are fused to obtain the fused result, and the fused result is inversely normalized to obtain the photovoltaic power generation forecast value within the future forecast window.
[0081] In this embodiment, step S1: Obtain multivariate photovoltaic power generation time series data within a preset historical input window; in a single prediction scenario, the multivariate photovoltaic power generation time series data can be represented as... In batch training or batch prediction implementations, the multivariate photovoltaic power generation time series data can also be extended to represent as follows: ;
[0082] Where B represents the batch sample size, L represents the window length of the preset historical input window, and C represents the number of variable channels. Multivariate photovoltaic power generation time series data includes a target variable and several exogenous variables related to the target variable. The target variable is photovoltaic power generation data, and the exogenous variables include meteorological variables, environmental variables, photovoltaic equipment sensor variables, and time variables. Each target variable and each exogenous variable corresponds to one variable channel.
[0083] Specifically, meteorological variables include total irradiance, diffuse irradiance, ambient temperature, relative humidity, wind speed, and wind direction; environmental variables include ambient temperature, module temperature, and weather condition codes; photovoltaic equipment sensor variables may include inverter status, equipment temperature, and operating status parameters; and time variables may include hourly, daily, weekly, or annual periodic features constructed from timestamps. These variables, aligned according to timestamps, form multivariate photovoltaic power generation time series data, enabling the target variable and all exogenous variables at the same sampling time to be used together for predicting photovoltaic power generation within the future prediction window.
[0084] In this embodiment, before step S2 and before trend-seasonal decomposition, preprocessing of the multivariate photovoltaic power generation time series data is required:
[0085] S121: Handling missing values in multivariate photovoltaic power generation time series data;
[0086] Specifically, the photovoltaic power generation data and each exogenous variable in the multivariate photovoltaic power generation time series data are sorted according to timestamps, and the data other than the timestamps are converted into numerical format; data that cannot be converted into numerical format is marked as null. If the missing rate of a certain exogenous variable exceeds a preset missing rate threshold, the exogenous variable can be removed; if a certain variable has a small number of missing values, methods such as forward imputation, backward imputation, linear interpolation, mean imputation, or interpolation between adjacent time points can be used to handle missing values.
[0087] S122: Perform correlation calculations on the target variable and each exogenous variable in the multivariate photovoltaic power generation time series data after missing value processing, obtain the correlation results of each exogenous variable, and use the exogenous variables whose correlation results meet the preset correlation conditions as the filtered exogenous variables;
[0088] Specifically, in one embodiment, the correlation calculation function can be the Spearman correlation calculation function, and the preset correlation condition is set to the absolute value of the correlation result being greater than or equal to the preset correlation threshold: since some exogenous variables may be negatively correlated with photovoltaic power generation data, but can still reflect the change law of photovoltaic power generation, the absolute value of the correlation result can be used to filter and retain exogenous variables with predictive value among both positive and negative correlated variables.
[0089] S123: Constructing periodic time features based on the timestamps of photovoltaic power generation data;
[0090] Furthermore, the hour and month values corresponding to the sampling time are extracted from the timestamp, and periodic time features are constructed based on the hour and month values. Let the hour value corresponding to a certain sampling time be... Month value Then, the following periodic time feature can be constructed:
[0091] ;
[0092] ;
[0093] ;
[0094] ;
[0095] in, and These represent the sinusoidal and cosine positional characteristics of the sampling moment within a one-day cycle, respectively. and These represent the sine and cosine position characteristics of the sampling time within a yearly month cycle, respectively. By converting the hour and month values into sine and cosine forms, the problem of discontinuity at the cycle boundary caused by directly using discrete time values can be avoided.
[0096] S124: Align and combine the photovoltaic power generation data, the selected exogenous variables, and the periodic time features according to the timestamps to obtain the preprocessed multivariate photovoltaic power generation time series data.
[0097] Specifically, each row of data corresponding to each sampling time includes the filtered exogenous variables, periodic time features, and target variables. After multiple rows are arranged in chronological order, they form preprocessed multivariate photovoltaic power generation time series data.
[0098] In this embodiment, step S2: Normalize and perform trend-seasonal decomposition on the multivariate photovoltaic power generation time series data sequentially to obtain the trend term and seasonal term, specifically including:
[0099] S21: Normalization process:
[0100] Based on the preset historical input window, the window mean and window standard deviation of each variable channel in the preprocessed multivariate photovoltaic power generation time series data are statistically analyzed along the time dimension.
[0101] Based on the window mean and window standard deviation of each variable channel, the preprocessed multivariate photovoltaic power generation time series data is normalized to obtain the normalized input sequence.
[0102] Specifically, for preprocessed multivariate photovoltaic power generation time series data The window mean corresponding to the c-th variable channel Represented as:
[0103] ;
[0104] The window standard deviation corresponding to the c-th variable channel Represented as:
[0105] ;
[0106] Where ε is a positive number, used to avoid division by zero when the window standard deviation is zero. Based on the window mean and window standard deviation corresponding to each variable channel, This represents the value corresponding to the c-th variable channel at the t-th sampling time in the multivariate photovoltaic power generation time series data;
[0107] The preprocessed multivariate photovoltaic power generation time series data is normalized to obtain the normalized input sequence. The normalized value of the c-th variable channel at the t-th sampling time in the normalized input sequence. :
[0108] ;
[0109] S22: Trend-Seasonal Breakdown:
[0110] The trend term is obtained by performing a moving average on the normalized input sequence.
[0111] Specifically, before the moving average processing, the sequence boundaries of the normalized input sequence can be copied and padded. Let the window length for the moving average processing be K. The initial sample value can be copied at the beginning of the normalized input sequence, and the final sample value can be copied at the end, ensuring that the moving average processing still has a complete window input at the sequence boundaries. Subsequently, the moving average processing is performed on the copied and padded normalized input sequence to obtain the trend term T.
[0112] The seasonal term S is obtained by calculating the difference between the normalized input sequence and the trend term.
[0113] Specifically, the trend term is used to characterize the smoothed change component in multivariate photovoltaic power generation time series data, while the seasonal term is used to characterize the periodic fluctuation component and local disturbance component that change around the trend term.
[0114] In this embodiment, step S3: input the trend term and seasonal term into the pre-trained photovoltaic power generation prediction model to obtain the trend prediction result and the seasonal prediction result;
[0115] like Figure 2As shown, the photovoltaic power generation prediction model includes a trend prediction branch and a seasonal prediction branch; the trend prediction branch includes a bidirectional state space modeling unit and a trend output mapping layer arranged in sequence; the bidirectional state space modeling unit includes a forward state space modeling branch and a reverse state space modeling branch arranged in parallel; the seasonal prediction branch includes a channel patch embedding layer, a two-dimensional joint bidirectional state space backbone and a seasonal output mapping layer connected in sequence.
[0116] Specifically, such as Figure 3 As shown, the processing steps for the trend prediction branch include:
[0117] Map the trend sequence of each variable channel in the trend term T to a latent space of a preset dimension to obtain the trend feature sequence;
[0118] The trend feature sequence is input into the positive state space modeling branch to obtain the positive trend features;
[0119] The trend feature sequence is flipped along the time dimension and then input into the reverse state space modeling branch. The output of the reverse state space modeling branch is then flipped back to the original time order to obtain the reverse trend feature.
[0120] The positive and negative trend features are fused together, and the fused trend features are mapped to the prediction window length through a trend output mapping layer to obtain the trend prediction result.
[0121] Specifically, in this implementation, the bidirectional state-space modeling unit in the trend prediction branch can be implemented using a bidirectional Mamba module.
[0122] Positive trend characteristics: ;
[0123] in, This represents the Mamba processing function corresponding to the forward state-space modeling branch. This represents a sequence of trend characteristics.
[0124] Reverse trend characteristics: ;
[0125] ;
[0126] in, This indicates a flip operation along the sequence dimension; This represents the output of the inverse state-space modeling branch; This represents the Mamba processing function corresponding to the inverse state space modeling branch; This represents the trend feature sequence after the reversal.
[0127] Specifically, such as Figure 4 The processing steps for the seasonal forecast branch shown include:
[0128] The seasonal item S is input into the channel patch embedding layer, the seasonal item is adjusted to the channel-first form, and the seasonal item in the channel-first form is patched, feature-mapped and position-encoded along the time axis to obtain the seasonal item patch features;
[0129] The seasonal item patch features are input into the two-dimensional joint bidirectional state space backbone. Through the two-dimensional joint modeling layer in the two-dimensional joint bidirectional state space backbone, the seasonal item patch features are sequentially subjected to time patch dimension bidirectional state space modeling, variable channel dimension bidirectional state space modeling and two-dimensional time-varying fusion processing to obtain the updated seasonal item patch features.
[0130] The updated seasonal item patch features are mapped to the prediction window length through the seasonal output mapping layer to obtain the seasonal prediction result.
[0131] The channel patch embedding layer is used to adjust the seasonal items to a channel-priority format. Specifically, the seasonal items are adjusted from a data format with the time dimension first and the variable channel dimension last to a data format with the variable channel dimension first and the time dimension last, so that each variable channel corresponds to a seasonal item sequence arranged in chronological order. The seasonal items in the channel-priority format are then patched, feature-mapped, and position-encoded along the time axis to obtain the seasonal item patch features.
[0132] The seasonal term S is converted to a channel-major form, resulting in Sc, such that each variable channel corresponds to a seasonal time series of length L=96. Subsequently, each variable channel is patched along the time dimension. Let the patch length be L. The patch splitting step size is =4, then the number of time patches At this point, each patch contains a local seasonal term fragment spanning 24 consecutive time steps; if this patch is further transformed through a linear mapping... Each patch fragment is represented as a 64-dimensional feature vector after linear mapping, and the corresponding positional encoding is superimposed to preserve the temporal position information of the patch within the original historical input window. Thus, the original 96-dimensional time series is compressed into 19 patch features, preserving the morphological information of local seasonal fluctuations while reducing the effective sequence length of the subsequent two-dimensional joint bidirectional state space backbone. This improves the processing efficiency of subsequent time patch-dimensional bidirectional state space modeling and variable channel-dimensional bidirectional state space modeling.
[0133] Furthermore, to adapt to the input format of the subsequent two-dimensional joint bidirectional state space backbone, the seasonal term patch feature is changed from... Rearranged as Then, the two-dimensional joint bidirectional state space backbone is input for subsequent processing. Here, B represents the number of batch input windows, N represents the number of time patches, and C represents the number of variable channels. This indicates the dimension of the patch features.
[0134] Specifically, the two-dimensional joint bidirectional state space backbone includes at least one two-dimensional joint modeling layer, and let the total number of two-dimensional joint modeling layers be . , No. The input of the two-dimensional joint modeling layer is ,in, .when hour, The seasonal patch features are output from the channel patch embedding layer and rearranged, and their tensor form is: .
[0135] like Figure 5 As shown, each two-dimensional joint modeling layer includes a first-layer normalization unit, a time-patch dimensional state-space modeling sublayer, a first residual unit, a second-layer normalization unit, a variable-channel dimensional state-space modeling sublayer, a second residual unit, a third-layer normalization unit, a two-dimensional time-varying fusion sublayer, and a third residual unit.
[0136] For the The two-dimensional joint modeling layer first patches the seasonal features of the input through the first-layer normalization unit. Layer normalization is performed to obtain the first normalized feature. Subsequently, a time-patch-dimensional state-space modeling sublayer is used to perform bidirectional state-space modeling on multiple time patches corresponding to the same variable channel in the first normalized feature, resulting in time-patch-dimensional modeled features. That is, for the same variable channel, the time-patch-dimensional state-space modeling sublayer reads the seasonal patch features of that variable channel at different time patch positions along the time patch dimension to extract the bidirectional temporal dependency between different time patches.
[0137] Furthermore, the time-patch dimensional modeling features are combined with the input dimensional features through the first residual unit. Seasonal Patch Features of Two-Dimensional Joint Modeling Layer Residual fusion is performed to obtain the first fused feature. This residual fusion can retain the original seasonal patch features of the input two-dimensional joint modeling layer while introducing time patch dimension modeling information, thus reducing information loss during feature update.
[0138] Then, the first fused feature is normalized using a second-level normalization unit to obtain the second normalized feature. Subsequently, a variable channel-dimensional state space modeling sublayer is used to perform bidirectional state space modeling on multiple variable channels corresponding to the same time patch position in the second normalized feature as a variable channel sequence, resulting in variable channel-dimensional modeling features. That is, for the same time patch position, the variable channel-dimensional state space modeling sublayer reads the seasonal patch features corresponding to variable channels such as photovoltaic power generation data, meteorological variables, environmental variables, photovoltaic equipment sensor variables, and time variables along the variable channel dimension to extract the cross-variable coupling relationship between different variable channels at the same time patch position.
[0139] Furthermore, the variable channel dimension modeling features are residually fused with the first fused features through the second residual unit to obtain the second fused features. This residual fusion can retain the feature expression after time patch dimension modeling while introducing variable channel dimension coupling information, thus avoiding the weakening of the time patch dimension dependency information obtained in the previous stage during the variable channel dimension modeling process.
[0140] Then, the second fused feature is normalized using a third-layer normalization unit to obtain the third normalized feature. Subsequently, a two-dimensional time-varying fusion sublayer is used to perform local neighborhood fusion processing on the third normalized feature on the two-dimensional feature plane formed by the time patch dimension and the variable channel dimension, resulting in the two-dimensional time-varying fused feature. In this process, the time patch dimension and the variable channel dimension together constitute... The two-dimensional feature plane. The two-dimensional time-varying fusion sublayer is used to fuse the local joint information between adjacent time patches and adjacent variable channels on this two-dimensional feature plane, so that the two-dimensional time-varying fusion features not only contain the dependencies in the sequence dimension, but also can characterize the joint change pattern formed by the coupling of local time changes and local variables.
[0141] The two-dimensional time-varying fusion sublayer employs a two-dimensional feature fusion method to fuse local neighborhood information of the seasonal patch features after modeling the variable channel dimension state space. Specifically, the third normalized feature is mapped to a two-dimensional feature plane composed of the time patch dimension and the variable channel dimension. Local correlation features are extracted along the time patch direction and the variable channel direction in the two-dimensional feature plane, and the extracted local correlation features are fused to obtain the two-dimensional time-varying fusion feature. In one specific implementation, the two-dimensional time-varying fusion sublayer can employ two-dimensional depthwise separable convolution.
[0142] Furthermore, the two-dimensional time-varying fusion feature is residually fused with the second fusion feature through the third residual unit to obtain the second residual feature. Updated seasonality patch features output from the two-dimensional co-modeling layer When the two-dimensional joint bidirectional state space backbone includes multiple two-dimensional joint modeling layers, the first... Updated seasonality patch features output from the two-dimensional co-modeling layer As the first The input of the +1 layer of the two-dimensional joint modeling layer is used to repeat the above process until the first layer is obtained. Updated seasonality patch features output from the two-dimensional co-modeling layer .
[0143] Therefore, the two-dimensional joint bidirectional state space backbone can first capture the temporal dependencies of each variable channel between different time patches along the time patch dimension, and then capture the cross-variable coupling relationships between different variables at the same time patch position along the variable channel dimension. Furthermore, it uses two-dimensional time-varying fusion processing to perceive local joint patterns in both the time patch and variable channel dimensions, thus obtaining a more expressive updated seasonal item patch feature. Subsequently, the seasonal output mapping layer can be based on the updated seasonal item patch feature output by the last two-dimensional joint modeling layer. This is mapped to the prediction window length to obtain the seasonal prediction results.
[0144] In this embodiment, step S4: The trend forecast result and the seasonal forecast result are fused to obtain a fused result, and the fused result is denormalized to obtain the photovoltaic power generation forecast value within the future forecast window, including...
[0145] The trend forecast results and seasonal forecast results are fused together to obtain the fused result in the normalized space.
[0146] Specifically, the trend forecast results are used to characterize the overall trend of photovoltaic power generation within the future forecast window, while the seasonal forecast results are used to characterize the periodic fluctuations and local disturbances around the trend within the future forecast window. By integrating the two, we can comprehensively utilize long-term change patterns and short-term fluctuation information to improve the ability of the forecast results to characterize the dynamic change process of photovoltaic power generation.
[0147] Since the above fusion results are still in the normalized data space, it is necessary to perform inverse normalization on the fusion results based on the window mean and window standard deviation corresponding to the target variable saved in the normalization process, so that the prediction results are restored to the actual dimensions of photovoltaic power generation.
[0148] Through the above processing, the long-term variation characteristics of the trend prediction branch output and the periodic variation characteristics of the seasonal prediction branch output are fused and restored to the actual power scale, thereby obtaining the photovoltaic power generation prediction results for continuous moments within the future prediction window.
[0149] In this embodiment, the pre-trained photovoltaic power generation prediction model is trained in the following manner:
[0150] Obtain a historical multivariate photovoltaic power generation time series dataset and construct training samples based on a sliding window. The training samples include a training input window and a training prediction window corresponding to the training input window.
[0151] The quality of the training samples is determined based on the proportion of valid photovoltaic power sampling points within the training input window; where valid photovoltaic power sampling points are those where the photovoltaic power output is greater than the preset power tolerance.
[0152] The training samples are filtered based on their quality to obtain the target training sample set;
[0153] The training input windows of each training sample in the target training sample set are normalized and decomposed in sequence to obtain the training trend term and the training seasonal term.
[0154] Input the training trend term and training seasonal term into the photovoltaic power generation prediction model to be trained to obtain the training trend prediction result and the training seasonal prediction result.
[0155] The training trend prediction results and the training seasonal prediction results are fused together to obtain the training fusion result. The training fusion result is then inversely normalized to obtain the training photovoltaic power generation prediction value.
[0156] The training loss is calculated based on the training photovoltaic power generation prediction value and the real photovoltaic power generation data corresponding to the training prediction window. The model parameters of the photovoltaic power generation prediction model to be trained are updated according to the training loss to obtain the pre-trained photovoltaic power generation prediction model.
[0157] In this embodiment, when filtering training samples based on sample quality, the number of valid power generation sampling points within the training input window corresponding to each training sample is first counted. The sample quality of the training sample is then determined based on the proportion of valid power generation sampling points to the total number of sampling points within the training input window. Valid power generation sampling points refer to sampling points where the photovoltaic power generation at the corresponding sampling time is greater than a preset power tolerance. By statistically analyzing the proportion of valid power generation sampling points, it can be determined whether the current training sample contains sufficient data on effective daytime power generation.
[0158] Furthermore, the training samples are screened according to preset sample quality judgment criteria. When the proportion of effective power generation sampling points in a training sample is high, it indicates that the training sample contains sufficient information on photovoltaic power generation variation, and the training sample is identified as the target training sample and retained. When the proportion of effective power generation sampling points in a training sample is low, it indicates that the training sample mainly consists of near-zero power data under nighttime or low irradiance conditions. Such training samples contribute little to the learning of photovoltaic power generation variation patterns, and therefore are filtered out.
[0159] In one specific implementation, for a training input window composed of historical photovoltaic power generation data sampled within a day, when the number of effective power generation sampling points reaches a preset proportion, the corresponding training input window is used as a valid training sample; when the number of effective power generation sampling points does not reach the preset proportion, the training input window is determined to be a low-quality training sample and is removed from the training sample set. This method reduces the adverse impact of a large amount of near-zero power data at night on the model parameter update process, allowing the model training process to focus more on the power change patterns within the effective power generation period, and improving the photovoltaic power generation prediction model's ability to learn from the actual photovoltaic output change characteristics.
[0160] Example 2
[0161] To verify the effectiveness of the photovoltaic power prediction method based on a dual-branch state space introduced in Example 1, this example compares the method of the present invention with existing long-sequence time prediction models based on an actual photovoltaic power generation prediction task:
[0162] Specifically, historical photovoltaic (PV) power generation operation data is selected as the experimental dataset. This historical PV power generation operation data includes PV power generation data and multivariate exogenous data related to changes in PV power generation. Based on the aforementioned historical data, model input data is constructed according to a preset historical input window length and a prediction window length. The historical input window length is set to 96 sampling times, and the prediction window length is also set to 96 sampling times. That is, the PV power generation at the next 96 sampling times is predicted using data from 96 consecutive historical sampling times.
[0163] In this embodiment, the photovoltaic power prediction method based on a dual-branch state space provided in Embodiment 1 of the present invention is compared with existing long-sequence time prediction models PatchTST (Patch Time Series Transformer) and iTransformer (Inverted Transformer). Each comparison model employs a multivariate input, single-variable output prediction approach; that is, the input includes photovoltaic power generation data and multiple exogenous variables, and the output is the photovoltaic power generation prediction result within the future prediction window.
[0164] To evaluate the predictive performance of different prediction models, mean absolute error (MAE) and root mean square error (RMSE) were used as evaluation metrics. MAE measures the average deviation between predicted and actual values, while RMSE measures the overall fluctuation of prediction error and the impact of larger error samples on the prediction results. A smaller evaluation metric indicates higher model prediction accuracy.
[0165] The experimental results are shown in Table 1.
[0166] Table 1 Comparison of Evaluation Indicators for Predictive Models
[0167]
[0168] As shown in Table 1, compared to PatchTST and iTransformer, the method provided in this embodiment of the invention achieves superior results in both MAE and RMSE metrics. Specifically, this method employs bidirectional state-space modeling of the trend term through a trend prediction branch, enabling the model to simultaneously utilize contextual information from different directions within the historical window, thus enhancing its ability to characterize the long-term trend of photovoltaic power generation. Simultaneously, through bidirectional state-space modeling in the time patch dimension and variable channel dimension within the seasonal prediction branch, along with two-dimensional time-varying fusion processing, the model can simultaneously learn the changing patterns between time patches, the coupling relationships between different variables, and local joint change characteristics. Therefore, compared to existing prediction models based solely on single-dimensional time or variable modeling, this method achieves more accurate and stable prediction results.
[0169] Furthermore, to verify the impact of each component module in the method of this invention on the prediction performance, this embodiment further conducts an ablation experiment. Specifically, while keeping other structures unchanged, the low-quality sample filtering module, the bidirectional state-space modeling module in the trend prediction branch, the time patch dimension bidirectional state-space modeling module in the seasonal prediction branch, the variable channel dimension bidirectional state-space modeling module, and the two-dimensional time-varying fusion module are removed respectively, and the prediction performance of the corresponding models is tested respectively.
[0170] The experimental results are shown in Table 2.
[0171] Table 2 Ablation Experiment Results of the Method of the Present Invention
[0172] 1 Low-quality sample removal filter module 0.4909 0.9264 2 The trend prediction branch uses MLP instead of bidirectional state-space modeling. 0.3521 0.5687 3 Remove the two-dimensional time-varying fusion module 0.3797 0.6287 4 Remove variable channel dimension bidirectional state space modeling module 0.4162 0.9339 5 Remove time patch dimensional bidirectional state space modeling module 0.2939 0.5703 6 Complete model 0.3157 0.4903
[0173] As shown in Table 2, the model prediction error increased significantly after removing the low-quality sample filtering module. This indicates that samples at night or near-zero power will interfere with the model parameter optimization process. However, by screening the training sample quality, the impact of invalid samples on the model learning process can be reduced, making the model pay more attention to the changing patterns of the effective power generation stage.
[0174] When the bidirectional state-space modeling module in the trend prediction branch is replaced by MLP, the model prediction performance deteriorates, indicating that the long-term change patterns contained in the trend term cannot be fully expressed by simple nonlinear mapping alone. Bidirectional state-space modeling can utilize the information correlation between the forward and backward directions of the trend sequence to improve the modeling ability of low-frequency change trends.
[0175] The performance of the model deteriorated more significantly after the variable channel dimension bidirectional state space modeling module was removed. This indicates that the change in photovoltaic power generation is not only related to its own historical changes, but is also affected by multiple variables such as meteorological variables, environmental variables, and equipment operating status. Variable channel dimension modeling can effectively extract the coupling relationship between different variables and improve the prediction accuracy under complex weather conditions.
[0176] When the time-patch bidirectional state-space modeling module is removed, although the MAE index decreases in some cases, the RMSE index increases significantly. This indicates that the module can effectively reduce the cumulative error in long prediction windows and the large error under sudden fluctuations, thereby improving the model's prediction stability.
[0177] The model performance also decreased after the two-dimensional time-varying fusion module was removed, indicating that relying solely on state space modeling in the two directions of time patch dimension and variable channel dimension is insufficient to fully express the two-dimensional local change relationship formed by the time patch and variable channel. The two-dimensional time-varying fusion can further enhance the ability to express local joint features.
[0178] Therefore, the method provided by the embodiments of the present invention improves the effectiveness of training data by filtering low-quality training samples, enhances the ability to model long-term change trends by using the trend prediction branch, and enhances the expressive ability of time dependence, variable coupling relationship and local joint mode by using the bidirectional state space modeling and two-dimensional joint fusion mechanism in the seasonal prediction branch, so that the model has higher prediction accuracy and better stability in long-sequence photovoltaic power generation prediction tasks.
[0179] Figure 6 The figure shows the prediction results of the photovoltaic power prediction task in the embodiment of the present invention. The horizontal axis represents the time step and the vertical axis represents the photovoltaic power generation. The figure is divided by the prediction starting point. The left area corresponds to the historical input stage and is used to represent the historical window data input to the photovoltaic power generation prediction model. The right area corresponds to the prediction stage and is used to represent the process by which the model generates the photovoltaic power generation prediction results in the future prediction window based on the historical input window.
[0180] Specifically, in the figure, the "True Value" curve represents the actual photovoltaic power generation change curve collected within the future prediction window, and the "Predicted Value" curve represents the photovoltaic power generation prediction curve output by the method provided in this embodiment of the invention. Figure 6 It can be seen that after entering the prediction stage, the predicted value curve can follow the changing trend of the actual value curve well. It can maintain a high degree of consistency in the rapid rise of photovoltaic power, the peak holding stage and the power decline stage, indicating that the method of the present invention can effectively capture the trend characteristics and periodic fluctuation characteristics of photovoltaic power generation over time.
[0181] Furthermore, the local changes in the prediction curve show that when photovoltaic power changes rapidly or fluctuates locally, the predicted value can respond promptly to the actual power change trend, reducing the deviation between the predicted and actual results. This indicates that modeling the long-term trend through the trend prediction branch and jointly modeling the time patch dimension change law and the correlation between variable channels through the seasonal prediction branch can improve the stability and accuracy of photovoltaic power generation prediction under a long prediction window.
[0182] In summary, this invention reduces the interference of nighttime or near-zero power samples on the model parameter optimization process through sample quality filtering during the training phase; improves the model's ability to represent the long-term trend of photovoltaic power generation through bidirectional state-space modeling in the trend prediction branch; enhances the model's ability to extract multivariate coupling relationships and temporal variation patterns through bidirectional state-space modeling in the variable channel dimension and time patch dimension in the seasonal prediction branch; and further improves the model's ability to perceive the local joint change features of the time patch dimension and variable channel dimension through two-dimensional time-varying fusion processing. Therefore, the method of this invention can balance prediction accuracy and prediction stability in long-sequence photovoltaic power generation prediction tasks.
[0183] Example 3
[0184] This embodiment provides a photovoltaic power prediction system based on a dual-branch state space, used to implement the photovoltaic power prediction method based on a dual-branch state space in Embodiment 1, such as... Figure 7 As shown, it includes:
[0185] The data acquisition module is used to acquire multivariate photovoltaic power generation time series data within a preset historical input window;
[0186] The decomposition processing module is used to perform normalization and trend-seasonal decomposition on the multivariate photovoltaic power generation time series data in sequence to obtain trend and seasonal terms.
[0187] The prediction module is used to input the trend term and the seasonal term into a pre-trained photovoltaic power generation prediction model to obtain trend prediction results and seasonal prediction results. The photovoltaic power generation prediction model includes a trend prediction branch and a seasonal prediction branch. The trend prediction branch is used to perform bidirectional state-space modeling on the trend term to obtain the trend prediction result. The seasonal prediction branch is used to perform patch embedding on the seasonal term to obtain seasonal term patch features, and then sequentially performs time patch dimension bidirectional state-space modeling, variable channel dimension bidirectional state-space modeling, and two-dimensional time-varying fusion processing on the seasonal term patch features through a two-dimensional joint bidirectional state-space backbone to obtain the seasonal prediction result.
[0188] The fusion output module is used to fuse the trend prediction results and the seasonal prediction results to obtain a fusion result, and to perform inverse normalization on the fusion result to obtain the photovoltaic power generation prediction value within the future prediction window.
[0189] The specific functions of each module described above are explained in the relevant content of the method in Embodiment 1, and will not be repeated here.
[0190] Example 4
[0191] This embodiment provides a computer-readable storage medium storing a computer program that, when executed, implements the photovoltaic power prediction method based on a dual-branch state space as described in Embodiment 1.
[0192] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0193] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0194] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0195] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. A photovoltaic power prediction method based on a dual-branch state space, characterized in that, include: Obtain multivariate photovoltaic power generation time series data within a preset historical input window; The multivariate photovoltaic power generation time series data were subjected to normalization and trend-seasonal decomposition in sequence to obtain the trend term and seasonal term; The trend term and the seasonal term are input into a pre-trained photovoltaic power generation prediction model to obtain trend prediction results and seasonal prediction results. The photovoltaic power generation prediction model includes a trend prediction branch and a seasonal prediction branch. The trend prediction branch is used to perform bidirectional state space modeling on the trend term to obtain the trend prediction result. The seasonal prediction branch is used to perform patch embedding on the seasonal term to obtain seasonal term patch features. The seasonal term patch features are then subjected to time patch dimension bidirectional state space modeling, variable channel dimension bidirectional state space modeling, and two-dimensional time-varying fusion processing sequentially through a two-dimensional joint bidirectional state space backbone to obtain the seasonal prediction result. The trend prediction results and the seasonal prediction results are fused to obtain a fused result, and the fused result is inversely normalized to obtain the photovoltaic power generation prediction value within the future prediction window. The trend prediction branch includes a bidirectional state space modeling unit and a trend output mapping layer arranged sequentially; the bidirectional state space modeling unit includes a forward state space modeling branch and a reverse state space modeling branch arranged in parallel; The trend prediction branch is used to perform bidirectional state-space modeling on the trend term to obtain the trend prediction result, including: The trend sequence corresponding to each variable channel in the trend item is mapped to a latent space of a preset dimension to obtain a trend feature sequence; The trend feature sequence is input into the positive state space modeling branch to obtain the positive trend features; The trend feature sequence is flipped along the time dimension and then input into the reverse state space modeling branch. The output of the reverse state space modeling branch is then flipped back to the original time order to obtain the reverse trend feature. The positive trend features and the negative trend features are fused together, and the fused trend features are mapped to the prediction window length through the trend output mapping layer to obtain the trend prediction result; The seasonal prediction branch includes a channel patch embedding layer, a two-dimensional joint bidirectional state space backbone, and a seasonal output mapping layer connected in sequence. The channel patch embedding layer is used to adjust the seasonal item into a channel-priority form, and to perform patch segmentation, feature mapping and position encoding on the seasonal item in the channel-priority form along the time axis to obtain the seasonal item patch features; The two-dimensional joint bidirectional state space backbone includes at least one two-dimensional joint modeling layer. The two-dimensional joint modeling layer is used to perform time patch dimension bidirectional state space modeling, variable channel dimension bidirectional state space modeling, and two-dimensional time-varying fusion processing on the input seasonal item patch features to obtain the updated seasonal item patch features. The seasonal output mapping layer is used to map the updated seasonal item patch features of the output of the two-dimensional joint bidirectional state space backbone to the prediction window length to obtain the seasonal prediction result. The two-dimensional joint modeling layer includes a first-layer normalization unit, a time-patch dimension state-space modeling sublayer, a first residual unit, a second-layer normalization unit, a variable channel dimension state-space modeling sublayer, a second residual unit, a third-layer normalization unit, a two-dimensional time-varying fusion sublayer, and a third residual unit, arranged sequentially. The two-dimensional joint modeling layer is used to perform time-patch dimension bidirectional state-space modeling, variable channel dimension bidirectional state-space modeling, and two-dimensional time-varying fusion processing on the input seasonal patch features to obtain updated seasonal patch features, including: The seasonal patch features input to the two-dimensional joint modeling layer are subjected to layer normalization processing by the first layer normalization unit to obtain the first normalized features; By using the time patch dimension state space modeling sub-layer, multiple time patches corresponding to the same variable channel in the first normalized feature are treated as time patch sequences for bidirectional state space modeling to obtain time patch dimension modeling features. The first residual unit performs residual fusion of the time patch dimension modeling feature and the seasonal term patch feature input to the two-dimensional joint modeling layer to obtain the first fused feature. The first fused feature is subjected to layer normalization processing by the second layer normalization unit to obtain the second normalized feature; By using the variable channel dimension state space modeling sub-layer, multiple variable channels corresponding to the same time patch position in the second normalized feature are used as variable channel sequences for bidirectional state space modeling to obtain variable channel dimension modeling features. The variable channel dimension modeling feature is residually fused with the first fusion feature by the second residual unit to obtain the second fusion feature; The second fused feature is subjected to layer normalization processing by the third normalization unit to obtain the third normalized feature; Through the two-dimensional time-varying fusion sublayer, the third normalized feature is subjected to local neighborhood fusion processing on the two-dimensional feature plane composed of the time patch dimension and the variable channel dimension to obtain the two-dimensional time-varying fusion feature. The second fusion feature is residually fused with the two-dimensional time-varying fusion feature by the third residual unit to obtain the updated seasonal item patch feature.
2. The photovoltaic power prediction method based on a dual-branch state space according to claim 1, characterized in that, The multivariate photovoltaic power generation time series data includes a target variable and multiple exogenous variables related to the target variable; the target variable is photovoltaic power generation data; the exogenous variables include meteorological variables, environmental variables, photovoltaic equipment sensor variables, and time variables; wherein, the target variable and each of the exogenous variables correspond to a variable channel.
3. The photovoltaic power prediction method based on a dual-branch state space according to claim 2, characterized in that, Before performing normalization and trend-seasonal decomposition on the multivariate photovoltaic power generation time series data, the method further includes: Missing values were processed in the multivariate photovoltaic power generation time series data; The correlation between the target variable and each exogenous variable in the multivariate photovoltaic power generation time series data after missing values were processed was calculated to obtain the correlation results of each exogenous variable. The exogenous variables whose correlation results meet the preset correlation conditions were selected as the exogenous variables. A periodic time feature is constructed based on the timestamp of the photovoltaic power generation data. The photovoltaic power generation data, the filtered exogenous variables, and the periodic time features are aligned and combined according to timestamps to obtain preprocessed multivariate photovoltaic power generation time series data.
4. The photovoltaic power prediction method based on a dual-branch state space according to claim 3, characterized in that, Normalization includes: Based on a preset historical input window, the mean and standard deviation of the window corresponding to each variable channel in the preprocessed multivariate photovoltaic power generation time series data are statistically analyzed along the time dimension. Based on the window mean and window standard deviation corresponding to each variable channel, the preprocessed multivariate photovoltaic power generation time series data is normalized to obtain a normalized input sequence. The inverse normalization process includes: inverse normalizing the fusion results based on the window mean and window standard deviation corresponding to the target variable to obtain the predicted value of photovoltaic power generation.
5. The photovoltaic power prediction method based on a dual-branch state space according to claim 4, characterized in that, Trend-seasonal breakdown includes: The normalized input sequence is subjected to a moving average to obtain the trend term; The seasonal term is obtained based on the difference between the normalized input sequence and the trend term; Prior to the moving average processing, the sequence boundaries of the normalized input sequence are copied and padded.
6. The photovoltaic power prediction method based on a dual-branch state space according to claim 1, characterized in that, The pre-trained photovoltaic power generation prediction model is obtained through the following method: A historical multivariate photovoltaic power generation time series dataset is obtained, and training samples are constructed based on a sliding window. The training samples include a training input window and a training prediction window corresponding to the training input window. The quality of the training samples is determined based on the proportion of effective photovoltaic power sampling points within the training input window; wherein, the effective photovoltaic power sampling points are sampling points where the photovoltaic power is greater than a preset power tolerance. The training samples are filtered according to the sample quality to obtain the target training sample set; The training input windows of each training sample in the target training sample set are sequentially normalized and subjected to trend-seasonal decomposition to obtain the training trend term and the training seasonal term. The training trend term and the training seasonal term are input into the photovoltaic power generation prediction model to be trained to obtain the training trend prediction result and the training seasonal prediction result. The training trend prediction results and the training seasonal prediction results are fused together to obtain the training fusion result, and the training fusion result is inversely normalized to obtain the training photovoltaic power generation prediction value. The training loss is calculated based on the trained photovoltaic power generation prediction value and the real photovoltaic power generation data corresponding to the training prediction window, and the model parameters of the photovoltaic power generation prediction model to be trained are updated according to the training loss to obtain the pre-trained photovoltaic power generation prediction model.
7. A photovoltaic power prediction system based on a two-branch state space, used to execute the photovoltaic power prediction method based on a two-branch state space as described in any one of claims 1 to 6, characterized in that, include: The data acquisition module is used to acquire multivariate photovoltaic power generation time series data within a preset historical input window; The decomposition processing module is used to perform normalization and trend-seasonal decomposition on the multivariate photovoltaic power generation time series data in sequence to obtain trend and seasonal terms. The prediction module is used to input the trend term and the seasonal term into a pre-trained photovoltaic power generation prediction model to obtain trend prediction results and seasonal prediction results. The photovoltaic power generation prediction model includes a trend prediction branch and a seasonal prediction branch. The trend prediction branch is used to perform bidirectional state-space modeling on the trend term to obtain the trend prediction result. The seasonal prediction branch is used to perform patch embedding on the seasonal term to obtain seasonal term patch features, and then sequentially performs time patch dimension bidirectional state-space modeling, variable channel dimension bidirectional state-space modeling, and two-dimensional time-varying fusion processing on the seasonal term patch features through a two-dimensional joint bidirectional state-space backbone to obtain the seasonal prediction result. The fusion output module is used to fuse the trend prediction results and the seasonal prediction results to obtain a fusion result, and to perform inverse normalization on the fusion result to obtain the photovoltaic power generation prediction value within the future prediction window.
