A multi-dimensional photovoltaic clustering method based on bat algorithm
By combining the improved Laida criterion, stacked sparse autoencoder, and bat algorithm, the problems of multi-dimensional feature capture and local optima in traditional photovoltaic clustering algorithms are solved, achieving efficient and accurate photovoltaic clustering and supporting the stable operation of high-proportion distributed photovoltaic grids.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HOHAI UNIV
- Filing Date
- 2026-03-05
- Publication Date
- 2026-06-05
AI Technical Summary
Existing photovoltaic clustering algorithms struggle to effectively capture multidimensional features, are prone to getting trapped in local optima, leading to unreasonable clustering results, and have high computational complexity, making it difficult to meet the stable operation requirements of high-proportion distributed photovoltaic grid connections.
An improved Laida criterion is used for data preprocessing, and deep features are extracted by stacked sparse autoencoders to construct a multi-dimensional clustering model. The Bat algorithm is used for optimization and solution, and a two-layer optimization model is used for closed-loop verification to ensure the accuracy and robustness of the clustering results.
It achieves efficient and accurate photovoltaic clustering, which can accurately characterize the differences between photovoltaic scenarios, improve the robustness and adaptability of clustering results, and support the stable operation of distribution networks under high-proportion distributed photovoltaic access.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to a photovoltaic clustering and cluster partitioning method, and in particular a multi-dimensional photovoltaic clustering method based on the Bat algorithm. Background Technology
[0002] Against the backdrop of energy shortages and global warming, photovoltaic (PV) and wind power, as major forms of renewable energy, are witnessing the growth of global energy utilization capacity. With the accelerated transformation to smart grids, distributed photovoltaic (DPV) is being connected to the distribution network at high speed and in high proportion. Due to its significant uncertainty and volatility, it poses a severe challenge to the stable operation of the distribution network.
[0003] Currently, power distribution network configuration mainly relies on traditional clustering algorithms. The K-means algorithm is widely used due to its simplicity and efficiency, but it is sensitive to initial cluster centers, struggles to capture the multidimensional features of photovoltaic output curves, and is prone to generating unreasonable clusters with "similar shapes but vastly different energy levels." Another widely used hierarchical clustering method, while capable of representing data structures, suffers from high computational complexity, and determining the optimal cut point is highly subjective. Fuzzy clustering, represented by fuzzy C-means (FCM), introduces the concept of membership, but its performance is significantly affected by the fuzzy index and is similarly limited by a single similarity metric. These methods all have certain limitations: their feature metrics are single-dimensional, they are prone to getting trapped in local optima during optimization, and the resulting typical scenarios lack robustness, making it difficult to accurately characterize the complex uncertainties of cluster partitioning.
[0004] Based on the above, this study proposes a multi-dimensional photovoltaic clustering method optimized using the Bat Algorithm. This method first performs outlier detection and processing by improving the Laida criterion, and then utilizes a stacked autoencoder to extract deep features from the original time-series data, mapping the high-dimensional, nonlinear photovoltaic data to a low-dimensional, more representative feature space. Next, a clustering model integrating a four-dimensional comprehensive metric is constructed to accurately quantify the differences between scenarios from multiple dimensions. Subsequently, the Bat Algorithm, a group of intelligent optimizers, is used to solve the complex high-dimensional, nonlinear clustering model, effectively avoiding the pitfalls of traditional algorithms that easily get trapped in local optima, and ultimately robustly finding the globally optimal clustering partition and typical scenarios. Summary of the Invention
[0005] This invention proposes a photovoltaic clustering method. This method uses a novel multi-dimensional distribution network configuration method and iteratively solves the model through a swarm intelligence optimization method with powerful global search capabilities. It can effectively overcome the limitation of traditional clustering that only relies on Euclidean distance, and find more accurate, robust and more physically realistic clustering results.
[0006] For subsequent applications such as energy storage optimization and risk assessment, the scenarios extracted by this method are more representative in terms of key constraints such as energy balance and peak timing, thereby contributing to the safe, economical and stable operation of high-proportion energy grids.
[0007] The technical solution adopted in this invention is: 9) Data preprocessing and feature extraction based on the improved Laida criterion 10) Construct a multi-dimensional clustering model 11) Optimization solution using the Bat Algorithm 12) Substitute into the two-level optimization model for closed-loop verification. 1. Data Preprocessing and Feature Extraction Based on Improved Laida Criterion This invention employs an improved Laida criterion for outlier detection and performs denoising and missing value imputation on historical photovoltaic power generation data to ensure data integrity and accuracy. Missing data is imputed using time-series-based interpolation to avoid clustering bias caused by incomplete data.
[0008] Assuming the research subjects are those who have participated in the study within one year... Day (usually) The combined time-series data of photovoltaic output and load, including daily data. Each sampling point (e.g.) or The original data matrix is denoted as... First, impute the missing values in the data:
[0009] If the first The timestamp data for a certain day is completely missing. It is filled by the average value of data from other days at the same time during the same period. The replacement data can be represented as follows:
[0010] If random data points are missing within a single day, they will be filled using linear interpolation of data from adjacent time points. The replacement data is as follows:
[0011] Subsequently, an improved Laida criterion was used for outlier detection and correction: For each time step... dataset Calculate its initial mean and standard deviation To improve the adaptability of the threshold to data distribution, a variable coefficient method is introduced to dynamically adjust the anomaly detection threshold. :
[0012]
[0013] in, To remove initial outliers (such as...) The ratio of the standard deviation to the mean of the remaining samples. If a data point satisfies... If a value is found to be outlier, it is identified as an outlier and replaced with the truncated mean of the data at that moment (the average value after excluding outliers). This method improves the adaptability to the fluctuation characteristics of photovoltaic data by dynamically adjusting the outlier detection threshold, ensuring the integrity and rationality of the dataset.
[0014] Next, in order to overcome the complexity of clustering high-dimensional time series data and to perform deep feature extraction on the dataset, this invention uses a stacked sparse autoencoder network (SSAE) to perform nonlinear dimensionality reduction on the cleaned data.
[0015] The network structure is a symmetrical encoder-decoder architecture: Encoder: Converts standardized input data The image is mapped to a low-dimensional embedding space through multiple nonlinear transformations. Let the encoder function be... The deep feature representation is then obtained as follows:
[0016]
[0017] in The dimension of the embedded space.
[0018] Decoder: embeds features Reconstructing back to the original data space, the function is denoted as ,in Given the decoder's weights and biases, the output reconstructed data matrix is:
[0019] Training objective: Minimize the sum of reconstruction error and sparse regularization term.
[0020] in The second term represents the Frobenius norm, and the third term represents the weights of each layer of the encoder. L1 regularization is applied to encourage the learning of sparse features. is the sparsity coefficient.
[0021] The network compresses the raw data into a low-dimensional embedding space through an encoder, learning feature representations that reflect the core modes of photovoltaic power output; then, a decoder reconstructs the data to supervise the learning process. Ultimately, a high-quality low-dimensional feature dataset is obtained, which serves as input for subsequent clustering.
[0022] 2. Multidimensional clustering model Based on feature extraction, this invention constructs a multi-dimensional clustering model for accurately segmenting photovoltaic power generation scenarios. This model calculates the comprehensive similarity between different scenarios by combining four similarity metrics, and then clusters the photovoltaic scenarios based on this similarity. Specifically, the formula for calculating the distance metric between each pair of scenarios is as follows:
[0023]
[0024] in, Let be the weight vector, satisfying and The components are defined as follows:
[0025] Power curve similarity The similarity of the power curve shapes of the two scenarios is measured using Euclidean distance.
[0026]
[0027] in, Number of sampling points per day For the scene At any moment The power value.
[0028] Similarity of daily power generation : To measure the balance of total power generation in the two scenarios and ensure that the energy levels within the cluster are similar.
[0029]
[0030] Similarity in patterns and trends By calculating the maximum value of the normalized cross-correlation sequence, the consistency of the morphological trends of the two power curves under sliding alignment is evaluated, overcoming the limitations of fixed alignment.
[0031]
[0032] in, for and The normalized cross-correlation sequence.
[0033] Similarity of fluctuation positions Focus on the time alignment of key fluctuation points (such as peaks) to characterize the temporal synchronization characteristics of fluctuation patterns.
[0034]
[0035] in, To achieve maximum similarity in pattern trends At this time, the required displacement step size of one sequence relative to another sequence. The smaller the value, the more synchronized the fluctuations of the two curves are.
[0036] The core of this clustering model is to ensure the scientific validity and accuracy of the clustering results through multi-dimensional metrics. Unlike traditional Euclidean distance metrics, this invention adopts a metric that comprehensively considers multiple physical characteristics of photovoltaic power generation, thereby more realistically reflecting the differences between photovoltaic power generation scenarios and avoiding the limitations of a single metric method.
[0037] 3. Optimization solution using the Bat Algorithm To solve the multi-dimensional clustering model, this invention employs the Bat Algorithm for optimization. The Bat Algorithm is a swarm intelligence optimization algorithm that simulates the echolocation behavior of bats and possesses powerful global search capabilities. This algorithm transforms the photovoltaic scene clustering problem into an optimization problem: finding a set of cluster centers. This makes the total distance from all scenes to their respective cluster centers... The sum is minimized. This invention uses the bat algorithm to solve this high-dimensional, nonlinear optimization problem, where the position of each bat is encoded as a potential cluster center set solution. The algorithm flow is as follows:
[0038] 22) Initialize the population and parameters Input photovoltaic power data matrix (in For the number of days, (Daily average number of sampling points), set the number of clusters. .
[0039] initialization The location of only bats (Corresponding cluster center matrix) ∈ ), randomly generate the frequency of each bat ∈[ , Loudness ∈[ , and pulse emission rate ∈[0, ].
[0040] Calculate the fitness value corresponding to the initial cluster centers. The fitness function adopts the sum of squared clustering errors (SSE), which, combined with the photovoltaic multidimensional similarity requirement, is defined as:
[0041] in, This is the i-th photovoltaic power sample; Let k be the cluster center corresponding to the b-th bat; This is the weight vector.
[0042] 26) Iterative optimization process For the The next iteration ( =1,2,..., ), perform the following operations: Each bat is based on its current optimal cluster center. (The position of the bat with the lowest fitness) Adjust the frequency and flight speed, and update the formula as follows:
[0043] in, This represents the current flight frequency of the b-th bat. The minimum frequency for bat flight; This represents the maximum flight frequency of bats. for Random numbers within a range are used to adjust the randomness of the frequency.
[0044]
[0045] in, For the bth bat in the th... Flight speed at the next iteration; For the bth bat in the th... Flight speed at the next iteration; Let b be the position of the b-th bat in the t-th iteration; This is the optimal position among all bats currently in use.
[0046] Update bat locations (cluster centers) based on speed:
[0047] in, For the bth bat in the th... The new position at +1 iteration; For the bth bat in the th... Flight speed at +1 iteration.
[0048] Calculate the cluster center corresponding to the new location Each photovoltaic power sample is assigned to its corresponding cluster based on the minimum LESD distance, and the fitness value is recalculated. .
[0049] If random number and If so, accept the new location and update the optimal cluster center. Simultaneously adjust loudness and pulse emission rate:
[0050] in, For the bth bat in the th... Loudness at +1 iteration; For the bth bat in the th... Loudness at the next iteration; This is the loudness decay coefficient, used to control the rate at which loudness decays with each iteration.
[0051]
[0052] in, For the bth bat in the th... Pulse emission rate at +1 iteration; The initial pulse emission rate; It is a natural constant (approximately 2.718), ensuring that the pulse emission rate increases linearly to 1 with iteration.
[0053] 31) Termination Condition and Optimal Clustering Output When the number of iterations reaches (The maximum number of preset iterations) or the change in the optimal fitness value after 5 consecutive iterations is less than The algorithm terminates when the optimal cluster centers are reached. The corresponding photovoltaic power clustering results are used, and the representative pattern of each cluster is the power curve of the cluster center (including the confidence interval of mean ± standard deviation), which is used for subsequent power grid planning and simulation analysis.
[0054] The Bat Algorithm explores the solution space by simulating the echolocation of bats. Its greatest advantage lies in its powerful global search capability, which can effectively avoid the problem of local optima and ensure that the final clustering results have strong robustness and accuracy.
[0055] 4. Closed-loop verification of the two-level optimization model To ensure the validity of the clustering results, this invention further introduces a two-layer optimization model for verification. Through two-layer optimization, this invention can verify whether the extracted photovoltaic scenarios can meet the requirements of energy balance and power system stability in different application scenarios such as power grid planning, energy storage optimization configuration, and risk assessment.
[0056] The closed-loop verification process of the two-level optimization model includes: Upper-level planning model: Based on typical scenarios, with the goals of minimizing the system's annual comprehensive investment and operating costs and minimizing node voltage deviation, it optimizes the installation location, capacity, and power of distributed photovoltaic and energy storage.
[0057] Lower-level operation model: Under the configuration determined by the upper-level planning, the charging and discharging strategies of energy storage in each typical day are optimized with the goal of minimizing daily operating costs, network losses and voltage deviations.
[0058] By comparing and analyzing the differences in optimization configuration results (such as total investment cost, voltage qualification rate, and network loss reduction rate) between the scenarios extracted using the method of this invention and those extracted using traditional methods such as K-means, it is demonstrated that the clustering results obtained by this invention have significant advantages in supporting accurate planning and efficient operation of the power grid.
[0059] The technical solution of this invention can achieve the following technical effects: 34. An improved Laida criterion is adopted to achieve adaptive preprocessing of photovoltaic data. Combined with a stacked sparse autoencoder, nonlinear dimensionality reduction and deep feature extraction of high-dimensional photovoltaic time series data are achieved, which effectively preserves the core time series features of photovoltaic power output, reduces the computational complexity of subsequent clustering, and improves clustering efficiency.
[0060] 35. Construct a four-dimensional comprehensive measurement model that integrates power curve shape, daily power generation, trend synchronization, and fluctuation position. This model breaks through the limitations of the traditional single Euclidean distance and accurately describes the differences between photovoltaic scenarios from multiple physical dimensions. It avoids unreasonable clustering of "similar shapes but different energies" and improves the physical rationality of clustering results.
[0061] 36. The bat algorithm is used to perform global optimization of the multi-dimensional clustering model. By leveraging the global search capability of swarm intelligence algorithms, it effectively overcomes the shortcomings of traditional clustering algorithms, such as sensitivity to initial values and susceptibility to local optima. It robustly finds the globally optimal clustering partitioning result, thereby improving the robustness and accuracy of the clustering results.
[0062] 37. A two-layer optimization model is introduced to realize closed-loop verification of clustering results, ensuring that the typical scenarios output can adapt to the actual needs of distribution network planning and operation, and providing reliable scenario support for distribution network energy storage optimization, risk assessment, operation scheduling and other work under high proportion of distributed photovoltaic access.
[0063] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0064] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0065] Figure 1This is a flowchart illustrating the multi-dimensional photovoltaic clustering method based on the bat algorithm in this invention. Figure 2 This is a schematic diagram of the data preprocessing and feature extraction process in this invention; Figure 3 This is a schematic diagram of the optimization solution using the bat algorithm in this invention; Figure 4 This is a schematic diagram of the closed-loop verification process of the two-layer optimization model in this invention. Detailed Implementation
[0066] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0067] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0068] like Figure 1 As shown, this application provides a multi-dimensional photovoltaic clustering method based on the bat algorithm, the method including: S1: Collect historical time-series photovoltaic power output data, preprocess the historical time-series photovoltaic power output data based on the improved Laida criterion, and then perform deep feature extraction on the preprocessed data through a stacked sparse autoencoder to generate a low-dimensional feature dataset. S2: Construct a multi-dimensional clustering model. Based on the low-dimensional feature dataset, calculate the comprehensive similarity between different photovoltaic scenarios by using a four-dimensional comprehensive distance metric formula that integrates power curve similarity, daily power generation similarity, morphological trend similarity, and fluctuation position similarity. S3: The photovoltaic scenario clustering problem is transformed into a cluster center optimization problem. The optimization objective is to minimize the sum of the comprehensive distances from all scenarios to their respective cluster centers. The multi-dimensional clustering model is iteratively optimized and solved using the bat algorithm to obtain the globally optimal clustering results and typical scenarios. S4: Based on the two-layer optimization model, the clustering results are verified in a closed loop with typical scenarios, and the final photovoltaic clustering results are output.
[0069] Specifically, the first step is to collect historical time-series power output data of distributed photovoltaic (PV) systems in the target area. The research object is defined as the photovoltaic power output time-series data for N days within a year, with T sampling points per day. N is typically 365, and T can be 24 or 96 depending on the sampling frequency. The original data matrix is denoted as... To address issues such as missing values and outliers in the original data, data preprocessing was performed by improving the Laida criterion to ensure data integrity and accuracy. Then, a stacked sparse autoencoder was used to perform nonlinear dimensionality reduction on the cleaned high-dimensional time-series data to extract deep features that reflect the core modes of photovoltaic power output, generating a low-dimensional feature dataset. This reduces the complexity of subsequent clustering calculations and improves the representativeness of the features.
[0070] After feature extraction, a multi-dimensional clustering model is constructed to overcome the limitations of traditional single Euclidean distance measurement. From four physical dimensions—power curve shape, daily power generation, trend synchronization, and fluctuation position—a comprehensive distance measurement formula, LESD, is constructed to accurately quantify the differences between different photovoltaic scenarios. This ensures that the clustering results simultaneously meet the requirements of similar curve shape, similar energy level, synchronized trend changes, and aligned fluctuation time sequence, avoiding unreasonable divisions in traditional clustering methods.
[0071] Subsequently, the photovoltaic (PV) scenario clustering problem is transformed into a high-dimensional nonlinear optimization problem. The optimization objective is to find a set of optimal cluster centers that minimizes the sum of the LESD (Lead-Oriented Distance) of the combined distances from all PV scenarios to their respective cluster centers. The Bat Algorithm, a swarm optimization algorithm, is employed to solve this problem. The location of each bat is encoded as a set of potential cluster centers. By simulating the echolocation behavior of bats, a global search and local optimization are performed in the solution space, effectively avoiding the tendency of traditional clustering algorithms to get trapped in local optima. After iteration, the globally optimal clustering results and typical scenarios are output. The representative pattern of each cluster is represented by the power curve of the cluster center, and the confidence interval of the mean ± standard deviation is provided for subsequent power grid planning and simulation analysis.
[0072] Finally, a two-layer optimization model is introduced to perform closed-loop verification of the clustering results. By nesting the upper-layer planning model and the lower-layer operation model, the differences between the scenarios extracted by the method of this invention and traditional methods such as K-means in the optimized configuration results of photovoltaic and energy storage in the distribution network are compared. These differences include core indicators such as total investment cost, voltage qualification rate, and network loss reduction rate. The effectiveness of the clustering results in supporting the accurate planning and efficient operation of the power grid is verified, and the verified photovoltaic clustering results are finally output.
[0073] The technical solution of this invention realizes accurate feature extraction and multi-dimensional global optimal clustering of high-dimensional photovoltaic time-series data, effectively solving the problems of single feature measurement dimension, easy to get trapped in local optima, and poor robustness of clustering results in traditional photovoltaic clustering algorithms, and providing reliable scenario support for distribution network planning and operation under high proportion of distributed photovoltaic access.
[0074] Furthermore, the preprocessing of the photovoltaic historical time-series power output data based on the improved Laida criterion includes: Missing values in the historical photovoltaic power output data are filled in, and the process is divided into two scenarios: If the data for a certain timestamp on day m is completely missing, it is filled by the average value of the data from the same time on other days of the same period. The formula for calculating the replacement data is:
[0075] If random data points are missing within a single day, they are filled using linear interpolation of data from adjacent time points. The formula for calculating the replacement data is as follows:
[0076] After missing value imputation, an improved Laida criterion is used for outlier detection and correction. For the dataset at each time t Calculate its initial mean and standard deviation To improve the adaptability of the threshold to the fluctuation characteristics of photovoltaic data, a variable coefficient method is introduced to dynamically adjust the anomaly detection threshold K. The calculation formula is as follows:
[0077]
[0078] in, To remove initial outliers (greater than) The ratio of the standard deviation to the mean of the remaining samples after the numerical value is calculated.
[0079] If a data point satisfies If a value is found to be outlier, it is identified as an outlier and replaced with the truncated mean of the data at that moment (the average value after excluding outliers). This method avoids the misjudgment of fluctuating data by the traditional Laida criterion's fixed 3σ threshold by dynamically adjusting the outlier detection threshold, thus improving the accuracy of outlier detection and ensuring the integrity and rationality of the dataset.
[0080] Furthermore, the step of performing deep feature extraction on the preprocessed data using stacked sparse autoencoders to generate a low-dimensional feature dataset includes: A stacked sparse autoencoder (SSAE) network with a symmetric encoder-decoder architecture is constructed. This network learns the deep nonlinear features of photovoltaic time series data in an unsupervised manner, thereby achieving effective dimensionality reduction of high-dimensional data.
[0081] The encoder part maps the standardized input data X to a low-dimensional embedding space through multiple nonlinear transformations. Let the encoder function be... The deep feature representation is then obtained as follows:
[0082]
[0083] Where d is the dimension of the embedding space, which can be set to 1 / 4 to 1 / 8 of the original dimension according to the data features, so as to retain the core features while reducing the data dimension.
[0084] Decoder part: Reconstructs the embedded features Z back into the original data space, denoted by the function . ,in Given the decoder's weights and biases, the output reconstructed data matrix is:
[0085] Training objective: Minimize the sum of reconstruction error and sparse regularization term. The training objective function is:
[0086] In the formula, for The norm is used to measure the reconstruction error between the original data and the reconstructed data; the second term is the weight of each layer of the encoder. L1 regularization is applied to encourage the network to learn sparse feature representations. β is the sparsity coefficient, which is usually taken as 0.001~0.01.
[0087] The SSAE network was trained by optimizing its parameters using backpropagation and gradient descent. Preprocessed, standardized data was input into the trained encoder, which outputs a low-dimensional feature dataset as input for subsequent clustering. This network effectively captures the nonlinear characteristics of photovoltaic power output time-series data. Compared to traditional linear dimensionality reduction methods, it is better suited to the complex fluctuations in photovoltaic power output, thus improving the effectiveness of feature extraction.
[0088] Furthermore, the distance formula for the fused four-dimensional comprehensive metric is the Comprehensive Distance LESD, and the calculation formula is as follows:
[0089] In the formula, Let be the weight vector, satisfying and u=1,2,3,4, and the weights can be adjusted according to the needs of the application scenario. The default value is set to 1. , , , .
[0090] The specific definitions of each dimension component are as follows: Power curve similarity Euclidean distance is used to measure the overall similarity of the power curve shapes of two scenes. It is a fundamental metric for clustering, and the calculation formula is as follows:
[0091] Similarity of daily power generation This measure assesses the balance of total power generation between two scenarios, ensuring that scenarios within the same cluster maintain consistent energy levels and avoiding unreasonable clustering with similar curve shapes but vastly different total power generation. The calculation formula is as follows:
[0092] Similarity in patterns and trends By calculating the maximum value of the normalized cross-correlation sequence, the consistency of the morphological trends of the two power curves under sliding alignment is evaluated. This overcomes the limitations of traditional Euclidean distance fixed-time alignment and can effectively capture the rising, falling, and fluctuating trend characteristics of photovoltaic power output curves. The calculation formula is as follows:
[0093] in, for and The closer the normalized cross-correlation sequence is to 1, the stronger the trend consistency between the two curves, and the closer the corresponding S value is to 0.
[0094] Similarity of fluctuation positions Focusing on the time alignment of key fluctuation points in photovoltaic power output (such as peak and trough values) characterizes the temporal synchronization features of fluctuation patterns, ensuring that scenarios within the same cluster maintain consistency in key temporal features such as the time of peak power output. The calculation formula is as follows:
[0095] in, To achieve maximum morphological trend similarity, the required displacement step size of one sequence relative to another. The smaller the value, the more synchronized the fluctuations of the two curves are, and the closer the corresponding δ value is to 0.
[0096] This multi-dimensional clustering model, starting from multiple physical characteristics of photovoltaic power output, comprehensively depicts the differences between different scenarios, effectively making up for the limitations of traditional single measurement methods, and ensuring that the clustering results are more in line with the actual physical characteristics of the power system.
[0097] Furthermore, the iterative optimization and solution of the multi-dimensional clustering model using the bat algorithm includes: S31: Initialize the population and parameters Input photovoltaic power low-dimensional feature dataset Set the number of clusters K, and the optimal number of clusters can be determined using the silhouette coefficient method; initialize the positions of B bats. The location of each bat is encoded as a K×d dimensional cluster center matrix. ∈ Randomly generated within the data range; the frequency of each bat is randomly generated. ∈[ , ], usually set , Initialize the loudness of the bat. ∈[ , ], usually set , Initialize pulse emission rate ∈[0, ], usually set ; Calculate the fitness value corresponding to the initial position of each bat. The fitness function uses the sum of squared clustering errors, combined with the four-dimensional comprehensive distance, and is defined as follows:
[0098] in, For the i-th photovoltaic power sample, Let be the k-th cluster center corresponding to the b-th bat.
[0099] S32: Iterative Optimization Process For the m-th iteration (m=1,2,...,M), perform the following operations: Each bat is determined based on the current globally optimal cluster center. (The position of the bat with the lowest fitness) Adjust the frequency and flight speed, and update the formula as follows:
[0100]
[0101] in, The initial velocity is a uniformly distributed random number within the interval [0,1], used to adjust the randomness of the frequency. Set to 0.
[0102] Update the bat's location (cluster center) based on its speed:
[0103] Calculate the cluster center corresponding to the new location Each photovoltaic power sample is assigned to its corresponding cluster based on the minimum LESD distance, and the fitness value is recalculated. .
[0104] If the generated random number and If so, accept the new position and update the current globally optimal position. Simultaneously adjust loudness and pulse emission rate, and update the formula as follows:
[0105]
[0106] Where α is the loudness attenuation coefficient, usually taken as 0.9; and γ is the impulse emission rate growth coefficient, usually taken as 0.9. As the number of iterations increases, the loudness of the bat gradually decreases, while the impulse emission rate gradually increases. The algorithm gradually shifts from global search to local fine-grained optimization, balancing global exploration and local development capabilities.
[0107] S33: Termination Conditions and Optimal Clustering Output When the number of iterations reaches the preset maximum number of iterations M (usually set to 100~500), or the change in the optimal fitness value after 5 consecutive iterations is less than... The algorithm terminates when the time is right. It outputs the globally optimal cluster centers. The corresponding photovoltaic power clustering results are provided, with the power curve of the cluster center representing the representative pattern of each cluster. The confidence interval of the mean ± standard deviation is also given for subsequent power grid planning and simulation analysis.
[0108] The Bat Algorithm explores the solution space by simulating the echolocation behavior of bats. It has both strong global search capabilities and local optimization capabilities, and can effectively avoid the defects of traditional algorithms such as K-means, which are sensitive to the initial cluster centers and are prone to getting trapped in local optima. This ensures that the final clustering results have strong robustness and accuracy.
[0109] Furthermore, the closed-loop verification of the clustering results and typical scenarios based on the two-layer optimization model includes: To ensure that the clustering results can be adapted to the actual needs of power distribution network planning and operation, a two-level optimization model is constructed for closed-loop verification. The effectiveness of the clustering results is verified by nesting the upper and lower level models.
[0110] Upper-level planning model: As the core decision-making link of the two-level optimization model, it uses typical photovoltaic scenarios obtained by clustering in this invention as the core input. It fully leverages the characterization of photovoltaic features by these typical scenarios to establish dual optimization objectives: minimizing the system's annual comprehensive investment and operating cost and minimizing node voltage deviation. The system's annual comprehensive investment and operating cost encompasses the annual investment cost of distributed photovoltaic and energy storage equipment, the operation and maintenance costs throughout the equipment's lifecycle, and the annual network loss cost of the distribution network, achieving a balance between economic efficiency and practicality. The node voltage deviation minimization objective aims to ensure that the voltage at each node of the distribution network remains stable near its rated range, guaranteeing the safe and stable operation of the power grid.
[0111] Lower-level operation model: Under the photovoltaic and energy storage configuration scheme determined by the upper-level planning, the optimization objectives are to minimize daily operating costs, network losses, and node voltage deviations. For each typical scenario obtained from the clustering, the charging and discharging strategies of the energy storage are optimized within the day. The decision variables of the lower-level model are the charging and discharging power time series of each typical day's energy storage, and the constraints include: upper and lower limits of energy storage charging and discharging power, upper and lower limits of state of charge, intraday state of charge balance constraints, node voltage constraints, and branch power flow constraints.
[0112] By comparing the typical scenarios extracted by this invention with those extracted by traditional clustering methods such as K-means, the superiority of the clustering results of this invention is verified through the differences in configuration schemes, economic and power grid operation indicators after two-layer optimization. The photovoltaic clustering results are output after closed-loop verification to ensure that they are suitable for various practical application needs of the power distribution network.
[0113] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from its scope. Thus, if such modifications and modifications fall within the scope of the claims and their equivalents, this application intends to include such modifications and modifications.
Claims
1. A multi-dimensional photovoltaic clustering method based on the Bat algorithm, characterized in that, The method includes: S1: Collect historical time-series photovoltaic power output data, preprocess the historical time-series photovoltaic power output data based on the improved Laida criterion, and then perform deep feature extraction on the preprocessed data through a stacked sparse autoencoder to generate a low-dimensional feature dataset. S2: Construct a multi-dimensional clustering model. Based on the low-dimensional feature dataset, calculate the comprehensive similarity between different photovoltaic scenarios by using a four-dimensional comprehensive distance metric formula that integrates power curve similarity, daily power generation similarity, morphological trend similarity, and fluctuation position similarity. S3: The photovoltaic scenario clustering problem is transformed into a cluster center optimization problem. The optimization objective is to minimize the sum of the comprehensive distances from all scenarios to their respective cluster centers. The multi-dimensional clustering model is iteratively optimized and solved using the bat algorithm to obtain the globally optimal clustering results and typical scenarios. S4: Based on the two-layer optimization model, the clustering results are verified in a closed loop with typical scenarios, and the final photovoltaic clustering results are output.
2. The multi-dimensional photovoltaic clustering method based on the bat algorithm according to claim 1, characterized in that, The preprocessing of the photovoltaic historical time-series power output data based on the improved Laida criterion includes: Missing values in the historical photovoltaic power output data are filled in as follows: if the overall timestamp data for a single day is missing, the average value of the data at the same time on other days of the same period is used to fill in the missing values; if random data points are missing within a single day, linear interpolation of data at adjacent times is used to fill in the missing values. An improved Laida criterion is used for outlier detection and correction: the initial mean and standard deviation of the dataset at each time point are calculated, and the variable coefficient method is introduced to dynamically adjust the outlier judgment threshold K. If a data point exceeds the threshold range, it is judged as an outlier and replaced by the truncated mean of the data at that time point. The multi-dimensional photovoltaic clustering method based on the bat algorithm according to claim 1 is characterized in that the step of performing deep feature extraction on the preprocessed data through stacked sparse autoencoders to generate a low-dimensional feature dataset includes: Construct a stacked sparse autoencoder network with a symmetric encoder-decoder architecture; The encoder maps the standardized preprocessed data to a low-dimensional embedding space through multi-layer nonlinear transformation to obtain a deep feature representation Z. Then, the embedded feature Z is reconstructed back into the original data space using a decoder, and the reconstructed data matrix is output. Finally, the stacked sparse autoencoder network is trained with the goal of minimizing the sum of the reconstruction error and the sparse regularization term. The preprocessed data is then input into the trained encoder, which outputs a low-dimensional feature dataset.
3. The multi-dimensional photovoltaic clustering method based on the bat algorithm according to claim 1, characterized in that, The multi-dimensional clustering model integrates the comprehensive distance LESD of a four-dimensional comprehensive metric, the four dimensions of which are as follows: To assess the similarity of power curves, Euclidean distance is used to measure the closeness of the power curve shapes between the two scenarios. The similarity of daily power generation is used to measure the balance of total power generation between two photovoltaic scenarios; To assess the similarity of morphological trends, the consistency of the morphological trends of the two power curves is evaluated using normalized cross-correlation sequences. To characterize the temporal synchronization features of the fluctuation modes of two photovoltaic scenarios, we consider the similarity of fluctuation positions.
4. The multi-dimensional photovoltaic clustering method based on the bat algorithm according to claim 1, characterized in that, The iterative optimization and solution of the multi-dimensional clustering model using the bat algorithm includes: S31: Initialize the population and parameters: Input a low-dimensional feature dataset, set the number of clusters K, initialize the positions of B bats, encode the position of each bat as a set of potential cluster center matrices, randomly generate the frequency, initial loudness and initial impulse emission rate of each bat, and calculate the fitness value corresponding to the initial position of each bat. S32: Iterative optimization: In each iteration, each bat adjusts its frequency and flight speed based on the current global optimal position, updates its own position, and calculates the fitness value corresponding to the new position; it uses random numbers to determine whether to accept the new position. If it accepts, it updates the global optimal position and adjusts the bat's loudness and impulse emission rate simultaneously. S33: Termination condition judgment: When the number of iterations reaches the preset maximum number of iterations, or when the change in the optimal fitness value of multiple consecutive iterations is less than the preset threshold, the algorithm terminates and outputs the globally optimal cluster center, clustering results, and typical scenarios.
5. The multi-dimensional photovoltaic clustering method based on the bat algorithm according to claim 1, characterized in that, The closed-loop verification of the clustering results and typical scenarios based on the two-layer optimization model includes: Constructing an upper-level planning model: Based on typical scenarios obtained from clustering, with the optimization objectives of minimizing the system's annual comprehensive investment and operating costs and minimizing node voltage deviation, the decision variables are the installation location, installation capacity, and rated power of distributed photovoltaic and energy storage; Constructing a lower-level operation model: Under the photovoltaic and energy storage configuration scheme determined by the upper-level planning, the optimization objectives are to minimize daily operating costs, network losses, and node voltage deviations, and the decision variables are the charging and discharging power time series of energy storage in each typical day; By comparing the clustering results of this invention with those of traditional clustering algorithms in terms of configuration schemes, economic indicators, and power grid operation indicators after two-layer optimization, the effectiveness of the clustering results is verified, and the final photovoltaic clustering results that pass the verification are output.
6. The multi-dimensional photovoltaic clustering method based on the bat algorithm according to claim 5, characterized in that, The termination condition is: the number of iterations reaches the preset maximum number of iterations M, or the change in the optimal fitness value over 5 consecutive iterations is less than... .
7. A multi-dimensional photovoltaic clustering system based on the Bat algorithm, characterized in that, The system includes: The data processing unit collects historical time-series photovoltaic power output data, preprocesses the data based on the improved Laida criterion, and performs deep feature extraction on the preprocessed data through stacked sparse autoencoders to generate a low-dimensional feature dataset. The model building unit constructs a multi-dimensional clustering model. Based on the low-dimensional feature dataset, it calculates the comprehensive similarity between different photovoltaic scenarios by fusing a distance formula with a four-dimensional comprehensive metric. The optimization solution unit transforms the photovoltaic scenario clustering problem into a cluster center optimization solution problem. The bat algorithm is used to iteratively optimize and solve the multi-dimensional clustering model to obtain the globally optimal clustering partitioning result and typical scenarios. The verification output unit performs closed-loop verification of the clustering results and typical scenarios based on a two-layer optimization model, and outputs the final photovoltaic clustering results.
8. A multi-dimensional photovoltaic clustering device based on the Bat algorithm, characterized in that, The device is used to implement the multi-dimensional photovoltaic clustering method based on the bat algorithm as described in any one of claims 1-8.