Double-layer clustering algorithm based on KPCA (Kernel Principal Component Analysis) and application thereof in power consumption behavior analysis

Through the KPCA-based bilayer clustering algorithm, combined with KPCA dimensionality reduction, spectral clustering, and k-means clustering, the problem of traditional methods being unable to effectively explore data nonlinear logic and single clustering is solved, and more efficient load classification and electricity consumption behavior analysis is achieved.

CN119537979APending Publication Date: 2025-02-28TIELING POWER SUPPLY COMPANY OF STATE GRID LIAONING ELECTRIC POWER COMPANY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411443926.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

Traditional principal component analysis algorithms cannot effectively explore the nonlinear logic between data, and a single clustering algorithm cannot meet clustering efficiency and clustering quality at the same time.

Method used

The KPCA-based bilayer clustering algorithm is used to process data through KPCA dimensionality reduction. The outer layer uses the spectral clustering algorithm to obtain the morphological similarity load cluster, and the inner layer uses the k-means clustering algorithm to obtain the amplitude similarity load cluster.

Benefits of technology

It significantly improves the effectiveness and stability of clustering, can perform load classification more accurately, explore nonlinear logic between data, and enhances the effect of data dimensionality reduction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537979A_ABST
    Figure CN119537979A_ABST
Patent Text Reader

Abstract

The invention relates to a KPCA (Kernel Principal Component Analysis)-based double-layer clustering algorithm and application thereof in power consumption behavior analysis, and belongs to the technical field of energy. The method comprises the following steps of firstly completing nonlinear change on original data through a kernel function, mapping the original data to a high-dimensional linear feature space, and then performing feature extraction by using a KPCA algorithm to reduce the dimension of the data; a double-layer clustering algorithm is adopted, an outer layer adopts a spectral clustering algorithm based on cosine similarity to obtain a morphological similarity load class cluster, and an inner layer adopts a k-means clustering algorithm based on Euclidean distance on the basis of morphological similarity clustering of the outer layer to obtain an amplitude similarity load class cluster; and completing user power consumption behavior analysis. According to the method, the problems that a traditional principal component analysis algorithm cannot only consider linear correlation among variables, nonlinear logic among data is not explored, and a single clustering algorithm cannot meet clustering efficiency and clustering quality at the same time are solved, and the clustering effectiveness, stability and other aspects are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of energy technology, and in particular relates to a KPCA-based double-layer clustering algorithm and its application in power consumption behavior analysis. Background Art

[0002] In the era of energy Internet, by establishing a two-way information flow between the demand side of power users and the supply side of the power grid, promoting the development of "source-grid-load", and using big data analysis technology to mine the effective value of information, we can achieve a win-win situation for power supply and demand. As a bridge between the supply and demand sides, power distribution data has important reference value for load analysis and planning, demand-side response, and other tasks of the power system. However, traditional analysis methods such as data dimensionality reduction processing and clustering analysis still have problems such as unsatisfactory dimensionality reduction effect and poor clustering efficiency. Specifically, the traditional principal component analysis algorithm cannot only consider the linear correlation between variables, and does not explore the nonlinear logic between data; a single clustering algorithm cannot simultaneously meet the clustering efficiency and clustering quality. Summary of the invention

[0003] In view of the shortcomings of the prior art, the present invention provides a two-layer clustering algorithm based on KPCA, which solves the problem that the traditional principal component analysis algorithm cannot only consider the linear correlation between variables, does not explore the nonlinear logic between data, and a single clustering algorithm cannot simultaneously meet the clustering efficiency and clustering quality, thereby significantly improving the clustering effectiveness and stability.

[0004] Another object of the present invention is to provide an application of a two-layer clustering algorithm based on KPCA dimensionality reduction in electricity consumption behavior analysis.

[0005] To achieve the above objectives, the present invention provides a two-layer clustering algorithm based on KPCA dimensionality reduction, comprising the following steps:

[0006] Step 1: Select power load data and perform KPCA dimensionality reduction to reduce the dimension of the data;

[0007] Step 2: A double-layer clustering algorithm was used. The outer layer used a spectral clustering algorithm based on cosine similarity to obtain morphological similarity load clusters. The inner layer used a k-means clustering algorithm based on Euclidean distance based on the outer layer morphological similarity clustering to obtain amplitude similarity load clusters.

[0008] Step 3: Complete the analysis of user electricity usage behavior.

[0009] Preferably, the step 1 is specifically:

[0010] Step 1.1: Use the kernel function to transform the original data into nonlinear form.

[0011] Let X j ∈Rm , j=1,2,…,N represents a set of zero-mean data. The kernel function realizes the mapping of point x to F through mapping. The conditions that the center data of the feature space needs to satisfy are shown in formula (1.1).

[0012]

[0013] Through nonlinear mapping, the covariance of the mapped data in the feature space is shown in formula (1.2).

[0014]

[0015] T is the transposition symbol;

[0016] C can be diagonalized by eigenvalue decomposition as shown in formula (1.3)

[0017]

[0018] In the formula, λ represents the eigenvalue and v represents the eigenvector.

[0019] Substituting formula (1.2) into formula (1.3) yields:

[0020]

[0021] Consider that all λ≠0 exist for φ(x1),φ(x2),…,φ(x N ), and express the result linearly as shown in equations (1.5) and (1.6).

[0022]

[0023]

[0024] Where, v = 1, 2, ..., N; a i is a constant coefficient.

[0025] Step 1.2, calculate the kernel matrix K through the kernel function

[0026] Define the N-order matrix K as shown in formula (1.7)

[0027] K iv =(φ(x i )·φ(x v )) (1.7)

[0028] Simplifying formula (1.7) we can get:

[0029] NλKα=K 2 α (1.8)

[0030] where α=[α1,α2,…,αN ] T is a constant coefficient matrix, N is the matrix order, in order to facilitate the solution

[0031] Simplifying formula (1.8) we can get:

[0032] Nλα=Kα (1.9)

[0033] By solving equation (1.9), we can get the corresponding eigenvalues ​​and eigenvectors, and the training sample φ(x) in the eigenvector space F V k The projection of the direction can be expressed as

[0034]

[0035] Replacing the inner product with the kernel function gives:

[0036]

[0037] If the assumption (1.1) is not true, then it is necessary to adjust φ (xi) for:

[0038]

[0039] Then the kernel matrix Ki v can be corrected as shown in formula (1.13).

[0040]

[0041] Where K iw K i1 , K i2 …K iN Kernel matrix, K wv K 1v ,K 2v …K Nv Kernel matrix, K w,τ K 1,1 ,K 2,2 …K N,N Kernel Matrix;

[0042] Step 1.3: Determine the number of nonlinear principal components by using the cumulative contribution of variance method (CPV)

[0043] The calculation formula is as follows:

[0044]

[0045] Where: is the contribution rate of the nonlinear principal component, which is the ratio of the sum of the largest eigenvalues ​​of the first P samples of the covariance matrix to the sum of all eigenvalues; in order to ensure that most of the valid information in the data can be retained, the principal component contribution rate threshold is usually set to CPV a ≥85%.

[0046] Preferably, the step 2 includes: determining the initial cluster center, determining the optimal number of clusters, inner layer spectral clustering and outer layer k-means clustering.

[0047] Preferably, the determination of the initialization cluster center is specifically as follows:

[0048] Step 2.1: Calculate the average distance between objects,

[0049]

[0050] In the formula, d(x i ,x j ) represents the object x i and x j The Euclidean distance between them; m is the total number of loads; It represents the number of all possible combinations of taking 2 objects from m objects;

[0051] Step 2.2: Calculate the density parameters for each object,

[0052]

[0053] Where deventy(p,M) represents the density parameter and U represents M-|p i -p|Function relationship, p represents any load data selected in the cycle; p i For other load data;

[0054] Step 2.3: Select the data object corresponding to the maximum value of the density parameter as the first cluster center, and calculate the distance between the object in the data set and the selected cluster center, and delete the data objects whose distance is less than M;

[0055] Step 2.4: Repeat steps 1-3. If the average distance is greater than the target value, it means that the distance between the sample points is far, and the k value is reduced; if the density is greater than the target value, it means that there are more cluster centers in the data set, and the k value is increased to finally obtain its initial cluster center.

[0056] The DBI index is used as the basis for selecting the number of inner clusters, and the calculation of the Euclidean distance in the DBI index is changed to cosine similarity as the basis for selecting the number of outer clusters, that is,

[0057]

[0058] In the formula, O i represents the standard error of the cosine distance between the i-th type of data and the cluster center; O j represents the standard error of the cosine distance between the j-th data and the cluster center; k represents the number of clusters; d cij Represents the cosine distance between the cluster centers of the i-th and j-th clusters; the process of selecting the optimal number of clusters includes the following steps:

[0059] Step 3.1, determine the maximum and minimum values ​​of the number of clusters;

[0060] Step 3.2, spectral clustering returns cluster categories;

[0061] Step 3.3, calculate the coordinates of the cluster center;

[0062] Step 3.4, calculate the cluster DBI / DBO index;

[0063] Step 3.5, determine whether the upper limit of the set number of clusters is reached; if reached, sort and select the best number of clusters; if not reached, add 1 to the number of clusters and return to step 3.2.

[0064] Preferably, the inner layer spectral clustering is specifically:

[0065] Step 4.1: Let vector a be (x1, y1) and vector b be (x2, y2) according to Calculate the similarity between load curves; select similarity criteria for similarity calculation, and convert the calculated distance into a square matrix

[0066] Step 4.2: Use the Gaussian kernel function to construct a similarity matrix instead of the adjacency matrix. The specific formula is:

[0067]

[0068] In the formula, sin(x i ,x j ) 2 is the element in the matrix obtained by the first similarity calculation; γ is the parameter of the Gaussian kernel function;

[0069] Step 4.3: Add the elements of each column of the similarity matrix and place them on the diagonal to obtain the degree matrix D;

[0070] Step 4.4: Obtain the Laplacian matrix:

[0071]

[0072] Step 4.5: Calculate the eigenvalues ​​of L and select the smallest K eigenvalues ​​to calculate the eigenvector;

[0073] Step 4.6: Perform k-means clustering on the feature vector.

[0074] Preferably, the outer layer k-means clustering is:

[0075] Assume that the data set is (x1, x2, …, x i ,…,x m ), and each x i is an n-dimensional vector. The purpose of K-means clustering is to divide the original data into k categories under the condition of a given cluster number k (k≤m), S={S1,S2,…,S k};

[0076] The clustering objective function is as follows:

[0077]

[0078] Where m represents the number of loads; r ic Indicates whether the fth sample point belongs to the cth class. If it does, then r ic =1, if it does not belong to r ic =0;μ c Represents the cluster center of the cth class; the specific algorithm steps are as follows:

[0079] Step 5.1: Randomly select k objects as initial cluster centers;

[0080] Step 5.2: The samples in the data are sorted according to the minimum distance principle, that is, Assigned to the nearest neighbor cluster;

[0081] Step 5.3: Recalculate the cluster center as the new cluster center according to the distribution results;

[0082] Step 5.4: Repeat steps 5.2 and 5.3 until the cluster center meets the error requirement or no longer changes, completing the classification of the power load.

[0083] The present invention has the following beneficial effects:

[0084] The present invention can explore the effect of nonlinear logic enhancement on data dimensionality reduction by considering the linear correlation between data variables.

[0085] The double-layer clustering algorithm of the present invention solves the problem that a single clustering algorithm cannot satisfy both clustering efficiency and clustering quality, thereby making load classification more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0086] Figure 1 is a flow chart of the method of the present invention;

[0087] Figure 2It is a block diagram of the double-layer clustering algorithm of the present invention;

[0088] Figure 3 The flowchart for selecting the optimal number of clusters of the present invention is as follows;

[0089] Figure 4 This is a schematic diagram of the clustering effectiveness index DBO in the application embodiment of the present invention;

[0090] Figure 5 A schematic diagram of a clustering effectiveness index DBI in an application example of the present invention;

[0091] Figure 6a-6h This is a schematic diagram of clustering results obtained by using the inner layer K-means clustering algorithm in an application example of the present invention. DETAILED DESCRIPTION

[0092] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0093] Example

[0094] The present invention provides a two-layer clustering algorithm based on KPCA dimensionality reduction, comprising the following steps:

[0095] Step 1: Select power load data and perform KPCA dimensionality reduction to reduce the dimension of the data;

[0096] Step 1.1: Use the kernel function to transform the original data into nonlinear form.

[0097] Let X j ∈R m , j=1,2,…,N represents a set of zero-mean data. The kernel function realizes the mapping of point x to F through mapping. The conditions that the center data of the feature space needs to satisfy are shown in formula (1.1).

[0098]

[0099] Through nonlinear mapping, the covariance of the mapped data in the feature space is shown in formula (1.2).

[0100]

[0101] T is the transposition symbol;

[0102] C can be diagonalized by eigenvalue decomposition as shown in formula (1.3)

[0103]

[0104] In the formula, λ represents the eigenvalue and v represents the eigenvector.

[0105] Substituting formula (1.2) into formula (1.3) yields:

[0106]

[0107] Consider that all λ≠0 exist for φ(x1),φ(x2),…,φ(x N ), and express the result linearly as shown in equations (1.5) and (1.6).

[0108]

[0109]

[0110] Where, v = 1, 2, ..., N; a i is a constant coefficient.

[0111] Step 1.2, calculate the kernel matrix K through the kernel function

[0112] Define the N-order matrix K as shown in formula (1.7)

[0113] K iv =(φ(x i )·φ(x v )) (1.7)

[0114] Simplifying formula (1.7) we can get:

[0115] NλKα=K 2 α (1.8)

[0116] where α=[α1,α2,…,α N ] T is a constant coefficient matrix, N is the matrix order, in order to facilitate the solution

[0117] Simplifying formula (1.8) we can get:

[0118] Nλα=Kα (1.9)

[0119] By solving equation (1.9), we can get the corresponding eigenvalues ​​and eigenvectors, and the training sample φ(x) in the eigenvector space F is V k The projection of the direction can be expressed as

[0120]

[0121] Replacing the inner product with the kernel function gives:

[0122]

[0123] If the assumption (1.1) is not true, then it is necessary to adjust φ(x i )for:

[0124]

[0125] Then the kernel matrix Ki v can be corrected as shown in formula (1.13).

[0126]

[0127] Where K iw K i1 , K i2 …K iN Kernel matrix, K wv K 1v ,K 2v …K Nv Kernel matrix, K w,τ K 1,1 ,K 2,2 …K N,N Kernel Matrix;

[0128] Step 1.3: Determine the number of nonlinear principal components by using the cumulative contribution of variance method (CPV)

[0129] The calculation formula is as follows:

[0130]

[0131] Where: is the contribution rate of the nonlinear principal component, which is the ratio of the sum of the largest eigenvalues ​​of the first P samples of the covariance matrix to the sum of all eigenvalues; in order to ensure that most of the valid information in the data can be retained, the principal component contribution rate threshold is usually set to CPV a ≥85%.

[0132] Step 2: A two-layer clustering algorithm was adopted. The outer layer adopted a spectral clustering algorithm based on cosine similarity to obtain morphological similarity load clusters. The inner layer adopted a k-means clustering algorithm based on Euclidean distance on the basis of the outer layer morphological similarity clustering to obtain amplitude similarity load clusters; including: determining the initial cluster center, determining the optimal number of clusters, inner layer spectral clustering and outer layer k-means clustering.

[0133] The specific step of determining the initialization cluster center is:

[0134] Step 2.1: Calculate the average distance between objects,

[0135]

[0136] In the formula, Represents object x i and x j The Euclidean distance between them; m is the total number of loads; It represents the number of all possible combinations of taking 2 objects from m objects;

[0137] Step 2.2: Calculate the density parameters for each object,

[0138]

[0139] Where deventy(p,M) represents the density parameter and U represents M-|p i -p|Function relationship, p represents any load data selected in the cycle; p i For other load data;

[0140] Step 2.3: Select the data object corresponding to the maximum value of the density parameter as the first cluster center, and calculate the distance between the object in the data set and the selected cluster center, and delete the data objects whose distance is less than M;

[0141] Step 2.4: Repeat steps 1-3. If the average distance is greater than the target value, it means that the distance between the sample points is far, and the k value should be reduced. If the density is greater than the target value, it means that there are more cluster centers in the data set, and the k value should be increased. Finally, the initial cluster center can be obtained.

[0142] The specific method for determining the optimal number of clusters is:

[0143] The DBI index considers both the differences between classes and the similarities within classes, and this index is insensitive to boundary points, so it is more suitable as an evaluation index for load clustering. Considering that the DBI index based on Euclidean distance is not suitable for clustering effectiveness evaluation based on cosine distance, the DBI index is used as the basis for selecting the number of inner clusters, and the calculation of Euclidean distance in the DBI index is changed to cosine similarity as the basis for selecting the number of outer clusters, that is,

[0144]

[0145] In the formula, O i represents the standard error of the cosine distance between the i-th type of data and the cluster center; O j represents the standard error of the cosine distance between the j-th data and the cluster center; k represents the number of clusters; d cij Represents the cosine distance between the cluster centers of the i-th and j-th clusters; the process of selecting the optimal number of clusters includes the following steps:

[0146] Step 3.1, determine the maximum and minimum values ​​of the number of clusters;

[0147] Step 3.2, spectral clustering returns cluster categories;

[0148] Step 3.3, calculate the coordinates of the cluster center;

[0149] Step 3.4, calculate the cluster DBI / DBO index;

[0150] Step 3.5, determine whether the upper limit of the set number of clusters is reached; if reached, sort and select the best number of clusters; if not reached, add 1 to the number of clusters and return to step 3.2.

[0151] Spectral clustering is a clustering algorithm based on graph theory. It represents data as nodes in a graph, divides data samples according to the similarity between nodes, and finally clusters them according to the eigenvectors of the Laplace matrix. The algorithm complexity for clustering high-dimensional data is lower than that of traditional clustering algorithms. The inner spectral clustering is specifically as follows:

[0152] Step 4.1: Let vector a be Vector b is (x2, y2) according to Calculate the similarity between load curves; select similarity criteria for similarity calculation, and convert the calculated distance into a square matrix

[0153] Step 4.2: Use the Gaussian kernel function to construct a similarity matrix instead of the adjacency matrix. The specific formula is:

[0154]

[0155] In the formula, sin(x i ,x j ) 2 is the element in the matrix obtained by the first similarity calculation; γ is the parameter of the Gaussian kernel function;

[0156] Step 4.3: Add the elements of each column of the similarity matrix and place them on the diagonal to obtain the degree matrix D;

[0157] Step 4.4: Obtain the Laplacian matrix:

[0158]

[0159] Step 4.5: Calculate the eigenvalues ​​of L and select the smallest K eigenvalues ​​to calculate the eigenvector;

[0160] Step 4.6: Perform k-means clustering on the feature vector.

[0161] The outer layer k-means clustering is that the k-means clustering algorithm adopts a distance criterion when clustering data, that is, it is considered that the smaller the distance, the greater the similarity of the data participating in the clustering.

[0162] Assume that the data set is (x1, x2, …, x i ,…,x m ), and each x i is an n-dimensional vector. The purpose of K-means clustering is to divide the original data into k categories under the condition of a given cluster number k (k≤m), S={S1,S2,…,S k};

[0163] The clustering objective function is as follows:

[0164]

[0165] Where m represents the number of loads; r ic Indicates whether the fth sample point belongs to the cth class. If it does, then r ic =1, if it does not belong to r ic =0;μ c Represents the cluster center of the cth class; the specific algorithm steps are as follows:

[0166] Step 5.1: Randomly select k objects as initial cluster centers;

[0167] Step 5.2: The samples in the data are sorted according to the minimum distance principle, that is, Assigned to the nearest neighbor cluster;

[0168] Step 5.3: Recalculate the cluster center as the new cluster center according to the distribution results;

[0169] Step 5.4: Repeat steps 5.2 and 5.3 until the cluster center meets the error requirement or no longer changes, completing the classification of the power load.

[0170] Step 3: Complete the analysis of user electricity usage behavior.

[0171] Application Examples

[0172] 300 sets of load data from a certain region on April 2, 2020 were selected for case analysis. First, the KPCA dimensionality reduction algorithm was used to reduce the dimension, and then the double-layer clustering was used to cluster the reduced-dimensional data set. The optimal number of clusters for the outer layer clustering was determined according to the corresponding clustering effectiveness index. The clustering effectiveness index DBO is as follows: Figure 4 shown.

[0173] Depend on Figure 4 It can be seen that the number of clusters when the DBO index is the minimum is 7, so the optimal number of clusters selected by the outer clustering is 7. According to the selected optimal number of clusters, the outer spectral clustering algorithm is used.

[0174] Perform inner clustering on each outer cluster, and determine the optimal number of inner clusters according to the corresponding clustering effectiveness index. The clustering effectiveness index DBI is as follows: Figure 5 shown.

[0175] Depend on Figure 5 It can be seen that the number of clusters when the DBI index is the minimum value is 2, 3, 6, 6, 3, 5, 3, respectively. Therefore, the optimal number of clusters selected by the inner clustering is 2, 3, 6, 6, 3, 5, 3, respectively. According to the selected optimal number of clusters. Using the inner K-means clustering algorithm, the clustering results are as follows Figure 6a-6h .

[0176] After mining and analyzing the characteristics of the user's electricity consumption pattern, the adjustable users are selected, mainly for customers with single peak, single peak stable and double peak and large electricity consumption. Users with such characteristics mainly adopt one-shift and two-shift production systems. At the same time, because of their large electricity consumption, compared with users with small electricity consumption, they can play a greater role in actual peak shifting. The typical load curve after clustering of each user is used to represent the load characteristics of each user, and the total electricity consumption of each user is calculated separately. Develop different levels of peak shifting plans. Move the peak load to the valley period. After peak shifting, under the condition that the total electricity consumption of each user remains unchanged, part of the load can be pushed to the valley period of the whole network load, which helps to reduce the peak-valley difference of the whole network load and improve the stability of the whole network load. At the same time, on the basis of implementing the peak-valley electricity price strategy, the enterprise will adjust part of the production operation time to the low electricity consumption period, which has achieved a certain degree of cost savings from the perspective of the large electricity consumption enterprise itself, and can bring actual economic benefits to users.

[0177] It should be noted that, in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise", or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article, or device. In the absence of further restrictions, the elements defined by the sentence "including a reference structure" do not exclude the existence of other identical elements in the process, method, article, or device including the elements.

[0178] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and alterations may be made to the embodiments without departing from the principles and spirit of the invention, the scope of the invention being defined by the appended claims and their equivalents.

Claims

1. A two-layer clustering algorithm based on KPCA, characterized by The following steps are involved: Step 1: Select power load data and perform KPCA dimensionality reduction to reduce the dimension of the data; Step 2: A double-layer clustering algorithm was used. The outer layer used a spectral clustering algorithm based on cosine similarity to obtain morphological similarity load clusters. The inner layer used a k-means clustering algorithm based on Euclidean distance based on the outer layer morphological similarity clustering to obtain amplitude similarity load clusters. Step 3: Complete the analysis of user electricity usage behavior.

2. A two-layer clustering algorithm based on KPCA according to claim 1, characterized in that: The step 1 is specifically as follows: Step 1.1, the original data is transformed nonlinearly through the kernel function. Let X j ∈R m , j = 1, 2, ..., N represents a set of zero-mean data. The kernel function realizes the mapping of point x to the newly generated principal component F through mapping. The conditions that the obtained feature space center data needs to meet are shown in formula (1.1); Through nonlinear mapping, the covariance of the mapped data in the feature space is shown in formula (1.2); T is the transposition symbol; C can be diagonalized by eigenvalue decomposition as shown in formula (1.3) In the formula, λ represents the eigenvalue, and v represents the eigenvector; Substituting formula (1.2) into formula (1.3) yields: Consider that all λ≠0 exist for φ(x1),φ(x2),…,φ(x N ), and express the result linearly as shown in equations (1.5) and (1.6). Where, v = 1, 2, ..., N; a i is a constant coefficient. Step 1.2, calculate the kernel matrix K through the kernel function Define the N-order matrix K as shown in formula (1.7) K iv =(φ(x i )·φ(x v )) (1.7) Simplifying formula (1.7) we can get: NλKα=K 2 a (1.8) where α=[α1,α2,…,α N ] T is a constant coefficient matrix, N is the matrix order, in order to facilitate the solution Simplifying formula (1.8) we can get: Nλα=Kα (1.9) By solving equation (1.9), we can get the corresponding eigenvalues ​​and eigenvectors, and the training sample φ(x) in the eigenvector space F V k The projection of the direction can be expressed as Replacing the inner product with the kernel function gives: If the assumption (1.1) is not true, then it is necessary to adjust φ (xi) for: Then the kernel matrix K can be modified iv As shown in formula (1.13). Where K iw K i1 , K i2 …K iN Kernel matrix, K wv K 1v ,K 2v …K Nv Kernel matrix, K w,τ K 1,1 ,K 2,2 …K N,N Kernel Matrix; Step 1.3: Determine the number of nonlinear principal components by using the cumulative contribution of variance method (CPV) The calculation formula is as follows: Where: is the contribution rate of the nonlinear principal component, which is the ratio of the sum of the largest eigenvalues ​​of the first P samples of the covariance matrix to the sum of all eigenvalues; in order to ensure that most of the valid information in the data can be retained, the principal component contribution rate threshold is usually set to CPV a ≥85%.

3. A two-layer clustering algorithm based on KPCA according to claim 1, characterized in that: The second step includes: determining the initial cluster center, determining the optimal number of clusters, inner spectral clustering and outer k-means clustering.

4. A two-layer clustering algorithm based on KPCA according to claim 3, characterized in that: The specific step of determining the initialization cluster center is: Step 2.1: Calculate the average distance between objects, In the formula, Represents object x i and x j The Euclidean distance between them; m is the total number of loads; It represents the number of all possible combinations of taking two objects from m objects; Step 2.2: Calculate the density parameters for each object, Where deventy(p,M) represents the density parameter and U represents M-|p i -p|Function relationship, p represents any load data selected in the cycle; p i For other load data; Step 2.3: Select the data object corresponding to the maximum value of the density parameter as the first cluster center, and calculate the distance between the object in the data set and the selected cluster center, and delete the data objects whose distance is less than M; Step 2.4: Repeat steps 1-3. If the average distance is greater than the target value, it means that the distance between the sample points is far, and the k value is reduced; if the density is greater than the target value, it means that there are more cluster centers in the data set, and the k value is increased to finally obtain its initial cluster center.

5. A two-layer clustering algorithm based on KPCA according to claim 3, characterized in that: The specific method for determining the optimal number of clusters is: The DBI index is used as the basis for selecting the number of inner clusters, and the calculation of the Euclidean distance in the DBI index is changed to cosine similarity as the basis for selecting the number of outer clusters, that is, In the formula, O i represents the standard error of the cosine distance between the i-th type of data and the cluster center; O j represents the standard error of the cosine distance between the j-th data and the cluster center; k represents the number of clusters; d cij Represents the cosine distance between the cluster centers of the i-th and j-th clusters; the process of selecting the optimal number of clusters includes the following steps: Step 3.1, determine the maximum and minimum values ​​of the number of clusters; Step 3.2, spectral clustering returns cluster categories; Step 3.3, calculate the coordinates of the cluster center; Step 3.4, calculate the cluster DBI / DBO index; Step 3.5, determine whether the upper limit of the set number of clusters has been reached; If it is reached, sort and select the best number of clusters; if it is not reached, add 1 to the number of clusters and return to step 3.

2.

6. A two-layer clustering algorithm based on KPCA according to claim 3, characterized in that: The inner layer spectral clustering is specifically as follows: Step 4.1: Let vector a be (x1, y1) and vector b be (x2, y2) according to Calculate the similarity between load curves; Use similarity criterion to calculate similarity, and convert the calculated distance into a square matrix Step 4.2: Use the Gaussian kernel function to construct a similarity matrix instead of the adjacency matrix. The specific formula is: In the formula, sin(x i ,x j ) 2 is the element in the matrix obtained by the first similarity calculation; γ is the parameter of the Gaussian kernel function; Step 4.3: Add the elements of each column of the similarity matrix and place them on the diagonal to obtain the degree matrix D; Step 4.4: Obtain the Laplacian matrix: Step 4.5: Calculate the eigenvalues ​​of L and select the smallest K eigenvalues ​​to calculate the eigenvector; Step 4.6: Perform k-means clustering on the feature vector.

7. A two-layer clustering algorithm based on KPCA according to claim 3, characterized in that: The outer layer k-means clustering is: Assume that the data set is (x1, x2, …, x i ,…,x m ), and each x i is an n-dimensional vector. The purpose of K-means clustering is to divide the original data into k categories under the condition of a given cluster number k (k≤m), S={S1,S2,…,S k }; The clustering objective function is as follows: Where m represents the number of loads; r ic Indicates whether the fth sample point belongs to the cth class. If it does, then r ic =1, if it does not belong to r ic =0;μ c Represents the cluster center of the cth class; the specific algorithm steps are as follows: Step 5.1: Randomly select k objects as initial cluster centers; Step 5.2: The samples in the data are sorted according to the minimum distance principle, that is, Assigned to the nearest neighbor cluster; Step 5.3: Recalculate the cluster center as the new cluster center according to the distribution results; Step 5.4: Repeat steps 5.2 and 5.3 until the cluster center meets the error requirement or no longer changes, completing the classification of the power load.

8. A two-layer clustering algorithm based on KPCA according to claim 1, characterized in that: Application in electricity consumption behavior analysis.