An lstm photovoltaic power generation power prediction method and system fusing multi-modal data

By aligning multi-source time-series data and constructing a multi-input channel LSTM model, combined with domain adversarial training and reinforcement learning, the problems of accuracy and cross-regional adaptability in photovoltaic power generation prediction were solved, achieving high-precision photovoltaic power generation prediction.

CN121032279BActive Publication Date: 2026-02-17ZHEJIANG POST & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511517722.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-23
Publication Date
2026-02-17
Estimated Expiration
2045-10-23

AI Technical Summary

Technical Problem

Existing photovoltaic power generation forecasting methods rely on single meteorological data, making it difficult to integrate key monitoring parameters such as photovoltaic panel temperature and dust coverage. This limits forecast accuracy and reduces cross-regional generalization capabilities, failing to meet the real-time bidding requirements of the electricity market.

Method used

By aligning multi-source time-series data using a dynamic time warping algorithm, a multi-input channel LSTM prediction model is constructed. Combined with domain adversarial training and dual-reward reinforcement learning strategies, a cross-regional generalized photovoltaic power generation prediction model is generated.

Benefits of technology

It achieves high-precision and highly adaptable photovoltaic power generation prediction, and can dynamically optimize the model to adapt to data distribution and changes in economic factors in different regions, thereby improving the accuracy and applicability of the prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121032279B_ABST
    Figure CN121032279B_ABST
Patent Text Reader

Abstract

The application discloses a kind of fusion multimodal data's LSTM photovoltaic power generation power prediction method and system, method includes: according to historical meteorological data, historical photovoltaic monitoring data and corresponding historical power generation power data, generate spatiotemporal consistent multimodal training feature matrix;Based on multimodal training feature matrix, construct the LSTM prediction model of multiple input channels, output the pre-training model of cross-regional generalization;According to the real-time meteorological data of target area, current photovoltaic monitoring data and electricity price fluctuation curve, using double reward reinforcement learning strategy online updates pre-training model, output the power prediction model after dynamic optimization;Current time's meteorological data, photovoltaic monitoring data are input into the power prediction model after dynamic optimization, generate the photovoltaic power generation power prediction sequence of future preset time.Using the embodiment of the application, high-precision, strong adaptability photovoltaic power generation power prediction can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of photovoltaic power generation, and particularly relates to an LSTM photovoltaic power generation power prediction method and system fusing multi-modal data. BACKGROUND

[0002] With the increasing proportion of photovoltaic power generation in the energy structure, accurate prediction of photovoltaic power generation power is of great significance to power grid dispatching, power market transaction and new energy consumption. Traditional prediction methods mainly rely on single meteorological data or historical power generation data, and cannot effectively fuse key monitoring parameters such as photovoltaic panel temperature and surface dust coverage, resulting in limited prediction accuracy. At the same time, the existing LSTM model has poor adaptability to data distribution differences of photovoltaic power stations in different regions and poor cross-region generalization ability. In addition, conventional prediction methods do not consider economic factors such as price fluctuations and load demand, and cannot meet the real-time bidding demand of the power market. At present, the multi-modal data fusion technology has problems such as inaccurate time alignment and unreasonable feature weight allocation, and the dynamic optimization strategy often ignores the balance between prediction accuracy and economic benefits. SUMMARY

[0003] The application aims to provide an LSTM photovoltaic power generation power prediction method and system fusing multi-modal data, to solve the problems in the prior art and realize high-precision and strong-adaptive photovoltaic power generation power prediction.

[0004] One embodiment of the application provides an LSTM photovoltaic power generation power prediction method fusing multi-modal data, which comprises the following steps:

[0005] According to historical meteorological data, historical photovoltaic monitoring data and corresponding historical power generation power data, multi-source time series data is aligned through a dynamic time warping algorithm to generate a spatiotemporally consistent multi-modal training feature matrix, wherein the photovoltaic monitoring data includes photovoltaic panel temperature, surface dust coverage and component attenuation coefficient;

[0006] Based on the multi-modal training feature matrix, an LSTM prediction model with multiple input channels is constructed, a time convolution network layer is embedded in the input gate of the LSTM to capture the periodic characteristics of the meteorological data, and the data distribution of different regions is aligned through domain adversarial training to output a pre-trained model with cross-region generalization;

[0007] According to real-time meteorological data, current photovoltaic monitoring data and price fluctuation curves of a target region, a double-reward reinforcement learning strategy is used to update the pre-trained model online, wherein a first reward function is based on the error between the predicted power and the true value, and a second reward function is based on the matching degree between power generation economic benefits and load demand, and a dynamically optimized power prediction model is output;

[0008] The meteorological data and photovoltaic monitoring data of the current time are input into the dynamically optimized power prediction model, and the feature contribution degrees of different time steps are dynamically weighted through a space-time attention mechanism to generate a photovoltaic power prediction sequence of a preset future time.

[0009] Optionally, the multi-source time series data is aligned through a dynamic time warping algorithm according to historical meteorological data, historical photovoltaic monitoring data and corresponding historical power generation data, and a multi-modal training feature matrix consistent in time and space is generated, wherein the photovoltaic monitoring data includes photovoltaic panel temperature, surface dust coverage rate and component attenuation coefficient, and the method comprises the following steps:

[0010] According to the difference in sampling frequency between the meteorological sensor and the photovoltaic monitoring device, a sliding window adaptive interpolation algorithm is used to align the timestamps to generate a uniform time reference original time series data set;

[0011] The original time series data set is input into a dynamic time warping module to calculate the optimal time offset of the photovoltaic panel temperature, the dust coverage rate and the power generation sequence, and a phase-aligned time series feature vector is generated;

[0012] Based on the phase-aligned time series feature vector, a multi-modal feature fusion network is used to extract the cross-modal correlation weight of the meteorological data and the monitoring data, and a weighted fusion feature matrix is generated;

[0013] The weighted fusion feature matrix is subjected to a space-time smoothing constraint, and a bidirectional LSTM is used to eliminate sudden noise points, and a multi-modal training feature matrix with regularized dimensions is output.

[0014] Optionally, based on the multi-modal training feature matrix, an LSTM prediction model with multiple input channels is constructed, a time convolution network layer is embedded in the input gate of the LSTM to capture the periodic characteristics of the meteorological data, and the data distribution of different regions is aligned through domain adversarial training, and a pre-trained model with cross-regional generalization is output, comprising:

[0015] The multi-modal training feature matrix is split into a meteorological channel and a monitoring channel according to the data type, a time convolution network layer is embedded in the meteorological channel, and a meteorological periodicity tensor containing hourly, daily and weekly periodicity features is output;

[0016] The meteorological periodicity tensor and the monitoring channel features are spliced and input into the LSTM unit, and the weight proportion of the two types of features is dynamically adjusted through a gated fusion mechanism to generate a periodicity-enhanced time series memory state;

[0017] A domain adversarial training framework is constructed based on the time series memory state, a gradient reversal layer is used to force the LSTM hidden layer output region-independent general features, and a domain-invariant feature vector is generated;

[0018] The domain-invariant feature vector is input into a full connection prediction layer, a power prediction loss function and a domain classification loss function are jointly optimized, and a preliminary cross-region generalization model is output.

[0019] Knowledge distillation is performed on the preliminary cross-region generalization model, and region-specific parameters are removed, thereby outputting a lightweight pre-training model.

[0020] Optionally, the pre-training model is updated online according to real-time meteorological data of a target region, current photovoltaic monitoring data and a power price fluctuation curve, using a double-reward reinforcement learning strategy, wherein a first reward function is based on an error between predicted power and a true value, and a second reward function is based on a matching degree between power generation economic benefits and load demand, thereby outputting a dynamically optimized power prediction model, including:

[0021] The pre-training model is loaded as a reinforcement learning strategy network, an environment state is defined as a sliding window feature vector of real-time meteorological-monitoring data, and an action is a power prediction value adjustment amount.

[0022] A first reward calculation module is constructed, an accuracy reward signal is generated according to a root mean square error between predicted power and measured values, and a recent error is given a weight coefficient of 3 times;

[0023] A second reward calculation module is constructed, an economic benefit reward signal is generated according to a matching degree between a power price curve and a load demand period, and reward values are distributed according to a benefit gradient;

[0024] A double Q network architecture is designed, Q value functions of accuracy rewards and economic rewards are learned respectively, and a comprehensive Q value is generated by dynamic weighting fusion to guide strategy updating;

[0025] A priority experience replay mechanism is introduced to store historical state-action-reward tuples, strategy network parameters are periodically sampled and fine-tuned, and a dynamically optimized power prediction model is output.

[0026] Optionally, the meteorological data and photovoltaic monitoring data of the current time are input into the dynamically optimized power prediction model, the feature contribution degrees of different time steps are dynamically weighted through a spatio-temporal attention mechanism, and a photovoltaic power generation power prediction sequence for a future preset time is generated, including:

[0027] Real-time meteorological data and photovoltaic monitoring data are input into the dynamically optimized power prediction model, past one-hour time series features are extracted through a sliding window, and a standardized input tensor is generated;

[0028] A spatio-temporal attention module is deployed at an output end of an LSTM hidden layer, time dimension attention weights and feature dimension attention weights are calculated respectively, and a spatio-temporal attention weight matrix is generated;

[0029] The space-time attention weight matrix is used for dynamically weighting and fusing the standardized input tensor, suppressing the influence of noise period characteristics, and generating an enhanced space-time feature vector.

[0030] The space-time feature vector is input into a recursive prediction layer to iteratively generate power prediction values for the next 24 hours at 15-minute intervals, and output high-precision time series prediction results.

[0031] Another embodiment of the present application provides an LSTM photovoltaic power prediction system fusing multi-modal data, comprising:

[0032] An alignment module is configured to align multi-source time series data by a dynamic time warping algorithm according to historical meteorological data, historical photovoltaic monitoring data and corresponding historical power generation data, and generate a multi-modal training feature matrix consistent in space and time, wherein the photovoltaic monitoring data includes photovoltaic panel temperature, surface dust coverage and component attenuation coefficient.

[0033] A construction module is configured to construct an LSTM prediction model with multiple input channels based on the multi-modal training feature matrix, embed a time convolution network layer in an input gate of the LSTM to capture periodic characteristics of the meteorological data, and align data distribution of different regions by domain adversarial training, and output a pre-trained model with cross-region generalization.

[0034] An optimization module is configured to update the pre-trained model online by a double reward reinforcement learning strategy according to real-time meteorological data, current photovoltaic monitoring data and price fluctuation curve of a target region, wherein a first reward function is based on the error between predicted power and true value, and a second reward function is based on the matching degree between power generation economic benefits and load demand, and output a dynamically optimized power prediction model.

[0035] A prediction module is configured to input meteorological data and photovoltaic monitoring data of a current time into the dynamically optimized power prediction model, dynamically weight the feature contribution of different time steps by a space-time attention mechanism, and generate a photovoltaic power prediction sequence for a future preset time.

[0036] Another embodiment of the present application provides a storage medium having a computer program stored therein, wherein the computer program is configured to execute the method described in any of the above embodiments when running.

[0037] Another embodiment of the present application provides an electronic device comprising a memory and a processor, wherein the memory has a computer program stored therein, and the processor is configured to run the computer program to execute the method described in any of the above embodiments.

[0038] Compared with the prior art, the application provides an LSTM photovoltaic power prediction method fusing multi-modal data, which generates a spatiotemporal consistent multi-modal training feature matrix according to historical meteorological data, historical photovoltaic monitoring data and corresponding historical power generation data; constructs a multi-input channel LSTM prediction model based on the multi-modal training feature matrix, and outputs a pre-training model with cross-regional generalization; adopts a double reward reinforcement learning strategy to update the pre-training model online according to real-time meteorological data, current photovoltaic monitoring data and price fluctuation curves of a target region, and outputs a dynamically optimized power prediction model; inputs the meteorological data and photovoltaic monitoring data at the current time into the dynamically optimized power prediction model, and generates a photovoltaic power prediction sequence at a preset future time, so that high-precision and strong-adaptive photovoltaic power prediction can be realized. BRIEF DESCRIPTION OF DRAWINGS

[0039] Figure 1 A hardware structure block diagram of a computer terminal of the LSTM photovoltaic power prediction method fusing multi-modal data provided by the embodiment of the application is provided.

[0040] Figure 2 A flowchart of the LSTM photovoltaic power prediction method fusing multi-modal data provided by the embodiment of the application is provided.

[0041] Figure 3 A structure diagram of the LSTM photovoltaic power prediction system fusing multi-modal data provided by the embodiment of the application is provided. DETAILED DESCRIPTION

[0042] The embodiments described below with reference to the drawings are exemplary and are only used to explain the application, and cannot be explained as a limitation of the application.

[0043] The embodiment of the application first provides an LSTM photovoltaic power prediction method fusing multi-modal data, which can be applied to electronic equipment, such as a computer terminal, specifically, a general computer and the like.

[0044] The following will be described in detail by taking a computer terminal as an example. Figure 1 A hardware structure block diagram of a computer terminal of the LSTM photovoltaic power prediction method fusing multi-modal data provided by the embodiment of the application is provided. As shown in the figure, Figure 1 The computer equipment includes a processor, a memory and a network interface connected through a system bus, wherein the memory can include a non-volatile storage medium and an internal memory.

[0045] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions which, when executed, can cause the processor to perform any one of the LSTM photovoltaic power prediction methods fusing multi-modal data.

[0046] The processor is configured to provide computing and control capabilities to support the operation of the entire computer device.

[0047] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium, which, when executed by the processor, can cause the processor to perform any one of the LSTM photovoltaic power prediction methods fusing multi-modal data.

[0048] The network interface is configured to perform network communication, such as sending assigned tasks, etc. Those skilled in the art can understand that, Figure 1 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0049] It should be understood that the processor can be a central processing unit (CPU), and the processor can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0050] Referring to Figure 2 The embodiments of the present application provide an LSTM photovoltaic power prediction method fusing multi-modal data, which can include the following steps:

[0051] S201, according to historical meteorological data, historical photovoltaic monitoring data and corresponding historical power generation data, aligning multi-source time series data through a dynamic time warping algorithm to generate a spatiotemporally consistent multi-modal training feature matrix, wherein the photovoltaic monitoring data includes photovoltaic panel temperature, surface dust coverage rate and component attenuation coefficient;

[0052] Specifically, a sliding window adaptive interpolation algorithm can be used to align timestamps and generate a unified time reference raw time series dataset based on the differences in sampling frequencies between meteorological sensors and photovoltaic monitoring devices.

[0053] Photovoltaic monitoring devices (such as temperature sensors, dust detection cameras) and meteorological sensors (such as anemometers, pyranometers) usually have different sampling frequencies. For example, photovoltaic panel temperature may be collected every 5 minutes, while wind speed data is recorded every 10 minutes. The sliding window adaptive interpolation algorithm aims to align multi-source data to a unified time reference (such as one data point per minute), eliminating the interference of timestamp differences on model training.

[0054] ‌Sliding window design‌:

[0055] ‌Window size setting‌: Determine the window length based on the highest sampling frequency. For example, if the photovoltaic monitoring data has the highest sampling frequency (5 minutes / once), set the window length to 5 minutes.

[0056] ‌Dynamic filling strategy‌: Within each window, if some sensor data is missing (such as meteorological data only once every 10 minutes), use linear interpolation (Linear Interpolation) or cubic spline interpolation (Cubic Spline Interpolation) to fill in the missing time points. For example, within a 5-minute window, if the wind speed data is missing at a certain time, calculate the intermediate value based on the 10-minute data of the adjacent window.

[0057] ‌Outlier filtering‌: Apply sliding standard deviation filtering (Sliding Standard Deviation Filter) to the interpolated data to remove outliers that are more than 3 times the standard deviation. For example, the average temperature of a photovoltaic panel in a certain window is 45°C, and the standard deviation is 2°C. Temperatures greater than 51°C or less than 39°C are considered abnormal and are removed.

[0058] ‌Timestamp alignment and resampling‌:

[0059] ‌Reference time axis generation‌: Take the local time of the photovoltaic power station as the reference, create a continuous sequence of timestamps every minute (such as 00:00, 00:01,..., 23:59).

[0060] ‌Multi-source data mapping‌: Map each sensor data to the reference time axis using nearest neighbor matching (Nearest Neighbor Matching) or weighted averaging (Weighted Averaging). For example, the timestamp of a certain photovoltaic monitoring data is 00:03:24, then map it to the reference time 00:03 and record the original value.

[0061] ‌Sampling frequency normalization‌: Apply forward fill or mean fill to low-frequency data (e.g., hourly dust coverage). For example, if there is no dust data at the current time, use the last valid value.

[0062] ‌Output unified dataset‌:

[0063] ‌Data structure example‌: Generate a table containing timestamps, meteorological data (wind speed, irradiance, ambient temperature, etc.), and photovoltaic monitoring data (module temperature, dust coverage, degradation coefficient, etc.), stored in CSV or Parquet format.

[0064] ‌Alignment verification‌: Calculate the missing rate of each column of data (e.g., wind speed data missing rate <1%) and time coverage integrity (e.g., 1440 reference time point coverage rate >99.5%), ensuring that the dataset can be used for subsequent model training.

[0065] Input the original time series dataset into the dynamic time warping module to calculate the optimal time offset of the photovoltaic panel temperature, dust coverage, and power generation sequence, and generate a phase-aligned time series feature vector;

[0066] Even after timestamp alignment, the timing changes of different variables may have phase delays (e.g., temperature rise may cause power drop with a few minutes lag). Dynamic time warping (DTW) aligns time series data nonlinearly to find the optimal time offset relationship between variables.

[0067] ‌Dynamic time warping algorithm configuration‌:

[0068] ‌Sequence window setting‌: Limit the maximum time offset range to ±15 minutes (i.e., allow DTW to align sequences within ±15 minutes), preventing excessive distortion of time series relationships.

[0069] ‌Distance metric selection‌: Use Euclidean distance as the cost function for sequence alignment. For example, calculate the point-by-point distance matrix of the photovoltaic panel temperature sequence and the power generation sequence in the same time period.

[0070] ‌Path constraint‌: Apply slope weighting to limit the degree of curvature of the alignment path, avoiding unreasonable jump-like alignment. For example, limit the path slope to [0.5, 2] to ensure smooth time series alignment.

[0071] ‌Variable alignment and phase correction‌:

[0072] ‌Key Variable Selection‌: For variables like PV panel temperature and dust coverage that are strongly related to power generation, DTW alignment is performed with the power sequence.

[0073] ‌Offset Calculation‌: Find the minimum cost alignment path through the Accumulated Cost Matrix to determine the time offset for each variable. For example, the PV panel temperature sequence needs to be shifted forward by 3 minutes, and the dust coverage sequence needs to be shifted backward by 2 minutes.

[0074] ‌Phase Alignment Operation‌: Perform a Circular Shift on the original sequences based on the offset. For example, shift the temperature sequence 3 time steps to the right (one step per minute), and fill the missing part with edge values.

[0075] ‌Alignment Result Verification‌:

[0076] ‌Correlation Analysis‌: Calculate the Pearson Correlation Coefficient between the variables and power generation before and after alignment. For example, the correlation coefficient between temperature and power improves from -0.6 before alignment to -0.8 after alignment.

[0077] ‌Visual Inspection‌: Plot the time series overlay before and after alignment to observe the synchronization of peaks and valleys. For example, the temperature peak and power valley completely coincide after a 3-minute shift.

[0078] ‌Output Feature Vector‌: Concatenate the phase-aligned temperature, dust coverage, power, and other sequences by time step to generate a multi-dimensional time series feature vector (e.g., one vector per minute, containing 10 feature dimensions).

[0079] Based on the phase-aligned time series feature vector, the multi-modal feature fusion network extracts the cross-modal correlation weight between meteorological data and monitoring data, generating a weighted fusion feature matrix.

[0080] Meteorological data (such as irradiance, wind speed) and photovoltaic monitoring data (such as temperature, dust coverage) have different physical meanings and numerical ranges. Direct concatenation will cause the model to be biased towards high-dimensional features. The multi-modal feature fusion network learns the cross-modal correlation weight through the attention mechanism, achieving adaptive weighted fusion.

[0081] ‌Feature Standardization and Encoding‌:

[0082] ‌Normalization‌: Perform Min-Max Scaling on each feature column to scale the values to the [0, 1] interval. For example, the irradiance range is 0-1000 W / m 2Mapping to 0-1, temperature range 20-80°C mapped to 0-1.

[0083] ‌Modality Grouping‌: Features are divided into meteorological modalities (wind speed, irradiance, ambient temperature) and monitoring modalities (component temperature, dust coverage, attenuation coefficient), each fed into different encoder branches.

[0084] ‌Embedding Representation‌: Each modality branch generates a 128-dimensional feature vector through a Fully Connected Layer. For example, the meteorological modality input is a 3-dimensional feature, and the output is a 128-dimensional embedding vector.

[0085] ‌Cross-Modality Attention Mechanism‌:

[0086] ‌Attention Weight Calculation‌: Bilinear Attention is used to calculate the association weights between meteorological and monitoring modalities. The formula is simplified as: weight = Softmax(meteorological embedding × weight matrix × monitoring embedding^T).

[0087] ‌Dynamic Weighted Fusion‌: Monitoring modality features are weighted and summed according to the weights to generate fusion features related to meteorological modalities. For example, the dust coverage feature weight increases to 0.9 during high irradiance periods, and the attenuation coefficient weight decreases to 0.1.

[0088] ‌Residual Connection‌: The original meteorological embedding is added to the fused features to retain the original information and enhance cross-modality interaction.

[0089] ‌Post-processing of Fusion Features‌:

[0090] ‌Dimensionality Reduction and Regularization‌: The fused 256-dimensional features are reduced to 64-dimensional through Principal Component Analysis (PCA), and L2 regularization (regularization coefficient λ=0.01) is applied to prevent overfitting.

[0091] ‌Time Step Concatenation‌: The fused features of each minute are concatenated in chronological order to generate a time series feature matrix (e.g., 1440 minutes × 64 dimensions).

[0092] ‌Output Format‌: Stored as a NumPy array or HDF5 file for subsequent model training calls.

[0093] Apply spatio-temporal smoothing constraints to the weighted fusion feature matrix, use bidirectional LSTM to eliminate sudden noise points, and output a well-structured multi-modal training feature matrix.

[0094] The fused feature matrix may contain transient noise (e.g. outliers caused by sensor transient faults), which needs to be improved through spatio-temporal smoothing constraints and bidirectional sequence modeling (Bi-LSTM).

[0095] ‌Spatio-temporal smoothing constraints applied:

[0096] ‌Temporal dimension smoothing: Apply Moving Average to each feature column, with a window length of 15 minutes (i.e. the average of the current point and the previous 14 points). For example, the value of a certain feature at 10:00 is the average of the previous 10 minutes to 10:14.

[0097] ‌Spatial dimension smoothing: For multi-PV module monitoring data (e.g. 10 component temperatures in the same array), calculate the intra-group mean at the same time step to replace single-component outliers. For example, if a component temperature deviates from the group mean by ±3°C, replace it with the mean.

[0098] ‌Constraint loss function: When training the fusion network, add a smooth regularization term to penalize the drastic change of feature values between adjacent time steps. For example, add the L1 norm of the difference between adjacent features (coefficient 0.05) to the loss function.

[0099] ‌Bidirectional LSTM denoising:

[0100] ‌Network structure design: Build a bidirectional LSTM network with 128 hidden units in each direction, input sequence length 1440 (total minutes in a day), and output the same length sequence.

[0101] ‌Noise point detection: Calculate the reconstruction error of LSTM (i.e. the mean squared error (MSE) between the predicted value and the original value). If the error of a certain time step exceeds the threshold (e.g. 3 times the average error), mark it as a noise point.

[0102] ‌Noise replacement strategy: Replace noise points with linear interpolation of the previous and next time steps (average of the previous 5 minutes and the next 5 minutes) to ensure sequence continuity.

[0103] ‌Final feature matrix generation:

[0104] ‌Dimension regularization: Map the 128-dimensional hidden state output by the bidirectional LSTM to 32 dimensions through a fully connected layer to reduce redundant information.

[0105] ‌Standardization review: Standardize the final feature matrix by Z-Score (mean=0, standard deviation=1) to ensure that different features have the same dimension.

[0106] ‌Data Storage: The output shape is a 3D tensor of (sample number x time step x feature dimension), for example, 1000-day samples correspond to a 1000 x 1440 x 32 matrix, stored in TFRecord format to adapt to the TensorFlow training process.

[0107] The method first integrates historical operation data from different sources, including key parameters such as weather conditions, photovoltaic component status, and actual power generation, solves the time delay and frequency difference problem of multi-source data collection through advanced time series alignment technology. Pay special attention to monitoring indicators such as photovoltaic panel temperature and dust coverage that directly affect power generation efficiency, ensure data spatio-temporal consistency, establish a high-quality multi-modal training dataset, eliminate spatio-temporal bias in the data collection process, and provide accurate feature input reflecting the real operating state of the photovoltaic system for subsequent model training. By incorporating long-term factors such as component attenuation, the model's adaptability to real working conditions such as equipment aging is enhanced.

[0108] S202, based on the multi-modal training feature matrix, a LSTM prediction model with multiple input channels is constructed, a time convolution network layer is embedded in the input gate of LSTM to capture the periodic characteristics of meteorological data, and the data distribution of different regions is aligned through domain adversarial training, outputting a pre-trained model that generalizes across regions;

[0109] Specifically, the multi-modal training feature matrix can be split into a meteorological channel and a monitoring channel according to the data type, a time convolution network layer is embedded in the meteorological channel, and a meteorological periodic tensor containing hourly, daily, and weekly periodic features is outputted;

[0110] The multi-modal training feature matrix contains meteorological data (such as wind speed, irradiance, and ambient temperature) and photovoltaic monitoring data (such as component temperature, dust coverage, and attenuation coefficient), which need to be separated by data type and enhanced. Temporal Convolutional Network (TCN) captures the periodic patterns of meteorological data (such as hourly, daily, and weekly periods) through dilated convolution.

[0111] ‌Data Channel Splitting‌:

[0112] ‌Meteorological Channel: Extract features related to weather such as wind speed, irradiance, and ambient temperature. For example, the input feature matrix contains 10 dimensions, of which the first 3 are meteorological data.

[0113] ‌Monitoring Channel: Extract monitoring features such as component temperature, dust coverage, and attenuation coefficient. For example, the last 7 dimensions are monitoring data.

[0114] ‌Data Format Conversion‌: Convert the split data into a 3D tensor (number of samples × time steps × feature dimensions). For example, the meteorological channel tensor has a shape of 1000 (samples) × 1440 (time steps) × 3 (features).

[0115] ‌Temporal Convolution Network (TCN) Design‌:

[0116] ‌Causal Convolution‌: Ensure that the convolution kernel only covers the current and historical time steps, avoiding future information leakage. For example, set the convolution kernel size to 3 (covering the previous 2 time steps and the current time step).

[0117] ‌Dilation Rate Setting‌: Capture multi-scale periodic features through different dilation rates (Dilation Rate):

[0118] ‌Hourly Period‌: Dilation Rate = 12 (covering a 12 × 5-minute = 1-hour history window).

[0119] ‌Daily Period‌: Dilation Rate = 288 (covering a 288 × 5-minute = 24-hour history window).

[0120] ‌Weekly Period‌: Dilation Rate = 2016 (covering a 2016 × 5-minute = 7-day history window).

[0121] ‌Residual Connection‌: Each TCN block contains a residual structure to prevent gradient vanishing. For example, the input features are added to the original input after passing through the convolution layer.

[0122] ‌Periodic Feature Extraction‌:

[0123] ‌Hierarchical Stacking‌: Stack multiple TCN blocks (such as 3 layers), expanding the receptive field layer by layer. For example, the first layer has a convolution kernel size of 3 and a dilation rate of 1, the second layer has a dilation rate of 12, and the third layer has a dilation rate of 288.

[0124] ‌Feature Concatenation‌: Concatenate the feature maps output by different dilation rates to form a meteorological period tensor containing hourly, daily, and weekly periods. For example, the output tensor has a shape of 1000 × 1440 × 64 (64-dimensional periodic features).

[0125] ‌Output Normalization‌: Perform layer normalization on the meteorological period tensor to eliminate dimensional differences. For example, the normalized features have a mean of 0 and a standard deviation of 1.

[0126] Concatenate the meteorological period tensor with the monitoring channel features and input them into the LSTM unit. Through the gating fusion mechanism, dynamically adjust the weight ratio of the two types of features to generate a period-enhanced time series memory state.

[0127] The influence weight of meteorological period features (e.g., daily cycle irradiance variation) and monitoring features (e.g., dust coverage) on power generation power dynamically changes over time, which needs to be self-adaptively adjusted by a gated fusion mechanism.

[0128] ‌Feature concatenation and input preparation‌:

[0129] ‌Data alignment‌: Ensure the time steps of meteorological period tensors (e.g., 1440x64) and monitoring channel features (e.g., 1440x7) are aligned. For example, forward fill missing time steps for monitoring channels.

[0130] ‌Concatenation operation‌: Concatenate meteorological period tensors and monitoring features along the feature dimension to generate combined features (e.g., 1440x71 dimensions).

[0131] ‌Input normalization‌: Batch normalize combined features, calculating mean and variance for each sample batch. For example, independently normalize 128 samples per batch.

[0132] ‌Gated fusion mechanism design‌:

[0133] ‌Input gate extension‌: Add a fully connected layer to the input gate of LSTM to generate the weight ratio of meteorological features and monitoring features. For example, the input gate outputs two weight values (meteorological weight α, monitoring weight β), satisfying α + β = 1.

[0134] ‌Dynamic weighted fusion‌: Weighted sum of meteorological period features and monitoring features according to weights. For example, in sunny weather, irradiance feature weight α = 0.8, dust coverage weight β = 0.2; in cloudy weather, α = 0.5, β = 0.5.

[0135] ‌Memory state update‌: Input the weighted fusion features into the LSTM unit to update the cell state and hidden state. For example, the hidden state dimension is set to 128.

[0136] ‌Time series memory enhancement‌:

[0137] ‌Time step loop processing‌: Process fusion features step by step according to time steps (from t=1 to t=1440) to preserve long-term dependencies. For example, the hidden state at t=720 (12 noon) contains information from all morning periods.

[0138] ‌Gradient Clipping‌: Set a gradient threshold (e.g., 1.0) to prevent gradient explosion during training. For example, when the gradient norm exceeds 1.0, scale it to the threshold.

[0139] ‌Output Memory State‌: Generate a periodic enhanced time-series memory state with the shape of sample number × time step × hidden dimension (e.g., 1000 × 1440 × 128).

[0140] Construct a domain-adversarial training framework based on the time-series memory state, use a gradient reversal layer to force the LSTM hidden layer to output region-independent general features, and generate a domain-invariant feature vector;

[0141] The distribution difference of meteorological and monitoring data in different regions may cause the model to overfit to a specific region (e.g., a rainy area in the south), and domain-adversarial training (Domain-Adversarial Training) can confuse regional features and force the model to learn region-independent general patterns.

[0142] ‌Domain-adversarial framework design‌:

[0143] ‌Feature Extractor‌: The LSTM hidden layer serves as a feature extractor, outputting domain-invariant features. For example, a 128-dimensional hidden state vector.

[0144] ‌Domain Classifier‌: Build a fully connected network (input 128-dimensional, output 2-dimensional) to determine which region the feature comes from (e.g., region A or region B).

[0145] ‌Gradient Reversal Layer‌: Reverse the gradient of the domain classifier during backpropagation to force the feature extractor to generate confusing features that cannot distinguish between regions. For example, the gradient reversal coefficient λ = 0.1.

[0146] ‌Adversarial training process‌:

[0147] ‌Forward Propagation‌: Input the time-series memory state into the domain classifier to output the region prediction probability. For example, the probability of region A is 0.7 and the probability of region B is 0.3.

[0148] ‌Backpropagation‌: Calculate the domain classification loss (e.g., cross-entropy loss), but pass the gradient multiplied by -λ back to the feature extractor through the gradient reversal layer. For example, when λ = 0.1, the gradient direction is reversed and the intensity is weakened.

[0149] ‌Loss Balancing‌: Set the domain classification loss weight (e.g., 0.2) to prevent excessive interference with the main task (power prediction) training. For example, the total loss = power prediction loss + 0.2 × domain classification loss.

[0150] ‌Domain-invariant feature generation:

[0151] ‌Feature visualization verification: Visualize the feature distribution of different regions through t-SNE (t-Distributed Stochastic Neighbor Embedding) dimensionality reduction. For example, the features of region A and region B significantly increase in overlap after adversarial training.

[0152] ‌Region confusion matrix: Calculate the accuracy of the domain classifier, aiming to approach random guessing (50% accuracy). For example, the accuracy decreases to 55% after training, indicating that the region information is effectively suppressed.

[0153] ‌Output feature vector: Generate a domain-invariant feature matrix with dimensions sample number × time step × 128.

[0154] Input the domain-invariant feature vector into the fully connected prediction layer, jointly optimize the power prediction loss function and the domain classification loss function, and output the preliminary cross-region generalization model;

[0155] Under the domain adversarial training framework, the model needs to optimize both power prediction accuracy and region confusion ability, and balance the two tasks through a joint loss function.

[0156] ‌Fully connected prediction layer design:

[0157] ‌Network structure: Stack two fully connected layers (128→64→1), gradually reduce the dimension to the predicted power value. For example, input 128-dimensional features, output 1-dimensional power value (unit: kW).

[0158] ‌Activation function: The last layer uses a linear activation function (Linear Activation), and the intermediate layer uses a ReLU (Rectified Linear Unit) activation function. For example, the ReLU function outputs = max(0, input).

[0159] ‌Regularization: Apply Dropout (random inactivation ratio 0.2) and L2 regularization (weight decay coefficient 0.001) to prevent overfitting.

[0160] ‌Joint loss function definition:

[0161] ‌Power prediction loss: Use mean squared error (MSE, Mean Squared Error) to measure the deviation between predicted power and true value. For example, MSE = Σ (predicted value - true value) 2 / sample number.

[0162] ‌Domain Classification Loss: Cross-Entropy Loss is used to measure the accuracy of domain classification. For example, Cross-Entropy = -Σ region label × log(predicted probability).

[0163] ‌Total Weighted Loss: Total Loss = Power Prediction Loss + 0.2 × Domain Classification Loss. For example, Power Prediction Loss is 10.5, Domain Classification Loss is 0.8 → Total Loss = 10.5 + 0.16 = 10.66.

[0164] ‌Model Training and Validation:

[0165] ‌Optimizer Configuration: Adam optimizer is used with an initial learning rate of 0.001, beta1 = 0.9, and beta2 = 0.999.

[0166] ‌Early Stopping: The validation set loss is monitored, and if there is no decrease for 10 consecutive epochs, the training is stopped.

[0167] ‌Cross-Region Validation: The model performance is tested on unseen regions (e.g., Region C) to ensure that the prediction error is comparable to the training regions (Regions A and B). For example, the MAE (Mean Absolute Error) for Region C is 15kW, and for Region A, it is 14kW.

[0168] ‌Knowledge Distillation: The preliminary cross-region generalization model is distilled to remove region-specific parameters, resulting in a lightweight pre-trained model.

[0169] ‌Knowledge Distillation: The preliminary model may contain redundant parameters (e.g., overfitting to noise features in Region A), and Knowledge Distillation uses a teacher-student framework to compress the model while preserving cross-region generalization capabilities.

[0170] ‌Teacher-Student Framework Construction:

[0171] ‌Teacher Model: The preliminary cross-region generalization model (with 1 million parameters) is used to generate soft labels (SoftLabels). For example, the probability distribution of predicted power (with a temperature parameter T = 5 for smoothing output).

[0172] ‌Student Model: A lightweight LSTM is designed (with 64 hidden units and 250,000 parameters), and the input and output dimensions are consistent with the teacher model.

[0173] ‌Distillation Loss: The KL divergence (Kullback-Leibler Divergence) between the student's prediction and the teacher's soft labels is calculated, and the MSE between the student's prediction and the true value is also optimized. For example, Total Loss = 0.7 × KL divergence + 0.3 × MSE.

[0174] ‌Region-specific parameter pruning‌:

[0175] ‌Significance analysis‌: Identify neurons sensitive to region classification through Gradient Weight. For example, a hidden unit has significantly higher activation intensity in region A than in region B.

[0176] ‌Pruning‌: Remove neurons with low significance (e.g., units with activation intensity <0.1) to compress model size. For example, prune from 128 hidden units to 64.

[0177] ‌Quantization‌: Quantize model parameters from 32-bit floating-point to 8-bit integer (INT8) to reduce memory usage and computational delay.

[0178] ‌Lightweight model output‌:

[0179] ‌Performance verification‌: Ensure that the student model's prediction accuracy on the test set is not less than 95% of the teacher model's. For example, teacher MAE=15kW, student MAE=15.8kW.

[0180] ‌Cross-region deployment‌: Package the pre-trained model into ONNX (Open Neural Network Exchange) format to adapt to different hardware platforms (such as edge computing devices).

[0181] ‌Model documentation‌: Record the parameter size after distillation, inference speed (e.g., single prediction time 10ms), and applicable region range.

[0182] ‌Key technology examples and parameter explanations‌

[0183] ‌Dilated Convolution‌: Expand the receptive field by interval sampling, with the parameter "dilation rate" determining the sampling interval (e.g., dilation rate 2 means sampling once every 1 point).

[0184] ‌Gradient Reversal Layer‌: Reverse the gradient sign during backpropagation, with the parameter "λ" controlling the reversal intensity (e.g., λ=0.1 means scaling the gradient to -0.1 times the original value).

[0185] ‌Knowledge Distillation‌: Transfer the teacher model's knowledge through soft labels, with the parameter "temperature T" controlling the label smoothing degree (the higher T, the flatter the distribution).

[0186] Adam optimizer: self-adaptive learning rate adjustment, parameter "beta1" controls the first-order moment decay rate, and "beta2" controls the second-order moment decay rate.

[0187] ONNX format: Open Neural Network Exchange format, supports cross-framework model deployment, parameter "opset_version" specifies the operator set version (e.g. opset_version=13).

[0188] Combine time convolution network with traditional LSTM, while retaining the advantages of time series modeling, explicitly extract the day-night and seasonal cycle rules of meteorological data. Introduce an adversarial training mechanism to force the model to learn a general feature representation that is not affected by regional differences, improve the model's adaptability to new scenarios, significantly improve the accuracy of capturing meteorological cycle features, and solve the common problem of regional data distribution differences in photovoltaic prediction. The pre-trained model has good transfer learning ability and can quickly adapt to photovoltaic power stations in different geographical environments.

[0189] S203, according to the real-time meteorological data of the target area, the current photovoltaic monitoring data and the price fluctuation curve, using a double reward reinforcement learning strategy to update the pre-trained model online, wherein the first reward function is based on the error between the predicted power and the true value, and the second reward function is based on the matching degree of power generation economic benefit and load demand, and the output is a dynamically optimized power prediction model;

[0190] Specifically, the pre-trained model can be loaded as a reinforcement learning strategy network, the environment state is defined as a sliding window feature vector of real-time meteorological-monitoring data, and the action is a power prediction value adjustment amount.

[0191] The pre-trained model (lightweight LSTM) is used as a policy network of reinforcement learning (Reinforcement Learning, RL), which is responsible for generating power prediction adjustment actions according to real-time environmental states. The state (State) is defined as a time series feature vector containing real-time meteorological data (such as wind speed, irradiance, and ambient temperature) and photovoltaic monitoring data (such as component temperature, dust coverage, and attenuation coefficient), which captures short-term dynamic changes through a sliding window. The action (Action) is defined as the adjustment amount of the original prediction value of the pre-trained model, such as percentage or absolute value increase or decrease based on the original prediction value.

[0192] Policy network initialization:

[0193] Model loading: freeze the LSTM layer of the pre-trained model (parameters cannot be updated), and only keep the fully connected layer as the adjustable part. For example, the LSTM hidden layer parameters are fixed, and the fully connected layer weights are set to a trainable state.

[0194] ‌Input Adaptation: Define the input layer to receive sliding window data. For example, the input tensor shape is (batch size, time step, feature dimension), with a time step of 60 minutes (i.e., 1 hour of past data) and a feature dimension containing 10 meteorological and monitoring features.

[0195] ‌Action Space Design: Actions are defined as continuous value adjustments with a range limited to [-20%, +20%], corresponding to percentage adjustments of the power prediction value. For example, if the original prediction is 100 kW, an action of +0.1 represents an adjustment to 110 kW, and an action of -0.05 represents an adjustment to 95 kW.

[0196] ‌Sliding Window Feature Extraction:

[0197] ‌Window Length Setting: Based on the time dependence of photovoltaic power changes (such as cloud movement periods), set the window length to 60 minutes (i.e., 1 minute per time step, with a total of 60 steps).

[0198] ‌Real-time Data Alignment: Align meteorological data (e.g., updated every minute) with monitoring data (e.g., updated every 5 minutes) through timestamp matching. For example, missing time steps in monitoring data are filled using forward filling.

[0199] ‌Standardization: Perform Z-Score standardization (mean = 0, standard deviation = 1) on each feature within the sliding window to eliminate dimensional differences. For example, the original value range of irradiance is 0~1000 W / m 2 is mapped to the interval [-1.5, 2.3].

[0200] ‌Action Execution Mechanism:

[0201] ‌Action Generation: The policy network outputs Gaussian distribution parameters (mean μ and standard deviation σ), and exploratory actions are generated by random sampling (e.g., μ = 0.05 and σ = 0.02). For example, a sampling result of +0.08 represents an 8% increase in the predicted value.

[0202] ‌Action Constraints: Apply the Tanh activation function to limit the action range to [-1, 1], and then scale it to [-20%, +20%]. For example, a Tanh output of 0.4 corresponds to a scaled adjustment of +8%.

[0203] ‌Action Delay Handling: Consider the communication delay from the sensor to the control end (e.g., an average of 300 ms), and introduce a historical action buffer to compensate for the delay impact. For example, the current action is calculated based on the state 300 ms ago.

[0204] The first reward calculation module is constructed to generate an accuracy reward signal based on the root mean square error of the predicted power and the measured value, and to assign a 3 times weight coefficient to the recent error;

[0205] ‌The first reward function (Accuracy Reward) is used to measure the prediction accuracy, based on the root mean square error (RMSE), and emphasizes the importance of recent predictions through time-decayed weighting.

[0206] ‌Root Mean Square Error (RMSE) calculation‌:

[0207] ‌Real-time comparison‌: The real power generation (such as the measured value of the smart meter) is obtained every 5 minutes, and compared with the adjusted prediction value. For example, the error between the prediction value of 110kW and the measured value of 105kW is 5kW.

[0208] ‌Window accumulation‌: Calculate the average of the square of all error values in the sliding window (such as the past 1 hour, a total of 12 5-minute points). For example, the sum of the squares of the past 12 error values is 2500kW 2 , the average is 208.3→RMSE=√208.3≈14.43kW.

[0209] ‌Normalization processing‌: Divide the RMSE by the rated power of the power station (such as 500kW) to get the normalized error (Normalized Error). For example, 14.43 / 500≈0.0289.

[0210] ‌Time-decayed weighting strategy‌:

[0211] ‌Exponential decay weight‌: Assign a weight w_t=3×e^(-λt) to each time point in the window, where λ is the decay coefficient and t is the interval (in minutes) between the time point and the current time. For example, λ=0.01, the weight of the current time t=0 is 3×1=3, and the weight of t=60 60 minutes ago is 3×e^(-0.6)=3×0.5488≈1.646.

[0212] ‌Weighted RMSE calculation‌: The weighted error is Σ(w_t×(predicted value-measured value) 2 ) / Σw_t. For example, the recent error has a higher weight, which improves the model's sensitivity to short-term fluctuations.

[0213] ‌Reward mapping‌: Convert the weighted RMSE to a reward value, the formula is R1=1 / (1+RMSE), which ensures that the smaller the error, the greater the reward. For example, RMSE=14.43→R1≈0.0648.

[0214] ‌Real-time calibration mechanism‌:

[0215] ‌Dynamic threshold adjustment‌: Set the maximum tolerated error according to the historical error distribution (e.g. 95th percentile). For example, if the maximum historical RMSE is 50kW, errors exceeding this value are considered abnormal and the reward is directly set to 0.

[0216] ‌Smoothing‌: Apply a moving average (window length 5) to the reward signal to suppress transient noise. For example, if the reward suddenly drops by 70% at a certain time, the fluctuation amplitude is reduced to 20% after smoothing.

[0217] ‌Reward scaling‌: Linearly scale the reward value to the [-1, +1] interval to facilitate fusion with other reward signals. For example, the original reward 0.0648 is scaled to +0.032, and the maximum reward corresponds to +1.

[0218] Construct a second reward calculation module to generate an economic benefit reward signal by combining the matching degree of the electricity price curve and the load demand period, and distribute the reward value according to the benefit gradient;

[0219] The second reward function (Economic Reward) reflects the matching degree of power generation benefit and load demand, which needs to combine real-time electricity price (such as time-of-use TOU) and load curve (such as industrial electricity peak period) to dynamically calculate economic value.

[0220] ‌Electricity price curve integration‌:

[0221] ‌Electricity price period division‌: According to the time-of-use TOU policy of the power grid, define the peak (such as 10:00-14:00), flat (8:00-10:00, 14:00-22:00), and valley (22:00-8:00 the next day) electricity prices. For example, the peak electricity price is 0.8 yuan / kWh, and the valley electricity price is 0.3 yuan / kWh.

[0222] ‌Real-time electricity price mapping‌: Establish a timestamp-price comparison table to dynamically query the current period electricity price. For example, 12:15 corresponds to the peak electricity price of 0.8 yuan / kWh.

[0223] ‌Predicted electricity price integration‌: If there is an electricity price prediction model (such as LSTM based on load prediction), use its output value as the reference electricity price for future periods.

[0224] ‌Load demand matching degree calculation‌:

[0225] ‌Load curve acquisition‌: Extract the typical load curve of the target area from the power grid dispatching system or historical data. For example, a certain industrial park has a power consumption peak of 5000kW from 9:00 to 18:00.

[0226] Matching degree index: Define matching degree M = actual power generation / load demand, range 0~1. For example, power generation 4000kW corresponds to load demand 5000kW → M = 0.8.

[0227] Dynamic weight allocation: Give higher weight to matching degree in peak electricity price period. For example, the weight coefficient of M in peak period is 2, flat period is 1, and valley is 0.5.

[0228] Economic benefit reward generation:

[0229] Benefit calculation formula: Economic benefit E = power generation × electricity price × matching degree weight. For example, power generation 100kW, electricity price 0.8 yuan / kWh, matching degree weight 2 → E = 100 × 0.8 × 2 = 160 yuan.

[0230] Gradient reward allocation: Divide the reward level according to the gradient of the benefit. For example:

[0231] E <100 yuan → R2=0.2;

[0232] 100≤E<200 → R2=0.5;

[0233] E≥200 → R2=1.0.

[0234] Normalization: Scale R2 to the same range as R1 (such as [-1, +1]) to ensure that the reward signal is comparable. For example, the maximum benefit 300 yuan corresponds to R2 = +1, and the minimum benefit 0 yuan corresponds to R2 = -1.

[0235] Design a double Q network architecture to learn the Q value functions of precision reward and economic reward respectively, and generate a comprehensive Q value to guide policy update through dynamic weighting fusion;

[0236] Double Q network (Double Q-Network) consists of two independent Q networks, which learn the value functions of the first reward (precision) and the second reward (economy) respectively, and fuse the Q values of the two through dynamic weight to balance the conflict between prediction accuracy and economic benefit.

[0237] Q network structure design:

[0238] Accuracy Q network (Q1): The input is the state feature vector (such as 60 minutes × 10 dimensions), and the output is the expected cumulative accuracy reward of each action. The network structure is fully connected layer (64→32→1), and the activation function is ReLU.

[0239] Economic Q network (Q2): The input is the same state, and the output is the expected cumulative economic reward. The structure is the same as above, but the parameters are independently initialized.

[0240] ‌Target Network: Create a delayed update copy of the network for Q1 and Q2 (parameters are synchronized every 1000 steps), to improve training stability.

[0241] ‌Dynamic Weighted Fusion Strategy:

[0242] ‌Weight Generator: Design a small neural network (input state features, output 2-dimensional weight vector [w1, w2]) to ensure w1 + w2 = 1 through Softmax. For example, network structure is 64→32→2.

[0243] ‌Context-Aware Weights: Dynamically adjust weights based on current state. For example, during peak electricity price period, weight towards economic reward (w2=0.7, w1=0.3); during night low valley period, weight towards accuracy (w1=0.8, w2=0.2).

[0244] ‌Total Q Value Calculation: Q_total = w1×Q1 + w2×Q2. For example, Q1=0.6, Q2=0.9, weights [0.3, 0.7]→Q_total=0.3×0.6 + 0.7×0.9=0.81.

[0245] ‌Policy Optimization and Update:

[0246] ‌Loss Function Definition: Use Huber Loss to balance mean square error and absolute error, formula: when |Q_target - Q_current| ≤ δ, L = 0.5×(Q_target - Q_current) 2 , otherwise L = δ×|Q_target - Q_current| - 0.5×δ 2 .

[0247] where δ is the threshold (e.g. 1.0), Q_target is the total Q value calculated by the target network, Q_current is the current network output.

[0248] ‌Gradient Backpropagation: Update Q1, Q2 and weight generator parameters through Adam optimizer, learning rate set to 0.0001 to prevent overfitting.

[0249] ‌Exploration-Exploitation Balance: Use Epsilon-Greedy strategy (Epsilon-Greedy), initial ε=0.9 (high exploration), decay by 0.1 every 1000 steps, minimum ε=0.1. For example, 90% random actions in the first 1000 steps, gradually increasing the utilization ratio.

[0250] Introduce a prioritized experience replay mechanism to store historical state-action-reward tuples, periodically sample and fine-tune the policy network parameters, and output a dynamically optimized power prediction model.

[0251] ‌Prioritized Experience Replay (PER) improves training efficiency by storing high-value experiences (such as large rewards or high error samples) and prioritizing sampling. Periodic Fine-Tuning adjusts model parameters based on the latest data to adapt to environmental changes.

[0252] ‌Experience Replay Pool Construction‌:

[0253] ‌Storage Structure‌: Each experience tuple contains State, Action, Reward, Next State, and Done. For example, the state is a 60x10 matrix, and the action is a floating-point number.

[0254] ‌Priority Calculation‌: Priority P = |TD Error| + ε (minimizing zero), TD Error = |Q_target - Q_current|. For example, if the TD error of a sample is 0.5, then P = 0.5 + 1e-6 ≈ 0.500001.

[0255] ‌Sampling Probability‌: The probability is proportional to the priority, formula: Probability(i) = P(i)^α / ΣP(j)^α, α controls the priority intensity (e.g., α = 0.6).

[0256] ‌Periodic Fine-Tuning Strategy‌:

[0257] ‌Fine-Tuning Frequency‌: Start fine-tuning after collecting 500 new experience tuples, and sample 200 high-priority samples each time.

[0258] ‌Policy Network Update‌: Calculate the policy gradient based on the comprehensive Q value, formula: Gradient ascent Δθ = α × ∇θ log(π(a|s)) × Q_total, where α is the learning rate (e.g., 0.0003).

[0259] ‌Model Stability Guarantee‌: Apply Gradient Clipping (threshold 1.0) and Soft Update (target network parameters θ' = τθ + (1 - τ)θ', τ = 0.01).

[0260] ‌Dynamic Optimization Model Output‌:

[0261] ‌Online Verification‌: Calculate the prediction accuracy (e.g., MAE) and economic benefits every 1 hour on the validation set (the latest 10% data). If the verification fails for 3 consecutive times, roll back to the last stable version.

[0262] ‌Model Snapshot‌: Save the daily optimal model parameters (e.g., based on 24-hour cumulative benefits) to support quick recovery and version comparison.

[0263] ‌Final Output‌: When the training loss converges (e.g., the loss fluctuation is less than 1% for 1000 consecutive steps) or reaches the maximum number of steps (e.g., 100,000 steps), output the dynamically optimized power prediction model and deploy it to the real-time prediction system.

[0264] ‌Key Technology Examples and Parameter Descriptions‌

[0265] ‌RMSE (Root Mean Square Error): The square root of the average of the squares of the prediction errors, with the same unit as the predicted value (e.g., kW). The parameter "decay coefficient λ" controls the time weight decay speed (e.g., λ = 0.01).

[0266] ‌TD Error (Time Difference Error): The difference between the target Q value and the current Q value, reflecting the learning value of the sample. The parameter "α" adjusts the priority intensity (α = 0.6 represents a medium priority bias).

[0267] ‌Huber Loss: A robust loss function, with the parameter "δ" determining the switching threshold between squared error and absolute error (δ = 1.0).

[0268] ‌Softmax Function: Converts the weight generator output into a probability distribution (sum = 1), with the parameter "temperature T" adjustable to adjust the distribution smoothness (default T = 1).

[0269] ‌Adam Optimizer: An adaptive learning rate optimization algorithm, with the parameters "beta1 = 0.9" controlling the first-order moment decay rate and "beta2 = 0.999" controlling the second-order moment decay rate.

[0270] By designing a dual reward mechanism that considers both prediction accuracy and economic efficiency, the model can not only continuously improve prediction accuracy in online applications, but also actively adapt to real-time electricity price fluctuations and load demand changes in the electricity market, achieving balanced optimization of technical performance and economic value. This breaks through the limitations of traditional prediction models that only focus on accuracy indicators, incorporates dynamic electricity market data into the optimization target, and makes the prediction results directly serve the maximization of power generation benefits, thereby improving the commercial operation efficiency of photovoltaic power stations.

[0271] S204, input the meteorological data and photovoltaic monitoring data of the current time into the dynamically optimized power prediction model, dynamically weight the feature contribution of different time steps through the spatio-temporal attention mechanism, and generate a photovoltaic power prediction sequence of a future preset time.

[0272] Specifically, real-time meteorological data and photovoltaic monitoring data can be input into the dynamically optimized power prediction model, past 1-hour time series features are extracted through a sliding window, and a standardized input tensor is generated.

[0273] Real-time meteorological data (such as instantaneous irradiance, wind speed, and ambient temperature) and photovoltaic monitoring data (such as component temperature, dust coverage, and attenuation coefficient) are updated at different frequencies (such as every minute or every 5 minutes). A sliding window is used to extract a feature sequence with a unified time reference, and standardization processing is performed to ensure that the time series features input into the model are consistent and comparable.

[0274] ‌Sliding window configuration‌:

[0275] ‌Window length setting‌: Based on the short-term fluctuation characteristics of photovoltaic power generation (such as the time scale affected by cloud cover), the window length is set to 1 hour (60 minutes), covering the past 60 time steps (one data point per minute). For example, if the current time is 14:00, the window covers data from 13:00 to 14:00.

[0276] ‌Feature alignment strategy‌: Linear interpolation (Linear Interpolation) is used to fill low-frequency data (such as dust coverage updated every 5 minutes) to a frequency of every minute. For example, the dust data at 13:05 is used until 13:06 and 13:07, and new data at 13:10 is used.

[0277] ‌Outlier processing‌: Median filter (Median Filter, window length 5 minutes) is applied to remove transient noise. For example, if the irradiance of a certain minute suddenly drops to 0 (sensor failure), it is replaced by the median of the adjacent 5 minutes.

[0278] ‌Standardization processing‌:

[0279] ‌Feature-wise normalization‌: Each feature dimension is individually standardized using Z-Score normalization (Z-Score Normalization), with the formula: standardized value = (original value - mean) / standard deviation. For example, the historical mean of irradiance is 500 W / m 2 , the standard deviation is 100 W / m 2 , and the current value is 600 W / m 2 . After standardization, it is (600-500) / 100=1.0.

[0280] Dynamic mean update: Exponentially Weighted Moving Average (EWMA) is used to dynamically update the mean and standard deviation, adapting to changes in data distribution. For example, new mean = 0.9 * old mean + 0.1 * current value, smoothing factor α = 0.1.

[0281] Missing value filling: If data is missing at a certain time step (e.g., communication interruption), use Bidirectional LSTM to predict the missing value. For example, predict the missing component temperature based on the data of the previous and next 10 minutes.

[0282] Input tensor generation:

[0283] Temporal dimension integration: Convert 60-minute x 10-feature (e.g., 3 weather, 7 monitoring) data into a three-dimensional tensor with shape (sample number = 1, time step = 60, feature dimension = 10). For example, single prediction only processes real-time data of the current power station, with a sample number of 1.

[0284] Format adaptation: Adjust the tensor to the required format for model input (e.g., TensorFlow's TF-Tensor or PyTorch's Torch Tensor). For example, use Float32 data type, memory layout as channel first (ChannelsLast).

[0285] Cache mechanism: Keep the last 1 hour of data in memory to avoid repeated calculations. For example, add a new time step data every minute and remove the oldest time step (sliding window rolling update).

[0286] Deploy a spatio-temporal attention module at the output of the LSTM hidden layer, respectively calculate the time dimension attention weight and the feature dimension attention weight, and generate a spatio-temporal attention weight matrix;

[0287] Spatio-temporal attention module (Spatio-Temporal Attention Module) dynamically focuses on key information by independently calculating the attention weight of time dimension (which time is more important) and feature dimension (which sensor data is more critical), enhancing the sensitivity of the model to important features.

[0288] Time attention calculation:

[0289] Attention input: Time series features output by LSTM hidden layer (shape 60x128, assuming 128 hidden units).

[0290] Attention weight generation:

[0291] Query, Key, Value vectors: Map hidden features to a low-dimensional space through three independent fully-connected layers (128→64 dimensions). For example, the Query vector captures the context needs at the current time step, and the Key vector represents the information at the historical time steps.

[0292] Similarity computation: Compute the dot product between the Query and each time step Key to measure the relevance between time steps. For example, a higher similarity score between the current time step and a historical time step indicates a stronger association.

[0293] Weight normalization: Apply the Softmax function to the similarity scores to generate time attention weights (sum to 1). For example, a weight of 0.15 for a time step indicates that it contributes 15% attention to the current prediction.

[0294] Temporal feature enhancement: Weighted sum of the weights and Value vectors to generate temporal attention features (shape 60×64). For example, historical peak generation periods (e.g., noon) have significantly higher weights than other periods.

[0295] Feature attention computation:

[0296] Feature importance evaluation: Compute the importance score of each feature dimension (e.g., irradiance, dust coverage) for the current prediction task.

[0297] Attention mechanism design:

[0298] Feature embedding: Map original features to an embedding space through a fully-connected layer (10→32 dimensions). For example, the irradiance embedding vector may be associated with a linear variation pattern in power generation.

[0299] Correlation score: Compute the cosine similarity between the embedding vectors and the task target (power generation). For example, irradiance has the highest similarity score with power, followed by dust coverage.

[0300] Weight assignment: Normalize the scores through the Softmax function to generate feature attention weights (10-dimensional vector). For example, irradiance has a weight of 0.35, and dust coverage has a weight of 0.25, with the remaining features sharing the remaining weight.

[0301] Feature-weighted fusion: Weighted sum of the original features according to the weights to generate the feature attention vector (shape 60×10). For example, the irradiance feature weight increases to 0.5 during high irradiance periods.

[0302] Spatio-temporal weight matrix synthesis:

[0303] ‌Outer Product: Perform outer product operation between time attention weights (60 dimensions) and feature attention weights (10 dimensions) to generate a 60x10 spatio-temporal attention matrix. For example, the irradiance (feature weight 0.35) at a certain time (time weight 0.2) corresponds to the matrix element 0.2x0.35=0.07.

[0304] ‌Normalization: Perform row-wise Softmax on the matrix elements to ensure that the sum of weights at each time step is 1. For example, the sum of all feature weights at a certain time step is forced to be 1 to avoid weight drift.

[0305] ‌Matrix Visualization: Visualize the spatio-temporal weight distribution through a heat map to help operations and maintenance personnel understand the model focus. For example, the component temperature feature weight significantly increases during high temperature periods.

[0306] Use the spatio-temporal attention weight matrix to dynamically weight and fuse the standardized input tensor, suppress the influence of noise period features, and generate an enhanced spatio-temporal feature vector;

[0307] The spatio-temporal attention weight matrix indicates the relative importance of different time points and features. Through dynamic weighted fusion, amplify key signals and suppress the influence of noise or irrelevant features to improve the signal-to-noise ratio of input data.

[0308] ‌Weighted Fusion Process:

[0309] ‌Element-wise Multiplication: Element-wise multiply the spatio-temporal attention matrix (60x10) and the standardized input tensor (60x10) to generate a weighted feature matrix. For example, the original value of irradiance at a certain time is 1.2, and the weight is 0.07→ weighted value is 1.2x0.07=0.084.

[0310] ‌Feature Scaling: Scale the weighted features proportionally to maintain numerical stability. For example, introduce a learnable scaling coefficient γ (initial value 1.0) to adjust the amplitude of the weighted features.

[0311] ‌Residual Connection: Add the weighted features to the original input to retain basic information. For example, weighted features + original input = enhanced features to prevent excessive reliance on attention mechanisms and loss of original data distribution.

[0312] ‌Noise Suppression Strategy:

[0313] ‌Low Weight Filtering: Set a threshold (such as weight <0.05) to mask irrelevant features. For example, the wind speed weight at a certain time is 0.03, which is directly set to zero to eliminate interference.

[0314] ‌Moving Average Smoothing: Apply a Moving Average with window length 5 to the weighted feature sequence to smooth out transient fluctuations. For example, a feature sequence [0.1, 0.2, 0.05, 0.15, 0.3] is smoothed to [0.14, 0.15, 0.16,...].

[0315] ‌Adversarial Training Enhancement: Inject random noise (e.g., Gaussian noise σ=0.1) during training to force the attention module to learn robust weighting. For example, add noise to the input tensor and recalculate the weights to ensure stable weight distribution.

[0316] ‌Enhanced Feature Generation:

[0317] ‌Dimension Compression: Compress the feature dimensions through a fully connected layer (60×10→60×64) to reduce redundant information. For example, map 10-dimensional weighted features to a 64-dimensional high-level semantic space.

[0318] ‌Time Step Stacking: Stack the enhanced features along the time dimension to generate a spatio-temporal feature vector with shape 1×60×64 (sample number × time step × feature dimension).

[0319] ‌Caching and Reuse: Store the enhanced features of the current time step in a cache queue for subsequent prediction iterations. For example, reuse part of the features from time t when predicting time t+1 to reduce redundant calculations.

[0320] Input the spatio-temporal feature vector into the Recursive Prediction Layer to iteratively generate 24-hour power prediction values at 15-minute intervals, outputting high-precision time series prediction results.

[0321] The Recursive Prediction Layer uses an Autoregressive approach, taking the prediction result of the previous time step as input for the next time step, gradually generating power values at multiple future time points to ensure the time continuity of the prediction sequence.

[0322] ‌Recursive Prediction Mechanism:

[0323] ‌Initial State Setting: Input the enhanced spatio-temporal feature vector (60×64) into the LSTM unit to initialize the Hidden State and Cell State. For example, the Hidden State dimension is 128, and the Cell State dimension is 128.

[0324] ‌Single Step Prediction Process:

[0325] ‌Feature Input: Input the feature vector of the current time step (e.g., t=60) into the LSTM unit, outputting the Hidden State.

[0326] ‌Power Prediction: The hidden state is passed through a fully connected layer (128→1) to generate the power prediction for the current time step (e.g., 150 kW).

[0327] ‌State Passing: The hidden state and cell state are passed to the next time step as the initial state.

[0328] ‌Input Updating: The current prediction is used as part of the input for the next time step (e.g., the electricity price data still needs to be updated in real-time).

[0329] ‌Multi-step Iteration: The above steps are repeated to generate a power sequence for 96 time points (24 hours × 4) with 15-minute intervals (i.e., predicting power every 15 minutes). For example, the first step predicts the power at 14:15, and the last step predicts the power at 14:00 the next day.

[0330] ‌Error Accumulation Suppression:

[0331] ‌Hybrid Input Strategy: During the recursion process, the predicted value is gradually replaced by the true value (if available) as input to reduce error propagation. For example, the predicted value is used for the first hour, and then the true value is updated every 15 minutes (Scheduled Sampling).

[0332] ‌Dynamic Correction Mechanism: External weather forecast data (e.g., future cloud cover prediction) is introduced to correct the model input. For example, if the forecast shows that it will rain in the next 2 hours, the irradiance input value is forcibly reduced.

[0333] ‌Ensemble Prediction: Multiple model instances (e.g., different initialization parameters) are run in parallel, and the average of the prediction results is taken as the final output to reduce variance. For example, the predicted values of 5 models are 148 kW, 152 kW, 150 kW, 149 kW, and 151 kW, and the final output is 150 kW.

[0334] ‌Result Post-processing and Output:

[0335] ‌Numerical Truncation: The predicted value is limited within the physical limits of the power plant (e.g., 0 to rated power 500 kW). For example, if the model predicts -10 kW, it is forcibly corrected to 0 kW.

[0336] ‌Smoothing Processing: The Savitzky-Golay filter (window length 7, polynomial order 2) is applied to the prediction sequence to eliminate high-frequency fluctuations. For example, [150, 155, 148, 160, 145] is smoothed to [153, 152, 151, 150, 149].

[0337] ‌Formatted Output‌: Convert the predicted sequence into JSON or CSV format, including timestamp and power value fields. For example:

[0338] {"timestamp": "2023-10-01 14:15:00", "power_kW": 150.2},

[0339] {"timestamp": "2023-10-01 14:30:00", "power_kW": 152.7},

[0340] ‌Visualization Interface‌: Display the predicted curve (line chart) on a monitoring large screen, superimposed with real value curve and historical same period curve, support operation and maintenance personnel interactive analysis.

[0341] ‌Key Technology Examples and Parameter Descriptions‌

[0342] ‌Sliding Window‌: Window length 60 minutes (time step 60), sliding every minute, parameter "window length" determines the historical information coverage range.

[0343] ‌Z-Score Standardization‌: Mean μ and standard deviation σ are dynamically updated, parameter "smoothing coefficient α=0.1" controls the historical data weight decay speed.

[0344] ‌Spacetime Attention Module‌: Number of time attention heads = 4, number of feature attention heads = 2, parameter "number of heads" determines the number of parallel calculation paths.

[0345] ‌Recursive Prediction Layer‌: Autoregressive step number 96 (24 hours x 4), parameter "step length" determines the prediction time granularity (15 minutes).

[0346] ‌Savitzky-Golay Filter‌: Window length 7, polynomial order 2, parameter "window length" affects the smoothing degree (the longer the smoother).

[0347] In the final prediction stage, introduce spatiotemporal attention mechanism, automatically identify and strengthen the influence weight of key time period and key feature, effectively suppress the negative impact of abnormal weather or equipment failure and other interference factors on the prediction result, improve the prediction robustness, through dynamic feature weighting significantly improve the stability and interpretability of the prediction result, make the model still maintain reliable output when facing complex weather changes or equipment state fluctuations, provide high credibility power generation power prediction for power grid dispatching.

[0348] It can be seen that, according to historical meteorological data, historical photovoltaic monitoring data and corresponding historical power generation data, a multi-modal training feature matrix consistent in space and time is generated; based on the multi-modal training feature matrix, an LSTM prediction model with multiple input channels is constructed, and a pre-trained model with cross-regional generalization is output; according to real-time meteorological data, current photovoltaic monitoring data and price fluctuation curve of a target region, a double reward reinforcement learning strategy is used to update the pre-trained model online, and a dynamically optimized power prediction model is output; meteorological data and photovoltaic monitoring data at the current time are input into the dynamically optimized power prediction model, and a photovoltaic power generation power prediction sequence at a future preset time is generated, so that high-precision and strong-adaptive photovoltaic power generation power prediction can be realized.

[0349] Another embodiment of the application provides a LSTM photovoltaic power generation power prediction system fusing multi-modal data, referring to Figure 3 , the system can include:

[0350] The alignment module 301 is configured to align multi-source time series data by a dynamic time warping algorithm according to historical meteorological data, historical photovoltaic monitoring data and corresponding historical power generation data, and generate a multi-modal training feature matrix consistent in space and time, wherein the photovoltaic monitoring data includes photovoltaic panel temperature, surface dust coverage rate and component attenuation coefficient.

[0351] The construction module 302 is configured to construct an LSTM prediction model with multiple input channels based on the multi-modal training feature matrix, embed a time convolution network layer in an input gate of the LSTM to capture periodic characteristics of the meteorological data, and align data distribution of different regions by domain adversarial training, and output a pre-trained model with cross-regional generalization.

[0352] The optimization module 303 is configured to update the pre-trained model online by a double reward reinforcement learning strategy according to real-time meteorological data, current photovoltaic monitoring data and price fluctuation curve of a target region, wherein a first reward function is based on an error between predicted power and true value, and a second reward function is based on a matching degree between power generation economic benefits and load demand, and output a dynamically optimized power prediction model.

[0353] The prediction module 304 is configured to input meteorological data and photovoltaic monitoring data at the current time into the dynamically optimized power prediction model, dynamically weight feature contribution degrees of different time steps by a space-time attention mechanism, and generate a photovoltaic power generation power prediction sequence at a future preset time.

[0354] It can be seen that, according to historical meteorological data, historical photovoltaic monitoring data and corresponding historical power generation data, a multi-modal training feature matrix consistent in time and space is generated; based on the multi-modal training feature matrix, an LSTM prediction model with multiple input channels is constructed, and a pre-training model with cross-regional generalization is output; according to real-time meteorological data, current photovoltaic monitoring data and price fluctuation curves of a target region, a double-reward reinforcement learning strategy is used to update the pre-training model online, and a dynamically optimized power prediction model is output; meteorological data and photovoltaic monitoring data at the current time are input into the dynamically optimized power prediction model, and a photovoltaic power generation power prediction sequence at a future preset time is generated, so that high-precision and strong-adaptive photovoltaic power generation power prediction can be realized.

[0355] The embodiment of the present application also provides a storage medium, wherein the storage medium stores a computer program, and the computer program is arranged to execute the steps in any of the method embodiments.

[0356] Specifically, in the embodiment, the storage medium can be arranged to store a computer program for executing the following steps:

[0357] S201, according to historical meteorological data, historical photovoltaic monitoring data and corresponding historical power generation data, aligning multi-source time series data through a dynamic time warping algorithm to generate a multi-modal training feature matrix consistent in time and space, wherein the photovoltaic monitoring data includes photovoltaic panel temperature, surface dust coverage rate and component attenuation coefficient;

[0358] S202, based on the multi-modal training feature matrix, constructing an LSTM prediction model with multiple input channels, embedding a time convolution network layer in an input gate of the LSTM to capture the periodic characteristics of the meteorological data, and aligning the data distribution of different regions through domain adversarial training, and outputting a pre-training model with cross-regional generalization;

[0359] S203, according to real-time meteorological data, current photovoltaic monitoring data and price fluctuation curves of a target region, using a double-reward reinforcement learning strategy to update the pre-training model online, wherein a first reward function is based on the error between predicted power and true value, and a second reward function is based on the matching degree between power generation economic benefits and load demand, and outputting a dynamically optimized power prediction model;

[0360] S204, inputting meteorological data and photovoltaic monitoring data at the current time into the dynamically optimized power prediction model, dynamically weighting the feature contribution degree of different time steps through a spatio-temporal attention mechanism, and generating a photovoltaic power generation power prediction sequence at a future preset time.

[0361] It can be seen that, according to historical meteorological data, historical photovoltaic monitoring data and corresponding historical power generation data, a multi-modal training feature matrix consistent in time and space is generated; based on the multi-modal training feature matrix, an LSTM prediction model with multiple input channels is constructed, and a pre-training model with cross-regional generalization is output; according to real-time meteorological data, current photovoltaic monitoring data and price fluctuation curves of a target region, a double-reward reinforcement learning strategy is used to update the pre-training model online, and a dynamically optimized power prediction model is output; meteorological data and photovoltaic monitoring data at the current time are input into the dynamically optimized power prediction model, and a photovoltaic power generation power prediction sequence at a preset future time is generated, so that high-precision and strong-adaptive photovoltaic power generation power prediction can be realized.

[0362] The embodiment of the present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the method embodiments.

[0363] Specifically, the electronic device can further comprise a transmission device connected to the processor and an input-output device connected to the processor.

[0364] Specifically, in the embodiment, the processor can be configured to execute the following steps through the computer program:

[0365] S201, according to historical meteorological data, historical photovoltaic monitoring data and corresponding historical power generation data, aligning multi-source time series data through a dynamic time warping algorithm to generate a multi-modal training feature matrix consistent in time and space, wherein the photovoltaic monitoring data includes photovoltaic panel temperature, surface dust coverage rate and component attenuation coefficient;

[0366] S202, based on the multi-modal training feature matrix, constructing an LSTM prediction model with multiple input channels, embedding a time convolution network layer in an input gate of the LSTM to capture the periodic characteristics of the meteorological data, and aligning the data distribution of different regions through domain adversarial training, and outputting a pre-training model with cross-regional generalization;

[0367] S203, according to real-time meteorological data, current photovoltaic monitoring data and price fluctuation curves of a target region, using a double-reward reinforcement learning strategy to update the pre-training model online, wherein a first reward function is based on the error between predicted power and true value, and a second reward function is based on the matching degree between power generation economic benefits and load demand, and outputting a dynamically optimized power prediction model;

[0368] S204, input the meteorological data and photovoltaic monitoring data of the current time into the dynamically optimized power prediction model, generate the photovoltaic power prediction sequence of the future preset time by dynamically weighting the feature contribution degree of different time steps through the space-time attention mechanism.

[0369] It can be seen that the multi-modal training feature matrix consistent in time and space is generated according to the historical meteorological data, the historical photovoltaic monitoring data and the corresponding historical power generation data; the LSTM prediction model with multiple input channels is constructed based on the multi-modal training feature matrix, and the pre-training model with cross-regional generalization is output; the pre-training model is updated online by using the double reward reinforcement learning strategy according to the real-time meteorological data, the current photovoltaic monitoring data and the price fluctuation curve of the target region, and the dynamically optimized power prediction model is output; the meteorological data and the photovoltaic monitoring data of the current time are input into the dynamically optimized power prediction model, and the photovoltaic power prediction sequence of the future preset time is generated, so that the high-precision and strong-adaptive photovoltaic power prediction can be realized.

[0370] The above describes the structure, features and effects of the application in detail according to the embodiments shown in the drawings. The above description is only the preferred embodiments of the application, but the application is not limited to the embodiments shown in the drawings. Any changes or modifications made according to the concept of the application, or equivalent embodiments with equivalent changes, are still within the scope of the application.

Claims

1. An LSTM photovoltaic power generation power prediction method fusing multi-modal data, characterized in that, The method comprises: According to historical meteorological data, historical photovoltaic monitoring data and corresponding historical power generation data, aligning multi-source time series data through dynamic time warping algorithm to generate spatiotemporal consistent multi-modal training feature matrix, wherein the photovoltaic monitoring data includes photovoltaic panel temperature, surface dust coverage rate and component attenuation coefficient; Based on the multi-modal training feature matrix, a LSTM prediction model with multiple input channels is constructed, the time convolution network layer is embedded in the input gate of LSTM to capture the periodic characteristics of meteorological data, and the data distribution of different regions is aligned through domain adversarial training, and a pre-trained model with cross-regional generalization is outputted; According to the real-time meteorological data, the current photovoltaic monitoring data and the price fluctuation curve of the target region, a double reward reinforcement learning strategy is used to update the pre-trained model online, wherein the first reward function is based on the error between the predicted power and the true value, and the second reward function is based on the matching degree of power generation economic benefit and load demand, and a dynamically optimized power prediction model is outputted; The meteorological data and photovoltaic monitoring data at the current time are inputted into the dynamically optimized power prediction model, and the feature contribution degree of different time steps is dynamically weighted through the spatiotemporal attention mechanism to generate a photovoltaic power generation power prediction sequence in the future preset time; The method comprises: According to the sampling frequency difference of meteorological sensors and photovoltaic monitoring equipment, a sliding window adaptive interpolation algorithm is used to align the time stamp to generate an original time series data set with a unified time reference; The original time series data set is inputted into the dynamic time warping module to calculate the optimal time offset of the photovoltaic panel temperature, dust coverage rate and power generation power sequence, and a phase-aligned time series feature vector is generated; Based on the phase-aligned time series feature vector, the cross-modal correlation weight of meteorological data and monitoring data is extracted through a multi-modal feature fusion network to generate a weighted fusion feature matrix; The weighted fusion feature matrix is subjected to spatiotemporal smoothing constraint, and a bidirectional LSTM is used to eliminate sudden noise points, and a dimension-regularized multi-modal training feature matrix is outputted; The method comprises: The multi-modal training feature matrix is split into meteorological channels and monitoring channels according to data types, a time convolution network layer is embedded in the meteorological channel to output a meteorological period tensor containing hour, day and week period characteristics; The meteorological period tensor and the monitoring channel features are spliced and inputted into the LSTM unit, and the weight proportion of the two types of features is dynamically adjusted through the gated fusion mechanism to generate a period-enhanced time series memory state; A domain adversarial training framework is constructed based on the timing memory state, and a gradient reversal layer is used to force the LSTM hidden layer output area-independent general features to generate domain-invariant feature vectors; The domain-invariant feature vectors are input into a fully connected prediction layer, and a power prediction loss function and a domain classification loss function are jointly optimized to output a preliminary cross-region generalization model; The preliminary cross-region generalization model is subjected to knowledge distillation, and region-specific parameters are removed to output a lightweight pre-trained model; The pre-trained model is updated online by using a double reward reinforcement learning strategy according to real-time meteorological data, current photovoltaic monitoring data and price fluctuation curves of the target region, wherein a first reward function is based on the error between the predicted power and the true value, and a second reward function is based on the matching degree of power generation economic benefits and load demand, and a dynamically optimized power prediction model is output, including: The pre-trained model is loaded as a reinforcement learning strategy network, the environment state is defined as a sliding window feature vector of real-time meteorological-monitoring data, and the action is a power prediction value adjustment amount; A first reward calculation module is constructed to generate an accuracy reward signal according to the root mean square error between the predicted power and the measured value, and a recent error is given a weight coefficient of 3 times; A second reward calculation module is constructed to generate an economic benefit reward signal based on the matching degree of the price curve and the load demand period, and the reward value is distributed according to the benefit gradient; A double Q network architecture is designed to learn the Q value functions of accuracy rewards and economic rewards respectively, and a comprehensive Q value is generated by dynamically weighting fusion to guide strategy updating; A priority experience replay mechanism is introduced to store historical state-action-reward tuples, and the strategy network parameters are periodically sampled to output a dynamically optimized power prediction model; The meteorological data and photovoltaic monitoring data of the current time are input into the dynamically optimized power prediction model, the feature contribution degree of different time steps is dynamically weighted through a spatio-temporal attention mechanism, and a photovoltaic power generation power prediction sequence for a future preset time is generated, including: Real-time meteorological data and photovoltaic monitoring data are input into the dynamically optimized power prediction model, time series features in the past 1 hour are extracted through a sliding window, and a standardized input tensor is generated; A spatio-temporal attention module is deployed at the output end of the LSTM hidden layer to calculate time dimension attention weights and feature dimension attention weights respectively, and a spatio-temporal attention weight matrix is generated; The spatio-temporal attention weight matrix is used to dynamically weight and fuse the standardized input tensor to suppress the influence of noise period features, and an enhanced spatio-temporal feature vector is generated; The spatio-temporal feature vector is input into a recursive prediction layer to iteratively generate future 24-hour power prediction values at 15-minute intervals, and a high-precision time series prediction result is output.

2. An LSTM photovoltaic power generation power prediction system fusing multi-modal data, characterized in that, The system comprises: An alignment module is configured to align multi-source time series data through a dynamic time warping algorithm according to historical meteorological data, historical photovoltaic monitoring data and corresponding historical power generation data, and generate a multi-modal training feature matrix consistent in time and space, wherein the photovoltaic monitoring data includes photovoltaic panel temperature, surface dust coverage and component attenuation coefficient. The construction module is configured to construct an LSTM prediction model with multiple input channels based on the multi-modal training feature matrix, embed a time convolution network layer in an input gate of the LSTM to capture periodic features of meteorological data, and align data distributions of different regions through domain adversarial training, and output a pre-trained model with cross-region generalization; The optimization module is configured to update the pre-trained model online according to real-time meteorological data of a target region, current photovoltaic monitoring data and a price fluctuation curve, using a double-reward reinforcement learning strategy, wherein a first reward function is based on an error between predicted power and a true value, and a second reward function is based on a matching degree between power generation economic benefits and load demand, and output a dynamically optimized power prediction model; The prediction module is configured to input meteorological data and photovoltaic monitoring data of a current time into the dynamically optimized power prediction model, dynamically weight feature contribution degrees of different time steps through a spatio-temporal attention mechanism, and generate a photovoltaic power generation power prediction sequence of a future preset time. The multi-modal training feature matrix is generated by aligning multi-source time series data through a dynamic time warping algorithm based on historical meteorological data, historical photovoltaic monitoring data and corresponding historical power generation power data, wherein the photovoltaic monitoring data includes photovoltaic panel temperature, surface dust coverage rate and component attenuation coefficient, and the method comprises the following steps: A sliding window adaptive interpolation algorithm is used to align timestamps according to differences in sampling frequencies of meteorological sensors and photovoltaic monitoring equipment, and generate an original time series data set with a unified time reference; The original time series data set is input into a dynamic time warping module to calculate optimal time offsets of the photovoltaic panel temperature, the dust coverage rate and the power generation power sequence, and generate phase-aligned time series feature vectors; Based on the phase-aligned time series feature vectors, cross-modal correlation weights of the meteorological data and the monitoring data are extracted through a multi-modal feature fusion network, and a weighted fusion feature matrix is generated; The weighted fusion feature matrix is subjected to spatio-temporal smoothing constraints, and a bidirectional LSTM is used to eliminate sudden noise points, and a dimension-regularized multi-modal training feature matrix is output; The LSTM prediction model with multiple input channels is constructed based on the multi-modal training feature matrix, a time convolution network layer is embedded in an input gate of the LSTM to capture periodic features of meteorological data, and the data distributions of different regions are aligned through domain adversarial training, and a pre-trained model with cross-region generalization is output, and the method comprises the following steps: The multi-modal training feature matrix is split into a meteorological channel and a monitoring channel according to data types, a time convolution network layer is embedded in the meteorological channel, and a meteorological period tensor containing hourly, daily and weekly period features is output; The meteorological period tensor and the monitoring channel features are spliced and input into an LSTM unit, the weight proportion of the two types of features is dynamically adjusted through a gating fusion mechanism, and a period-enhanced time series memory state is generated; A domain adversarial training framework is constructed based on the time series memory state, a gradient reversal layer is used to force the LSTM hidden layer to output region-independent general features, and a domain-invariant feature vector is generated; The domain-invariant feature vector is input into a fully connected prediction layer, a power prediction loss function and a domain classification loss function are jointly optimized, and an initial cross-region generalization model is output. The preliminary cross-region generalization model is knowledge distilled, region-specific parameters are removed, and a lightweight pre-training model is output; According to the real-time meteorological data of the target area, the current photovoltaic monitoring data and the price fluctuation curve, a double reward reinforcement learning strategy is used to update the pre-training model online, wherein a first reward function is based on the error of the predicted power and the true value, and a second reward function is based on the matching degree of the power generation economic benefit and the load demand, and a dynamically optimized power prediction model is output, including: The pre-training model is loaded as a reinforcement learning strategy network, the environment state is defined as a sliding window feature vector of real-time meteorological-monitoring data, and the action is a power prediction value adjustment amount; A first reward calculation module is constructed, an accuracy reward signal is generated according to the root mean square error of the predicted power and the measured value, and a recent error is given a weight coefficient of 3 times; A second reward calculation module is constructed, an economic benefit reward signal is generated according to the matching degree of the price curve and the load demand period, and the reward value is distributed according to the income gradient; A double Q network architecture is designed to learn the Q value functions of accuracy reward and economic reward respectively, and a comprehensive Q value is generated by dynamic weighting fusion to guide strategy update; A priority experience replay mechanism is introduced to store historical state-action-reward tuples, periodically sample and fine-tune strategy network parameters, and output a dynamically optimized power prediction model; The meteorological data and photovoltaic monitoring data of the current time are input into the dynamically optimized power prediction model, the feature contribution degree of different time steps is dynamically weighted through a spatio-temporal attention mechanism, and a photovoltaic power generation power prediction sequence for a future preset time is generated, including: Real-time meteorological data and photovoltaic monitoring data are input into the dynamically optimized power prediction model, 1-hour time series features in the past are extracted through a sliding window, and a standardized input tensor is generated; A spatio-temporal attention module is deployed at the output end of the LSTM hidden layer, and time dimension attention weights and feature dimension attention weights are calculated respectively to generate a spatio-temporal attention weight matrix; The spatio-temporal attention weight matrix is used to dynamically weight and fuse the standardized input tensor to suppress the influence of noise period features and generate an enhanced spatio-temporal feature vector; The spatio-temporal feature vector is input into a recursive prediction layer to iteratively generate 24-hour power prediction values at 15-minute intervals, and a high-precision time series prediction result is output.

3. A storage medium, characterized by The storage medium stores a computer program, wherein the computer program is configured to run the method of claim 1.

4. An electronic device comprising a memory and a processor, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to run the method of claim 1.

Citation Information

Patent Citations

  • Ultra-short-term photovoltaic power prediction method based on small-scale weather classification and adaptive window

    CN119026731A

  • Ultra-short-term photovoltaic power combined prediction method based on multivariate meteorological data

    CN120767787A