Method and system for predicting photovoltaic power of power distribution area

By employing a dual-encoder model and dynamic migration optimization technology in the distribution area, the problems of insufficient data feature extraction and inadequate model generalization ability were solved, achieving high-precision photovoltaic power prediction and reducing modeling costs.

CN121923091APending Publication Date: 2026-04-24CHAOYANG POWER SUPPLY COMPANY OF STATE GRID LIAONING ELECTRIC POWER SUPPLY +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHAOYANG POWER SUPPLY COMPANY OF STATE GRID LIAONING ELECTRIC POWER SUPPLY
Filing Date
2025-12-25
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing photovoltaic power prediction methods suffer from insufficient data feature extraction, inadequate model generalization ability, and long training time in distribution substations, making it difficult to meet the needs of large-scale photovoltaic prediction in distribution substations.

Method used

By extracting global-local features, employing a dual-encoder model and dynamic transfer optimization of model parameters, and combining Pearson correlation coefficient to screen meteorological features, data preprocessing and clustering convergence are performed to construct a source domain model library. Target models are then obtained through dynamic matching for prediction.

Benefits of technology

This improved the accuracy and reliability of photovoltaic power prediction in distribution areas, reduced modeling costs, and achieved high-precision photovoltaic power prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121923091A_ABST
    Figure CN121923091A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of photovoltaic power prediction, and discloses a power distribution area photovoltaic power prediction method and system, and the method comprises the steps: collecting the photovoltaic power and meteorological historical data of a power distribution area, and carrying out the preprocessing of the historical data, and screening the data features; clustering convergence is carried out on the preprocessed historical data, typical weather scenes and representative samples are selected, and a source domain representative data set is formed; for each typical weather scene, dividing the source domain representative data set into a training set, a verification set and a test set, and constructing a source domain model library; and acquiring meteorological data of a day to be predicted, selecting an initial model in the source domain model library, outputting a target model after dynamic matching, inputting the feature vector to be predicted into the target model, and outputting a photovoltaic power predicted value of the power distribution area. By extracting global-local features and dynamically migrating and optimizing model parameters, the accuracy and reliability of photovoltaic power prediction of the power distribution area are improved, and the modeling cost of the power distribution area is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of photovoltaic power prediction technology, and in particular to a method and system for predicting photovoltaic power in distribution substations. Background Technology

[0002] Currently, photovoltaic power prediction in distribution substations mainly relies on single-substation modeling or static scenario adaptation methods. The mainstream technologies include statistical models based on time-series analysis and traditional deep learning models. The former suffers from high computational complexity and poor model generalization ability when faced with massive and heterogeneous distribution substation data. Furthermore, distribution substations generally have limited data samples, making it difficult to effectively train statistical models that rely on complete historical data. While the latter has shown some advantages in predicting the power of large-scale photovoltaic power plants, it reveals multi-dimensional and insurmountable shortcomings under the core scenario constraints of "small sample size, heterogeneity, and low cost" in distribution substations. These shortcomings directly prevent it from meeting the needs of large-scale photovoltaic prediction in distribution substations. Summary of the Invention

[0003] The purpose of this invention is to address the problems of insufficient data feature extraction, inadequate model generalization ability, and long training time in existing photovoltaic power prediction methods. The proposed photovoltaic power prediction method and system for distribution substations solves the technical problems of insufficient feature extraction, weak generalization ability, poor scenario adaptability, and high modeling cost by extracting global-local features and dynamically optimizing model parameters. This improves the accuracy and reliability of photovoltaic power prediction in distribution substations and reduces the modeling cost of distribution substations.

[0004] To achieve the above objectives, the present invention adopts the following technical solution:

[0005] In a first aspect, the present invention provides a method for predicting photovoltaic power in a distribution area, comprising:

[0006] Historical data on photovoltaic power and weather conditions in the distribution area were collected, and the historical data were preprocessed to filter data features.

[0007] Clustering convergence is performed on the preprocessed historical data, and typical weather scenarios and representative samples are selected to form a representative dataset of the source domain.

[0008] For each typical weather scenario, the source domain representative dataset is divided into training set, validation set and test set to build a source domain model library;

[0009] Obtain meteorological data for the day to be predicted, select an initial model from the source domain model library, output the target model after dynamic matching, input the feature vector to be predicted into the target model, and output the predicted value of photovoltaic power in the distribution area.

[0010] A further improvement of this invention lies in the following process: The historical data on photovoltaic power and meteorological conditions of the distribution area are collected, and the historical data is fused and preprocessed to filter data features.

[0011] For missing meteorological or power values ​​in a single historical data point, linear fitting is performed to complete the data based on valid historical data from three adjacent times before and after the missing historical data point, as follows:

[0012] If historical data for time t is missing, let the values ​​for time t-1, t-2, and t-3 be... , , The values ​​at times t+1, t+2, and t+3 are , , Then complete the value. ;

[0013] Based on historical data of photovoltaic power and weather conditions for each distribution substation, the average photovoltaic power of that distribution substation is calculated. with standard deviation If a certain historical data point satisfy If the value is an outlier, the historical data is removed and replaced with the mean of the time before and after the historical data point.

[0014] For historical data after imputation and outlier removal, normalization is performed according to the feature dimension to map the values ​​to the [0,1] interval, as shown in the formula:

[0015] ;

[0016] in, , These are the minimum and maximum values ​​of this feature in historical data, respectively; For data at a certain historical data point, These are the normalized data values;

[0017] Analyze the correlation between weather and power, and screen out the data characteristics of weather's impact on photovoltaic power generation;

[0018] The formula for calculating the Pearson correlation coefficient is:

[0019] ;

[0020] In the formula, and These are sample data points for meteorological factors and photovoltaic output power in the distribution area, respectively, after preprocessing. and They are respectively and The corresponding average value, For the sample size, The Pearson correlation coefficient is used to screen data characteristics of the impact of meteorological factors on photovoltaic power generation.

[0021] A further improvement of this invention lies in the following process: clustering and converging the preprocessed historical data, selecting typical weather scenarios and representative samples to form a representative dataset of the source domain, the process of which is as follows:

[0022] The preprocessed meteorological data is used to iteratively update the attraction matrix through a clustering algorithm. With the degree of belonging matrix :

[0023] The similarity matrix is ​​calculated using negative values ​​of the Euclidean distance as the similarity between historical data samples.

[0024] ;

[0025] in, , The first , Meteorological feature vectors of each sample;

[0026] Set iteration parameters including damping coefficient, maximum number of iterations, and cluster center number threshold;

[0027] Matrix update: The attraction matrix is ​​updated in each iteration. With the degree of belonging matrix :

[0028] ;

[0029] ;

[0030] in, and They respectively represent traversing all non-equal to and The meteorological feature vector of the sample;

[0031] The top 20% of historical data samples with the highest similarity were selected as representative samples to form the source domain representative dataset.

[0032] A further improvement of this invention is that, for each typical weather scenario, the source domain representative dataset is divided into a training set, a validation set, and a test set to construct a source domain model library, as follows:

[0033] The source domain representative dataset is divided into typical weather scenarios. The representative samples of each typical weather scenario are divided into training set, validation set and test set. A dual encoder model is built separately for each typical weather scenario.

[0034] Local spatial features are extracted from data features in typical weather scenarios, and global features are captured after Fourier transformation to the frequency domain. The local spatial features and global features are then fused into a spatial feature vector through convolution.

[0035] Multi-scale convolution kernels are used to perform convolution operations on time-series data to extract feature vectors at different time scales. These feature vectors are then fused with spatial feature vectors to output spatial and temporal feature vectors, thereby constructing a source domain model library.

[0036] A further improvement of this invention is that the process of acquiring meteorological data for the day to be predicted, selecting an initial model from the source domain model library, outputting a target model after dynamic matching, inputting the feature vector to be predicted into the target model, and outputting the predicted photovoltaic power value of the distribution area is as follows:

[0037] Based on the meteorological data of the day to be predicted, the weighted Euclidean distance between the feature vector to be predicted and the center of each typical weather scenario is calculated. The typical weather scenario model with the smallest distance is selected as the initial model in the source domain model library. The formula for the weighted Euclidean distance is as follows:

[0038] ;

[0039] in, Let be the feature vector to be predicted. Let t represent the center similarity of each typical weather scene, and t be the time step. For feature dimension, For the first The weights of each feature vector. Let the feature vector to be predicted be at time step t. The values ​​of the eigenvectors, For a typical weather scenario, the center is at time step t. The values ​​of the eigenvectors;

[0040] Filter similar days before and after the date to be predicted, extract sample pairs of feature vectors and power values ​​for each similar day, and divide them into fine-tuning training set and fine-tuning validation set;

[0041] The parameters of the initial model are frozen, the weight matrix is ​​adjusted, and the model is trained based on the fine-tuned training set. The target model is output with dynamic matching. The feature vector to be predicted is input into the target model, and the predicted value of photovoltaic power in the distribution area is output.

[0042] In a second aspect, the present invention provides a photovoltaic power prediction system for distribution substations, comprising:

[0043] The data acquisition and preprocessing module collects historical data on photovoltaic power and weather in the distribution area, and preprocesses the historical data to filter data features.

[0044] The scene clustering module performs clustering convergence on the preprocessed historical data, selects typical weather scenes and representative samples, and forms a representative dataset of the source domain.

[0045] The model building module divides the source domain representative dataset into training, validation, and test sets for each typical weather scenario, and builds a source domain model library.

[0046] The dynamic migration output module acquires meteorological data for the day to be predicted, selects an initial model from the source domain model library, outputs a target model after dynamic matching, inputs the feature vector to be predicted into the target model, and outputs the predicted photovoltaic power value of the distribution area.

[0047] A further improvement of the present invention is that the data acquisition and preprocessing module performs the following operations:

[0048] Historical data on photovoltaic power and weather conditions in the distribution substation area were collected. Based on PyCharm, the historical data was preprocessed and filtered for key features. The steps are as follows:

[0049] For missing meteorological or power values ​​in a single historical data point, linear fitting is performed to complete the data based on valid historical data from three adjacent times before and after the missing historical data point, as follows:

[0050] If historical data for time t is missing, let the values ​​for time t-1, t-2, and t-3 be... , , The values ​​at times t+1, t+2, and t+3 are , , Then complete the value. ;

[0051] Based on historical data of photovoltaic power and weather conditions for each distribution substation, the average photovoltaic power of that distribution substation is calculated. with standard deviation If a certain historical data point satisfy If the value is an outlier, the historical data is removed and replaced with the mean of the time before and after the historical data point.

[0052] For historical data after imputation and outlier removal, normalization is performed according to the feature dimension to map the values ​​to the [0,1] interval, as shown in the formula:

[0053] ;

[0054] in, , These are the minimum and maximum values ​​of this feature in historical data, respectively; For data at a certain historical data point, These are the normalized data values;

[0055] Analyze the correlation between weather and power, and screen out the data characteristics of weather's impact on photovoltaic power generation;

[0056] The formula for calculating the Pearson correlation coefficient is:

[0057] ;

[0058] In the formula, and These are sample data points for meteorological factors and photovoltaic output power in the distribution area, respectively, after preprocessing. and They are respectively and The corresponding average value, For the sample size, The Pearson correlation coefficient is used to screen data characteristics of the impact of meteorological factors on photovoltaic power generation.

[0059] A further improvement of the present invention is that the scene clustering module performs the following operations:

[0060] The preprocessed meteorological data is used to iteratively update the attraction matrix through a clustering algorithm. With the degree of belonging matrix :

[0061] The similarity matrix is ​​calculated using negative values ​​of the Euclidean distance as the similarity between historical data samples.

[0062] ;

[0063] in, , The first , Meteorological feature vectors of each sample;

[0064] Set iteration parameters including damping coefficient, maximum number of iterations, and cluster center number threshold;

[0065] Matrix update: The attraction matrix is ​​updated in each iteration. With the degree of belonging matrix :

[0066] ;

[0067] ;

[0068] in, and They respectively represent traversing all non-equal to and The meteorological feature vector of the sample;

[0069] The top 20% of historical data samples with the highest similarity were selected as representative samples to form the source domain representative dataset.

[0070] A further improvement of this invention is that the model building module performs the following operations:

[0071] The source domain representative dataset is divided into typical weather scenarios. The representative samples of each typical weather scenario are divided into training set, validation set and test set. A dual encoder model is built separately for each typical weather scenario.

[0072] Local spatial features are extracted from data features in typical weather scenarios, and global features are captured after Fourier transformation to the frequency domain. The local spatial features and global features are then fused into a spatial feature vector through convolution.

[0073] Multi-scale convolution kernels are used to perform convolution operations on time-series data to extract feature vectors at different time scales. These feature vectors are then fused with spatial feature vectors to output spatial and temporal feature vectors, thereby constructing a source domain model library.

[0074] A further improvement of the present invention is that the dynamic migration output module performs the following operations:

[0075] Based on the meteorological data of the day to be predicted, the weighted Euclidean distance between the feature vector to be predicted and the center of each typical weather scenario is calculated. The typical weather scenario model with the smallest distance is selected as the initial model in the source domain model library. The formula for the weighted Euclidean distance is as follows:

[0076] ;

[0077] in, Let be the feature vector to be predicted. Let t represent the center similarity of each typical weather scene, and t be the time step. For feature dimension, For the first The weights of each feature vector. Let the feature vector to be predicted be at time step t. The values ​​of the eigenvectors, For a typical weather scenario, the center is at time step t. The values ​​of the eigenvectors;

[0078] Filter similar days before and after the date to be predicted, extract sample pairs of feature vectors and power values ​​for each similar day, and divide them into fine-tuning training set and fine-tuning validation set;

[0079] The parameters of the initial model are frozen, the weight matrix is ​​adjusted, and the model is trained based on the fine-tuned training set. The target model is output with dynamic matching. The feature vector to be predicted is input into the target model, and the predicted value of photovoltaic power in the distribution area is output.

[0080] Compared with the prior art, the beneficial effects of the present invention are as follows: The photovoltaic power prediction method and system for distribution substations proposed in this invention solve the technical problems of insufficient feature extraction, weak generalization ability, poor scene adaptation and high modeling cost by extracting global and local features through dual encoders and dynamically transferring and optimizing model parameters. This achieves high-precision prediction of photovoltaic power in distribution substations, improves the reliability of photovoltaic power prediction in distribution substations, and reduces the modeling cost of distribution substations. Attached Figure Description

[0081] Figure 1 This is a flowchart of the photovoltaic power prediction method for distribution substations in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the dual encoder model constructed in Embodiment 1 of the present invention; Figure 3 These are power prediction diagrams of sampling points for different schemes in Embodiment 2 of the present invention; Figure 4 This is a power prediction error diagram of different schemes in Embodiment 2 of the present invention; Figure 5 This is a block diagram of the photovoltaic power prediction system for distribution substations in Embodiment 3 of the present invention; Figure 6 This is a structural block diagram of the electronic device in Embodiment 4 of the present invention. Detailed Implementation

[0082] To make the objectives, technical solutions, and beneficial effects of this invention clearer, the specific embodiments of this invention will be described in detail below with reference to the accompanying drawings. These embodiments are merely preferred examples of this invention, used to aid in understanding the inventive concept, and do not constitute a limitation on the scope of protection.

[0083] Example 1

[0084] A method for predicting photovoltaic power in a distribution area, such as Figure 1 As shown, the method includes the following steps:

[0085] Step S1: Data fusion and preprocessing. Historical data on photovoltaic power and weather in the distribution area are collected, and the historical data are fused and preprocessed to filter data features.

[0086] Step S2, weather scene clustering: cluster the preprocessed historical data to converge, select typical weather scenes and representative samples to form a source domain representative dataset.

[0087] Step S3: Source domain model construction. For each typical weather scenario, the representative dataset of the source domain is divided into training set, validation set and test set to build a source domain model library.

[0088] Step S4, dynamic migration optimization, obtain meteorological data for the day to be predicted, select the initial model from the source domain model library, output the target model after dynamic matching, input the feature vector to be predicted into the target model, and output the photovoltaic power prediction value of the distribution area.

[0089] In one possible implementation, step S1 involves collecting historical data on photovoltaic power and weather conditions in the distribution area. To enhance the application value of this historical data, it is necessary to preprocess and filter its features. The historical data is preprocessed in the following manner:

[0090] Step S11: Collect historical data on photovoltaic power and meteorological conditions of the distribution substations. Simultaneously acquire 15-minute resolution photovoltaic power data and meteorological data for N distribution substations in a given location. The collection period is 6 months, with 50,000 data entries. The collected meteorological data includes irradiance, temperature, cloud cover, surface pressure, 10m wind speed, and humidity. PyCharm is a Python IDE (Integrated Development Environment) developed by JetBrains. It includes a complete set of tools to help users improve their efficiency when developing with Python, such as debugging, syntax highlighting, project management, code navigation, intelligent suggestions, auto-completion, unit testing, and version control. In this embodiment, historical data is fused and preprocessed using PyCharm to filter data features, as follows:

[0091] Step S11: Linear interpolation to complete missing values. For missing meteorological or power values ​​in a single historical data point, linear fitting is performed to complete the missing values ​​based on valid historical data from three adjacent times before and after the missing historical data. The method is as follows:

[0092] If historical data for time t is missing, let the values ​​for time t-1, t-2, and t-3 be... , , The values ​​at times t+1, t+2, and t+3 are , , Then complete the value. ;

[0093] Steps S12, 3 The criteria are used to eliminate outliers, and the mean photovoltaic power of each distribution substation is calculated based on historical data of photovoltaic power and weather conditions. with standard deviation If a certain historical data point satisfy If a value is found to be outlier, the historical data is removed and replaced with the mean of the time points before and after that historical data point.

[0094] Step S13, Min-Max normalization: For the historical data after imputation and outlier removal, normalization is performed according to the feature dimension, mapping the values ​​to the [0,1] interval. The formula is:

[0095] ;

[0096] in, , These are the minimum and maximum values ​​of this feature in historical data, respectively; For data at a certain historical data point, These are the normalized data values.

[0097] Step S14, core feature screening: After the above preprocessing of historical data, further correlation analysis is performed using the Pearson correlation coefficient. Initially considering six meteorological factors, namely irradiance, temperature, cloud cover, surface air pressure, 10m wind speed, and humidity, the correlation between meteorological conditions and power is analyzed to screen out the data features of meteorological influence on photovoltaic power generation, providing a basis for weather forecast scenario classification. The screening criterion is based on the strength of the correlation between the six meteorological factors and photovoltaic output power, and the top three correlated meteorological factors are selected as core features.

[0098] The formula for calculating the Pearson correlation coefficient is:

[0099] ;

[0100] In the formula, and These are sample data points for meteorological factors and photovoltaic output power in the distribution area, respectively, after preprocessing. and They are respectively and The corresponding average value, For the sample size, The Pearson correlation coefficient has a value range of [-1, 1]. The larger the absolute value, the stronger the correlation. The Pearson correlation coefficient is used to screen out the data characteristics of the impact of meteorological factors on photovoltaic power generation.

[0101] In one possible implementation, for step S2, weather scene clustering, the preprocessed historical data is clustered and converged, and typical weather scenes and representative samples are selected to form a source domain representative dataset. The specific process is as follows:

[0102] After preprocessing and filtering historical data features in step S1, the preprocessed meteorological data is clustered using a clustering algorithm. One feasible implementation example is as follows: the preprocessed meteorological data is input into the scene clustering module, and the AP clustering algorithm is called through Python's scikit-learn library to iteratively update the attraction matrix. With the degree of belonging matrix The AP clustering algorithm's clustering process is as follows:

[0103] Step S21, similarity matrix calculation: The negative value of the Euclidean distance is used as the sample similarity of the preprocessed meteorological data, that is:

[0104] ;

[0105] in, , The first , Meteorological feature vectors of each sample;

[0106] Step S22: Set the iteration parameters, including: the damping coefficient is set to 0.5, the maximum number of iterations is set to 500, and the threshold for the number of cluster centers is set to stop the iteration when there is no change in the cluster centers for 20 consecutive iterations.

[0107] Step S23: Update the attraction matrix in each iteration. With the degree of belonging matrix The matrix update formula is:

[0108] ;

[0109] ;

[0110] in, and They respectively represent traversing all non-equal to and The meteorological feature vector of the sample;

[0111] Step S24: After clustering convergence, the clustering effect is evaluated using the SC, DBI, and CH indices. Each clustering method has corresponding three indices; higher SC and CH values ​​and lower DBI values ​​indicate better clustering results. The number of clusters is determined based on these three indices, i.e., the number of typical weather scenarios. The optimal typical weather scenarios are selected. Referring to the method for calculating inter-sample similarity, the similarity between samples and cluster centers is calculated. The top 20% of historical data samples with the highest similarity are selected as representative samples. These top 20% representative samples are merged to form the source domain representative dataset, which has a data volume of approximately 20% of the original data, reducing modeling complexity.

[0112] In one possible embodiment, step S3, source domain model library construction, involves dividing the representative dataset of the source domain into training, validation, and test sets for each typical weather scenario, and constructing the source domain model library, as follows:

[0113] The source domain representative dataset is divided according to typical weather scenarios. Representative samples for each typical weather scenario are divided into training, validation, and test sets in a 7:2:1 ratio. A dual-encoder model is then constructed separately for each typical weather scenario. Figure 2 As shown.

[0114] Training the spatial encoder: Data features (dimension: number of samples × time step × number of features) from typical weather scenarios are input into the Swin-Transformer module of the dual encoder model training module to extract local spatial features; at the same time, they are input into the Transformer module of Fourier transform, and after being transformed to the frequency domain by Fourier transform (FFT), global features are captured by the adaptive Fourier neural operator (AFNO). The two types of features (local spatial features and global features) are fused into a spatial feature vector by 1×1 convolution;

[0115] The training time encoder employs multi-scale convolutional kernels (1×1, 3×3, 7×7, and 11×11) to perform convolution operations on time-series data (time series such as photovoltaic power and irradiance) to extract features at different time scales. Each kernel extracts features at a different time scale: 1×1 captures immediate features, 3×3 captures short-cycle (1-3 hours) features, 7×7 captures medium-cycle (half-day) features, and 11×11 captures long-cycle (1 day and above) features. After convolution, the multi-scale features are integrated through a concatenation operation to form a multi-scale feature vector. A Fast Fourier Transform (FFT) is then performed on the multi-scale feature vector using a Fourier module to convert the time-domain signal into a frequency-domain signal, obtaining a frequency-domain feature representation. In the frequency domain, long-term time dependencies are captured through an attention mechanism or linear transformation. Finally, an Inverse Fast Fourier Transform (IFFT) is performed to convert the frequency-domain signal back to the time domain, resulting in a time feature vector that incorporates long-term time dependencies. The temporal feature vector extracted by the temporal encoder is fused with the spatial feature vector extracted by the spatial encoder to output a fused spatial and temporal feature vector. For different weather scenarios (sunny, cloudy, overcast, etc.), each typical weather scenario corresponds to a source domain model, and multiple source domain models form a source domain model library.

[0116] By inputting the spatial and temporal feature vectors into the decoder, and using the LeakyReLU activation function and linear rectification function (ramp function) with a negative slope of 0.01, the normalized 96-point power prediction value can be output.

[0117] To address the shortcomings of traditional models, such as insufficient feature extraction and weak generalization ability, this solution further employs the following steps to dynamically transfer and optimize model parameters in the source domain model.

[0118] Step S4: Dynamically migrate and optimize the source domain model parameters, obtain meteorological data for the day to be predicted, select the initial model from the source domain model library, output the target model after dynamic matching, input the feature vector to be predicted into the target model, and output the predicted photovoltaic power value of the distribution area. The process is as follows:

[0119] Based on the meteorological data of the day to be predicted (after processing in steps S1-S3 above, the feature vector to be predicted is obtained), the weighted Euclidean distance between the feature vector to be predicted and the center of typical weather scenarios corresponding to each source domain model in the source domain model library is calculated. The typical weather scenario model with the smallest distance is selected as the initial model in the source domain model library to achieve dynamic matching of source domain models. The formula for the weighted Euclidean distance is as follows:

[0120] ;

[0121] in, Let be the feature vector to be predicted. Let t represent the center similarity of each typical weather scene (calculated in the same way as the similarity between samples), and t represent the time step (1-96). For feature dimensions (1-5). For the first The weights of each feature vector. Let the feature vector to be predicted be at time step t. The values ​​of the eigenvectors, For a typical weather scenario, the center is at time step t. The values ​​of the eigenvectors.

[0122] Fifty similar days within 30 days before and after the date to be predicted are selected. For each similar day, a sample pair of feature vectors and power values ​​is extracted and divided into a fine-tuning training set and a fine-tuning validation set in an 8:2 ratio. These sets are used to update the initial model parameters in the source domain model library and monitor performance.

[0123] Source domain model dynamic transfer freezes the parameters of the Swing-Transformer module and Fourier module in the encoder of the initial model, and only fine-tunes the weight matrix of the decoder. Training is based on the fine-tuned training set, with a learning rate of 0.0001, for 5-10 rounds until the mean absolute percentage error (MAPE) of the fine-tuned validation set decreases steadily. The output is a dynamically matched target model for power prediction of the current distribution area.

[0124] The feature vector to be predicted The target model is input, processed by a deconvolution layer and the LeakyReLU activation function, and the normalized photovoltaic power prediction value of each distribution area (i.e., the photovoltaic power prediction value of the distribution area) is output.

[0125] Example 2

[0126] Ten 10kV distribution substations in an industrial park in a certain region, numbered T1-T10, were selected as the implementation targets, each equipped with a 2MW distributed photovoltaic power station. To verify the effectiveness of the method in Example 1, this example designed two schemes to conduct a comparative experiment with the photovoltaic power prediction method for distribution substations proposed in this invention. The root mean square error (RMSE) and coefficient of determination (R²) were used as evaluation models to test the photovoltaic power prediction performance. The calculation formulas are as follows:

[0127] ;

[0128] ;

[0129] In the formula: , These represent the root mean square error and the coefficient of determination between the predicted power and the actual power, respectively. Indicates the number of samples; Indicates the sample sequence number; and These represent the actual power value and the predicted power value, respectively. For boot capacity, For sample point data, This represents the average of the true values.

[0130] The present invention proposes the following approach: integrating high-quality data from distribution radio areas to model different scenarios, using Swin-Transformer and Fourier Transformer to build a source domain model for transfer learning, and dynamically updating decoder parameters based on historical similar days.

[0131] Option 2: Integrate high-quality data from distribution radio areas to model different scenarios, and use Swin-Transformer and Fourier Transformer to build a source domain model for transfer learning. The parameters of the entire model are dynamically updated based on historical similar days.

[0132] Option 3: High-quality data from integrated power distribution substations is used for scenario-based modeling. The source domain model for transfer learning is built using Swin-Transformer, and the decoder parameters are dynamically updated based on historical similar days.

[0133] Step 1: Data Acquisition and Fusion Preprocessing:

[0134] Historical photovoltaic power and meteorological data with a 15-minute resolution were acquired from 10 distribution substations. The data collection period was from January 1, 2024 to June 30, 2024, with a collection frequency of 15 minutes per data point, resulting in 50,000 data entries. The historical photovoltaic power and meteorological data were transmitted to the server in real time via 4G communication, with the transmission frequency synchronized with the collection frequency.

[0135] The server receives data via a Python-written listener program, automatically validates the data format, and stores successfully validated data in a MySQL database. Data that fails validation is marked as "abnormal and pending review" and temporarily stored in a temporary folder.

[0136] Then, a data preprocessing module based on PyCharm is invoked to perform batch processing on the raw data stored in MySQL. The processing flow is automated through a Python script, as detailed below:

[0137] Missing value completion: Linear interpolation is used to complete missing meteorological / power values ​​in a single data point by linear fitting based on valid data from three consecutive time points before and after the missing value. The original data is then subjected to linear interpolation to complete missing values. The criteria are to remove outliers and normalize to the [0,1] interval using Min-Max;

[0138] Then, core features were selected using the Pearson correlation coefficient, and the correlation between normalized meteorological factors and photovoltaic power was analyzed using the Pearson correlation coefficient. The calculation process used the pearsonr function from the Scikit-learn library, outputting the correlation coefficients between each meteorological factor and power. Irradiance, temperature, and humidity were retained as three features to generate preprocessed meteorological data.

[0139] Step 2: Weather Scene Segmentation and Representative Sample Selection:

[0140] The preprocessed meteorological data is input into the scene clustering module, the AP clustering algorithm is started, and the attraction matrix is ​​iteratively updated. With the degree of belonging matrix ;

[0141] After clustering convergence, the clustering effect was evaluated using the SC, DBI, and CH indices, as shown in Table 1. When the number of clusters was 5, SC was the highest, DBI was the lowest, and CH was the highest, indicating the optimal clustering effect. Therefore, 5 typical weather scenarios were automatically identified, and the scenario types were labeled based on the physical meaning of meteorological characteristics.

[0142] Sunny day: Irradiance > 1000W / ㎡, temperature > 20℃;

[0143] Partly cloudy: Irradiance 500-1000W / ㎡, temperature 15-25℃;

[0144] Cloudy: Irradiance <500W / ㎡, temperature 10-20℃;

[0145] Light rain: Irradiance <300W / ㎡, humidity >70%;

[0146] Heavy rain: Irradiance <100W / ㎡, humidity >90%.

[0147] Table 1 Clustering Indicators

[0148]

[0149] Then, for each scenario, the similarity between the sample and the cluster center is calculated, and the top 20% of highly similar samples are selected as representative samples and merged to form the source domain representative dataset, which is about 20% of the original data and used for the subsequent construction of the source domain model library.

[0150] Step 3: Source Domain Model Construction and Training

[0151] The source domain is divided into representative datasets based on typical weather scenarios, and a dual encoder model is built separately for each scenario.

[0152] The data features (dimension: number of samples × time step × number of features) in typical weather scenarios are input into the Swin-Transformer module to extract local spatial features; at the same time, they are input into the Transformer module, which transforms them to the frequency domain by FFT and then captures global features through AFNO. The two types of features, local spatial features and global features, are fused into a unified spatial feature vector through 1×1 convolution.

[0153] A unified spatial feature vector is input into the training temporal encoder. Multi-scale convolutional kernels of 1×1, 3×3, 7×7, and 11×11 are used to perform convolution operations on the time series data to extract features at different time scales. Then, long-term temporal dependencies are modeled through FFT-IFTT to output spatial and temporal feature vectors. For different weather scenarios (sunny, cloudy, overcast, etc.), each typical weather scenario corresponds to a source domain model. Multiple source domain models form a source domain model library. The trained models for the five scenarios are saved to the "source_domain_models" folder.

[0154] The spatial and temporal feature vectors are input into the decoder, and the output layer uses the LeakyReLU activation function with a negative slope of 0.01 to output the normalized 96-point power prediction value.

[0155] Step 4, Dynamic Transfer and Model Fine-tuning:

[0156] Taking the power prediction of the T5 distribution area on July 1, 2024 as an example, the accurate matching between the scene to be predicted and the source domain model library is achieved through "feature vector similarity calculation".

[0157] The dynamic transition output module calculates the weighted Euclidean distance between the feature vector to be predicted and the scene centers corresponding to the source domain models in the source domain model library, and selects the scene model with the smallest distance as the initial model in the source domain model library.

[0158] Select 50 similar days within 30 days before and after the date to be predicted.

[0159] Freeze the encoder parameters of the initial model: the Swin-Transformer module and the Fourier module Transformer, fine-tune only the decoder weight matrix, use a learning rate of 0.0001, train for 5-10 rounds until the MAPE on the validation set decreases steadily.

[0160] Output the target model for dynamic matching, which is used for power prediction in the T5 transformer area.

[0161] Step 5, Power Prediction and Result Output:

[0162] For different sampling points and the different schemes mentioned above, the feature vector to be predicted is input into the target model, processed by a deconvolution layer and the LeakyReLU activation function, and the normalized predicted power value of the sampling point is output, such as... Figure 3 As shown.

[0163] Compared to other options, by Figure 4 The power prediction error diagram clearly shows that the present invention has higher accuracy in power prediction, meeting the accuracy requirements of power prediction results for power distribution areas.

[0164] Table 2 lists the average training time of different schemes. Although the training time of Scheme 3 is shorter than that of the method proposed in this invention, its prediction accuracy is lower and cannot effectively meet the requirements of high-precision prediction. Scheme 2 increases the training time of the model by about 10 times during dynamic transfer, but the model prediction accuracy is not significantly improved. Therefore, the effectiveness of the Fourier perceptual-transfer learning strategy proposed in this invention is verified.

[0165] Table 2 Comparison of average training time for different model schemes

[0166]

[0167] In this embodiment, the proposed solution is verified through multi-scheme comparison. Based on multi-scenario source domain model sharing and lightweight fine-tuning, the modeling time for a single distribution area is reduced by more than 70%, solving the cost problem of repetitive modeling of massive distribution areas. The combination of Fourier global perception and Swing Transformer local capture, along with similar day fine-tuning, reduces the prediction RMSE by 15%-25%, and achieves an R² of over 0.97. It has strong generalization ability: dynamic scene matching adapts to complex meteorological conditions, maintaining stable performance even in cloudy and rainy scenarios, avoiding the adaptation limitations of traditional static models.

[0168] Example 3

[0169] This embodiment proposes a photovoltaic power prediction system for distribution substations, such as... Figure 5 As shown, the system includes:

[0170] The data acquisition and preprocessing module collects historical data on photovoltaic power and meteorology in the distribution area, and preprocesses the historical data to filter data features, providing high-quality data support for subsequent weather scene clustering, model training, and other tasks.

[0171] The scene clustering module performs clustering convergence on the preprocessed historical data, selects typical weather scenes and representative samples to form a representative dataset of the source domain. The scene clustering module is equipped with the nearest neighbor propagation (AP) clustering algorithm to classify the preprocessed data into weather scenes. It has built-in evaluation units such as silhouette coefficient (SC), DBI index (Davies-Bouldin index, DBI), and CH index (Calinski-Harabasz index, CH) to select the optimal clustering results, realize the classification of different weather scenes, and provide scene-based data support for subsequent model training.

[0172] The model building module divides the source domain representative dataset into training, validation, and test sets for each typical weather scenario, and builds a source domain model library.

[0173] The dynamic migration output module integrates an entropy weight-Euclidean distance calculation unit and a parameter fine-tuning controller. It acquires meteorological data for the day to be predicted, selects an initial model from the source domain model library, outputs a target model after dynamic matching, inputs the feature vector to be predicted into the target model, and outputs the predicted photovoltaic power value of the distribution area.

[0174] During model training, you can refer to the parameter information set in Table 3 to configure the model training parameters.

[0175] Table 3 Model Training Parameters and Configuration Table

[0176]

[0177] The data acquisition and preprocessing module performs the following operations:

[0178] Historical data on photovoltaic power and weather conditions in the distribution substation area were collected. Based on PyCharm, the historical data was preprocessed and filtered for key features. The steps are as follows:

[0179] For missing meteorological or power values ​​in a single historical data point, linear fitting is performed to complete the data based on valid historical data from three adjacent times before and after the missing historical data point, as follows:

[0180] If historical data for time t is missing, let the values ​​for time t-1, t-2, and t-3 be... , , The values ​​at times t+1, t+2, and t+3 are , , Then complete the value. ;

[0181] Based on historical data of photovoltaic power and weather conditions for each distribution substation, the average photovoltaic power of that distribution substation is calculated. with standard deviation If a certain historical data point satisfy If the value is an outlier, the historical data is removed and replaced with the mean of the time before and after the historical data point.

[0182] For historical data after imputation and outlier removal, normalization is performed according to the feature dimension to map the values ​​to the [0,1] interval, as shown in the formula:

[0183] ;

[0184] in, , These are the minimum and maximum values ​​of this feature in historical data, respectively; For data at a certain historical data point, These are the normalized data values;

[0185] Analyze the correlation between weather and power, and screen out the data characteristics of weather's impact on photovoltaic power generation;

[0186] The formula for calculating the Pearson correlation coefficient is:

[0187] ;

[0188] In the formula, and These are sample data points for meteorological factors and photovoltaic output power in the distribution area, respectively, after preprocessing. and They are respectively and The corresponding average value, For the sample size, The Pearson correlation coefficient is used to screen data characteristics of the impact of meteorological factors on photovoltaic power generation.

[0189] The scene clustering module performs the following operations:

[0190] The preprocessed meteorological data is used to iteratively update the attraction matrix through a clustering algorithm. With the degree of belonging matrix :

[0191] The similarity matrix is ​​calculated using negative values ​​of the Euclidean distance as the similarity between historical data samples.

[0192] ;

[0193] in, , The first , Meteorological feature vectors of each sample;

[0194] Set iteration parameters including damping coefficient, maximum number of iterations, and cluster center number threshold;

[0195] Matrix update: The attraction matrix is ​​updated in each iteration. With the degree of belonging matrix :

[0196] ;

[0197] ;

[0198] in, and They respectively represent traversing all non-equal to and The meteorological feature vector of the sample;

[0199] The top 20% of historical data samples with the highest similarity were selected as representative samples to form the source domain representative dataset.

[0200] The model building module performs the following operations:

[0201] The source domain representative dataset is divided into typical weather scenarios. The representative samples of each typical weather scenario are divided into training set, validation set and test set. A dual encoder model is built separately for each typical weather scenario.

[0202] Local spatial features are extracted from data features in typical weather scenarios, and global features are captured after Fourier transformation to the frequency domain. The local spatial features and global features are then fused into a spatial feature vector through convolution.

[0203] Multi-scale convolution kernels are used to perform convolution operations on time-series data to extract feature vectors at different time scales. These feature vectors are then fused with spatial feature vectors to output spatial and temporal feature vectors, thereby constructing a source domain model library.

[0204] The dynamic migration output module performs the following operations:

[0205] Based on the meteorological data of the day to be predicted, the weighted Euclidean distance between the feature vector to be predicted and the center of each typical weather scenario is calculated. The typical weather scenario model with the smallest distance is selected as the initial model in the source domain model library. The formula for the weighted Euclidean distance is as follows:

[0206] ;

[0207] in, Let be the feature vector to be predicted. Let t represent the center similarity of each typical weather scene, and t be the time step. For feature dimension, For the first The weights of each feature vector. Let the feature vector to be predicted be at time step t. The values ​​of the eigenvectors, For a typical weather scenario, the center is at time step t. The values ​​of the eigenvectors;

[0208] Filter similar days before and after the date to be predicted, extract sample pairs of feature vectors and power values ​​for each similar day, and divide them into fine-tuning training set and fine-tuning validation set;

[0209] The parameters of the initial model are frozen, the weight matrix is ​​adjusted, and the model is trained based on the fine-tuned training set. The target model is output with dynamic matching. The feature vector to be predicted is input into the target model, and the predicted value of photovoltaic power in the distribution area is output.

[0210] Example 4

[0211] Please see Figure 6 As shown, the present invention also provides an electronic device 100 for implementing the photovoltaic power prediction method of the distribution area; the electronic device 100 includes a memory 101, at least one processor 102, a computer program 103 stored in the memory 101 and executable on the at least one processor 102, and at least one communication bus 104.

[0212] The memory 101 can be used to store the computer program 103. The processor 102 implements the photovoltaic power prediction method for distribution substations described in Embodiment 1 by running or executing the computer program stored in the memory 101 and calling the data stored in the memory 101. The memory 101 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device 100 (such as audio data), etc. In addition, the memory 101 may include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other non-volatile solid-state storage device.

[0213] The at least one processor 102 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 102 may be a microprocessor or any conventional processor. The processor 102 is the control center of the electronic device 100, connecting various parts of the electronic device 100 via various interfaces and lines.

[0214] The memory 101 in the electronic device 100 stores multiple instructions to implement a photovoltaic power prediction method for a distribution area, and the processor 102 can execute the multiple instructions to achieve the following:

[0215] Historical data on photovoltaic power and weather conditions in the distribution area were collected, and the historical data were preprocessed to filter data features.

[0216] Clustering convergence is performed on the preprocessed historical data, and typical weather scenarios and representative samples are selected to form a representative dataset of the source domain.

[0217] For each typical weather scenario, the source domain representative dataset is divided into training set, validation set and test set to build a source domain model library;

[0218] Obtain meteorological data for the day to be predicted, select an initial model from the source domain model library, output the target model after dynamic matching, input the feature vector to be predicted into the target model, and output the predicted value of photovoltaic power in the distribution area.

[0219] Example 5

[0220] If the modules / units integrated in the electronic device 100 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium can include: any entity or device capable of carrying the computer program code, a medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory, a random access memory, an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals. For ease of explanation, the above description only illustrates the parts related to the embodiments of the present invention. For specific technical details not disclosed, please refer to the method section of the embodiments of the present invention. This computer-readable storage medium is non-transitory and can be stored in storage devices formed by various electronic devices, enabling the execution process described in the method of the embodiments of the present invention.

[0221] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0222] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0223] Although the steps in the above embodiments are described in the above order, those skilled in the art will understand that in order to achieve the effect of this embodiment, different steps do not need to be executed in such order. They can be executed simultaneously (in parallel) or in reverse order. These simple variations are all within the protection scope of this invention.

[0224] Those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, in the claims of this invention, any of the claimed embodiments can be used in any combination.

Claims

1. A method for predicting photovoltaic power in a distribution area, characterized in that, include: Historical data on photovoltaic power and weather conditions in the distribution area were collected, and the historical data were preprocessed to filter data features. Clustering convergence is performed on the preprocessed historical data, and typical weather scenarios and representative samples are selected to form a representative dataset of the source domain. For each typical weather scenario, the source domain representative dataset is divided into training set, validation set and test set to build a source domain model library; Obtain meteorological data for the day to be predicted, select an initial model from the source domain model library, output the target model after dynamic matching, input the feature vector to be predicted into the target model, and output the predicted value of photovoltaic power in the distribution area.

2. The photovoltaic power prediction method for distribution substations according to claim 1, characterized in that, The process of collecting historical data on photovoltaic power and meteorological conditions in the distribution area, and then fusing and preprocessing the historical data to filter data features is as follows: For missing meteorological or power values ​​in a single historical data point, linear fitting is performed to complete the data based on valid historical data from three adjacent times before and after the missing historical data point, as follows: If historical data for time t is missing, let the values ​​for time t-1, t-2, and t-3 be... , , The values ​​at times t+1, t+2, and t+3 are , , Then complete the value. ; Based on historical data of photovoltaic power and weather conditions for each distribution substation, the average photovoltaic power of that distribution substation is calculated. with standard deviation If a certain historical data point satisfy If the value is an outlier, the historical data is removed and replaced with the mean of the time before and after the historical data point. For historical data after imputation and outlier removal, normalization is performed according to the feature dimension to map the values ​​to the [0,1] interval, as shown in the formula: ; in, , These are the minimum and maximum values ​​of this feature in historical data, respectively; For data at a certain historical data point, These are the normalized data values; Analyze the correlation between weather and power, and screen out the data characteristics of weather's impact on photovoltaic power generation; The formula for calculating the Pearson correlation coefficient is: ; In the formula, and These are sample data points for meteorological factors and photovoltaic output power in the distribution area, respectively, after preprocessing. and They are respectively and The corresponding average value, For the sample size, The Pearson correlation coefficient is used to screen data characteristics of the impact of meteorological factors on photovoltaic power generation.

3. The method for predicting photovoltaic power in a distribution area according to claim 1, characterized in that, The process of clustering and converging the preprocessed historical data, selecting typical weather scenarios and representative samples, and forming a representative dataset of the source domain is as follows: The preprocessed meteorological data is used to iteratively update the attraction matrix through a clustering algorithm. With the degree of belonging matrix : The similarity matrix is ​​calculated using negative values ​​of the Euclidean distance as the similarity between historical data samples. ; in, , The first , Meteorological feature vectors of each sample; Set iteration parameters including damping coefficient, maximum number of iterations, and cluster center number threshold; Matrix update: The attraction matrix is ​​updated in each iteration. With the degree of belonging matrix : ; ; in, and They respectively represent traversing all non-equal to and The meteorological feature vector of the sample; The top 20% of historical data samples with the highest similarity were selected as representative samples to form the source domain representative dataset.

4. The photovoltaic power prediction method for distribution substations according to claim 1, characterized in that, For each typical weather scenario, the source domain representative dataset is divided into training, validation, and test sets to construct a source domain model library. The process is as follows: The source domain representative dataset is divided into typical weather scenarios. The representative samples of each typical weather scenario are divided into training set, validation set and test set. A dual encoder model is built separately for each typical weather scenario. Local spatial features are extracted from data features in typical weather scenarios, and global features are captured after Fourier transformation to the frequency domain. The local spatial features and global features are then fused into a spatial feature vector through convolution. Multi-scale convolution kernels are used to perform convolution operations on time-series data to extract feature vectors at different time scales. These feature vectors are then fused with spatial feature vectors to output spatial and temporal feature vectors, thereby constructing a source domain model library.

5. The photovoltaic power prediction method for distribution substations according to claim 1, characterized in that, The process of acquiring meteorological data for the day to be predicted, selecting an initial model from the source domain model library, outputting a target model after dynamic matching, inputting the feature vector to be predicted into the target model, and outputting the predicted photovoltaic power value of the distribution area is as follows: Based on the meteorological data of the day to be predicted, the weighted Euclidean distance between the feature vector to be predicted and the center of each typical weather scenario is calculated. The typical weather scenario model with the smallest distance is selected as the initial model in the source domain model library. The formula for the weighted Euclidean distance is as follows: ; in, Let be the feature vector to be predicted. Let t represent the center similarity of each typical weather scene, and t be the time step. For feature dimension, For the first The weights of each feature vector. Let the feature vector to be predicted be at time step t. The values ​​of the feature vectors, For a typical weather scenario, the center is at time step t. The values ​​of the eigenvectors; Filter similar days before and after the date to be predicted, extract sample pairs of feature vectors and power values ​​for each similar day, and divide them into fine-tuning training set and fine-tuning validation set; The parameters of the initial model are frozen, the weight matrix is ​​adjusted, and the model is trained based on the fine-tuned training set. The target model is then output as a dynamically matched model. The feature vector to be predicted is input into the target model, and the predicted photovoltaic power of the distribution area is output.

6. A photovoltaic power prediction system for distribution areas, characterized in that, include: The data acquisition and preprocessing module collects historical data on photovoltaic power and weather in the distribution area, and preprocesses the historical data to filter data features. The scene clustering module performs clustering convergence on the preprocessed historical data, selects typical weather scenes and representative samples, and forms a representative dataset of the source domain. The model building module divides the source domain representative dataset into training, validation, and test sets for each typical weather scenario, and builds a source domain model library. The dynamic migration output module acquires meteorological data for the day to be predicted, selects an initial model from the source domain model library, outputs the target model after dynamic matching, inputs the feature vector to be predicted into the target model, and outputs the predicted value of photovoltaic power in the distribution area.

7. The photovoltaic power prediction system for distribution areas according to claim 6, characterized in that, The data acquisition and preprocessing module performs the following operations: Historical data on photovoltaic power and weather conditions in the distribution substation area were collected. Based on PyCharm, the historical data was preprocessed and filtered for key features. The steps are as follows: For missing meteorological or power values ​​in a single historical data point, linear fitting is performed to complete the data based on valid historical data from three adjacent times before and after the missing historical data point, as follows: If historical data for time t is missing, let the values ​​for time t-1, t-2, and t-3 be... , , The values ​​at times t+1, t+2, and t+3 are , , Then complete the value. ; Based on historical data of photovoltaic power and weather conditions for each distribution substation, the average photovoltaic power of that distribution substation is calculated. with standard deviation If a certain historical data point satisfy If the value is an outlier, the historical data is removed and replaced with the mean of the time before and after the historical data point. For historical data after imputation and outlier removal, normalization is performed according to the feature dimension to map the values ​​to the [0,1] interval, as shown in the formula: ; in, , These are the minimum and maximum values ​​of this feature in historical data, respectively; For data at a certain historical data point, These are the normalized data values; Analyze the correlation between weather and power, and screen out the data characteristics of weather's impact on photovoltaic power generation; The formula for calculating the Pearson correlation coefficient is: ; In the formula, and These are sample data points for meteorological factors and photovoltaic output power in the distribution area, respectively, after preprocessing. and They are respectively and The corresponding average value, For the sample size, The Pearson correlation coefficient is used to screen data characteristics of the impact of meteorological factors on photovoltaic power generation.

8. The photovoltaic power prediction system for distribution areas according to claim 6, characterized in that, The scene clustering module performs the following operations: The preprocessed meteorological data is used to iteratively update the attraction matrix through a clustering algorithm. With the degree of belonging matrix : The similarity matrix is ​​calculated using negative values ​​of the Euclidean distance as the similarity between historical data samples. ; in, , The first , Meteorological feature vectors of each sample; Set iteration parameters including damping coefficient, maximum number of iterations, and cluster center number threshold; Matrix update: The attraction matrix is ​​updated in each iteration. With the degree of belonging matrix : ; ; in, and They respectively represent traversing all non-equal to and The meteorological feature vector of the sample; The top 20% of historical data samples with the highest similarity were selected as representative samples to form the source domain representative dataset.

9. The photovoltaic power prediction system for distribution areas according to claim 6, characterized in that, The model building module performs the following operations: The source domain representative dataset is divided into typical weather scenarios. The representative samples of each typical weather scenario are divided into training set, validation set and test set. A dual encoder model is built separately for each typical weather scenario. Local spatial features are extracted from data features in typical weather scenarios, and global features are captured after Fourier transformation to the frequency domain. The local spatial features and global features are then fused into a spatial feature vector through convolution. Multi-scale convolution kernels are used to perform convolution operations on time-series data to extract feature vectors at different time scales. These feature vectors are then fused with spatial feature vectors to output spatial and temporal feature vectors, thereby constructing a source domain model library.

10. The photovoltaic power prediction system for distribution areas according to claim 6, characterized in that, The dynamic migration output module performs the following operations: Based on the meteorological data of the day to be predicted, the weighted Euclidean distance between the feature vector to be predicted and the center of each typical weather scenario is calculated. The typical weather scenario model with the smallest distance is selected as the initial model in the source domain model. The formula for the weighted Euclidean distance is as follows: ; in, Let be the feature vector to be predicted. Let t represent the center similarity of each typical weather scene, and t be the time step. For feature dimension, For the first The weights of each feature vector. Let the feature vector to be predicted be at time step t. The values ​​of the feature vectors, For a typical weather scenario, the center is at time step t. The values ​​of the eigenvectors; Filter similar days before and after the date to be predicted, extract sample pairs of feature vectors and power values ​​for each similar day, and divide them into fine-tuning training set and fine-tuning validation set; The parameters of the initial model are frozen, the weight matrix is ​​adjusted, and the model is trained based on the fine-tuned training set. The target model is then output as a dynamically matched model. The feature vector to be predicted is input into the target model, and the predicted photovoltaic power of the distribution area is output.