A Power Load Clustering Method
By improving the K-means clustering algorithm, the initial clustering center vector is selected and the similarity measurement standard is improved, the problem of low clustering accuracy of power load data is solved, and a higher precision power load curve clustering is achieved.
Patent Information
- Application Number
- CN202210189375.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-28
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2042-02-28
AI Technical Summary
The prior art is difficult to accurately cluster power load data, and it is impossible to ensure the clustering accuracy of the power load curve.
The K-means clustering algorithm is improved, the initial cluster center vector is selected through the principle of maximum combined distance, and the similarity measurement standard is improved in combination with the Pearson correlation coefficient, and the power load curve is further allocated to the cluster that is most similar to it.
The accuracy of power load curve clustering is improved, the similarity of load curves in clusters and the difference of power load curves between clusters is increased.
Smart Images

Figure CN114970660B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power load analysis, and in particular to a power load clustering method. Background Art
[0002] Power load clustering analysis is an important foundation for demand-side management, load modeling, power system planning, etc., and is of great significance to the analysis, operation, and planning of power systems. With the continuous improvement of the informationization of power systems, the distribution and consumption sides are constantly producing and recording massive amounts of data. At the same time, the power company's integrated distribution and operation has achieved the integration of various business systems, which has laid the foundation for more effective mining of load data. Accurate power load clustering can extract the common characteristics of loads. For the user layer, load clustering analysis can extract its power consumption mode and help to deeply grasp the user's power consumption rules; for the substation layer, load clustering analysis can largely reflect the operating status of the system and can effectively solve the time-varying and regional dispersion problems of loads.
[0003] With the development of various intelligent algorithms, scholars at home and abroad have studied power load clustering algorithms. Currently, the more popular clustering algorithms include K-means clustering algorithm, wavelet analysis, fuzzy C-means clustering algorithm (FCM), integrated clustering algorithm, self-organizing feature mapping neural network (SOM), extreme learning machine (ELM), cloud model, etc. However, as power load is a kind of data with nonlinear and time-series characteristics, the above clustering methods are difficult to accurately cluster power load data and cannot guarantee the clustering accuracy of power load curves. Summary of the invention
[0004] The purpose of the present invention is to provide a power load clustering method in order to overcome the defects of the above-mentioned prior art, and to improve the accuracy of power load curve clustering by improving the K-means clustering algorithm.
[0005] The object of the present invention can be achieved by the following technical solution: A power load clustering method comprises the following steps:
[0006] S1. Obtain power load data to be clustered, and preprocess the acquired power load data to obtain a preprocessed data set;
[0007] S2, initialization processing;
[0008] S3. Calculate an initial cluster center vector matrix according to the preprocessed data set, wherein the initial cluster center vector matrix includes a plurality of initial cluster center vectors;
[0009] S4, according to the improved similarity measurement standard, the remaining load vectors are assigned to the clusters where the corresponding cluster centers are located, and multiple clusters are obtained;
[0010] S5, calculating the average value of the intra-cluster vector of each cluster as the current cluster center vector of the cluster;
[0011] S6, judging whether the set clustering standard is met according to the current cluster center vector and the corresponding previous cluster center vector, if it is judged to be yes, executing step S8, otherwise executing step S7;
[0012] S7, further determine whether the set maximum number of iterations has been reached, if so, execute step S8, otherwise return to step S4;
[0013] S8. Output the current clustering result and end the clustering process.
[0014] Furthermore, the process of preprocessing the acquired power load data in step S1 includes denoising, dimensionality reduction and normalization processing.
[0015] Furthermore, the step S1 specifically uses the DBSCAN algorithm to perform denoising processing; uses the KPCA algorithm to perform dimensionality reduction processing; and uses the Max algorithm to perform normalization processing.
[0016] Furthermore, the initialization process in step S2 specifically includes setting the number of clusters, setting the maximum number of iterations, and setting the minimum distance between cluster center vectors before and after the update.
[0017] Furthermore, the step S3 specifically includes the following steps:
[0018] S31, setting the number of clusters to k, then selecting k vectors corresponding to k power load curves from the preprocessed data set;
[0019] S32. Find the combined distance d between any two vectors among the k vectors c , if there are n power load curves, there are combination distances, and then select the combination distance d c The k vectors corresponding to the maximum values are used as the initial cluster center vectors to construct the initial cluster center vector matrix.
[0020] Furthermore, the combined distance d between the two vectors in step S32 is c Specifically:
[0021]
[0022]
[0023] Among them, X i , X jare two vectors selected from the k vectors in the preprocessed data set, ρ(X i ,X j ) is the vector X i With vector X j The Pearson correlation coefficient, x is is the i-th vector X i The s-th dimension element, x js is the jth vector X j The s-th dimension element of i ,X j )The larger the value, the i With X j The stronger the positive correlation is.
[0024] Furthermore, the step S4 specifically includes the following steps:
[0025] S41, calculating the distances between the remaining vectors and the current cluster center vectors, and selecting the minimum distance value from the distance calculation results;
[0026] S42, assigning the remaining vectors to the cluster where the cluster center vector corresponding to the minimum distance value is located;
[0027] S43. According to the process of step S41 and step S42, all the remaining vectors are assigned to the clusters where the corresponding cluster centers are located, and multiple clusters are obtained.
[0028] Furthermore, the distances between the remaining vectors and the cluster center vector in step S41 are specifically:
[0029]
[0030]
[0031] Among them, γ is the current iteration number, x is is the i-th vector X i The s-th dimension element, u js is the jth cluster center vector U j The s-th dimension element of , n is the vector dimension, X is the γth iteration i with U j The Pearson correlation coefficient between .
[0032] Furthermore, the specific process of step S6 is as follows:
[0033] The distance between the current cluster center vector and the corresponding previous cluster center vector is calculated to determine whether the distance value meets the set clustering standard. If yes, step S8 is executed, otherwise step S7 is executed.
[0034] Furthermore, the set clustering standard is specifically that the distance between the current cluster center vector and the corresponding previous cluster center vector is less than the set minimum distance between the cluster center vectors before and after the update.
[0035] Compared with the prior art, the present invention selects the initial clustering center vector according to the principle of maximum combination distance, so that the power load curves with the greatest difference can be divided into different clusters at the very beginning; then, combined with the improved similarity measurement standard, the remaining power load curves can be further assigned to the clusters that are most similar to them, thereby increasing the similarity of the load curves within the cluster and the difference of the power load curves between clusters during the power load curve clustering process, thereby effectively improving the accuracy of power load curve clustering.
[0036] The present invention takes into account the nonlinear and time-series characteristics of the power load curve, and improves the traditional Euclidean distance formula in combination with the Pearson correlation coefficient as a new similarity measurement standard, so that the remaining load vectors are allocated to the cluster where the most similar cluster center is located, and then through the subsequent update and comparison of the cluster center vectors within the cluster, it is possible to iteratively optimize and obtain a clustering result with higher accuracy and better quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a schematic diagram of the method flow of the present invention;
[0038] Figure 2 Schematic diagram of the application process of the embodiment. DETAILED DESCRIPTION
[0039] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0040] Example
[0041] like Figure 1 As shown, a power load clustering method includes the following steps:
[0042] S1. Obtain the power load data to be clustered, and preprocess the acquired power load data to obtain a preprocessed data set, wherein the preprocessing specifically includes denoising, dimensionality reduction and normalization of the acquired power load data. In this embodiment, the DBSCAN algorithm is used for denoising; the KPCA algorithm is used for dimensionality reduction; and the Max algorithm is used for normalization;
[0043] S2, initialization processing: setting the number of clusters, setting the maximum number of iterations, and setting the minimum distance between the cluster center vectors before and after the update;
[0044] S3. According to the preprocessed data set, an initial cluster center vector matrix is calculated. The initial cluster center vector matrix includes multiple initial cluster center vectors. Specifically:
[0045] S31, setting the number of clusters to k, then selecting k vectors corresponding to k power load curves from the preprocessed data set;
[0046] S32. Find the combined distance d between any two vectors among the k vectors c , if there are n power load curves, there are combination distances, and then select the combination distance d c The k vectors corresponding to the maximum value are used as the initial cluster center vectors to construct the initial cluster center vector matrix, where the combined distance d between the two vectors is c for:
[0047]
[0048]
[0049] Where, X i , X j are two vectors selected from the k vectors in the preprocessed data set, ρ(X i ,X j ) is the vector X i With vector X j The Pearson correlation coefficient, x is is the i-th vector X i The s-th dimension element, x js is the jth vector X j The s-th dimension element of i ,X j )The larger the value, the i With X j The stronger the positive correlation between them;
[0050] S4. According to the improved similarity measurement standard, the remaining load vectors are assigned to the clusters where the corresponding cluster centers are located to obtain multiple clusters. Specifically:
[0051] S41, calculate the distances between the remaining vectors and the current cluster center vectors:
[0052]
[0053]
[0054] In the formula, γ is the current iteration number, x is is the i-th vector X iThe s-th dimension element, u js is the jth cluster center vector U j The s-th dimension element of , n is the vector dimension, X is the γth iteration i with U j Pearson correlation coefficient between ;
[0055] Then, the minimum distance value is selected from the distance calculation results;
[0056] S42, assigning the remaining vectors to the cluster where the cluster center vector corresponding to the minimum distance value is located;
[0057] S43, according to the process of step S41 and step S42, all the remaining vectors are assigned to the clusters where the corresponding cluster centers are located, and multiple clusters are obtained;
[0058] S5, calculating the average value of the intra-cluster vector of each cluster as the current cluster center vector of the cluster;
[0059] S6, judging whether the set clustering standard is met according to the current cluster center vector and the corresponding previous cluster center vector, if it is judged to be yes, executing step S8, otherwise executing step S7;
[0060] Specifically, the distance between the current cluster center vector and the corresponding previous cluster center vector is calculated, and then whether the distance value meets the set clustering standard is determined, wherein the set clustering standard is specifically that the distance between the current cluster center vector and the corresponding previous cluster center vector is less than the set minimum distance between the cluster center vectors before and after the update;
[0061] S7, further determine whether the set maximum number of iterations has been reached, if so, execute step S8, otherwise return to step S4;
[0062] S8. Output the current clustering result and end the clustering process.
[0063] This technical solution aims to improve the distance formula and optimize the initial cluster center: 1) The distance formula is improved by combining the Pearson correlation coefficient as a new similarity measurement standard; 2) K curves are selected from the original power load curve as the initial cluster center curves, and the principle is that the sum of the distances between these k curves (combined distance) is the largest.
[0064] This embodiment applies the above technical solution, such as Figure 2 As shown:
[0065] I. First, the original load data is preprocessed by denoising, dimensionality reduction and normalization using DBSCAN, KPCA and Max respectively.
[0066] II. In the preprocessed data set, k vectors corresponding to k power load curves are selected, and the sum of the distances between them (combined distance) d is calculated. c , if there are n curves, then there are combination distances, and then select the combination distance d c The k vectors corresponding to the largest ones are used as the initial cluster center vectors.
[0067] III. According to the improved similarity measure, the remaining load vectors are assigned to the cluster centers that are most similar to them.
[0068] IV. After the vectors are assigned, the average value of the vectors in the cluster is calculated as the new centroid vector. It is determined whether the distance between the new centroid vector and the original centroid vector is less than the set value. If so, jump to step VI. If not, jump to step V.
[0069] V. Determine whether the number of iterations reaches the preset value. If so, jump to step VI; if not, jump to step III.
[0070] VI. End the iteration process and output the clustering results.
[0071] Among them, when calculating the initial cluster center vector, this scheme uses the improved distance formula as the similarity measurement standard, and selects the principle of maximum combined distance to optimize the initial cluster center, so as to improve the clustering accuracy of the power load curve. Use the following formula:
[0072]
[0073] Where: X i , X j are two vectors among the k vectors selected from the original data set, ρ(X i ,X j ) is the vector X i With vector X j The Pearson correlation coefficient is expressed as follows:
[0074]
[0075] Where: x is represents the i-th vector X i The s-th dimension element, x js represents the jth vector X j The s-th dimension element of , n represents the dimension of the vector; ρ(X i ,X j)The larger the value, the stronger the positive correlation. So when the positive correlation between two vectors is relatively small, the corresponding distance becomes larger. This can try to assign vectors with little correlation to different clusters.
[0076] After the centroid is determined, the remaining loads are distributed using the improved distance formula as the similarity measure:
[0077]
[0078] In the formula, ρ(X i γ , U j γ ) is the vector X i γ and U j γ The Pearson correlation coefficient, X i γ , U j γ are the i-th rest vector and the j-th centroid vector at the γ-th iteration, n is the vector dimension, γ represents the number of iterations, and x is represents the i-th vector X i The s-th dimension element, u js represents the jth centroid vector U j The s-th dimension element of That is, it represents the Pearson correlation coefficient between the i-th rest vector and the j-th centroid vector at the γ-th iteration.
[0079] In summary, in order to increase the similarity of load curves within a cluster and the difference of load curves between clusters in the process of clustering power load curves, this technical solution can improve the accuracy of power load curve clustering. Therefore, an improved clustering method is proposed: considering the nonlinear and temporal characteristics of power load curves, the Euclidean distance formula is improved in combination with the Pearson correlation coefficient, which is used as a similarity measurement standard; and the initial cluster center is selected by the principle of obtaining the maximum combined distance. Thereby improving the accuracy of power load curve clustering.
[0080] By selecting the initial centroid vector according to the principle of maximum combined distance, the power load curves with the greatest difference can be divided into different clusters at the beginning; then, the distance formula improved by combining the Pearson correlation coefficient is used as a new similarity measurement standard to further assign the remaining power load curves to the clusters that are most similar to them, thereby obtaining a clustering result with higher accuracy and better quality.
Claims
1. A power load clustering method, characterized in that: The following steps are involved: S1. Obtain power load data to be clustered, and preprocess the acquired power load data to obtain a preprocessed data set; S2, initialization processing; S3. Calculate an initial cluster center vector matrix according to the preprocessed data set, wherein the initial cluster center vector matrix includes a plurality of initial cluster center vectors; S4, according to the improved similarity measurement standard, the remaining load vectors are assigned to the clusters where the corresponding cluster centers are located, and multiple clusters are obtained; S5, calculating the average value of the intra-cluster vector of each cluster as the current cluster center vector of the cluster; S6, judging whether the set clustering standard is met according to the current cluster center vector and the corresponding previous cluster center vector, if it is judged to be yes, executing step S8, otherwise executing step S7; S7, further determine whether the set maximum number of iterations has been reached, if so, execute step S8, otherwise return to step S4; S8, output the current clustering result and end the clustering process; The initialization process in step S2 specifically includes setting the number of clusters, setting the maximum number of iterations, and setting the minimum distance between the cluster center vectors before and after the update; The step S3 specifically comprises the following steps: S31, setting the number of clusters to k, then selecting k vectors corresponding to k power load curves from the preprocessed data set; S32. Find the combined distance d between any two vectors among the k vectors c , if there are n power load curves, there are combination distances, and then select the combination distance d c The k vectors corresponding to the maximum values are used as the initial cluster center vectors to construct the initial cluster center vector matrix; The combined distance d between the two vectors in step S32 c Specifically: Among them, X i , X j are two vectors selected from the k vectors in the preprocessed data set, ρ(X i ,X j ) is the vector X i With vector X j The Pearson correlation coefficient, x is is the i-th vector X i The s-th dimension element, x js is the jth vector X j The s-th dimension element of i ,X j )The larger the value, the i With X j The stronger the positive correlation between them; The step S4 specifically comprises the following steps: S41, calculating the distances between the remaining vectors and the current cluster center vectors, and selecting the minimum distance value from the distance calculation results; S42, assigning the remaining vectors to the cluster where the cluster center vector corresponding to the minimum distance value is located; S43, according to the process of step S41 and step S42, all the remaining vectors are assigned to the clusters where the corresponding cluster centers are located, and multiple clusters are obtained; The distances between the remaining vectors and the cluster center vector in step S41 are specifically: Among them, γ is the current iteration number, x is is the i-th vector X i The s-th dimension element, u js is the jth cluster center vector U j The s-th dimension element, x is γ is the i-th vector X at the γ-th iteration i The s-th dimension element, u js γ is the jth cluster center vector U at the γth iteration j The s-th dimension element of , n is the vector dimension, X is the γth iteration i with U j The Pearson correlation coefficient between .
2. A power load clustering method according to claim 1, characterized in that: The process of preprocessing the acquired power load data in step S1 includes denoising, dimensionality reduction and normalization processing.
3. A power load clustering method according to claim 2, characterized in that: The step S1 specifically uses the DBSCAN algorithm to perform denoising; uses the KPCA algorithm to perform dimensionality reduction; and uses the Max algorithm to perform normalization.
4. A power load clustering method according to claim 1, characterized in that: The specific process of step S6 is as follows: The distance between the current cluster center vector and the corresponding previous cluster center vector is calculated to determine whether the distance value meets the set clustering standard. If yes, step S8 is executed, otherwise step S7 is executed.
5. A power load clustering method according to claim 4, characterized in that: The set clustering standard is specifically that the distance between the current cluster center vector and the corresponding previous cluster center vector is less than the set minimum distance between the cluster center vectors before and after the update.