A multivariate photovoltaic power prediction method and device based on dual clustering
By combining dual clustering and joint loss function, the problems of sample time misalignment and regression distribution imbalance in multivariate photovoltaic power prediction are solved, achieving higher accuracy and more stable photovoltaic power prediction.
Patent Information
- Application Number
- CN202611359130.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-03
- Publication Date
- 2026-11-17
AI Technical Summary
Existing multivariate photovoltaic power prediction methods suffer from problems such as sample time misalignment and regression distribution imbalance, leading to inaccurate and unstable prediction results.
A dual clustering strategy is adopted to decompose historical meteorological factors and future photovoltaic power data into independent component sets for clustering. Data is aligned by time delay vectors, and a joint loss function is constructed to identify outliers and weight the training model.
It effectively solves the problems of sample time misalignment and regression distribution imbalance, and improves the accuracy and reliability of photovoltaic power prediction, especially the accuracy under extreme power output scenarios.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to the field of renewable energy power generation prediction technology, and more specifically, to a multivariate photovoltaic power prediction method and apparatus based on dual clustering. Background Technology
[0002] Against the backdrop of the global transition to low-carbon energy systems, the penetration rate of photovoltaic (PV) power generation in modern power grids is continuously increasing. However, the inherent intermittency and volatility of PV output pose significant challenges to grid stability, economic dispatch, and energy management. Reliable short-term PV power forecasting (ST-PVPF) is a key strategy for mitigating these issues, enabling power system dispatchers to optimize renewable energy dispatch and reduce imbalance costs.
[0003] Currently, data-driven (such as deep learning) multivariate photovoltaic power prediction methods have become mainstream. However, in practical applications, existing data-driven models generally face two major technical bottlenecks that severely restrict their predictive performance. The first is the problem of sample time misalignment. Due to the varying response delays of different types of meteorological sensors and the inherent asynchronicity of photovoltaic modules' physical responses to different meteorological factors, there is a subtle time misalignment between the collected historical meteorological factor sequences and the future photovoltaic power sequences. This temporal inconsistency disrupts the inherent causal relationship of the data, leading to inaccurate and unstable photovoltaic power prediction results.
[0004] Secondly, there is the problem of imbalanced regression distribution. The actual measured values of photovoltaic power are distributed extremely unevenly across different power ranges, typically exhibiting dense sample data in the low-power range and very sparse sample data in the high-power (peak power generation) range. This causes machine learning models to easily underfit in the sparse high-power range, resulting in extremely poor prediction ability for peak power. Traditional solutions, such as simply increasing the training weights of samples in the sparse range, often amplify the impact of outliers in that range, leading to model misguidance, overfitting, and failing to truly solve the problem.
[0005] In summary, there is an urgent need for a comprehensive photovoltaic power prediction mechanism that can simultaneously and effectively solve the problem of temporal misalignment of multidimensional meteorological characteristics and suppress outlier interference caused by unbalanced data distribution. Summary of the Invention
[0006] The purpose of this application is to provide a multivariate photovoltaic power prediction method, device, and computer-readable storage medium based on dual clustering, so as to solve the problem of inaccurate photovoltaic power prediction results caused by sample time misalignment and unbalanced regression distribution in the prior art.
[0007] To achieve the above objectives, this application provides the following solution: To achieve the above objectives, this invention provides a multivariate photovoltaic power prediction method based on dual clustering, comprising: acquiring historical photovoltaic power data and multidimensional meteorological factor data; splitting the data along the feature dimension into a historical meteorological factor component set and a future photovoltaic power component set; clustering the two component sets respectively to generate a first similarity matrix and a second similarity matrix; determining the optimal time delay vector for aligning the historical meteorological factor data by searching a time delay vector to minimize a preset difference metric between the first similarity matrix and the second similarity matrix, thereby obtaining a time-aligned sample set; dividing the samples into a normal value set and an outlier set based on the inconsistency between the first similarity matrix and the second similarity matrix; constructing a joint loss function, wherein for samples in the outlier set, a penalty term is added to the basic loss, and the penalty value of the penalty term increases as the residual between the model predicted value and the sample true value decreases; training a machine learning prediction model using the time-aligned sample set and the joint loss function, and using the optimal time delay vector to align real-time meteorological data for online prediction.
[0008] Furthermore, the time delay vector is a multi-dimensional time delay vector, with the same dimension as the multi-dimensional meteorological factors, and each component of the multi-dimensional time delay vector corresponds to a time offset of a meteorological factor sequence. By applying different time offsets to different meteorological factors, the asynchronicity between various types of data can be corrected more precisely.
[0009] Optionally, the clustering employs a clustering algorithm based on time series similarity. This type of algorithm can effectively capture the similarity of time series data in terms of shape and trend, thereby providing a reliable basis for constructing a similarity matrix that represents the topological relationship of samples.
[0010] In one implementation, both the first similarity matrix and the second similarity matrix are binary matrices, wherein if any two samples belong to the same cluster, the corresponding element in the matrix is 1, and otherwise it is 0. This approach simplifies the construction of the similarity matrix, making subsequent difference measurement calculations more efficient.
[0011] Preferably, the preset difference metric is the Frobenius norm of the difference between the first similarity matrix and the second similarity matrix. The Frobenius norm can measure the degree of difference between the two matrices as a whole. The smaller the value, the more consistent the structure of the two matrices, that is, the stronger the correspondence between "similar inputs" and "similar outputs".
[0012] Furthermore, the search process for determining the optimal time delay vector employs a dimension-by-dimensional search approach. Compared to exhaustive searching across the entire multidimensional space, dimension-by-dimensional search significantly reduces computational complexity, finding an approximate optimal solution within an acceptable timeframe. Specifically, the dimension-by-dimensional search approach includes: pre-defining a search range centered at zero with preset upper and lower limits for each component of the time delay vector. This limits the search space, avoids meaningless searches, and improves optimization efficiency.
[0013] In one implementation, the step of dividing samples into a normal value set and an outlier set includes: calculating an absolute difference matrix based on the first similarity matrix and the second similarity matrix; defining the sum of the elements in the corresponding column of each sample in the absolute difference matrix as the inconsistency index of that sample; and identifying samples whose inconsistency index meets a preset condition as outliers. This inconsistency index quantifies the degree to which each sample violates the fundamental principle of "similar inputs produce similar outputs." Further, the preset condition is that the inconsistency index is higher than the average inconsistency index of all samples. This is a simple and effective data-driven threshold determination method that can adaptively divide samples into normal and outlier categories.
[0014] Optionally, the base loss of the joint loss function is the Log-Cosh loss function. This loss function approximates the mean squared error when the residuals are small, which is beneficial for the model to converge quickly; when the residuals are large, it approximates the mean absolute error, which can reduce the sensitivity to extreme outliers. Furthermore, the penalty term is constructed based on a Gaussian function, and the maximum penalty value is obtained when the residuals are zero. This unique penalty mechanism can apply a large penalty gradient when the model attempts to forcibly fit outliers, thereby effectively preventing the model from overfitting to outliers in the sparse interval.
[0015] Furthermore, the method includes: before training the machine learning prediction model, dividing the power value range into multiple intervals, and calculating the base interval weights based on the sample frequency of each interval to weight the joint loss function, so that intervals with lower frequencies receive higher weights. This aims to increase the model's attention to high-power intervals with sparse samples.
[0016] Optionally, the machine learning prediction model is a deep learning prediction model, such as a neural network architecture with advantages in long-term time series modeling.
[0017] The present invention also provides an apparatus for training a photovoltaic power prediction model, comprising: a data processing unit for acquiring historical photovoltaic power data and multidimensional meteorological factor data, performing dual clustering on the data to generate first and second similarity matrices, and determining an optimal time delay vector for aligning the historical meteorological data by minimizing the difference between the matrices; an anomaly detection unit for dividing samples into a normal value set and an outlier set based on the inconsistency of the first and second similarity matrices; and a model training unit for constructing a joint loss function and training a machine learning prediction model using the data aligned by the data processing unit and the sample set divided by the anomaly detection unit, wherein the joint loss function adds a penalty term to the samples in the outlier set, and the penalty value of the penalty term increases as the prediction residual decreases.
[0018] The present invention also provides a photovoltaic power prediction device, comprising: an online prediction module, used to align real-time collected meteorological data using a pre-calculated optimal time delay vector, and then input the aligned real-time data into a trained machine learning prediction model to output a short-term photovoltaic power prediction result; wherein, the optimal time delay vector and the trained machine learning prediction model are determined and trained according to the aforementioned method.
[0019] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any of the preceding claims.
[0020] Compared with existing technologies, this invention has the following beneficial effects: 1. By introducing a dual clustering strategy, the abstract problem of "temporal matching degree" is transformed into a computable optimization problem of "cluster structure consistency". Without complex brute-force exhaustive search, the optimal time delay vector of each meteorological factor can be estimated efficiently and accurately, eliminating temporal misalignment interference from the data source and laying the foundation for obtaining accurate photovoltaic power prediction results. 2. By calculating the inconsistency degree of the dual clustering results, an outlier accurate identification method that does not rely on prior data distribution assumptions is realized. This method can effectively screen out samples that violate the physical law of "similar inputs produce similar outputs", providing a basis for subsequent differential processing. 3. An innovative joint loss function combining Log-Cosh basic loss and a specific penalty term is constructed. This loss function not only improves the model's attention to the sparse high-power interval through interval weighting, but also prevents catastrophic overfitting of the model to outliers in the sparse interval from the underlying mechanism of backpropagation through a unique penalty term design, significantly improving the stability and robustness of peak power interval prediction. 4. This invention integrates sample alignment, outlier detection, and weighted training into a complete technical framework, which collaboratively solves two major industry problems: sample time misalignment and regression distribution imbalance. It comprehensively improves the overall accuracy and reliability of multivariate short-term photovoltaic power prediction, especially in extreme power output scenarios that are of most concern to grid dispatch, and obtains more accurate and reliable prediction results. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic flowchart of a photovoltaic power prediction method provided in an embodiment of the present invention.
[0023] Figure 2 This is a logical diagram illustrating the dual clustering and similarity matrix construction in an embodiment of the present invention.
[0024] Figure 3 This is a visual illustration of the impact of the time delay vector on the prediction error in an embodiment of the present invention.
[0025] Figure 4 This is a schematic diagram illustrating the regression distribution imbalance phenomenon in an embodiment of the present invention and the error comparison after correction using the method of the present invention. Detailed Implementation
[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0027] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0028] In the current field of data-driven photovoltaic power prediction, two major technical challenges exist: sample time misalignment and unbalanced regression distribution. The former stems from the inherent asynchronous dynamic response between meteorological factors and photovoltaic power, as well as sensor measurement delays, which disrupt the temporal consistency of the data. The latter arises from the extremely uneven distribution of photovoltaic power data across different power ranges, leading to poor accuracy in power prediction results for high-power, sparsely distributed ranges. This invention aims to provide a comprehensive technical solution that can simultaneously address both of these problems.
[0029] The core idea of this invention lies in transforming the previously invisible abstract concepts of "temporal matching degree" and "sample consistency" into mathematical indicators that can be precisely calculated and optimized through an innovative dual clustering strategy. Specifically, this invention introduces a series of key technical concepts. The first is "dual clustering," which splits a sample set containing multidimensional meteorological factors and future photovoltaic power along its characteristic dimensions into an input component set containing only historical meteorological factors and an output component set containing only future photovoltaic power, and then performs independent clustering operations on these two component sets. This design forms the basis for all subsequent analyses.
[0030] Based on the results of dual clustering, this invention constructs two core data structures: a first similarity matrix and a second similarity matrix. The first similarity matrix is generated after clustering the historical meteorological factor component set and is used to characterize the topological relationships between samples in the input feature space. Correspondingly, the second similarity matrix is generated after clustering the future photovoltaic power component set and is used to characterize the topological relationships between samples in the output target space. These two matrices together form the cornerstone for measuring the fundamental principle of "whether similar inputs produce similar outputs".
[0031] To address the issue of sample time misalignment, this invention introduces the concept of a time delay vector. This time delay vector is a multi-dimensional vector whose dimensions match those of the meteorological factors, used to parameterize the alignment deviation between the meteorological factor sequences and the photovoltaic power sequences. Each component of the vector corresponds to a specific time offset required for a particular meteorological factor. By systematically adjusting this vector, data misalignment caused by sensor delays or physical response lags can be corrected. To determine the optimal time delay vector, this invention defines a preset difference metric to measure the difference between a first similarity matrix and a second similarity matrix. When the two matrices are highly consistent, it means that similar input patterns indeed correspond to similar output patterns, and the sample sets are considered well aligned. Therefore, by searching for the time delay vector that minimizes this preset difference metric, the optimal data alignment can be found.
[0032] After addressing the time alignment issue, this invention further utilizes the results of dual clustering to handle the imbalanced regression distribution problem. By comparing the differences between the first and second similarity matrices, the degree to which each sample deviates from the rule of "similar inputs produce similar outputs" can be quantified, i.e., the "inconsistency" of the samples. Based on this inconsistency, the samples can be divided into a set of normal values that conform to the rule and a set of outliers that severely deviate from the rule. This division method does not rely on any prior assumptions about the data distribution and can accurately identify those outlier samples that may mislead model training.
[0033] For identified outlier sets, especially in sparse high-power regions, simply increasing sample weights can amplify the impact of outliers, leading to model overfitting. To address this, this invention constructs a special joint loss function. This function, in addition to the basic loss, adds a penalty term specifically for samples within the outlier set. This penalty term is cleverly designed; its value increases as the residual between the model's predicted value and the true sample value decreases. This counterintuitive design effectively prevents the model from forcibly fitting outliers, thus ensuring the generalization ability and stability of power prediction in sparse regions.
[0034] The following will describe in detail, with reference to the accompanying drawings, a multivariate photovoltaic power prediction method based on dual clustering provided by the present invention. (Refer to...) Figure 1 The overall process of this method includes steps S1 to S5, and aims to systematically solve the core challenges in photovoltaic forecasting.
[0035] In one specific implementation, the method first performs the steps of acquiring historical photovoltaic power data and multidimensional meteorological factor data. This data, which forms the basis for model training, typically originates from the monitoring and data acquisition system of the photovoltaic power plant. After acquiring the data, a crucial step is to split the data along the feature dimensions into a historical meteorological factor component set and a future photovoltaic power component set. (Refer to...) Figure 2 This decomposition operation embodies the concept of "duality," breaking down a complete prediction problem into independent analyses of the input and output spaces. Subsequently, clustering is performed on these two component sets to generate a first similarity matrix and a second similarity matrix. These two matrices capture the intrinsic structure of the samples at the input and output ends, respectively.
[0036] Next, the method enters the sample alignment stage. The core task of this stage is to determine the optimal time delay vector for aligning historical meteorological factor data by searching for a time delay vector that minimizes a preset difference metric between the first and second similarity matrices. Essentially, this process seeks an optimal time shift scheme that best matches the similarity structure of the input and output data. Once the optimal time delay vector is determined, it can be used to shift and correct the original historical meteorological data, obtaining a time-aligned sample set, thus fundamentally eliminating noise introduced by the asynchronous nature of data acquisition.
[0037] After obtaining aligned samples, the method then addresses the issue of sample inconsistency. Based on the inconsistency between the first and second similarity matrices, the samples are divided into a set of normal values and a set of outliers. A sample with similar input features to other samples but drastically different outputs (or vice versa) has a high degree of inconsistency and is likely an outlier. In this way, the present invention can accurately identify data points that do not conform to general physical laws.
[0038] The method then moves to the core of model training. This stage constructs a joint loss function that, for samples within the outlier set, adds a penalty term to the base loss. The penalty term increases as the residual between the model's predicted value and the true sample value decreases. This unique penalty mechanism ensures that the model is not "biased" by outliers in sparse intervals during the learning process, because it makes forcibly fitting an outlier (i.e., reducing the residual to zero) extremely costly.
[0039] Finally, a machine learning prediction model is trained using a time-aligned sample set and a joint loss function. Once trained, the model can be used for online prediction. In practical applications, real-time meteorological data is aligned using the previously calculated optimal time delay vector and then input into the trained model to output high-precision short-term photovoltaic power prediction results.
[0040] Building upon the aforementioned scheme, to more accurately model the complex temporal relationship between multidimensional meteorological factors and photovoltaic power, a multidimensional time delay vector is preferred. This multidimensional time delay vector has the same dimension as the multidimensional meteorological factors; for example, if there are five meteorological factors, the vector will also be five-dimensional. Furthermore, each component of the multidimensional time delay vector corresponds to a time offset of a meteorological factor sequence. This design allows for finding an independent and optimal response delay time for each meteorological factor (such as radiation, temperature, wind speed, etc.), thereby significantly improving the physical realism and accuracy of data alignment.
[0041] Furthermore, to effectively handle time series data with complex dynamic characteristics, clustering algorithms based on time series similarity are preferred. For example, Dynamic Time Warping (DTW) distance can be used as a similarity measure, or clustering algorithms specifically designed for time series, such as Torque, can be employed. These algorithms are better able to capture the morphological similarity of sequences rather than simple numerical similarity, making the clustering results more reflective of the dynamic patterns behind the data, thus ensuring the generation of high-quality first and second similarity matrices.
[0042] As a specific implementation, both the first and second similarity matrices are binary matrices. Their construction rule is as follows: if any two samples belong to the same cluster, the element at the intersection of these two samples in the matrix is assigned a value of 1; conversely, if they belong to different clusters, the corresponding element is assigned a value of 0. This binary representation is concise and computationally efficient, clearly expressing the cluster relationship between samples, and facilitating subsequent calculations of matrix differences and sample inconsistency.
[0043] To quantify the degree of consistency between the first and second similarity matrices, the preferred difference metric is the Frobenius norm, which measures the difference between the two matrices. The Frobenius norm is the square root of the sum of the squares of all elements in the matrix, and it comprehensively measures the difference between the two matrices. A smaller norm value indicates a more similar structure between the two matrices, meaning the clustering structures of the input and output spaces are more consistent. Therefore, by minimizing this norm, the time delay vector that best aligns the data can be effectively found.
[0044] In the search for the optimal time delay vector, considering the potentially enormous multidimensional search space, a brute-force exhaustive search would be computationally extremely costly. Therefore, as an efficient optimization strategy, a dimensional search approach is preferred for determining the optimal time delay vector. Specifically, this method fixes other dimensions and searches only the delay component of one meteorological factor at a time. After finding the optimal value for that dimension, the search proceeds to the next dimension, and so on until convergence. This approach decomposes a high-dimensional joint optimization problem into a series of low-dimensional subproblems, significantly reducing computational complexity and making the solution for the optimal time delay vector fast and feasible.
[0045] To further standardize the dimensional search process, the dimensional search method can specifically include: pre-defining a search range centered at zero with preset upper and lower limits for each component of the time delay vector. For example, the search range can be set to [-10, 10] time steps. This range can be set based on prior knowledge, such as the maximum possible delay of the sensor. Centering at zero indicates that both delay and lead are considered. Searching within this preset range can avoid unbounded searches and ensure that the found delay value is physically reasonable.
[0046] The step of dividing samples into normal and outlier sets can be implemented as follows: First, based on the first and second similarity matrices, an absolute difference matrix is calculated. Each element (0 or 1) of this difference matrix directly reflects whether the corresponding pair of samples are consistent in their clustering relationship in the input and output spaces. Then, the sum of all elements in the corresponding column of the absolute difference matrix for each sample is defined as the inconsistency index of that sample. The higher the index, the more frequently the inconsistency in the relationship between that sample and other samples is manifested in the input and output spaces, and the more "abnormal" its behavior.
[0047] After calculating the inconsistency index for each sample, a clear rule is needed to determine which samples belong to the outlier set. As a simple and effective method, a preset condition can be set as follows: the inconsistency index must be higher than the average inconsistency index of all samples. That is, calculate the arithmetic mean of the inconsistency indices of all samples and use this average as a threshold. Any sample whose inconsistency index exceeds this threshold is identified and classified into the outlier set, while the rest are classified into the normal value set. This adaptive thresholding method avoids the difficulty of manually setting thresholds, automating the outlier detection process.
[0048] The design of the joint loss function, particularly its base loss component, significantly impacts the model's convergence speed and robustness. In a preferred embodiment of this invention, the base loss of the joint loss function is the Log-Cosh loss function. When the residuals are small, the Log-Cosh loss function approximates the mean squared error, contributing to rapid model convergence; while when the residuals are large, it approximates the mean absolute error, exhibiting lower sensitivity to outliers. This characteristic makes it a base loss choice that achieves a good balance between stability and robustness.
[0049] The penalty term for outliers in the joint loss function is one of the key innovations of this invention. To achieve the goal of "preventing the model from overfitting to outliers," the penalty term is preferably constructed based on a Gaussian function, and its key characteristic is that it achieves the maximum penalty value when the residual is zero. A typical form could be... , where β is the penalty coefficient. When the model attempts to approximate the prediction residual of an outlier to zero, this penalty term reaches its peak β, resulting in a large penalty gradient during backpropagation, forcing the model to abandon fitting the outlier. This design acts like a "circuit breaker," effectively preventing the model from being misled by noisy data in sparse regions.
[0050] To address the imbalanced regression distribution problem, specifically the insufficient model learning caused by sparse samples in the high-power interval, the method of this invention preferably includes a preprocessing step: before training the machine learning prediction model, the power range is divided into multiple intervals, and a base interval weight is calculated based on the sample frequency of each interval to weight the joint loss function, thus giving higher weights to intervals with lower frequencies. For example, the power range of 0-6kW can be divided into several bins, the number of samples in each bin can be counted, and the repetition weight can be set to the reciprocal of the frequency or a variation thereof. In this way, samples falling into the sparse high-power interval, even if they are normal values, can receive higher attention in the loss calculation, thereby guiding the model to learn these important but scarce samples more fully.
[0051] Considering that photovoltaic power prediction involves complex time-series pattern recognition, deep learning prediction models are preferred for machine learning prediction. For example, recurrent neural networks (RNNs), long short-term memory networks (LSTMs), gated recurrent units (GRUs), or more advanced attention-based models such as Transformer, Pyraformer, and MICN can be used. These deep learning models possess strong nonlinear fitting capabilities and long-range time-dependent modeling capabilities, and can fully utilize the high-quality data processed by the method of this invention, thereby achieving high-precision photovoltaic power prediction.
[0052] To illustrate the embodiments of the present invention more specifically, a general example is provided below. First, a data processing unit acquires historical operating data of a photovoltaic power plant, including a multidimensional meteorological factor sequence and a corresponding photovoltaic power sequence. The data processing unit splits the data samples within each time window into a historical meteorological factor component set and a future photovoltaic power component set, and performs clustering operations on these two component sets respectively, thereby generating a first similarity matrix and a second similarity matrix.
[0053] Next, the data processing unit searches for a multi-dimensional time delay vector through an optimization process. The goal of this search is to minimize a pre-defined difference metric between the first and second similarity matrices. After the search is complete, an optimal time delay vector is obtained. The data processing unit uses this vector to shift the original historical meteorological data, generating a time-accurately aligned training sample set.
[0054] Then, an anomaly detection unit comes into play. This unit compares the first and second similarity matrices, calculates the degree of inconsistency for each sample, and classifies all samples into a set of normal values and a set of outliers based on this. Simultaneously, this unit may also calculate a basic weight for each sample based on the distribution frequency of the power values.
[0055] Finally, a model training unit uses the aligned sample set and sample classification results to train a machine learning prediction model. This unit employs a special joint loss function. For samples in the normal value set, it calculates a basic loss; for samples in the outlier set, it adds an additional penalty term on top of the basic loss. This penalty term is maximized when the model prediction is very close to the true value. After training, the resulting model and the optimal time delay vector are fixed for online prediction. During online prediction, an online prediction module receives real-time meteorological data, aligns it using the optimal time delay vector, inputs it into the model, and obtains the prediction result.
[0056] To more comprehensively demonstrate the technical details and superior effects of this invention, a complete implementation of the above method will be described in detail below with reference to a specific application scenario. This embodiment takes an actual photovoltaic (PV) distribution area at a solar energy center in Australia as the research object. The rated PV power generation of this distribution area is 6.0 kW, and the data sampling interval is set to 10 minutes. To construct a multivariate prediction model, meteorological data in five dimensions were collected, including total radiation from the tilted surface, diffuse radiation from the tilted surface, total radiation from the horizontal surface, diffuse radiation from the horizontal surface, and wind speed, while the actual PV active power was recorded. The goal of the prediction task is to predict the PV output sequence for the next 16 hours in advance, corresponding to a prediction step size of 96 time steps.
[0057] Reference Figure 1Step S1 involves acquiring historical photovoltaic (PV) operation data and constructing an initial unaligned sample set containing a time delay vector. In actual PV power plant IoT data acquisition, due to the different response mechanisms of various meteorological sensors (such as anemometers and radiometers) and the inherent asynchronous characteristics of PV modules' dynamic responses to different meteorological physical quantities (such as temperature changes lagging behind wind speed changes), there is often a subtle misalignment between the acquired meteorological data sequence and the PV power data sequence on the time axis. To mathematically model this misalignment, this invention employs a sliding time window technique to extract historical operation data sequences.
[0058] Specifically, assuming that at the i-th sampling time, the original measured future photovoltaic power sequence segment is defined as Meanwhile, the corresponding m-th historical meteorological factor sequence fragment is defined as... ,in This represents the length of the historical observation time window. To address the aforementioned asynchronous issue, this invention innovatively introduces a time delay vector. This is used to parameterize the alignment deviation between each meteorological factor and photovoltaic power. After lag parameter correction, the aligned historical meteorological factor sequence fragment is redefined as: That is, the entire sequence has shifted backward along the time axis. Each step size. Based on this, a training sample containing complete meteorological dimensions can be defined as: ,in This represents the set of all multidimensional meteorological factors corrected for a time delay of d. The task then becomes finding the optimal delay vector to construct a perfectly aligned training sample set.
[0059] Reference Figure 1 Step S2 involves performing sample alignment based on dual clustering (DCA) to solve for the optimal time delay vector. (See reference...) Figure 2 Due to the numerous meteorological dimensions, using the traditional exhaustive search method to find the optimal delay vector within a vast search space would lead to computational disaster. Therefore, this invention proposes a dual clustering strategy, the core assumption of which is to satisfy the fundamental premises of predictive model stability and discriminability: similar historical meteorological inputs should be able to produce similar future photovoltaic power outputs. Based on this criterion, this step first physically splits the overall sample set along the feature dimension into two independent subsets: one is a subset containing only the input features of historical meteorological data. One is a subset containing only the future power of the predicted target, and the other is a subset containing only the future power of the predicted target. Subsequently, a time-series similarity-based clustering algorithm (such as the Torque algorithm) is used to perform independent clustering operations on the two subsets, i.e., dual clustering. After completing the clustering, this invention constructs a similarity matrix representing the topological relationships between samples. and Based on historical meteorological similarity matrix For example, the assignment logic for its matrix elements is as follows: if the historical meteorological characteristics of the i-th sample and the j-th sample are classified into the same cluster, then the matrix elements... Assign a value of 1 otherwise assign a value of 0; Future power similarity matrix The construction logic is exactly the same.
[0060] After constructing the dual similarity matrix, this invention transforms the invisible "temporal matching degree" into a precisely calculable matrix similarity. To search for the optimal delay time dimension-by-dimensionally, the system sets upper and lower limits for the time delay search: Wherein, the unit is the sampling step size. In the optimization process, firstly... Perform a fixed clustering operation to generate a fixed number of clusters. Then, for the m-th meteorological factor, within its delayed search range... Iterate through possible delay steps one by one Reconstructing the historical meteorological subset in each traversal And perform clustering updates Subsequently, the Frobenius norm of the difference between the two matrices is calculated, i.e., the consistency loss is calculated: The smaller the Frobenius norm value, the more consistent the clustering topology of the historical inputs and the future outputs is with the current delay step; that is, the better the samples are physically aligned in time. The system will minimize this norm. Locking in the optimal delay for this meteorological factor In the Site 8 area data analysis of this embodiment, after the above-described dimension-by-dimensional optimization algorithm, the optimal time delay vector was finally calculated quickly and accurately. This physically indicates that the actual impact of the tilted surface total radiation (RGT) lags behind the recording time by 20 minutes (2 steps), while the impact of wind speed (WS) on component heat dissipation and efficiency lags behind by as much as 60 minutes (6 steps). By using this optimal vector to shift and correct all data sequences, an aligned sample set that eliminates time misalignment can be obtained. . Figure 3 The impact of different time delay combinations on prediction error is intuitively shown, with the optimal delay combination corresponding to the bottom of the error surface.
[0061] Reference Figure 1Step S3 addresses the regression distribution imbalance problem to perform inconsistency calculation and sample weighting based on dual clustering. Photovoltaic power data exhibits a severe regression distribution imbalance (RDI), meaning the samples are extremely dense in the low-power range and extremely sparse in the high-power (peak generation) range. This makes the prediction model highly susceptible to underfitting or being misled by outliers in the high-power range. Therefore, this step first performs outlier screening based on the similarity matrix generated in step S2. Specifically, the absolute difference matrix of the dual clusters is calculated: For the i-th sample, the system defines its "inconsistency" as the sum of all elements in the i-th column of the absolute difference matrix. The magnitude of the inconsistency reflects the severity to which the sample violates the rule of "similar inputs correspond to similar outputs". The system calculates the average inconsistency of all samples and isolates samples with inconsistencies significantly greater than this average, classifying them into the "outliers" set. The remaining reliable samples are classified into the "inliers" set.
[0062] After outlier isolation is completed, the system needs to configure adaptive sample weights based on the data distribution. The photovoltaic power amplitude was divided into multiple statistical intervals at equal intervals (e.g., 7 intervals, Bin 1 to Bin 7). Statistical analysis revealed that the data in the 7th interval, representing extremely high power, accounted for only 0.12%, indicating a severe imbalance in distribution. (Refer to...) Figure 4 As shown on the left. Statistical results show that in this embodiment, the data in the 7th interval, representing extremely high power, accounts for only 0.12%. The system uses the formula: Calculate the base interval weights for each sample, where This is a mapping function that is the reciprocal of the frequency in this interval or the reciprocal of the correlation, such that samples falling into extremely sparse intervals (e.g., high-power regions) can obtain a multiplied base weight. However, directly amplifying the weights in the sparse interval can lead to catastrophic overfitting of the model to outliers within that interval. Therefore, this invention abandons the traditional mean squared error (MSE) and innovatively constructs a joint loss function that combines a Log-Cosh structure with a Gaussian penalty term, the mathematical expression of which is: In this formula, This represents the residual between the predicted value output by the prediction model and the actual value. The design of this loss function is extremely ingenious: for samples classified as inliers, the residual is usually small, and the Taylor expansion of the Log-Cosh function approximates the mean squared error (MSE), guiding the model to converge quickly; while for samples classified as outliers, which often contain significant noise, the Log-Cosh function exhibits linear characteristics similar to the mean absolute error (MAE), reducing the model's sensitivity to extreme outliers. More importantly, a Gaussian penalty term is introduced additionally for outliers. Its mechanism of action is as follows: when a deep learning model attempts to forcibly fit outliers within these sparse intervals (i.e., attempts to fit the residuals of outliers) When forcibly approximating to 0, the value of the entire Gaussian penalty term will rise sharply to the peak value β as the exponential term approaches 0, thus generating a huge penalty gradient in backpropagation, completely blocking the "outlier overfitting" path of the prediction model in the high-power sparse region.
[0063] Reference Figure 1 Step S4 involves constructing a joint loss function and training a deep learning prediction model. After configuring the alignment operation and loss function, the system selects a deep learning network architecture with advantages in long-range time series modeling (such as the Pyraformer or MICN neural network used in this embodiment) as the core prediction engine. The aligned sample set obtained in step 2 is then used... The data is input into a deep neural network in batches, and the forward propagation outputs an initial prediction sequence. Subsequently, the system uses the joint loss function `loss` defined and configured with weights in step 3 to calculate the error loss of the current batch, and employs the Adam optimization algorithm for backpropagation to update the network node weights, with an initial learning rate set to 0.01. After multiple rounds of iterative training, the model parameters reach global optimum. Based on backtesting and verification using the actual test set, the model enhanced by the above method (i.e., the model integrating the DCA alignment module and the DCS weighted loss module) showed a significant improvement in prediction performance in Site 8 compared to the unprocessed baseline model: the overall mean absolute error (MAE) decreased by more than 10%. Especially in the 7th interval (i.e., the peak photovoltaic power generation period most concerned by the power grid), where the data distribution is extremely sparse and the prediction is highly unstable, the standard deviation (STD) of the prediction error was significantly compressed from 0.2744 to 0.1746, as shown in the reference... Figure 4 As shown in the comparison on the right, this fully demonstrates that the method of the present invention effectively smooths out the drastic fluctuations in prediction caused by temporal misalignment and distribution imbalance, and greatly improves the robustness of the model in the high-output range.
[0064] Reference Figure 1 Step S5 involves online photovoltaic power prediction and power system auxiliary decision-making applications. After training and validating the model, the prediction model is solidified and deployed in the edge computing nodes of the photovoltaic distribution area or in the centralized microgrid operation and control system. During normal operation, the system receives real-time data from various meteorological sensors. Upon receiving the real-time data stream, the system automatically calls the preset optimal time delay vector. Real-time data streams, such as radiation and wind speed, are buffered and dynamically aligned with time window offsets. The aligned real-time multidimensional feature matrix is then fed into the prediction engine, allowing the model to quickly infer and output a photovoltaic output prediction curve for the next 16 hours (96 time steps). This high-precision prediction curve is transmitted in real-time to the grid-side dispatch center via a communication protocol, directly assisting power system dispatchers in formulating peak-shaving and valley-filling strategies for the coming day, optimizing the reserve capacity arrangement of thermal power units, and guiding the charging and discharging actions of energy storage devices. This effectively reduces the imbalance penalty costs associated with new energy grid integration.
[0065] In summary, this invention systematically solves two major challenges in photovoltaic (PV) power forecasting: sample time misalignment and imbalanced regression distribution. This is achieved through dual clustering, time delay vector search, inconsistency calculation, and an innovative joint loss function, significantly improving the accuracy and robustness of PV power forecasting, particularly in the critical peak output range. The technical concepts of this invention are not only applicable to PV forecasting but also provide valuable reference for other industrial time series forecasting problems with similar challenges.
[0066] In this embodiment, the training process of steps S1 to S4 can be implemented by a device for training a photovoltaic power prediction model. The data processing unit executes steps S1 and S2, the anomaly detection unit executes the sample partitioning and inconsistency calculation in step S3, and the model training unit constructs the joint loss function and executes the training process of step S4. Correspondingly, the online prediction process of step S5 can be implemented by the photovoltaic power prediction device, whose online prediction module is responsible for aligning real-time data and outputting predictions.
[0067] In summary, the specific implementation methods provided in this invention comprehensively construct a full-link photovoltaic power prediction technology architecture, from multi-dimensional heterogeneous meteorological data acquisition and dynamic temporal alignment to anti-distribution imbalance model training, ultimately achieving high-precision online prediction. In the front-end data processing stage, this solution overcomes the technical blind spot of traditional methods that ignore physical sensors and the asynchronous nature of dynamic responses. It cleverly utilizes a sample alignment strategy (DCA) based on dual clustering to transform the abstract temporal matching degree into a mathematically calculable and comparable matrix consistency index. Without brute-force enumeration and massive computational overhead, it quickly and accurately locks the optimal time delay vector for each meteorological dimension, completely eliminating temporal misalignment interference from multi-dimensional spatiotemporal features at the data source. In the core stage of model training and optimization, addressing the industry challenge of inherent regression distribution imbalance (RDI) in photovoltaic power output data, this solution deeply explores the topological differences in dual clustering results. It achieves precise isolation of abnormal data by quantifying sample inconsistency and innovatively integrates a Log-Cosh structure and a Gaussian penalty term to construct a joint loss function (DCS). This innovative mechanism not only adaptively amplifies the model training weights in sparse intervals such as extremely high power, but also, from the underlying logic of backpropagation gradients, acts like a "fuse," completely preventing the deep learning model from catastrophic overfitting to outliers in sparse intervals.
[0068] These two core mechanisms work synergistically, effectively eliminating dual noise interference caused by temporal asynchrony and anomalous distribution, and fully unleashing the true potential of deep feedforward networks and long-range attention mechanisms in extracting spatiotemporal evolution features. This enables the system to exhibit extremely high predictive robustness and accuracy when dealing with complex and variable meteorological conditions, especially during peak photovoltaic output periods of high concern to the grid side. The successful implementation of this invention not only provides a solid quantitative decision-making foundation for high-proportion renewable energy consumption, economic dispatch of energy storage, and stable operation of microgrids under new power systems, but also provides a general and efficient technical paradigm for other industrial time series forecasting scenarios with high uncertainty, uneven distribution, and temporal asynchrony (such as wind power forecasting and load forecasting).
[0069] Finally, it should be noted that the above are merely preferred embodiments of the present invention combined with data from specific photovoltaic areas (such as the Site 8 area of the Australian Desert Knowledge Solar Centre), and are not intended to limit the physical scope of the present invention. In actual industrial applications, any parameter adjustments, equivalent substitutions of network architecture, or adaptive improvements to technical steps made within the core spirit and technical principles of the present invention for different geographical locations, different installed capacities, and different meteorological sensor configurations should be considered as not departing from the technical concept of the present invention and included within the patent protection scope of the present invention.
[0070] To implement the above method, the present invention also provides an apparatus for training a photovoltaic power prediction model. This apparatus can be a physical entity or a software suite deployed on a server or cloud platform. The internal functional structure of the apparatus can be divided into multiple logical units. Among these, a data processing unit is included, whose core function is to perform data preprocessing and alignment. This unit is used to acquire historical photovoltaic power data and multidimensional meteorological factor data, perform dual clustering on the data to generate first and second similarity matrices, and determine the optimal time delay vector for aligning historical meteorological data by minimizing the differences between the matrices.
[0071] The device also includes an anomaly detection unit. Working closely with the data processing unit, this unit's function is to divide samples into normal and outlier sets based on the inconsistencies between the first and second similarity matrices. This unit is responsible for calculating the inconsistency index for each sample and classifying it according to preset rules (such as comparison with the mean), providing sample labels for subsequent differential loss calculations.
[0072] The core of the device is the model training unit. This unit is used to construct the aforementioned joint loss function and train a machine learning prediction model using data aligned by the data processing unit and a sample set partitioned by the anomaly detection unit. Specifically, when calculating the loss, this unit adds a special penalty term to samples within the outlier set. The penalty value of this term increases as the prediction residual decreases, thereby achieving robust training against outliers.
[0073] This invention also provides a photovoltaic power prediction device, which is a direct application of a trained model. This device can be deployed at the edge computing nodes or central control room of a photovoltaic power plant. Its core is an online prediction module, which aligns real-time collected meteorological data using a pre-calculated optimal time delay vector. This optimal time delay vector and the machine learning prediction model used are determined and trained using the aforementioned training device and method. The aligned real-time data is input into the trained model, which performs forward inference and ultimately outputs a short-term photovoltaic power prediction result, providing decision support for grid dispatch and power plant operation and maintenance.
[0074] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0075] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0076] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0077] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0078] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods.
[0079] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0080] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A dualistic cluster-based multivariate photovoltaic power prediction method, characterized in that, include: Historical photovoltaic power data and multidimensional meteorological factor data are acquired. The data is split into historical meteorological factor component set and future photovoltaic power component set along the feature dimension. The two component sets are clustered to generate a first similarity matrix and a second similarity matrix. By searching for a time delay vector to minimize a preset difference metric between the first similarity matrix and the second similarity matrix, the optimal time delay vector for aligning the historical meteorological factor data is determined, thereby obtaining a time-aligned sample set. Based on the inconsistency between the first similarity matrix and the second similarity matrix, the samples are divided into a normal value set and an outlier set; Construct a joint loss function, which adds a penalty term to the base loss for samples in the outlier set. The penalty term increases as the residual between the model prediction and the true sample value decreases. A machine learning prediction model is trained using the time-aligned sample set and the joint loss function, and real-time meteorological data is aligned using the optimal time delay vector for online prediction.
2. The method of claim 1, wherein, The time delay vector is a multidimensional time delay vector, whose dimension is the same as that of the multidimensional meteorological factors, and each component of the multidimensional time delay vector corresponds to the time offset of a meteorological factor sequence.
3. The method of claim 1, wherein, The clustering uses a clustering algorithm based on time series similarity.
4. The method of claim 1, wherein, Both the first similarity matrix and the second similarity matrix are binary matrices. If any two samples are in the same cluster, the corresponding element in the matrix is 1; otherwise, it is 0.
5. The method of claim 1, wherein, The preset matrix difference metric is the Frobenius norm of the difference between the first similarity matrix and the second similarity matrix.
6. The method of claim 1, wherein, The step of dividing the samples into a normal value set and an outlier set includes: calculating the absolute difference matrix based on the first similarity matrix and the second similarity matrix; defining the sum of the elements of the corresponding column of each sample in the absolute difference matrix as the inconsistency index of the sample; and identifying samples whose inconsistency index meets the preset conditions as outlier sets.
7. The method according to claim 6, characterized in that, The preset condition is that the inconsistency index is higher than the average inconsistency index of all samples.
8. The method according to claim 1, characterized in that, The method further includes: before training the machine learning prediction model, dividing the power value range into multiple intervals, and calculating the basic interval weights based on the sample frequency of each interval to weight the joint loss function so that the intervals with lower frequencies receive higher weights.
9. An apparatus for training a photovoltaic power prediction model, characterized in that, include: The data processing unit is used to acquire historical photovoltaic power data and multidimensional meteorological factor data, perform dual clustering on the data to generate first and second similarity matrices, and determine the optimal time delay vector for aligning the historical meteorological data by minimizing the difference between the matrices. An anomaly detection unit is used to divide samples into a normal value set and an outlier set based on the inconsistency between the first and second similarity matrices. The model training unit is used to construct a joint loss function and train a machine learning prediction model using data aligned by the data processing unit and a sample set partitioned by the anomaly detection unit. The joint loss function adds a penalty term to the samples in the outlier set, and the penalty value of the penalty term increases as the prediction residual decreases.
10. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of claims 1 to 8.
