Weighted Gaussian and multi-scale perception fused photovoltaic power prediction method and system

By integrating weighted Gaussian mixture probability features with a multi-scale perception mechanism, and utilizing fuzzy clustering and the Transformer model, the problems of multi-scale features and uncertainties in photovoltaic power prediction are solved, thereby improving prediction accuracy and robustness.

CN121566420APending Publication Date: 2026-02-24STATE GRID SHANDONG ELECTRIC POWER CO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511650653.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-12
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing photovoltaic power prediction methods are unable to accurately characterize the multi-scale features and complex distribution uncertainties of photovoltaic power generation, resulting in insufficient prediction accuracy and model generalization ability.

Method used

We employ a fusion of weighted Gaussian mixture probabilistic features and a multi-scale perception mechanism. We extract weighted Gaussian mixture features through fuzzy clustering and combine Transformer with multi-scale convolution to achieve the fusion of global temporal and multi-scale features.

Benefits of technology

The model's ability to perceive and predict photovoltaic power fluctuations under complex weather conditions has been improved, enhancing its robustness and generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121566420A_ABST
    Figure CN121566420A_ABST
Patent Text Reader

Abstract

The invention discloses a weighted Gaussian and multi-scale perception fused photovoltaic power prediction method and system, and the method comprises the steps: obtaining multi-region load data, meteorological data and photovoltaic power generation power data, carrying out the point-level clustering and fragment-level clustering, combining the clustered features into WGMM features, splicing the initial input features with the WGMM features, and carrying out the splicing of the initial input features and the WGMM features. An expanded input vector is obtained, random Gaussian noise is added to the expanded input vector, and a processed input vector is obtained; an improved Transform encoder model is constructed, wherein the encoder model comprises a double-layer Transform encoder, a multi-scale sensing module, an attention fusion module and a full-connection decoding layer which are connected in sequence; training the model to obtain a trained encoder model; performing photovoltaic power generation power prediction by using the trained encoder model; according to the invention, the power fluctuation sensing capability and prediction precision of the model under complex meteorological conditions are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of new energy power generation prediction technology, and in particular relates to a photovoltaic power prediction method and system that integrates weighted Gaussian and multi-scale sensing. Background Technology

[0002] With the large-scale integration of renewable energy, the proportion of photovoltaic (PV) power generation in the power system is constantly increasing. Due to the significant randomness and volatility of PV power output, its output is easily affected by changes in meteorological conditions, posing challenges to the operation and scheduling of the distribution network and voltage stability. Therefore, conducting high-precision PV power forecasting is of great significance for improving the flexibility and reliability of the power system. Currently, PV power forecasting methods mainly include physical model methods, statistical learning methods, and deep learning methods. Physical models rely on meteorological parameters and component characteristics, are computationally complex, and are highly dependent on parameters; statistical models have limitations in characterizing nonlinear relationships; while deep learning-based methods can effectively extract temporal and spatial features, they still have shortcomings in dealing with multi-scale feature changes and complex distribution uncertainties. On the other hand, PV output power data often exhibits multi-peak and multi-modal distribution characteristics, making it difficult for traditional models to accurately capture their probability distribution characteristics. Therefore, how to construct a PV power forecasting model that combines probabilistic expressiveness and multi-scale perception capabilities has become a key issue in improving forecast accuracy and model generalization ability.

[0003] To address the aforementioned issues, this invention proposes a photovoltaic power prediction method and system that integrates weighted Gaussian and multi-scale sensing. By fusing global temporal dependence and multi-scale feature information, the model's ability to perceive power fluctuations under complex weather conditions and its prediction accuracy are effectively improved. Summary of the Invention

[0004] This invention addresses the challenges of large-scale renewable energy integration into power distribution networks, particularly the strong randomness and volatility of photovoltaic (PV) power generation, and the difficulty of traditional models accurately characterizing multi-scale features and complex distribution uncertainties. It proposes a PV power prediction method that integrates weighted Gaussian mixture probabilistic features with a multi-scale sensing mechanism. This method extracts weighted Gaussian mixture features through fuzzy clustering and combines Transformer and multi-scale convolution to achieve global temporal and multi-scale feature fusion, thereby improving the model's ability to perceive power fluctuations and its prediction accuracy under complex meteorological conditions.

[0005] To address the problems existing in the background art, the present invention aims to provide a photovoltaic power prediction method that integrates weighted Gaussian and multi-scale sensing, the method comprising the following steps:

[0006] The system acquires multi-regional load data, meteorological data, and photovoltaic power generation data. The multi-regional load data and meteorological data constitute the initial input features. The initial input features are then subjected to point-level clustering and segment-level clustering, respectively. The clustered features are combined into WGMM features. The initial input features and WGMM features are concatenated to obtain the expanded input vector. Random Gaussian noise is added to the expanded input vector to obtain the final processed input vector.

[0007] An improved Transformer encoder model is constructed, comprising a two-layer Transformer encoder, a multi-scale perception module, an attention fusion module, and a fully connected decoding layer connected in sequence; the model is trained using the processed input vector and photovoltaic power generation data to obtain the trained encoder model;

[0008] The trained encoder model is used to predict photovoltaic power generation.

[0009] Furthermore, the method for training the model using the processed input vector and photovoltaic power generation data to obtain the trained encoder model is as follows:

[0010] 1) Initialize model parameters and set training hyperparameters, then use the Adam optimizer to update the parameters;

[0011] 2) Based on the final processed input vector The dataset for building the model using the target sequence Y Divide the dataset into a training set. With test set

[0012]

[0013] In the formula, N train N represents the total number of training samples. test The total number of test samples;

[0014] Use PyTorch DataLoader to load data in batches to ensure that each training round can cover all training samples, and randomly shuffle the order to enhance generalization ability.

[0015] 3) Each sampling batch b randomly selects B samples from the training set, represented as:

[0016]

[0017] In the formula, For the b-th batch, i j The index of samples randomly drawn from the training set is used to ensure that samples within a batch are either unique or allowed to be duplicated.

[0018] Collected sample sequences The data is fed into a two-layer Transformer encoder to extract global temporal dependencies. The Transformer encoder captures the global correlation between time steps in long-term data through a multi-head self-attention mechanism, and its calculation formula is as follows:

[0019]

[0020] In the formula, These are the query, key, and value matrices, respectively, d k The dimension of each attention head; the encoder's feedforward network uses a two-layer fully connected structure, with hidden dimension d. ff =4d model Furthermore, residual connections and LayerNorm are used between layers to enhance gradient propagation and training stability. The encoder output is:

[0021]

[0022] The encoded sequence feature output H is input to the multi-scale perception module to extract local patterns at different time scales. The multi-scale perception module processes the features in parallel using multi-dilation rate one-dimensional convolutions, with the dilation rate set to [1,2,4], the convolution kernel size k, and the number of output channels mp_channels. The output of each convolution branch is...

[0023] The features of each branch are summed and ReLU activation is applied to obtain the multi-scale feature F. ms :

[0024] MP output and encoder last time step characteristics H last Perform residual connections:

[0025] F res =F ms +H last

[0026] H last =H[:,-1,:]

[0027] An attention fusion module is introduced to achieve adaptive fusion of multi-scale features and WGMM fuzzy probability features:

[0028]

[0029] G = WGMM

[0030] Where, softmax is a non-linear activation function, and G is the clustering feature obtained in step (2). T F is the transpose of clustering feature G. resThis represents the residual connection result between the MP output and the encoder output.

[0031] The fused features are mapped to the predicted output through a fully connected decoding layer:

[0032]

[0033] Backpropagation is performed on the loss, and the model parameters are updated using the Adam optimizer:

[0034]

[0035] In the formula, θ represents the model parameters. This is the loss function for this batch;

[0036] After the b-th batch completes training, the batch index b increases by 1:

[0037] b←b+1;

[0038] 4) If the training batches satisfy Then repeat step 3). If the condition is not met, the training round E is increased by 1.

[0039] 5) If the number of training epochs satisfies E < epochs, then increase the number of training epochs E by 1 and repeat steps 3)-4). If not, then complete the model training and output the trained model parameters.

[0040] Furthermore, during the model training phase, the mean squared error loss function is defined as the optimization objective:

[0041]

[0042] Here, T represents the mean squared error, N is the number of samples, and T is the mean squared error. out For the target sequence time step, D out Let be the feature dimension of the target sequence, i be the sample index, t be the time step index, and j be the output dimension index. Let y be the predicted value of the j-th output component of the model at time t for training sample i. i,t,j Let be the model's prediction of the j-th true observation at time t for training sample i.

[0043] Furthermore, multi-regional load data, meteorological data, and photovoltaic power generation data are acquired. The multi-regional load data and meteorological data constitute the initial input features. The initial input features are then subjected to point-level clustering and segment-level clustering. The clustered features are combined into WGMM features. The initial input features and WGMM features are concatenated to obtain an expanded input vector. Random Gaussian noise is added to the expanded input vector to obtain the final processed input vector. This process includes the following steps:

[0044] (1) Normalization preprocessing is performed on multi-regional load data, meteorological data x, and photovoltaic power generation data y to obtain the initial input sequence X and the target sequence Y:

[0045]

[0046] In the formula, N is the number of samples, and T in D is the time step of the initial input sequence. in Let T be the feature dimension of the initial input sequence. out For the target sequence time step, D out The feature dimension of the target sequence;

[0047] (2) The initial input sequence X is fuzzy clustered in both time and feature dimensions using the FCM clustering method, and WGMM features are constructed as follows:

[0048] Point-wise (PW) clustering: Performs FCM along the feature dimension to obtain the membership matrix at each time step. It reflects the soft affiliation of samples under different cluster centers;

[0049] Segment-wise (SW) clustering: Take the last L segments of each sample, expand them into L×D vectors, and then perform FCM clustering to obtain the segment-level membership matrix. Depicting the overall dynamic patterns between time segments;

[0050] WGMM Feature Construction: Constructing the point-level clustering matrix U pw With fragment-level clustering matrix U sw Combining features into WGMM:

[0051] WGMM=α·U pw +(1-α)·U sw ,α∈[0,1]

[0052] The original input feature X is concatenated with the fuzzy clustering feature WGMM to obtain the augmented input vector:

[0053] X′=[X,WGMM]

[0054] Add random Gaussian noise to the expanded input vector X′:

[0055]

[0056] in, This is the final processed input vector.

[0057] Furthermore, after the model training is completed, the trained model is tested using a test set. The specific steps are as follows:

[0058] 1) The trained model is f θ (·), perform forward inference on the test set:

[0059]

[0060] f is the predicted sequence output by the model. θ (·) represents the prediction model obtained after training, X j For the j-th sample, input sequence Let D be the predicted output vector at time step t, with dimension D. out ;

[0061] 2) The model performance is evaluated using three indicators: mean square error, mean absolute error, and root mean square error.

[0062] This invention also provides a photovoltaic power prediction system that integrates weighted Gaussian and multi-scale sensing, for implementing the aforementioned photovoltaic power prediction method integrating weighted Gaussian and multi-scale sensing. The system includes:

[0063] The input vector processing module is used to acquire multi-region load data, meteorological data, and photovoltaic power generation data. The multi-region load data and meteorological data constitute the initial input features. The initial input features are subjected to point-level clustering and segment-level clustering respectively. The clustered features are combined into WGMM features. The initial input features and WGMM features are concatenated to obtain the expanded input vector. Random Gaussian noise is added to the expanded input vector to obtain the final processed input vector.

[0064] An improved Transformer encoder model construction and training module is used to construct an improved Transformer encoder model, which includes a two-layer Transformer encoder, a multi-scale perception module, an attention fusion module, and a fully connected decoding layer connected in sequence; the model is trained using the processed input vector and photovoltaic power generation data to obtain the trained encoder model;

[0065] The photovoltaic power generation prediction module is used to predict photovoltaic power generation using a trained encoder model.

[0066] Furthermore, the present invention adopts the following technical solution:

[0067] A non-transitory computer-readable storage medium storing a computer program that, when executed by a processor, implements a photovoltaic power prediction method that integrates weighted Gaussian and multi-scale sensing.

[0068] Furthermore, the present invention adopts the following technical solution:

[0069] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the photovoltaic power prediction method fused with weighted Gaussian and multi-scale sensing as described above.

[0070] The beneficial technical effects of this invention are as follows:

[0071] This invention utilizes fuzzy clustering and multi-scale deep learning methods to address the issues of strong randomness and volatility in photovoltaic power generation, and the difficulty of traditional models in accurately characterizing multi-scale features and complex distribution uncertainties. It proposes a photovoltaic power prediction method that integrates weighted Gaussian mixture probability features and a multi-scale perception mechanism. This method can effectively extract the probability distribution features and multi-scale temporal features of photovoltaic power, and improve the model's power fluctuation perception capability and prediction accuracy under complex meteorological conditions. Attached Figure Description

[0072] Figure 1 This is a flowchart illustrating the photovoltaic power prediction method that integrates weighted Gaussian and multi-scale sensing provided in Embodiment 1 of the present invention.

[0073] Figure 2 This provides year-round multi-regional load and photovoltaic data for Embodiment 2 of the present invention.

[0074] Figure 3 The load and photovoltaic output power for two days are provided in Embodiment 2 of the present invention;

[0075] Figure 4 The training loss curves for each model provided in Embodiment 2 of the present invention are shown below.

[0076] in, Figure 4 In this paper, Original Model represents the model proposed in this invention, SimpleLSTM represents the Long Short-Term Memory network model, SimpleGRU represents the gated recurrent model, Transformer is a prediction model based entirely on self-attention, CNNLSTM is a model that uses convolutional neural network (CNN) feature extraction followed by prediction by the Long Short-Term Memory network, AttentionLSTM is a prediction model that introduces an attention mechanism on the basis of traditional LSTM, and WaveNet is an autoregressive prediction model modeled by causal convolution and dilated convolution. Detailed Implementation

[0077] This invention proposes a photovoltaic power prediction method that integrates weighted Gaussian mixture probabilistic features and a multi-scale perception mechanism. First, the model input sequence, composed of multi-regional load data and various meteorological data, undergoes fuzzy clustering processing. The Fuzzy C-Means (FCM) algorithm is used for point-level and segment-level clustering. The two types of fuzzy features are then fused using weighted methods to form a weighted Gaussian mixture feature (WGMM), which reflects a comprehensive representation of local and global temporal features. Second, the original input features are concatenated with the fuzzy clustering features. Gaussian noise is introduced during the training phase to improve the model's robustness and generalization ability. Finally, the enhanced input sequence is first processed by a two-layer Transformer encoder to extract global temporal dependencies, and then input into a multi-scale perception module (MP). Convolutions with different dilation rates are used in parallel to extract features across multiple time scales, enabling simultaneous perception of short-term fluctuations and long-term trends. Finally, an attention fusion module guides the weighted fusion of multi-scale features using WGMM features, achieving adaptive fusion of fuzzy semantics and temporal features through attention weighting to obtain the final prediction result.

[0078] The photovoltaic power prediction method and system integrating weighted Gaussian and multi-scale sensing provided by this invention will be further described clearly and completely below with reference to the accompanying drawings:

[0079] Example 1

[0080] like Figure 1 As shown in the figure, the photovoltaic power prediction method integrating weighted Gaussian and multi-scale sensing provided by the embodiments of the present invention includes the following steps:

[0081] The system acquires multi-regional load data, meteorological data, and photovoltaic power generation data. The multi-regional load data and meteorological data constitute the initial input features. The initial input features are then subjected to point-level clustering and segment-level clustering, respectively. The clustered features are combined into WGMM features. The initial input features and WGMM features are concatenated to obtain the expanded input vector. Random Gaussian noise is added to the expanded input vector to obtain the final processed input vector.

[0082] An improved Transformer encoder model is constructed, comprising a two-layer Transformer encoder, a multi-scale perception module, an attention fusion module, and a fully connected decoding layer connected in sequence; the model is trained using the processed input vector and photovoltaic power generation data to obtain the trained encoder model;

[0083] The trained encoder model is used to predict photovoltaic power generation.

[0084] The process involves acquiring multi-regional load data, meteorological data, and photovoltaic power generation data. The multi-regional load data and meteorological data constitute the initial input features. These initial input features are then subjected to point-level clustering and segment-level clustering. The clustered features are combined into a WGMM feature set. The initial input features are concatenated with the WGMM feature set to obtain an expanded input vector. Random Gaussian noise is added to the expanded input vector to obtain the final processed input vector. The process includes the following steps:

[0085] (1) Normalization preprocessing is performed on multi-regional load data, meteorological data x, and photovoltaic power generation data y to obtain the initial input sequence X and the target sequence Y:

[0086]

[0087] In the formula, N is the number of samples, and T in D is the time step of the initial input sequence. in Let T be the feature dimension of the initial input sequence. out For the target sequence time step, D out The feature dimension of the target sequence.

[0088] (2) The initial input sequence X is fuzzy clustered in both time and feature dimensions using the FCM clustering method, and WGMM features are constructed as follows:

[0089] Point-wise (PW) clustering: Performs FCM along the feature dimension to obtain the membership matrix at each time step. It reflects the soft affiliation of samples under different cluster centers;

[0090] Segment-wise (SW) clustering: Take the last L segments of each sample, expand them into L×D vectors, and then perform FCM clustering to obtain the segment-level membership matrix. Depicting the overall dynamic patterns between time segments.

[0091] WGMM Feature Construction: Constructing the point-level clustering matrix U pw With fragment-level clustering matrix U sw Combining features into WGMM:

[0092] WGMM=α·U pw +(1-α)·U sw ,α∈[0,1]

[0093] The original input feature X is concatenated with the fuzzy clustering feature WGMM to obtain the augmented input vector:

[0094] X′=[X,WGMM]

[0095] Add random Gaussian noise to the expanded input vector X′:

[0096]

[0097] in, This is the final processed input vector;

[0098] It should be noted that the above steps process the initial input features, mapping the original sequence to a fuzzy membership space based on the similarity between samples. This achieves soft partitioning and structured reorganization of the input features, smoothing local noise while preserving key information features, enhancing the separability and consistency of the data, and thus providing a more representative foundation for subsequent input features. In this way, the model can more fully uncover the implicit patterns of photovoltaic power data across multiple time scales, improving the perception and prediction of power fluctuation characteristics under various conditions.

[0099] In this embodiment, the improved Transformer encoder model is trained using the processed input vector and photovoltaic power generation data. The specific method is as follows:

[0100] 1) Model parameter initialization, including the hidden dimension d of the Transformer encoder. model Feedforward network dimension d ff Multi-head attention count n head The number of output channels (mp_channels) of the multi-scale sensing module (MP), the parameters of the fully connected layer of the decoder, etc.

[0101] The training hyperparameters were set as follows: number of training epochs, batch size B, and learning rate η. The Adam optimizer was used to update the parameters.

[0102] 2) Based on the final processed input vector The dataset for building the model using the target sequence Y Divide the dataset into a training set. With test set

[0103]

[0104] In the formula, N train N represents the total number of training samples. test The total number of test samples;

[0105] Use PyTorch DataLoader to load data in batches to ensure that each training round can cover all training samples, and randomly shuffle the order to enhance generalization ability.

[0106] 3) Each sampling batch b randomly selects B samples from the training set, represented as:

[0107]

[0108] In the formula, For the b-th batch, i j This is the index of samples randomly drawn from the training set, ensuring that samples within a batch are either unique or allowed to be duplicated.

[0109] Collected sample sequences The data is fed into a two-layer Transformer encoder to extract global temporal dependencies. The Transformer encoder captures the global correlation between time steps in long-term data through a multi-head attention mechanism, the calculation formula of which is as follows:

[0110]

[0111] In the formula, These are the query, key, and value matrices, respectively, d k The dimension of each attention head; the encoder's feedforward network uses a two-layer fully connected structure, with hidden dimension d. ff =4d model Furthermore, residual connections and LayerNorm are used between layers to enhance gradient propagation and training stability. The encoder output is:

[0112]

[0113] The encoded sequence feature output H is input to the multi-scale perception module to extract local patterns at different time scales. The multi-scale perception module processes the features in parallel using multi-dilation rate one-dimensional convolutions, with the dilation rate set to [1,2,4], the convolution kernel size k, and the number of output channels mp_channels. The output of each convolution branch is...

[0114] The features of each branch are summed and ReLU activation is applied to obtain the multi-scale feature F. ms :

[0115] MP output and encoder last time step characteristics H last Perform residual connections:

[0116] F res =F ms +H last

[0117] H last =H[:,-1,:]

[0118] An attention fusion module is introduced to achieve adaptive fusion of multi-scale features and WGMM fuzzy probability features:

[0119]

[0120] G = WGMM

[0121] Where, softmax is a non-linear activation function, and G is the clustering feature obtained in step (2). T F is the transpose of clustering feature G. res This is the residual connection result between the MP output and the encoder output.

[0122] The fused features are mapped to the predicted output through a fully connected decoding layer:

[0123]

[0124] During the model training phase, the mean squared error loss function (MSE) is defined as the optimization objective:

[0125]

[0126] Here, T represents the mean squared error, N is the number of samples, and T is the mean squared error. out For the target sequence time step, D out Let be the feature dimension of the target sequence, i be the sample index, t be the time step index, and j be the output dimension index. Let y be the predicted value of the j-th output component of the model at time t for training sample i. i,t,j Let be the model's prediction of the j-th true observation at time t for training sample i.

[0127] Backpropagation is performed on the loss, and the model parameters are updated using the Adam optimizer:

[0128]

[0129] In the formula, θ represents the model parameters. This is the loss function for this batch.

[0130] After the b-th batch completes training, the batch index b increases by 1:

[0131] b←b+1;

[0132] 4) If the training batches satisfy Then repeat step 3). If the condition is not met, the training round E is increased by 1.

[0133] 5) If the number of training epochs satisfies E < epochs, then increase the number of training epochs E by 1 and repeat steps 3)-4). If not, then complete the model training and output the trained model parameters.

[0134] After training the improved Transformer encoder model, the trained model is tested using a test set. The specific steps are as follows:

[0135] 1) The trained model is f θ (·), perform forward inference on the test set:

[0136]

[0137] f is the predicted sequence output by the model. θ (·) represents the prediction model obtained after training, X j For the j-th sample, input sequence Let D be the predicted output vector at time step t, with dimension D. out .

[0138] 2) The model performance is evaluated using three metrics: Mean Squared Error (MSE), Mean Absolute Error (MAE), and Root Mean Square Error (RMSE).

[0139] Mean square error:

[0140]

[0141] Mean Absolute Error:

[0142]

[0143] Root mean square error:

[0144]

[0145] Where, N test Let D be the number of test samples, τ be the prediction step size, and D be the number of test samples. out For the target sequence feature dimension, Let be the predicted value of the j-th output component of the model at time t for training sample i. Let be the model's prediction of the j-th true observation at time t for test sample i.

[0146] When using the improved Transformer encoder model trained in this embodiment for photovoltaic power prediction, the input data of the test set includes multi-regional load data, meteorological data, and historical photovoltaic power generation data. First, the initial input features are subjected to point-level and segment-level fuzzy clustering to generate weighted Gaussian mixture features, which are then concatenated with the original input features to form an expanded input vector. Random Gaussian noise is added to enhance robustness. This processing allows the input data to retain key information while suppressing local noise and mapping similar samples to a fuzzy membership space, achieving structured reorganization and providing more representative features for model learning. Subsequently, a two-layer Transformer encoder extracts global temporal dependencies, a multi-scale perception module captures local fluctuations and long-term trends at different time scales in parallel, and an attention fusion module uses WGMM features to adaptively weight multi-scale features, achieving dynamic fusion of fuzzy semantics and temporal features. This allows the model to fully utilize global temporal information, multi-time-scale local patterns, and probability distribution features during prediction, improving the perception and prediction accuracy of photovoltaic power fluctuations, while also enhancing generalization ability and adaptability to unknown conditions.

[0147] Example 2

[0148] As an example, in this embodiment, the photovoltaic power prediction is performed using the method in Embodiment 1. Load and meteorological data from a certain industrial park in Northwest China from January 1, 2011 to December 30, 2020 are used, with a sampling rate of once every 15 minutes. A case study analysis is conducted, and the annual multi-regional load and photovoltaic data are as follows: Figure 2 As shown.

[0149] In detail, taking the dataset from January 1st to January 2nd, 2011 as an example, the load and photovoltaic output for those two days are as follows: Figure 3 As shown.

[0150] To verify the effectiveness of the proposed method, six models were set up for comparative analysis. The dataset was divided into training and test sets in an 8:2 ratio. The loss convergence curves of each model during the training process are shown below. Figure 4 As shown.

[0151] After 100 rounds of training, all models have reached a relatively stable convergence state. The trained models were then validated on the test set, and the test results are as follows: Figure 4 As shown in the figure, the photovoltaic power generation prediction model proposed in this invention performs well in terms of fitting accuracy and trend tracking. The predicted curve has a higher degree of agreement with the actual observed value and can more accurately reflect the actual change law of photovoltaic power.

[0152] Example 3

[0153] The photovoltaic power prediction system integrating weighted Gaussian and multi-scale sensing provided in this embodiment is used in the aforementioned photovoltaic power prediction method integrating weighted Gaussian and multi-scale sensing. The system includes:

[0154] The input vector processing module is used to acquire multi-region load data, meteorological data, and photovoltaic power generation data. The multi-region load data and meteorological data constitute the initial input features. The initial input features are subjected to point-level clustering and segment-level clustering respectively. The clustered features are combined into WGMM features. The initial input features and WGMM features are concatenated to obtain the expanded input vector. Random Gaussian noise is added to the expanded input vector to obtain the final processed input vector.

[0155] An improved Transformer encoder model construction and training module is used to construct an improved Transformer encoder model, which includes a two-layer Transformer encoder, a multi-scale perception module, an attention fusion module, and a fully connected decoding layer connected in sequence; the model is trained using the processed input vector and photovoltaic power generation data to obtain the trained encoder model;

[0156] The photovoltaic power generation prediction module is used to predict photovoltaic power generation using a trained encoder model.

[0157] Furthermore, the present invention adopts the following technical solution:

[0158] A non-transitory computer-readable storage medium storing a computer program that, when executed by a processor, implements a photovoltaic power prediction method that integrates weighted Gaussian and multi-scale sensing.

[0159] Furthermore, the present invention adopts the following technical solution:

[0160] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, performs photovoltaic power prediction by fusion of weighted Gaussian and multi-scale sensing as described above.

[0161] From the above description of the embodiments, those skilled in the art will clearly understand that the facilities of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Embodiments of the present invention can be implemented using existing processors, or by dedicated processors used for this or other purposes for suitable systems, or by hardwired systems. Embodiments of the present invention also include non-transitory computer-readable storage media, comprising machine-readable media for carrying or having machine-executable instructions or data structures stored thereon; such machine-readable media can be any available medium accessible by a general-purpose or special-purpose computer or other machine with a processor. For example, such machine-readable media can include RAM, ROM, EPROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store the required program code in the form of machine-executable instructions or data structures and is accessible by a general-purpose or special-purpose computer or other machine with a processor. When information is transmitted or provided to a machine via a network or other communication connection (hardwired, or wireless, or a combination of hardwired and wireless), that connection is also considered a machine-readable medium.

[0162] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.

Claims

1. A photovoltaic power prediction method integrating weighted Gaussian and multi-scale sensing, characterized in that, The method includes the following steps: The system acquires multi-regional load data, meteorological data, and photovoltaic power generation data. The multi-regional load data and meteorological data constitute the initial input features. The initial input features are then subjected to point-level clustering and segment-level clustering, respectively. The clustered features are combined into WGMM features. The initial input features and WGMM features are concatenated to obtain the expanded input vector. Random Gaussian noise is added to the expanded input vector to obtain the final processed input vector. An improved Transformer encoder model is constructed, comprising a two-layer Transformer encoder, a multi-scale perception module, an attention fusion module, and a fully connected decoding layer connected in sequence; the model is trained using the processed input vector and photovoltaic power generation data to obtain the trained encoder model; The trained encoder model is used to predict photovoltaic power generation.

2. The photovoltaic power prediction method integrating weighted Gaussian and multi-scale sensing according to claim 1, characterized in that, The method for training the model using the processed input vector and photovoltaic power generation data to obtain the trained encoder model is as follows: 1) Initialize model parameters and set training hyperparameters, then use the Adam optimizer to update the parameters; 2) Based on the final processed input vector The dataset for building the model using the target sequence Y Divide the dataset into a training set. With test set In the formula, N train N represents the total number of training samples. test The total number of test samples; Use PyTorch DataLoader to load data in batches to ensure that each training round can cover all training samples, and randomly shuffle the order to enhance generalization ability. 3) Each sampling batch b randomly selects B samples from the training set, represented as: In the formula, For the b-th batch, i j The index of samples randomly drawn from the training set is used to ensure that samples within a batch are either unique or allowed to be duplicated. Collected sample sequences The data is fed into a two-layer Transformer encoder to extract global temporal dependencies. The Transformer encoder captures the global correlation between time steps in long-term data through a multi-head self-attention mechanism, and its calculation formula is as follows: In the formula, These are the query, key, and value matrices, respectively, d k The dimension of each attention head; the encoder's feedforward network uses a two-layer fully connected structure, with hidden dimension d. ff =4d model Furthermore, residual connections and LayerNorm are used between layers to enhance gradient propagation and training stability. The encoder output is: The encoded sequence feature output H is input to the multi-scale perception module to extract local patterns at different time scales. The multi-scale perception module processes the features in parallel using multi-dilation rate one-dimensional convolutions, with the dilation rate set to [1,2,4], the convolution kernel size k, and the number of output channels mp_channels. The output of each convolution branch is... The features of each branch are summed and ReLU activation is applied to obtain the multi-scale feature F. ms : MP output and encoder last time step characteristics H last Perform residual connections: F res =F ms +H last H last =H[:,-1,:] An attention fusion module is introduced to achieve adaptive fusion of multi-scale features and WGMM fuzzy probability features: G = WGMM Where, softmax is a non-linear activation function, and G is the clustering feature obtained in step (2). T F is the transpose of clustering feature G. res This represents the residual connection result between the MP output and the encoder output. The fused features are mapped to the predicted output through a fully connected decoding layer: Backpropagation is performed on the loss, and the model parameters are updated using the Adam optimizer: In the formula, θ represents the model parameters. This is the loss function for this batch; After the b-th batch completes training, the batch index b increases by 1: b←b+1; 4) If the training batches satisfy Then repeat step 3). If the condition is not met, the training round E is increased by 1. 5) If the number of training epochs satisfies E < epochs, then increase the number of training epochs E by 1 and repeat steps 3)-4). If not, then complete the model training and output the trained model parameters.

3. The photovoltaic power prediction method integrating weighted Gaussian and multi-scale sensing according to claim 2, characterized in that, During the model training phase, the mean squared error loss function is defined as the optimization objective: Here, T represents the mean squared error, N is the number of samples, and T is the mean squared error. out For the target sequence time step, D out Let be the feature dimension of the target sequence, i be the sample index, t be the time step index, and j be the output dimension index. Let y be the predicted value of the j-th output component of the model at time t for training sample i. i,t,j Let be the model's prediction of the j-th true observation at time t for training sample i.

4. The photovoltaic power prediction method integrating weighted Gaussian and multi-scale sensing according to claim 1, characterized in that, The process involves acquiring multi-regional load data, meteorological data, and photovoltaic power generation data. The multi-regional load data and meteorological data constitute the initial input features. These initial input features are then subjected to point-level clustering and segment-level clustering. The clustered features are combined into a WGMM feature set. The initial input features are concatenated with the WGMM feature set to obtain an expanded input vector. Random Gaussian noise is added to the expanded input vector to obtain the final processed input vector. The process includes the following steps: (1) Normalization preprocessing is performed on multi-regional load data, meteorological data x, and photovoltaic power generation data y to obtain the initial input sequence X and the target sequence Y: In the formula, N is the number of samples, and T in D is the time step of the initial input sequence. in Let T be the feature dimension of the initial input sequence. out For the target sequence time step, D out The feature dimension of the target sequence; (2) The initial input sequence X is fuzzy clustered in both time and feature dimensions using the FCM clustering method, and WGMM features are constructed as follows: Point-wise (PW) clustering: Performs FCM along the feature dimension to obtain the membership matrix at each time step. It reflects the soft affiliation of samples under different cluster centers; Segment-wise (SW) clustering: Take the last L segments of each sample, expand them into L×D vectors, and then perform FCM clustering to obtain the segment-level membership matrix. Depicting the overall dynamic patterns between time segments; WGMM Feature Construction: Constructing the point-level clustering matrix U pw With fragment-level clustering matrix U sw Combining features into WGMM: W GMM=α·U pw +(1-a)·U sw ,α∈[0,1] The original input feature X is concatenated with the fuzzy clustering feature WGMM to obtain the augmented input vector: X′=[X,WGMM] Add random Gaussian noise to the expanded input vector X′: in, This is the final processed input vector.

5. The photovoltaic power prediction method integrating weighted Gaussian and multi-scale sensing according to claim 2, characterized in that, After the model is trained, it is tested using a test set. The specific steps are as follows: 1) The trained model is f θ (·), perform forward inference on the test set: f is the predicted sequence output by the model. θ (·) represents the prediction model obtained after training, X j For the j-th sample, input sequence Let D be the predicted output vector at time step t, with dimension D. out ; 2) The model performance is evaluated using three indicators: mean square error, mean absolute error, and root mean square error.

6. A photovoltaic power prediction system integrating weighted Gaussian and multi-scale sensing, used to implement the photovoltaic power prediction method integrating weighted Gaussian and multi-scale sensing as described in any one of claims 1-5, characterized in that, The system includes: The input vector processing module is used to acquire multi-region load data, meteorological data, and photovoltaic power generation data. The multi-region load data and meteorological data constitute the initial input features. The initial input features are subjected to point-level clustering and segment-level clustering respectively. The clustered features are combined into WGMM features. The initial input features and WGMM features are concatenated to obtain the expanded input vector. Random Gaussian noise is added to the expanded input vector to obtain the final processed input vector. An improved Transformer encoder model construction and training module is used to construct an improved Transformer encoder model, which includes a two-layer Transformer encoder, a multi-scale perception module, an attention fusion module, and a fully connected decoding layer connected in sequence; the model is trained using the processed input vector and photovoltaic power generation data to obtain the trained encoder model; The photovoltaic power generation prediction module is used to predict photovoltaic power generation using a trained encoder model.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the photovoltaic power prediction method that combines weighted Gaussian and multi-scale sensing as described in any one of claims 1 to 5.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the photovoltaic power prediction method that integrates weighted Gaussian and multi-scale sensing as described in any one of claims 1 to 5.