Distributed photovoltaic power prediction method and device and electronic equipment

By combining the fuzzy C-means method and the iTransformer model, weather types are accurately classified and suitable prediction models are selected, which solves the problem of insufficient prediction accuracy and adaptability in distributed photovoltaic power generation, and improves the operating efficiency and stability of photovoltaic power plants and power grids.

CN120975138APending Publication Date: 2025-11-18SHAOGUAN POWER SUPPLY BUREAU OF GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511066673.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-30
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Existing photovoltaic power prediction methods suffer from weak model learning capabilities and poor optimization performance in distributed photovoltaic power generation scenarios, resulting in insufficient prediction accuracy and model adaptability, which affects the operating efficiency and stability of the power grid.

Method used

Historical weather forecast data are clustered using the fuzzy C-means method to identify different weather types, determine the correlation between current weather forecast data and each weather type, and input the data into a power prediction model based on the iTransformer model to generate distributed photovoltaic power prediction data.

Benefits of technology

It improves the accuracy and model adaptability of distributed photovoltaic power prediction, ensures the accuracy and stability of prediction results, and supports the stable operation of photovoltaic power plants and the efficient dispatch of the power grid.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120975138A_ABST
    Figure CN120975138A_ABST
Patent Text Reader

Abstract

The invention provides a distributed photovoltaic power prediction method and device and electronic equipment, and relates to the technical field of photovoltaic power generation. The method comprises the following steps: acquiring a weather forecast data sequence; for each weather type in a plurality of weather types, determining a correlation degree between the weather forecast data sequence and a comparison data sequence corresponding to the weather type, the plurality of weather types being obtained by clustering historical weather forecast data sequences based on a fuzzy C-means method; determining a target weather type corresponding to the weather forecast data sequence from the plurality of weather types according to all the correlation degrees; and inputting the weather forecast data sequence into a power prediction model corresponding to the target weather type to obtain distributed photovoltaic power prediction data, the power prediction model being obtained by pre-training based on an iTransform model. The method is used for improving the precision and model adaptability of distributed photovoltaic power prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of photovoltaic power generation technology, and in particular to a method, apparatus and electronic equipment for distributed photovoltaic power prediction. Background Technology

[0002] With the continuous growth of energy demand and the increasing depletion of traditional fossil fuels, renewable energy has become a key direction for energy development. Solar photovoltaic (PV) power generation, with its advantages of being clean, renewable, and abundant in resources, has become an important research area in renewable energy. Distributed PV power generation, as an innovative application model, disperses PV equipment at the end of the grid, near the user side or close to the load, achieving a close integration of power generation and consumption, reducing transmission losses, and improving energy utilization efficiency. This is of great significance for optimizing the grid's energy structure and improving power supply reliability and stability. Therefore, to fully leverage the advantages of distributed PV power generation, PV power forecasting can be used to optimize power dispatch, reduce uncertainty, and improve power supply reliability, thereby increasing the operating efficiency of the power grid.

[0003] In existing technologies, photovoltaic (PV) power prediction methods typically rely on a comprehensive analysis of historical meteorological data, PV system equipment parameters, and historical power generation data. Mathematical modeling and machine learning algorithms are used to construct prediction models, which are then used to predict future power generation. However, due to the dispersed and geographically dispersed nature of distributed PV systems, existing PV power prediction methods suffer from weak model learning capabilities and poor optimization performance in distributed PV power generation scenarios, resulting in insufficient prediction accuracy and model adaptability. Summary of the Invention

[0004] The distributed photovoltaic power prediction method, apparatus, and electronic equipment provided in this application are intended to address the problems of weak prediction model learning ability and poor optimization effect in existing photovoltaic power prediction methods in distributed photovoltaic power generation scenarios, resulting in insufficient prediction accuracy and model adaptability.

[0005] In a first aspect, embodiments of this application provide a distributed photovoltaic power prediction method, including:

[0006] Obtain weather forecast data sequences;

[0007] For each of the multiple weather types, the correlation between the weather forecast data series and the corresponding comparative data series of the weather type is determined. The multiple weather types are obtained by clustering historical weather forecast data series based on the fuzzy C-means method.

[0008] Based on all correlations, the target weather type corresponding to the weather forecast data sequence is determined from multiple weather types;

[0009] The weather forecast data sequence is input into the power prediction model corresponding to the target weather type to obtain distributed photovoltaic power prediction data. The power prediction model is pre-trained based on the iTransformer model.

[0010] In one possible implementation, for each of multiple weather types, the correlation between the weather forecast data sequence and the corresponding comparative data sequence is determined, including: determining the comparative data sequences corresponding to multiple weather types; for each weather type, comparing the weather forecast data sequence with the corresponding comparative data sequence point by point to determine the correlation coefficient of the data at each time point; and performing a weighted average of the correlation coefficients of the data at all time points to obtain the correlation between the weather forecast data sequence and the corresponding comparative data sequence.

[0011] In one possible implementation, obtaining a weather forecast data sequence includes: obtaining an initial weather forecast data sequence; filling the initial weather forecast data sequence with default values ​​based on co-kriging interpolation to obtain a first preprocessed data sequence; standardizing the first preprocessed data sequence to obtain a second preprocessed data sequence; and cleaning outlier data from the second preprocessed data sequence to obtain a weather forecast data sequence.

[0012] In one possible implementation, the power prediction model includes an embedding layer, a self-attention mechanism layer, a feedforward layer, and a mapping layer; wherein: the embedding layer is used to receive weather forecast data sequences and map each variable in the weather forecast data sequences to an embedding space to obtain an embedded data matrix; the self-attention mechanism layer is used to perform self-attention processing on each variable in the embedded data matrix to obtain a target data matrix; the feedforward layer is used to extract features from each variable in the target data matrix to obtain an enhanced feature matrix; and the mapping layer is used to map the enhanced feature matrix to distributed photovoltaic power prediction data.

[0013] In one possible implementation, the method further includes: acquiring a historical weather forecast data sequence, the historical weather forecast data sequence including a set of weather forecast data acquired within a preset historical time period; dividing the historical weather forecast data sequence into multiple samples; updating each initial cluster center of the clustering based on an initial membership matrix and the multiple samples to obtain a target cluster center, wherein the initial membership matrix includes multiple membership degrees, and each membership degree represents the degree of association between a sample and a cluster center; updating the initial membership matrix based on the target cluster center and the multiple samples to obtain a target membership matrix. The process involves: using the target membership matrix as the initial membership matrix and the target cluster centers as the initial cluster centers; re-executing the step of updating each initial cluster center based on the initial membership matrix and multiple samples to obtain the target cluster centers; continuing this process until the membership error between the target membership matrix and the initial membership matrix is ​​less than a preset error threshold, resulting in updated target cluster centers and a target membership matrix; determining multiple weather types based on the characteristics of the updated target cluster centers; and assigning multiple samples to the corresponding weather types based on the updated target membership matrix, thus obtaining a comparative data sequence for each weather type.

[0014] In one possible implementation, after updating the initial membership matrix based on the target cluster center and multiple samples to obtain the target membership matrix, the method further includes: determining the target function value for this update based on the target cluster center, the target membership matrix, and the multiple samples; obtaining a first error matrix based on the target membership matrix and the initial membership matrix, the first error matrix including multiple membership error values; obtaining a second error value based on the target function value and historical target function values, the historical target function value being the target function value of an update prior to this update; determining whether the first error matrix and the second error value satisfy preset error conditions; when the... When the first error matrix and / or the second error value do not meet the preset error condition, the target membership matrix is ​​used as the initial membership matrix, and the target cluster center is used as the initial cluster center. The step of updating each initial cluster center of the clustering according to the initial membership matrix and the multiple samples to obtain the target cluster center is repeated until the first error matrix and the second error value meet the preset error condition, resulting in an updated target cluster center and target membership matrix. Based on the characteristics of the updated target cluster centers, multiple weather types are determined. Based on the updated target membership matrix, the multiple samples are assigned to the corresponding weather types to obtain a comparison data sequence corresponding to each weather type.

[0015] In one possible implementation, before inputting the weather forecast data sequence into the power prediction model corresponding to the target weather type to obtain distributed photovoltaic power prediction data, the method further includes: acquiring a historical dataset, which includes multiple historical weather forecast data sequences and the distributed photovoltaic power corresponding to each historical weather forecast data sequence; performing data preprocessing on the historical dataset to obtain the target dataset, the data preprocessing including default value filling, standardization, and outlier cleaning; dividing the dataset into a training set and a test set; clustering the historical weather forecast data sequences in the training set based on the fuzzy C-means method to obtain multiple weather types and a training subset corresponding to each weather type; and training the initial power prediction model for each weather type based on the training subset corresponding to the weather type until the output information of the initial power prediction model meets the preset training requirements, thereby obtaining a power prediction model corresponding to the weather type.

[0016] In one possible implementation, after training an initial power prediction model for each weather type based on a training subset corresponding to that weather type until the output information of the initial power prediction model meets preset training requirements and a power prediction model corresponding to the weather type is obtained, the method further includes: for each weather type, determining the correlation between historical weather forecast data sequences in the test set and comparative data sequences corresponding to the weather type; dividing the test set into multiple test subsets based on all correlations, wherein each test subset corresponds to a weather type; for each weather type, updating the power prediction model based on the test subset corresponding to the weather type until the test information of the power prediction model meets the threshold requirements of preset indicators, thereby obtaining an updated power prediction model, wherein the preset indicators include mean square error, root mean square error, and mean absolute error.

[0017] Secondly, embodiments of this application provide a distributed photovoltaic power prediction device, comprising:

[0018] The acquisition module is used to acquire weather forecast data sequences;

[0019] The processing module is used to determine the correlation between the weather forecast data sequence and the corresponding comparative data sequence for each of the multiple weather types. The multiple weather types are obtained by clustering historical weather forecast data sequences based on the fuzzy C-means method.

[0020] The determination module is used to determine the target weather type corresponding to the weather forecast data sequence from multiple weather types based on all correlations;

[0021] The prediction module is used to input the weather forecast data sequence into the power prediction model corresponding to the target weather type to obtain distributed photovoltaic power prediction data. The power prediction model is pre-trained based on the iTransformer model.

[0022] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0023] The memory stores instructions that the computer executes;

[0024] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.

[0025] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed, are used to implement the first aspect and / or various possible implementations of the first aspect.

[0026] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed, implements the first aspect and / or various possible implementations of the first aspect.

[0027] The distributed photovoltaic power prediction method, apparatus, and electronic device provided in this application acquire weather forecast data sequences; for each of multiple weather types, determine the correlation between the weather forecast data sequence and the corresponding comparative data sequence, where the multiple weather types are obtained by clustering historical weather forecast data sequences using the fuzzy C-means method; based on all correlations, determine the target weather type corresponding to the weather forecast data sequence from the multiple weather types; input the weather forecast data sequence into the power prediction model corresponding to the target weather type to obtain distributed photovoltaic power prediction data, where the power prediction model is obtained by pre-training the iTransformer model and clustering historical weather forecast data using the fuzzy C-means method to identify different weather types in order to better understand the impact of weather on photovoltaic power generation; determine the correlation between the current weather forecast data and each weather type, thereby selecting the most matching target weather type, which can determine the weather type closest to the current weather conditions, ensuring that the selected model can adapt to the current weather conditions and improve prediction accuracy; at the same time, the power prediction model trained based on the iTransformer model can better handle complex time series data, improving the model's learning ability and prediction performance. Therefore, by considering the differences in photovoltaic power generation characteristics under different weather conditions and selecting prediction models in a personalized manner, the accuracy and adaptability of distributed photovoltaic power prediction can be improved. Attached Figure Description

[0028] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0029] Figure 1 A flowchart illustrating the distributed photovoltaic power prediction method provided in this application. Figure 1 ;

[0030] Figure 2 A flowchart illustrating the distributed photovoltaic power prediction method provided in this application. Figure 2 ;

[0031] Figure 3 A schematic diagram of the distributed photovoltaic power prediction device provided in this application;

[0032] Figure 4 A schematic diagram of the structure of the electronic device provided in this application.

[0033] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0034] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0035] In existing technologies, distributed photovoltaic (PV) power generation is affected by a variety of complex factors due to its dispersed locations and widespread installations. These factors include sunlight conditions, weather changes, component performance variations, and the dynamic effects of obstructions. Existing prediction models exhibit shortcomings in learning ability and optimization performance when dealing with these complex and variable factors. For example, some models oversimplify influencing factors to simplify calculations, neglecting the role of certain key factors and leading to large prediction biases. Conversely, some models consider numerous factors to improve accuracy, but limitations in algorithms or inconsistent data quality prevent sufficient and effective optimization, resulting in insufficient stability and accuracy of predictions. Therefore, existing prediction models in distributed PV power generation scenarios suffer from weak learning ability and poor optimization performance, leading to insufficient prediction accuracy and model adaptability. This makes it difficult for the power grid to effectively cope with power fluctuations, impacting the utilization of distributed PV and consequently affecting the safe and stable operation of the power grid.

[0036] To address the aforementioned issues, this application provides a distributed photovoltaic (PV) power prediction method, apparatus, and electronic device. It clusters historical weather forecast data using the fuzzy C-means method to identify different weather types, thereby better understanding the impact of weather on PV power generation. It determines the correlation between current weather forecast data and each weather type, selecting the most suitable target weather type. This ensures the model is adapted to current weather conditions, improving prediction accuracy. Finally, the weather forecast data is input into a power prediction model trained on an iTransformer model corresponding to the target weather type, generating distributed PV power prediction data. This model can better handle complex time-series data, improving its learning ability and prediction performance. Therefore, by accurately classifying weather types and selecting suitable prediction models, considering the differences in PV power generation characteristics under different weather conditions, and personalized model selection, the accuracy and adaptability of distributed PV power prediction can be improved, providing data support for the stable operation of PV power plants and efficient grid dispatch.

[0037] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0038] The execution entity of the distributed photovoltaic power prediction method provided in this application embodiment can be a computing device such as a server or server cluster. The server can be a mobile phone, computer, tablet, or other device. This application embodiment does not impose any particular restrictions on the implementation method of the execution entity, as long as the execution entity can obtain weather forecast data sequences; for each of multiple weather types, determine the correlation between the weather forecast data sequence and the corresponding comparative data sequence for that weather type; the multiple weather types are obtained by clustering historical weather forecast data sequences based on the fuzzy C-means method; based on all correlations, determine the target weather type corresponding to the weather forecast data sequence from the multiple weather types; input the weather forecast data sequence into the power prediction model corresponding to the target weather type to obtain distributed photovoltaic power prediction data; the power prediction model can be pre-trained based on the iTransformer model.

[0039] Figure 1 A flowchart illustrating the distributed photovoltaic power prediction method provided in this application. Figure 1 The execution entity of this method can be a server storing the distributed photovoltaic power prediction method or other servers. This embodiment does not impose any special restrictions here. Figure 1 As shown, the method may include:

[0040] S101. Obtain the weather forecast data sequence.

[0041] Among them, the weather forecast data sequence can be a series of data about future weather conditions arranged in chronological order. It can include a variety of meteorological variables such as humidity, wind speed, light intensity, temperature, and cloud cover. That is, the weather forecast data sequence contains a set of data subsequences corresponding to multiple meteorological variables. These variables are continuously updated over time, providing basic information for subsequent photovoltaic power prediction.

[0042] In one example, meteorological departments or meteorological data service agencies can periodically acquire NWP (Numerical Weather Prediction) data from photovoltaic power plants, thereby obtaining weather forecast data sequences of varying accuracies, such as short-term (1-3 days), medium-term (4-10 days), or long-term (over 10 days) weather forecast data sequences. For instance, the weather forecast data sequence may include short-term humidity data subsequences, wind speed data subsequences, and solar irradiance data subsequences. Furthermore, preliminary quality checks and preprocessing can be performed on the acquired data to remove obviously erroneous or missing data, ensuring data quality.

[0043] S102. For each of the multiple weather types, determine the correlation between the weather forecast data sequence and the comparison data sequence corresponding to the weather type. The multiple weather types are obtained by clustering historical weather forecast data sequences based on the fuzzy C-means method.

[0044] In this step, the Fuzzy C-Means (FCM) method assigns each sample (i.e., data point) in the historical weather forecast data sequence to different clusters (i.e., weather types). Each sample has a certain degree of membership to each cluster, rather than absolutely belonging to a particular cluster, thus reflecting the actual distribution of the data more flexibly. The comparison data sequence can refer to a representative historical weather forecast data sequence corresponding to each weather type, used to compare with the current weather forecast data sequence.

[0045] Furthermore, the correlation between the current weather forecast data series and various comparative data series can be calculated using preset correlation calculation methods, such as grey relational analysis and Pearson correlation coefficient. For example, the correlation calculation method can be selected and optimized based on data characteristics and actual needs. Specifically, for time series data, grey relational analysis better reflects the dynamic relationships between data; while for data with a relatively normal distribution, the Pearson correlation coefficient is more suitable. Simultaneously, to reduce computational load, the data can be pre-processed with dimensionality reduction or feature extraction to extract the key elements that best reflect weather characteristics for correlation calculation.

[0046] S103. Based on all correlations, determine the target weather type corresponding to the weather forecast data sequence from multiple weather types.

[0047] The target weather type refers to the weather type with the highest correlation to the current weather forecast data series. Determining the target weather type is to select the corresponding power prediction model that is most suitable for the current weather conditions, thereby improving the accuracy of the prediction.

[0048] In some examples, after calculating the correlation between the weather forecast data series and the comparative data series corresponding to each weather type, all correlations are sorted, and the weather type with the highest correlation is selected as the target weather type.

[0049] Furthermore, to ensure the accuracy of target weather type determination, a correlation threshold can be set. If the maximum correlation exceeds this threshold, it is directly identified as the target weather type; if the maximum correlation does not exceed the threshold, it may indicate that the current weather conditions are quite unique and do not belong to any existing weather type. In this case, further subdivision of the weather type or the establishment of a new forecasting model can be considered. Optionally, expert experience or a manual review mechanism can be introduced to verify and adjust the automatically determined target weather type, especially in some critical or complex weather conditions, which can further improve the accuracy of forecasts.

[0050] S104. Input the weather forecast data sequence into the power prediction model corresponding to the target weather type to obtain distributed photovoltaic power prediction data. The power prediction model is pre-trained based on the iTransformer model.

[0051] The iTransformer model is a deep learning model specifically designed for processing time series data. It can capture long-term dependencies and nonlinear characteristics in time series data, thereby accurately predicting photovoltaic power. A power prediction model corresponding to a target weather type can refer to a model trained on the iTransformer model for each weather type, using historical weather forecast data sequences and corresponding photovoltaic power data for that type.

[0052] Furthermore, to continuously optimize model performance, new data can be collected periodically to update and retrain the model, adapting to changes in weather and the operational characteristics of photovoltaic systems. For example, the actual distributed photovoltaic power corresponding to the current weather forecast data sequence can be obtained. By combining the predicted and actual distributed photovoltaic power data, model evaluation metrics (such as mean square error, root mean square error, and mean absolute error) can be determined, thereby updating the model. In addition, other prediction methods, such as physical models and statistical models, can be combined to fuse and correct the prediction results of the iTransformer model, further improving prediction accuracy.

[0053] The distributed photovoltaic (PV) power prediction method provided in this application uses weather forecast data sequences as the basis for prediction. It clusters historical weather data using the fuzzy C-means method to identify representative weather types and calculates the correlation between the current weather forecast data sequence and the comparative data sequences of each weather type to accurately determine the target weather type. The weather forecast data sequence is then input into a corresponding power prediction model based on the iTransformer model to obtain distributed PV power prediction data. This method fully considers the differences in PV power generation characteristics under different weather conditions and improves the accuracy of distributed PV power prediction by selecting a personalized prediction model. Furthermore, this method can provide relatively accurate prediction results under different weather conditions, helping PV power plants to rationally plan power generation, optimize energy management, reduce energy waste and supply shortages, and improve the stability and reliability of the power grid.

[0054] Based on the above embodiments, the method described in S102 for determining the correlation between a weather forecast data sequence and a comparative data sequence corresponding to a weather type for each of multiple weather types may include: determining comparative data sequences corresponding to multiple weather types; comparing the weather forecast data sequence and the comparative data sequence corresponding to the weather type point by point for each weather type to determine the correlation coefficient of the data corresponding to each time point; and performing a weighted average of the correlation coefficients of the data corresponding to all time points to obtain the correlation between the weather forecast data sequence and the comparative data sequence corresponding to the weather type.

[0055] In this embodiment, the historical weather forecast data sequences under each weather type constitute different behavioral sequences of the system. The comparison data sequence can refer to the behavioral sequence with typical characteristics under that weather type. For example, when classifying weather types by clustering, the central sequence corresponding to each weather type in the clustering results is used as the corresponding comparison data sequence.

[0056] For each weather type, the correlation coefficient of the data at each time point can be determined by comparing the weather forecast data series with the comparative data series corresponding to the weather type point by point. This can be achieved by using grey relational analysis to calculate the degree of correlation between the weather forecast data series and the comparative data series corresponding to the weather type at each time point, thereby measuring the similarity between the two series.

[0057] In the point-by-point comparison, the grey correlation coefficient between the weather forecast data sequence and the corresponding data of the comparison data sequence at each time point is calculated. This correlation coefficient reflects the degree of correlation between the two data at that time point, and the value ranges from 0 to 1. The larger the value, the stronger the correlation.

[0058] In one example, let the weather forecast data sequence X0 = (X0(1)...X0(n)) and the comparison data sequence X i =(X i (1)…X i (k)…X i Given a region (n), where i = 1, 2, ..., mk = 1, 2, ..., n, the grey relational coefficient is determined as follows:

[0059]

[0060] Where, Δ i (k) is the absolute difference between the weather forecast data sequence and the corresponding data of the i-th comparison data sequence at the k-th time point; ζ is the resolution coefficient, which is recommended to be between (0, 1), and is set to 0.3 here.

[0061] In order to more accurately reflect the actual situation, the resolution coefficient can be dynamically adjusted according to the degree of influence of different meteorological factors on photovoltaic power.

[0062] Furthermore, weighted averaging of the correlation coefficients of all time points can be used to synthesize the grey correlation coefficients of each time point to obtain an index (i.e., correlation degree) that reflects the overall correlation between the weather forecast data series and the comparative data series.

[0063] In one example, the degree of association can be determined in the following way:

[0064]

[0065] Furthermore, the impact of data at different time points on photovoltaic power prediction may vary. Therefore, different weights can be assigned, with a larger weight indicating a greater impact of the data at that time point on the overall correlation. Weighted averaging allows for a more comprehensive and accurate measurement of the grey correlation between two sequences, thus providing a more reliable basis for determining the target weather type. The weights can be determined based on the changing patterns of meteorological elements and the characteristics of photovoltaic power generation. For example, the impact of solar irradiance on photovoltaic power generation varies at different times of the day. Based on the daily variation curve of solar irradiance, corresponding weights can be assigned to the correlation coefficients at different time points.

[0066] By identifying and comparing data sequences, and calculating correlation coefficients point-by-point, the similarity between two sequences at local time points can be accurately captured. Weighted averaging yields the correlation degree, which comprehensively considers the importance of data at different time points, making the correlation degree calculation more reasonable. Therefore, based on grey relational analysis, the degree of correlation between the current weather forecast data sequence and comparative data sequences of various weather types can be measured more accurately, providing a reliable basis for more precise determination of target weather types, thereby further improving the accuracy and reliability of distributed photovoltaic power forecasting.

[0067] Based on the above embodiments, the method for obtaining weather forecast data sequences described in S101 may include: obtaining an initial weather forecast data sequence; filling the initial weather forecast data sequence with default values ​​based on co-kriging interpolation to obtain a first preprocessed data sequence; standardizing the first preprocessed data sequence to obtain a second preprocessed data sequence; and cleaning outlier data from the second preprocessed data sequence to obtain a weather forecast data sequence.

[0068] In this embodiment, the initial weather forecast data sequence may contain missing values ​​due to data collection reasons, i.e., data for certain time points or locations is missing. Default value filling involves estimating and supplementing this missing data using appropriate methods. Co-kriging interpolation is a spatial interpolation method that utilizes the correlation between multiple variables to estimate data for unknown points using data from known points. In weather forecast data sequence processing, it can leverage the spatial correlation between other relevant meteorological elements (such as temperature, humidity, and wind speed) to more accurately fill in the missing values ​​in the initial weather forecast data sequence. In some examples, co-kriging interpolation can use cross-covariance and cross-semivariogram to characterize the correlation, thereby improving the estimation accuracy of the main variables. The calculation formula is as follows:

[0069]

[0070] in, The estimated value of the main variable is the target variable whose default value needs to be filled. and Let λ represent the values ​​of the main variable and auxiliary variable for the i-th known data point in the initial weather forecast data sequence, respectively; i and μ i These are the weights assigned to the main variable and the auxiliary variable, respectively, and satisfying... λ can be solved using the Lagrange multiplier method. i and μ i The specific value.

[0071] Standardization refers to transforming data according to certain rules to give it a uniform scale or distribution characteristics. In weather forecast data series processing, standardization can eliminate the influence of differences in units, numerical ranges, etc., between different meteorological elements, making the data more comparable and analyzable. Standardization methods can include Z-score standardization, Min-Max standardization, etc. Taking Z-score standardization as an example, the mean and standard deviation of each data point in the first preprocessed data series can be calculated. Then, the mean is subtracted from each data point, and the result is divided by the standard deviation to obtain the standardized data, i.e., the second preprocessed data series.

[0072] Furthermore, the data is transformed into a standard normal distribution with a mean of 0 and a standard deviation of 1, ensuring that different data features have the same scale. The standardization formula satisfies:

[0073]

[0074] Where Z is the standardized value of the i-th data; X is the initial value of the i-th data; μ is the mean of the first preprocessed data sequence; σ is the standard deviation of the first preprocessed data sequence; and N is the number of data in the first preprocessed data sequence.

[0075] Outlier data refers to data that deviates significantly from the normal data distribution, possibly due to data acquisition errors, equipment malfunctions, or other reasons. Outlier data cleaning identifies and removes these outliers to obtain the final weather forecast data sequence, ensuring data quality and reliability. Outlier data cleaning methods can include statistical methods (such as the 3σ principle), distance-based methods (such as the KNN algorithm), and model-based methods (such as the Isolation Forest algorithm). Taking the 3σ principle as an example, the mean and standard deviation of the second preprocessed data sequence are calculated, and data whose distance from the mean exceeds three times the standard deviation (i.e., (μ-3σ, μ+3σ)) are considered outliers and removed.

[0076] By using co-kriging interpolation to fill in the default values ​​in the initial weather forecast data sequence, the correlation between multiple meteorological elements is fully utilized, improving the accuracy of default value filling and making the first preprocessed data sequence more complete. The first preprocessed data sequence is standardized to eliminate the influence of differences in units and numerical ranges between different meteorological elements. The second preprocessed data sequence is cleaned of outliers to remove abnormal data and ensure data quality and reliability, providing high-quality data input for subsequent distributed photovoltaic power prediction methods, which helps to improve the accuracy and stability of power prediction.

[0077] Based on the above embodiments, the power prediction model described in S104 may include an embedding layer, a self-attention mechanism layer, a feedforward layer, and a mapping layer; wherein: the embedding layer is used to receive weather forecast data sequences and map each variable in the weather forecast data sequences to the embedding space to obtain an embedded data matrix; the self-attention mechanism layer is used to perform self-attention processing on each variable in the embedded data matrix to obtain a target data matrix; the feedforward layer is used to extract features from each variable in the target data matrix to obtain an enhanced feature matrix; and the mapping layer is used to map the enhanced feature matrix to distributed photovoltaic power prediction data.

[0078] An embedding layer is a neural network layer that maps discrete or continuous variables to a low-dimensional continuous vector space (embedding space). It can convert different types of meteorological variables (such as temperature, humidity, light intensity, etc.) into vector representations with fixed dimensions. These vectors contain the semantic information and contextual relationships of the variables, which are convenient for subsequent neural network layers to process.

[0079] Furthermore, when the embedding layer receives the weather forecast data sequence, for each data subsequence corresponding to each meteorological variable in the sequence, it maps it according to a pre-defined embedding matrix. The embedding matrix is ​​a learnable parameter matrix, the dimension of which is determined by the number of meteorological variables and the dimension of the embedding vector. For example, the embedding matrix embeds each time-series variable entirely as a token; that is, the original sequences of different meteorological variables are independently embedded as tokens. When there are V meteorological variables, each meteorological variable contains a time-series variable sequence X = [X1, X2, ..., X...] with T time steps. V An embedding matrix E is used to map each variable to an embedding space, embedding each time-series variable as a token. The formula is as follows:

[0080] Z v =f(X) v ) = W v ·X v +b v ;

[0081] Among them, Z v For X v The embedded representation represents a single token; W v For variable X v The linear transformation matrix; b v For bias.

[0082] After the above operations, the embedding matrix Z = [Z1, Z2, ..., Zn] of all meteorological variables is obtained. V ], where each element represents an independent token.

[0083] Self-attention is a neural network mechanism that can capture the dependencies between variables at different positions in a sequence. It dynamically adjusts the importance of each variable in subsequent processing by calculating the attention weights between each variable and other variables in the sequence, thereby better capturing long-term dependencies and contextual information in the sequence.

[0084] Furthermore, a self-attention mechanism is employed to process the embedded variable tokens, enhancing interpretability and revealing the correlations between multiple variables. First, a linear transformation is performed on each variable token to obtain the query matrix (Q), key matrix (K), and value matrix (V). For example, Q = ZW. Q K = ZW K V=ZW V Among them, W Q W K W V These are learnable weight matrices used to generate the query, key, and value, respectively. Then, the dot product of the query matrix and the key matrix is ​​calculated to obtain the attention score matrix. This attention score matrix is ​​then normalized using the softmax function to obtain the attention weight matrix. Finally, the attention weight matrix is ​​multiplied by the value matrix to obtain the target data matrix, Attention(Q,K,V). For example,

[0085] The feedforward layer is a neural network layer composed of fully connected neural networks, capable of performing nonlinear transformations and feature extraction on the input data. Therefore, the feedforward layer can further extract and transform features from each variable in the target data matrix output by the self-attention mechanism layer, enhancing the data's expressive power.

[0086] Furthermore, feature representations of each token are extracted through a feedforward network (feedforward layer), and layer normalization is applied to reduce the differences between variables.

[0087] Applying a feedforward network, Z″=FFN(Z′)=σ(Z′W1+b1)W2+b2; where Z′ is the input matrix after processing by the self-attention mechanism; W1 and W2 are weight matrices; b1 and b2 are biases; and σ is the activation function, here the ReLU function is used.

[0088] The feedforward network output is subjected to layer normalization. Z″′=LayerNorm(Z″). Z″′ is the feature representation after layer normalization, and layer normalization is performed according to the following formula:

[0089]

[0090] Where μ and σ are the mean and variance of the features, respectively. γ and β are learnable scaling and translation parameters. ∈ is a small constant to prevent division by zero.

[0091] The mapping layer transforms the enhanced features extracted by the feedforward layer into the final prediction result, i.e., distributed photovoltaic (PV) power. The mapping layer can consist of a fully connected layer with the same input dimension as the enhanced feature matrix and an output dimension equal to the number of predicted PV power values ​​(e.g., if predicting PV power at multiple future time points, the output dimension would be the number of those time points). When the enhanced feature matrix is ​​input to the mapping layer, it undergoes a linear transformation by the fully connected layer to obtain the PV power prediction data.

[0092] In addition, to ensure that the input of each layer remains within a stable distribution range, thereby improving the training efficiency and performance of the entire model, normalization layers can be added between the self-attention mechanism layer and the feedforward layer, and between the feedforward layer and the mapping layer. By normalizing the input of the feedforward layer and the mapping layer through the normalization layer, the changes in the layer input distribution caused by parameter updates are reduced, making the model training more stable.

[0093] This power prediction model, through a combination of embedding layer, self-attention mechanism layer, feedforward layer and mapping layer, can effectively capture the characteristics of meteorological variables and complex patterns in the sequence, make full use of the information in the weather forecast data sequence, improve the accuracy and reliability of distributed photovoltaic power prediction, help photovoltaic power plants to rationally arrange power generation plans, optimize energy management, and ensure the stable operation of the power grid.

[0094] Based on the above embodiments, the method may further include: acquiring historical weather forecast data sequences, the historical weather forecast data sequences including a set of weather forecast data acquired within a preset historical time period; dividing the historical weather forecast data sequences into multiple samples; updating each initial cluster center of the clustering based on an initial membership matrix and multiple samples to obtain target cluster centers, wherein the initial membership matrix includes multiple membership degrees, and each membership degree represents the degree of association between a sample and a cluster center; updating the initial membership matrix based on the target cluster centers and multiple samples to obtain target membership degrees. The process involves: using the target membership matrix as the initial membership matrix and the target cluster centers as the initial cluster centers; re-executing the step of updating each initial cluster center based on the initial membership matrix and multiple samples to obtain the target cluster centers; continuing this process until the membership error between the target membership matrix and the initial membership matrix is ​​less than a preset error threshold, resulting in updated target cluster centers and a target membership matrix; determining multiple weather types based on the characteristics of the updated target cluster centers; and assigning multiple samples to the corresponding weather types based on the updated target membership matrix to obtain a comparative data sequence for each weather type.

[0095] In this embodiment, the initial membership matrix can be a matrix set at the beginning of clustering, with the number of rows equal to the number of samples and the number of columns equal to the number of clusters. Each element in the matrix represents the initial membership degree between a sample and a cluster center. At the beginning of clustering, the initial membership matrix can be obtained through random initialization or other methods.

[0096] In this embodiment, historical weather forecast data sequences can be divided into multiple samples based on the size of the time window, facilitating subsequent cluster analysis. Each sample can be viewed as a data point containing weather forecast data for a specific time period.

[0097] Here, the cluster center is a representative point of each cluster, used to describe the average characteristics of the samples in that cluster. Based on the initial membership matrix and sample data, the position of the cluster center is updated iteratively to make it closer to the center position of the samples in the cluster, thus obtaining the target cluster center. For example, the update formula for the cluster center satisfies:

[0098]

[0099] In the update formula for the cluster center, Let x be the center of the j-th target cluster; N is the total number of samples; x i For the i-th sample; For x i The initial membership degree relative to the j-th initial cluster center; m is the weighting exponent, with m set to 0.5.

[0100] After obtaining the target cluster centers, it is necessary to recalculate the membership degrees between the samples and each cluster center based on the new cluster centers and sample data, thus obtaining the target membership degree matrix. Membership degree characterizes the degree of association between a sample and a cluster center, with values ​​ranging from 0 to 1. A higher value indicates a stronger association between the sample and the cluster center, and a greater likelihood that the sample belongs to the weather type represented by that cluster center. Membership degrees can be calculated by determining the distances between the samples and each cluster center (e.g., Euclidean distance), and then based on these distances. For example, the membership degree update formula satisfies:

[0101]

[0102] In the membership update formula, For x i The target membership degree relative to the j-th target cluster center; C is the number of cluster centers, C is 3; c j Let be the j-th target cluster center; k is a temporary index used to traverse all cluster categories - i.e., cluster centers (k = 1, 2, ..., C).

[0103] in, The value of m is used to control the distribution of membership degrees. As m increases, the membership degrees become more ambiguous, and the difference in membership degrees between samples and cluster centers becomes smaller; the smaller m is, the clearer the clustering results become, and the greater the difference in membership degrees between samples and cluster centers. Through experiments and analysis, an appropriate value of m can be selected to obtain clustering results that better reflect actual weather conditions.

[0104] The membership error value is an indicator that measures the difference between the target membership matrix and the initial membership matrix. By iteratively updating the cluster centers and membership matrix until the membership error value is less than a preset error threshold, the clustering process is considered to have converged, yielding the final updated target cluster centers and target membership matrix. Furthermore, when all membership error values ​​between the target membership matrix and the initial membership matrix are less than the threshold, the clustering process is considered to have converged, i.e.: Where, k i For the number of updates; ε e1 The preset error threshold is typically set within the range of 0.01 to 0.5; here, we take the threshold ε. e1 =0.1.

[0105] It should be noted that using membership error to determine clustering update iterations can reduce computational load and speed up classification. However, the choice of a preset error threshold affects both clustering accuracy and computation time. A smaller threshold results in higher clustering accuracy but longer computation time; a larger threshold results in shorter computation time but lower clustering accuracy. Therefore, an appropriate preset error threshold can be selected through experiments and analysis to achieve a balance between clustering accuracy and computation time.

[0106] Based on the above embodiments, the updated target cluster centers contain the average characteristics of samples in each cluster. By analyzing and summarizing the characteristics of these cluster centers, multiple representative weather types can be identified. For example, the average value, variance, and other statistical quantities of each meteorological element in each cluster center are calculated. Based on these statistical quantities and meteorological knowledge, a corresponding weather type description is determined for each cluster center, such as sunny, cloudy, or rainy.

[0107] The updated target membership matrix contains the membership degree between each sample and each cluster center. Based on the size of the membership degree, the sample can be assigned to the weather type corresponding to the cluster center with the largest membership degree. The data of all samples belonging to the same weather type are sorted and summarized to obtain the comparative data sequence corresponding to that weather type.

[0108] Furthermore, when assigning samples, if the membership degrees of a sample to multiple cluster centers are not significantly different, it may be considered to mark the sample as an uncertain sample, or its characteristics may be further analyzed to determine a more suitable weather type. At the same time, to ensure the quality of the comparative data sequences, the assigned data can be checked and filtered again to remove outliers and unreasonable data.

[0109] By performing cluster analysis on historical weather forecast data, weather types can be more rationally classified, and representative benchmark data sequences can be generated, providing representative benchmark data for subsequent distributed photovoltaic power prediction.

[0110] Based on the above embodiments, after updating the initial membership matrix according to the target cluster center and multiple samples to obtain the target membership matrix, the method may further include: determining the target function value for this update based on the target cluster center, the target membership matrix, and the multiple samples; obtaining a first error matrix based on the target membership matrix and the initial membership matrix, the first error matrix including multiple membership error values; obtaining a second error value based on the target function value and historical target function values, the historical target function value being the target function value of an update prior to this update; determining whether the first error matrix and the second error value satisfy preset error conditions respectively; when the... When the first error matrix and / or the second error value do not meet the preset error condition, the target membership matrix is ​​used as the initial membership matrix, and the target cluster center is used as the initial cluster center. The step of updating each initial cluster center of the clustering according to the initial membership matrix and the multiple samples to obtain the target cluster center is repeated until the first error matrix and the second error value meet the preset error condition, resulting in an updated target cluster center and target membership matrix. Based on the characteristics of the updated target cluster centers, multiple weather types are determined. Based on the updated target membership matrix, the multiple samples are assigned to the corresponding weather types to obtain a comparison data sequence corresponding to each weather type.

[0111] In this embodiment, the goal of FCM clustering is to minimize an objective function, which is used to measure the quality of the clustering results. This is achieved by continuously updating and adjusting the membership degrees. and cluster center This approach aims to bring each sample as close as possible to the center of its cluster, thereby reducing the value of the objective function and achieving a more reasonable clustering result. The objective function value J... m Determined in the following ways:

[0112]

[0113] The first error matrix measures the difference between the target membership matrix and the initial membership matrix. Each element in the matrix represents the error value of the corresponding cluster center membership of a sample in the target membership matrix and the initial membership matrix. The second error value measures the difference between the updated objective function value and the historical objective function value, reflecting the change in the objective function value during the clustering process.

[0114] The preset error condition is a criterion used to determine whether the clustering process has converged. It specifies the maximum allowable range of the first error matrix and the second error value. The clustering process is considered converged and iteration can stop only when both the first error matrix and the second error value satisfy the preset error condition. If neither the first error matrix nor the second error value satisfies the preset error condition, or if either the first error matrix or the second error value fails to meet the preset error condition, it indicates that the clustering process has not yet converged, and the step of updating cluster centers needs to be repeated to further optimize the clustering results.

[0115] In one example, the preset error condition can be:

[0116]

[0117] in, ε is the largest membership error value in the first error matrix; e1 ε is the preset error threshold corresponding to the first error matrix; e2 This is the preset error threshold corresponding to the second error value; where the error threshold is generally set in the range of 0.01 to 0.5, and here ε is taken. e1 =0.1, ε e2 =0.3.

[0118] Based on the above embodiments, the updated target cluster centers contain the average characteristics of samples in each cluster. By analyzing and summarizing the characteristics of these cluster centers, several representative weather types can be identified, such as sunny, cloudy, and rainy. The updated target membership matrix contains the membership degree between each sample and each cluster center. For each sample, the cluster center with the highest membership degree is found, and the sample is assigned to the weather type corresponding to that cluster center. The data of all samples belonging to the same weather type are then organized and summarized to obtain the comparative data sequence corresponding to that weather type.

[0119] By determining the objective function value for this update, and based on the first error matrix and the second error value, we can determine whether they meet the preset error conditions. This allows for a more comprehensive evaluation of the convergence of the clustering process, making the clustering results more accurate and stable. Consequently, the weather types determined based on the updated target cluster centers are more consistent with actual meteorological characteristics, and the comparative data sequences corresponding to each weather type assigned based on the updated target membership matrix are more representative.

[0120] Based on the above embodiments, before inputting the weather forecast data sequence into the power prediction model corresponding to the target weather type to obtain distributed photovoltaic power prediction data, the method may further include: acquiring a historical dataset, which includes multiple historical weather forecast data sequences and the distributed photovoltaic power corresponding to each historical weather forecast data sequence; performing data preprocessing on the historical dataset to obtain the target dataset, the data preprocessing including default value filling, standardization processing, and outlier cleaning; dividing the dataset into a training set and a test set; clustering the historical weather forecast data sequences in the training set based on the fuzzy C-means method to obtain multiple weather types and a training subset corresponding to each weather type; and training the initial power prediction model for each weather type based on the training subset corresponding to the weather type until the output information of the initial power prediction model meets the preset training requirements, thereby obtaining a power prediction model corresponding to the weather type.

[0121] Historical datasets can be collections of weather forecast data sequences and corresponding distributed photovoltaic (PV) power data collected over a past period. Historical weather forecast data sequences can be obtained from the PV power plant's data acquisition system, along with power generation data from the PV power plant within the corresponding time period. These two sets of data are then correlated and organized to form a historical dataset. For example, NWP data (such as wind speed, humidity, and solar irradiance) and corresponding distributed PV power data can be collected at different times each day over the past year or longer.

[0122] Data preprocessing involves performing a series of operations on collected historical datasets to improve data quality and make it more suitable for model training. This includes steps such as default value imputation, standardization, and outlier cleaning. Furthermore, multiple methods can be combined during data preprocessing. For example, outlier detection and handling can be performed before standardization to prevent outliers from affecting the standardization results. Additionally, different preprocessing methods can be used for different meteorological elements based on their characteristics. For instance, logarithmic transformation can be used to standardize light intensity data to better reflect its distribution characteristics.

[0123] The target dataset can be divided into a training set and a test set for model training and evaluation, respectively. A 7:3 ratio can be used for the training and test sets. The training set is used to train the power prediction model, enabling it to learn the patterns and features in the data; the test set is used to evaluate the performance of the trained model, testing its prediction accuracy and generalization ability on unseen data.

[0124] The initial power prediction model is an untrained iTransformer model. For each weather type, the initial power prediction model is trained on a training subset, allowing the model to learn the mapping relationship between weather elements and photovoltaic power under that weather type. Further, the weather forecast data sequences from the training subset corresponding to each weather type are used as input, and the corresponding distributed photovoltaic power is used as output, and input into the initial power prediction model. Backpropagation and optimization algorithms (such as the Adam optimization algorithm) are used to update the model's parameters, gradually bringing the model's output closer to the actual photovoltaic power value. This training process is repeated until the model's output information meets preset training requirements, such as the model's loss function value being less than a preset threshold, or the model's prediction accuracy on the validation set reaching a preset level. Thus, the power prediction model for each weather type can be obtained.

[0125] By preprocessing data and using cluster analysis based on fuzzy C-means, corresponding power prediction models are constructed and trained for different weather types. This enables the models to better adapt to photovoltaic power prediction under different weather conditions, improving the accuracy and adaptability of predictions. This helps photovoltaic power plants to rationally arrange power generation plans, optimize energy management, and ensure the stable operation of the power grid.

[0126] Based on the above embodiments, after training the initial power prediction model for each weather type using a training subset corresponding to that weather type until the output information of the initial power prediction model meets the preset training requirements and a power prediction model corresponding to the weather type is obtained, the method may further include: for each weather type, determining the correlation between the historical weather forecast data sequence in the test set and the comparative data sequence corresponding to the weather type; dividing the test set into multiple test subsets based on all correlations, wherein each test subset corresponds to a weather type; for each weather type, updating the power prediction model based on the test subset corresponding to the weather type until the test information of the power prediction model meets the threshold requirements of preset indicators, thereby obtaining the updated power prediction model, wherein the preset indicators include mean square error, root mean square error, and mean absolute error.

[0127] In this embodiment, by calculating the correlation degree, data in the test set can be assigned to test subsets corresponding to the most similar weather types. That is, each test subset corresponds to one weather type, and the correlation degree can be calculated using the grey relational analysis method. For power prediction models of different weather types, the corresponding test subsets are used for evaluation and updating, improving the relevance of model evaluation and updating.

[0128] Mean Squared Error (MSE) is the average of the squared differences between predicted and true values, measuring the degree of difference between them. A smaller MSE indicates that the predicted values ​​are closer to the true values, and the better the model's predictive performance. Root Mean Squared Error (RMSE) is the square root of the mean squared error, having the same dimensions as MSE, and more directly reflects the average difference between predicted and true values. Mean Absolute Error (MAE) is the average of the absolute differences between predicted and true values, also measuring the degree of difference, but relatively insensitive to outliers.

[0129] Furthermore, the calculation formula for the preset indicators can satisfy:

[0130]

[0131] Where N is the number of samples in the test subset; f(x) i ) represents the distributed photovoltaic power in the test subset, y i This is the distributed photovoltaic power prediction data output by the model.

[0132] Model update refers to the process of further optimizing and adjusting the trained power prediction model based on data from the test subset. By continuously adjusting the model's parameters, the model's test information on the test subset meets the threshold requirements of preset indicators, thereby improving the model's prediction accuracy and generalization ability. Furthermore, the test information can include the model's prediction information and the current values ​​of preset indicators obtained through calculation.

[0133] By dividing the test set into multiple test subsets for each weather type, the model evaluation and updates become more targeted, enabling it to better adapt to photovoltaic power prediction under different weather types. This improves the model's prediction accuracy and generalization ability under different weather conditions, helping to more accurately predict distributed photovoltaic power, optimize energy management, and ensure the stable operation of photovoltaic power plants and efficient grid dispatch.

[0134] Figure 2 A flowchart illustrating the distributed photovoltaic power prediction method provided in this application. Figure 2 ,like Figure 1 As shown, in this embodiment... Figure 3 Based on the examples, taking a photovoltaic power plant as an example, the distributed photovoltaic power prediction method is described in detail. The method includes:

[0135] S1. Distributed Photovoltaic Data Set: Obtain NWP data of power plants and the corresponding distributed photovoltaic power output (i.e., photovoltaic power data). The NWP data may include relevant characteristics of photovoltaic power generation such as irradiance, ambient temperature, ambient humidity, and wind speed.

[0136] S2. Data Preprocessing: Preprocess the NWP data and photovoltaic power data obtained in S1, including data normalization, default value filling and outlier cleaning; match the preprocessed NWP data with the photovoltaic power data and divide the training set and test set according to a 7:3 ratio.

[0137] Furthermore, (1) the data is filled with default values ​​based on co-kriging interpolation. This method uses cross-covariance and cross-semivariogram to characterize the correlation and improve the estimation accuracy of the main variables. (2) the filled data is standardized based on the standard score method. This method sets the mean of the feature variables to 0 and the standard deviation to 1. The standardized data is not affected by the units. (3) the feature data after interpolation and standardization are screened. The data screening is based on the 3σ principle to filter out abnormal data distributed outside (μ-3σ, μ+3σ). (4) the processed NWP data and the corresponding photovoltaic power data are divided into training and test sets in a 7:3 ratio.

[0138] S3. Based on the NWP data obtained from S2, weather classification is performed, and the weather events are divided into three types: rain, cloudy, and sunny using a clustering algorithm.

[0139] Furthermore, weather events are categorized based on NWP data.

[0140] Furthermore, a clustering algorithm is used to classify weather based on NWP data. Based on the feature vector formed by the feature values ​​obtained from S2, the FCM method is used to classify the weather according to power fluctuations, categorizing the weather into three types: rainy, cloudy, and sunny. The specific steps are as follows:

[0141] The FCM clustering algorithm is based on the following objective function:

[0142]

[0143] Membership degree and cluster center Calculate using the following formula:

[0144]

[0145] The goal of the FCM clustering algorithm is to minimize the objective function J. m This means that the algorithm will continuously adjust the membership degree. and cluster center This makes each sample point as close as possible to the center of its cluster, thereby reducing the value of the objective function.

[0146] The FCM algorithm needs to iterate until it reaches the optimal value. The termination condition for the iteration is:

[0147]

[0148] Based on the above steps, the weather types are divided into three categories: rainy, cloudy, and sunny.

[0149] S4. Based on the weather classification results of S3, the data under the three weather types are fed into the iTransformer model for training to obtain the prediction models under the three weather types.

[0150] Furthermore, based on the weather classification results of S3, iTransformer power prediction models are constructed for three weather types.

[0151] Furthermore, (1) perform variable embedding, that is, embed each time series variable as a token, that is, the original series of different variables are independently embedded as tokens, to obtain the embedding matrix Z = [Z1, Z2, ..., Z V ], where each element represents an independent token.

[0152] (2) A self-attention mechanism is used to process the embedded variable tokens, enhancing interpretability, revealing the correlations between multiple variables, and layer normalization is applied to reduce the differences between variables. The resulting output matrix after processing by the self-attention mechanism is as follows:

[0153]

[0154] (3) Extract the feature representation of each token through a feedforward network, apply layer normalization to reduce the differences between variables, and finally output the data through a mapping layer.

[0155] S5. Based on the weather classification obtained from S3, match the weather processes for future periods.

[0156] Furthermore, based on the grey relational analysis method, the model is matched against the test set used for training or weather events in future time periods. Specifically, this may include: determining the grey relational coefficient γ[x0(k), x...] i (k)]; Calculate the grey relational degree γ(x0,x i And determine the type of weather process.

[0157] S6. Based on the type matching of future weather data in S5 and the prediction models established in S4 for different weather conditions, short-term distributed photovoltaic power output is predicted. The prediction results are evaluated based on three assessment indicators, and the model is adjusted according to the evaluation results.

[0158] Furthermore, the model's prediction results are evaluated based on RMSE, MSE, and MAE metrics, and threshold values ​​are set to test the model. If the evaluation passes, the model is saved, and the training and prediction results are visualized. If the model fails the test, it indicates a problem in weather matching or model training, requiring a review of previous steps and retraining of the model until it passes the test.

[0159] The distributed photovoltaic (PV) power prediction method provided in this application supplements the default NWP data using co-kriging interpolation; it distinguishes weather types using the FCM clustering algorithm, classifying weather events into three types: rain, cloudy, and sunny; it establishes distributed PV power prediction models for each of the three weather types based on the iTransformer model; it processes weather data using the grey relational analysis method, matching the three already classified weather types and generating weather type sequences; and based on the weather sequences, it feeds the data into the corresponding power prediction models to complete short-term predictions of future distributed PV power. This method combines weather analysis matching strategies with the advanced iTransformer model, effectively addressing the problems of weak learning ability and poor optimization performance in traditional distributed PV prediction models, significantly improving the accuracy and adaptability of distributed PV power prediction.

[0160] Figure 3 This is a schematic diagram of the distributed photovoltaic power prediction device provided in this application, as shown below. Figure 4 As shown, the distributed photovoltaic power prediction device 30 provided in this embodiment includes:

[0161] Module 301 is used to acquire weather forecast data sequences;

[0162] Processing module 302 is used to determine the correlation between the weather forecast data sequence and the comparison data sequence corresponding to the weather type for each of the multiple weather types. The multiple weather types are obtained by clustering historical weather forecast data sequences based on the fuzzy C-means method.

[0163] The determination module 303 is used to determine the target weather type corresponding to the weather forecast data sequence from multiple weather types based on all correlation degrees;

[0164] The prediction module 304 is used to input the weather forecast data sequence into the power prediction model corresponding to the target weather type to obtain distributed photovoltaic power prediction data. The power prediction model is pre-trained based on the iTransformer model.

[0165] In one possible implementation, the processing module 302 can also be used to: determine the comparison data sequences corresponding to multiple weather types; for each weather type, compare the weather forecast data sequence with the comparison data sequence corresponding to the weather type point by point to determine the correlation coefficient of the data corresponding to each time point; and perform a weighted average of the correlation coefficients of the data corresponding to all time points to obtain the correlation degree between the weather forecast data sequence and the comparison data sequence corresponding to the weather type.

[0166] In one possible implementation, the acquisition module 301 can also be used to: acquire an initial weather forecast data sequence; fill the initial weather forecast data sequence with default values ​​based on co-kriging interpolation to obtain a first preprocessed data sequence; perform standardization processing on the first preprocessed data sequence to obtain a second preprocessed data sequence; and perform abnormal data cleaning on the second preprocessed data sequence to obtain a weather forecast data sequence.

[0167] In one possible implementation, the processing module 302 can further be used to: acquire historical weather forecast data sequences, which include a set of weather forecast data acquired within a preset historical time period; partition the historical weather forecast data sequences to obtain multiple samples; update each initial cluster center of the clustering based on the initial membership matrix and the multiple samples to obtain target cluster centers, wherein the initial membership matrix includes multiple membership degrees, and each membership degree represents the degree of association between a sample and a cluster center; update the initial membership matrix based on the target cluster centers and the multiple samples to obtain target cluster centers. Membership matrix; using the target membership matrix as the initial membership matrix and the target cluster center as the initial cluster center, the step of updating each initial cluster center of the cluster based on the initial membership matrix and multiple samples is repeated until the membership error between the target membership matrix and the initial membership matrix is ​​less than a preset error threshold, resulting in updated target cluster centers and target membership matrix; based on the characteristics of the updated target cluster centers, multiple weather types are determined; based on the updated target membership matrix, multiple samples are assigned to the corresponding weather types to obtain the comparison data sequence corresponding to each weather type.

[0168] In one possible implementation, the processing module 302 can further be used to: determine the target function value for the current update based on the target cluster center, the target membership matrix, and the plurality of samples; obtain a first error matrix based on the target membership matrix and the initial membership matrix, the first error matrix including a plurality of membership error values; obtain a second error value based on the target function value and the historical target function value, the historical target function value being the target function value of an update prior to the current update; determine whether the first error matrix and the second error value satisfy a preset error condition; and determine whether the first error matrix and / or the second error value satisfy a preset error condition. If the preset error condition is not met, the target membership matrix is ​​used as the initial membership matrix, and the target cluster center is used as the initial cluster center. The step of updating each initial cluster center of the clustering based on the initial membership matrix and the multiple samples is repeated until the first error matrix and the second error value satisfy the preset error condition, resulting in an updated target cluster center and target membership matrix. Based on the characteristics of the updated target cluster centers, multiple weather types are determined. Based on the updated target membership matrix, the multiple samples are assigned to the corresponding weather types to obtain a comparison data sequence corresponding to each weather type.

[0169] In one possible implementation, the processing module 302 can also be used to: acquire a historical dataset, which includes multiple historical weather forecast data sequences and the distributed photovoltaic power corresponding to each historical weather forecast data sequence; perform data preprocessing on the historical dataset to obtain a target dataset, the data preprocessing including default value filling, standardization, and outlier cleaning; divide the dataset into a training set and a test set; cluster the historical weather forecast data sequences in the training set based on the fuzzy C-means method to obtain multiple weather types and a training subset corresponding to each weather type; and for each weather type, train the initial power prediction model based on the training subset corresponding to the weather type until the output information of the initial power prediction model meets the preset training requirements, thereby obtaining a power prediction model corresponding to the weather type.

[0170] In one possible implementation, the processing module 302 can also be used to: determine the correlation between the historical weather forecast data sequence in the test set and the comparative data sequence corresponding to the weather type for each weather type; divide the test set into multiple test subsets according to all correlations, wherein each test subset corresponds to a weather type; and update the power prediction model for each weather type based on the test subset corresponding to the weather type until the test information of the power prediction model meets the preset index threshold requirements, thereby obtaining the updated power prediction model, wherein the preset index includes mean square error and root mean square error.

[0171] The distributed photovoltaic power prediction device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0172] Figure 4 A schematic diagram of the structure of the electronic device provided in this application. ​ As shown, the electronic device 40 provided in this embodiment includes at least one processor 401 and a memory 402. Optionally, the device 40 further includes a communication component 403. The processor 401, memory 402, and communication component 403 are connected via a bus 404.

[0173] In a specific implementation, at least one processor 401 executes computer execution instructions stored in memory 402, causing at least one processor 401 to perform the above-described method.

[0174] The specific implementation process of processor 401 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0175] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0176] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0177] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0178] This application also provides a photovoltaic electric field, including a photovoltaic array and a power prediction device, wherein the photovoltaic array is used to convert solar energy into electrical energy, and the power prediction device includes electronic equipment 40.

[0179] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0180] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0181] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0182] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0183] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0184] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0185] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0186] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0187] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0188] It should be understood that the terms “comprising” and “having”, and any variations thereof, in the specification, claims and drawings of this application are intended to cover but not exclude inclusion. For example, a product or device that includes a series of components is not necessarily limited to those components that are explicitly listed, but may include other components that are not explicitly listed or that are inherent to such product or device.

[0189] As used in this application, the term "module" means any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code capable of performing the functions associated with that element.

[0190] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for predicting distributed photovoltaic power, characterized in that, include: Obtain weather forecast data sequences; For each of the multiple weather types, the correlation between the weather forecast data sequence and the comparison data sequence corresponding to the weather type is determined. The multiple weather types are obtained by clustering historical weather forecast data sequences based on the fuzzy C-means method. Based on all correlations, determine the target weather type corresponding to the weather forecast data sequence from the plurality of weather types; The weather forecast data sequence is input into the power prediction model corresponding to the target weather type to obtain distributed photovoltaic power prediction data. The power prediction model is pre-trained based on the iTransformer model.

2. The method according to claim 1, characterized in that, For each of the multiple weather types, determining the correlation between the weather forecast data sequence and the corresponding comparison data sequence for that weather type includes: Determine comparative data sequences corresponding to multiple weather types; For each weather type, the weather forecast data sequence is compared point by point with the comparison data sequence corresponding to the weather type to determine the correlation coefficient of the data at each time point; The correlation coefficients of all time point data are weighted and averaged to obtain the correlation degree between the weather forecast data sequence and the comparative data sequence corresponding to the weather type.

3. The method according to claim 1, characterized in that, The acquisition of the weather forecast data sequence includes: Obtain the initial weather forecast data sequence; Based on the co-kriging interpolation method, the initial weather forecast data sequence is filled with default values ​​to obtain the first preprocessed data sequence. The first preprocessed data sequence is standardized to obtain the second preprocessed data sequence. The second preprocessed data sequence is cleaned of abnormal data to obtain the weather forecast data sequence.

4. The method according to claim 1, characterized in that, The power prediction model includes an embedding layer, a self-attention mechanism layer, a feedforward layer, and a mapping layer; wherein: The embedding layer is used to receive weather forecast data sequences and map each variable in the weather forecast data sequences to an embedding space to obtain an embedding data matrix; The self-attention mechanism layer is used to perform self-attention processing on each variable in the embedded data matrix to obtain the target data matrix. The feedforward layer is used to extract features from each variable in the target data matrix to obtain an enhanced feature matrix. The mapping layer is used to map the enhanced feature matrix into distributed photovoltaic power prediction data.

5. The method according to any one of claims 1-4, characterized in that, The method further includes: Obtain historical weather forecast data sequences, which include a set of weather forecast data obtained within a preset historical time period; The historical weather forecast data sequence is divided into multiple samples; Based on the initial membership matrix and the multiple samples, each initial cluster center of the clustering is updated to obtain the target cluster center. The initial membership matrix includes multiple membership degrees, and each membership degree represents the degree of association between a sample and a cluster center. Based on the target cluster center and the multiple samples, the initial membership matrix is ​​updated to obtain the target membership matrix; Using the target membership matrix as the initial membership matrix and the target cluster center as the initial cluster center, the step of updating each initial cluster center of the cluster based on the initial membership matrix and the multiple samples is repeated until the membership error between the target membership matrix and the initial membership matrix is ​​less than a preset error threshold, thus obtaining the updated target cluster center and target membership matrix. Based on the characteristics of the updated target cluster center, multiple weather types are determined; Based on the updated target membership matrix, the multiple samples are assigned to the corresponding weather types to obtain the comparison data sequence corresponding to each weather type.

6. The method according to claim 5, characterized in that, After updating the initial membership matrix based on the target cluster center and the plurality of samples to obtain the target membership matrix, the method further includes: The target function value for this update is determined based on the target cluster center, the target membership matrix, and the multiple samples. Based on the target membership matrix and the initial membership matrix, a first error matrix is ​​obtained, which includes multiple membership error values. The second error value is obtained based on the objective function value and the historical objective function value, wherein the historical objective function value is the objective function value of the previous update; Determine whether the first error matrix and the second error value satisfy the preset error conditions respectively; When the first error matrix and / or the second error value do not meet the preset error condition, the target membership matrix is ​​used as the initial membership matrix, the target cluster center is used as the initial cluster center, and the step of updating each initial cluster center of the cluster according to the initial membership matrix and the multiple samples to obtain the target cluster center is re-executed until the first error matrix and the second error value meet the preset error condition, and the updated target cluster center and target membership matrix are obtained. Based on the characteristics of the updated target cluster center, multiple weather types are determined; Based on the updated target membership matrix, the multiple samples are assigned to the corresponding weather types to obtain the comparison data sequence corresponding to each weather type.

7. The method according to any one of claims 1-4, characterized in that, Before inputting the weather forecast data sequence into the power prediction model corresponding to the target weather type to obtain distributed photovoltaic power prediction data, the method further includes: Obtain historical datasets, which include multiple historical weather forecast data sequences and the distributed photovoltaic power corresponding to each historical weather forecast data sequence; The historical dataset is preprocessed to obtain the target dataset. The data preprocessing includes default value filling, standardization, and outlier cleaning. The dataset is divided into a training set and a test set; Based on the fuzzy C-means method, the historical weather forecast data sequences in the training set are clustered to obtain multiple weather types and training subsets corresponding to each weather type; For each weather type, an initial power prediction model is trained based on the training subset corresponding to the weather type until the output information of the initial power prediction model meets the preset training requirements, thereby obtaining a power prediction model corresponding to the weather type.

8. The method according to claim 7, characterized in that, After training an initial power prediction model for each weather type based on a training subset corresponding to that weather type until the output information of the initial power prediction model meets preset training requirements, thus obtaining a power prediction model corresponding to that weather type, the method further includes: For each weather type, determine the correlation between the historical weather forecast data sequence in the test set and the comparative data sequence corresponding to that weather type; Based on all the correlations, the test set is divided into multiple test subsets, where each test subset corresponds to a weather type; For each weather type, the power prediction model is updated based on the test subset corresponding to the weather type until the test information of the power prediction model meets the threshold requirements of the preset indicators, and the updated power prediction model is obtained. The preset indicators include mean square error, root mean square error and mean absolute error.

9. A distributed photovoltaic power prediction device, characterized in that, include: The acquisition module is used to acquire weather forecast data sequences; The processing module is used to determine the correlation between the weather forecast data sequence and the comparison data sequence corresponding to the weather type for each of the multiple weather types, wherein the multiple weather types are obtained by clustering historical weather forecast data sequences based on the fuzzy C-means method; The determination module is used to determine the target weather type corresponding to the weather forecast data sequence from the plurality of weather types based on all correlation degrees; The prediction module is used to input the weather forecast data sequence into the power prediction model corresponding to the target weather type to obtain distributed photovoltaic power prediction data. The power prediction model is pre-trained based on the iTransformer model.

10. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-8.

Citation Information

Cited By

  • Photovoltaic power uncertainty prediction method and system

    CN121688870A