A method for analyzing user electricity consumption behavior based on density peak clustering based on shared neighbors and attraction
Through the combination of principal component analysis and DPC-SNA algorithm, the accuracy problem of clustering algorithms in the existing technology under high-dimensional and noisy data is solved, and accurate analysis of power consumption behavior and reasonable planning of smart grids are achieved.
Patent Information
- Application Number
- CN202111552838.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-17
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-12-17
AI Technical Summary
Existing clustering algorithms have problems such as sensitive initial parameters, poor noise robustness, and poor clustering accuracy in power consumption behavior analysis. In particular, it is difficult to accurately allocate samples when processing high-dimensional, noisy power load data. .
Principal component analysis (PCA) is used to reduce the dimensionality of data, and the density peak clustering (DPC-SNA) algorithm based on shared neighbor and attraction is used to cluster the dimensionally reduced data, and the shared neighbor similarity and attraction are used to cluster the reduced data. The matrix is used for sample allocation, which reduces the impact of the truncation distance threshold and improves the accuracy of the clustering results.
It effectively distinguishes the power consumption behavior characteristics of different users, improves clustering accuracy, provides reasonable smart grid planning suggestions, and improves smart grid management and operation and power equipment maintenance support.
Smart Images

Figure CN114417970B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of power data detection, and in particular relates to a user power consumption behavior analysis method based on density peak clustering of shared neighbors and attraction. Background Art
[0002] In recent years, with the construction and development of smart grids, numerous data acquisition sensors have been installed and deployed in various links of the power system, and a large amount of power data has been acquired. These data are growing exponentially with the continuous expansion of the collection and monitoring scope and the continuous increase of monitoring indicators, and are the main source of power big data. How to mine the effective information and implicit rules in power big data and apply them to practical guidance has far-reaching significance for the management and operation of smart grids and the sustainable development of power users.
[0003] At present, power big data has been widely used in power load forecasting, power anomaly detection and power consumption behavior analysis. Power load forecasting refers to estimating and predicting the power load at a certain moment in the future based on the system operation characteristics, historical load data and other influencing factors, under certain prediction accuracy requirements, and based on the development trends of future meteorological, economic and other factors. Power anomaly detection is to find abnormal power consumption behaviors by comparing data similarities based on the power consumption patterns mined from the user's historical power consumption data. As the basis of power load forecasting and power anomaly detection, power consumption behavior analysis analyzes the information reflected by the user's power load curve, mines the user's power consumption behavior characteristics, and provides multi-faceted support for the planning and operation of smart grids, the maintenance of power equipment, and the optimization of user services. This paper takes the user's daily load data as the research and analysis object of its power consumption behavior characteristics.
[0004] In the related research on user electricity consumption behavior analysis, many scholars have extracted the electricity consumption characteristics of users through clustering algorithms. The commonly used clustering algorithms in electricity consumption behavior analysis mainly include partition-based clustering such as K-means, hierarchical clustering such as Chameleon, model-based clustering such as GMM, and density-based clustering such as DBSCAN. However, these clustering algorithms have defects such as sensitivity to initial parameters, poor noise robustness, and poor clustering accuracy.
[0005] In 2014, Alex Rodriguez and Alessandro Laio published a Clustering by fast search and find of density peaks algorithm in Science, referred to as the Density Peaks Clustering (DPC) algorithm. The algorithm is based on two assumptions: samples with higher density in the cluster are distributed near the center of the cluster; the distance between the centers of different clusters is relatively far. Based on the above two assumptions, the DPC algorithm only needs to pre-set a parameter to find the center of the cluster and quickly complete the sample allocation. However, the DPC algorithm has the following defects in the clustering process: the definition of local density depends on the selection of the cutoff distance threshold, and the selection of the threshold is sensitive to the local density; the allocation strategy of the DPC algorithm is prone to sample allocation errors. Summary of the invention
[0006] The purpose of the present invention is to provide a user electricity consumption behavior analysis method based on density peak clustering of shared neighbors and attraction. In view of the high dimensionality, noise and multiple redundancy of electricity load data, the principal component analysis (PCA) method is introduced to reduce the dimension of the data; the DPC-SNA algorithm is used to cluster the reduced data to obtain the clustering results of the user electricity load curve; finally, the electricity load curve results are analyzed and 5 typical electricity consumption behavior characteristics are summarized, thereby giving reasonable smart grid planning suggestions for different user electricity consumption behavior characteristics.
[0007] To achieve the above purpose, the technical solution adopted by the present invention is: a user electricity consumption behavior analysis method based on shared neighbor and attraction density peak clustering, the steps are as follows:
[0008] Step 1: Preprocess the user's electricity load data, interpolate missing data, and eliminate invalid data;
[0009] Step 2: Use PCA technology to reduce the dimension of load data, calculate the characteristic matrix, and extract its principal components;
[0010] Step 3: Using the reduced-dimensional data as input, clustering is performed using the local density and attraction allocation strategy of the shared nearest neighbors of the DPC-SNA algorithm;
[0011] Step 4: Analyze the clustering results, reconstruct the user's power load curve, and analyze the user's power consumption behavior.
[0012] Furthermore, the process of the DPC-SNA algorithm in step 3 is as follows:
[0013] (1) Input the reduced-dimensional dataset data and the number of sample neighbors K.
[0014] (2) Normalize the data;
[0015] (3) Calculate the Euclidean distance d between samples ij ;
[0016] (4) By sharing the local density of the nearest neighbors, the sample X i The shared neighbor similarity S(i,j) is accumulated to obtain the sample X i The local density ρ i value, according to the local density ρ i , take the local density greater than ρ of sample i i And the distance to its nearest point is taken as sample X i The relative distance δ i ; After arranging all samples in descending order of density, the relative distance of the sample with the highest density is set to the maximum value, that is, the δ i value;
[0017] (5) Calculate ρ for all samples i and δ i After the value, ρ i As the abscissa, δ i As the vertical axis, establish a decision diagram and select ρ i and δ i The larger points are taken as density peaks, i.e., cluster centers, or through γ i Select the density peak;
[0018] (6) Considering the samples as particles, all samples in the data set have attraction. The shared neighbor similarity between samples is introduced into the sample attraction calculation to obtain the sample attraction matrix;
[0019] (7) Find the core sample with the largest attraction to the assigned sample in the attraction matrix and assign it to the cluster where the assigned sample is located;
[0020] (8) When the attraction between all allocated samples and unallocated samples reaches zero, go to step (9); otherwise, go to step (7) to find the sample with the largest attraction again and continue the allocation;
[0021] (9) The remaining samples are allocated using the allocation strategy of the DPC algorithm;
[0022] (10) Output the final clustering results.
[0023] Furthermore, i The calculation formula is Where S(i,j) is the sample X iThe shared neighbor similarity of sample X i The greater the shared neighbor similarity, the more samples there are around X. i Nearby, that is, X i The higher the local density.
[0024] Furthermore, the method for calculating the shared neighbor similarity S(i,j) is to form a set KNN(i) of the K nearest samples of sample i, and a set KNN(j) of the K nearest samples of sample j. The intersection of KNN(i) and KNN(j) is the shared neighbor SNN(i,j) of sample i and sample j. Then, according to the distribution characteristics of the K nearest neighbor set KNN(i) of sample i and the distribution characteristics of the K nearest neighbor set KNN(j) of sample j, the shared neighbor SNN(i,j) of sample i and sample j is weighted to obtain the shared neighbor similarity S(i,j) of sample i and sample j.
[0025] Furthermore, the calculation formula of the shared nearest neighbor SNN(i,j) of each sample in the data set is SNN(i,j)=KNN(i)∩KNN(j); the calculation formula of the shared nearest neighbor similarity S(i,j) is In the formula Characterizes the membership of sample i’s K nearest neighbor samples to sample j, The membership of K nearest neighbor samples of sample j to sample i is characterized, and the sum of the two memberships is used as the weight to weight the shared neighbor SNN (i, j) to obtain the shared neighbor similarity of the two samples.
[0026] Furthermore, in step 4, the user power consumption behavior analysis is classified according to the daily power consumption time nodes and the peak and off-peak seasons, and the power distribution quota is recommended according to the peak value of the power load curve of different types of users.
[0027] Furthermore, in step one, the missing data are interpolated using the mean interpolation method, that is, the mean of the data at the three previous and subsequent time points is used for interpolation; the invalid data refers to the data of users who did not use electricity.
[0028] Furthermore, γ i The definition of γ is as follows i =ρ i ·δ i shown.
[0029] Compared with the prior art, the present invention has the following beneficial effects: 1. Aiming at the high dimensionality, noise and multi-redundancy characteristics of power load data, the present invention introduces the principal component analysis (PCA) method to reduce the dimension of the data; the DPC-SNA algorithm is used to cluster the data after dimensionality reduction to obtain the clustering results of the user power load curve; finally, the power load curve results are analyzed to summarize the typical power consumption behavior characteristics, and reasonable smart grid planning suggestions are given for the power consumption behavior characteristics of different users. 2. The present invention adopts the DPC-SNA algorithm to construct a sample similarity measurement criterion of shared neighbor similarity, and defines the local density accordingly. The new local density can effectively distinguish the contribution of local samples and global samples to it, and at the same time eliminates the influence of the selection of the truncation distance threshold on the local density. 3. The present invention defines the sample attraction that integrates the idea of universal gravitation, and relies on the attraction matrix to distribute the remaining samples to ensure the accuracy of the clustering results. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is a schematic diagram of the user electricity consumption behavior analysis process of the present invention;
[0031] Figure 2 This is a schematic diagram of the evening peak production mode for type A users of the present invention;
[0032] Figure 3 This is a schematic diagram of the full-day production of type B users of the present invention;
[0033] Figure 4 This is a schematic diagram of multi-peak production of type C users of the present invention;
[0034] Figure 5 This is a schematic diagram of the daytime production of a D-type user of the present invention;
[0035] Figure 6 This is a schematic diagram of the night production of the E-type user of the present invention; DETAILED DESCRIPTION
[0036] In order to verify the performance of the DPC-SNA algorithm in analyzing user electricity consumption behavior, the present invention selected 19,200 daily electricity load data of 400 households in a certain area of Jiangxi Province in July 2020 for experiment. The data collection frequency is 30 minutes, and 48 data points are collected every day. The load data at each moment can be regarded as a dimension to form a load curve for one day. The analysis is performed according to the analysis method of the present invention, and the steps are as follows:
[0037] Reference Figure 1 ,Step 1: For the missing load power data, the mean interpolation method is used to interpolate the data using the mean of the data at the three time points before and after; secondly, the users who are not working all day are identified, labeled and removed. After data preprocessing, this case contains 16,608 valid daily power load data of 364 households.
[0038] Step 2: Extract the principal components of the data based on the characteristic matrix of the principal component analysis technology. When 12 principal components are selected, the cumulative variance contribution rate reaches 90.5%. Therefore, the experiment selects the first 12 principal components of the PCA characteristic matrix, thereby reducing the data from 48 dimensions to 12 dimensions as the original input for the subsequent DPC-SNA algorithm clustering.
[0039] Step 3: (1) Input the reduced-dimensional dataset data and the number of sample neighbors K.
[0040] (2) Normalize the data;
[0041] (3) Calculate the Euclidean distance d between samples ij ;
[0042] (4) According to the formula SNN(i,j)=KNN(i)∩KNN(j), the K nearest samples of sample i are grouped into a set KNN(i), and the K nearest samples of sample j are grouped into a set KNN(j). The intersection of KNN(i) and KNN(j) is the shared nearest neighbor SNN(i,j) of sample i and sample j. Then according to the formula The distribution characteristics of the K nearest neighbor set KNN(i) of sample i and the distribution characteristics of the K nearest neighbor set KNN(j) of sample j are weighted to obtain the shared nearest neighbor similarity S(i,j) of sample i and sample j, where Characterizes the membership of sample i’s K nearest neighbor samples to sample j, Characterize the membership of sample j's K nearest neighbor samples to sample i, and use the sum of the two memberships as the weight to weight the shared neighbor SNN (i, j) to obtain the shared neighbor similarity of the two samples; then use the local density of the shared neighbor to calculate the similarity according to the formula The sample X i The shared neighbor similarity S(i,j) is accumulated to obtain the sample X i The local density ρ i value, according to the local density ρ i , take the local density greater than the sample ρ i And the distance i from its nearest point is taken as sample X i The relative distance δ i ; After arranging all samples in descending order of density, the relative distance of the sample with the highest density is set to the maximum value, that is, the δ i value;
[0043] (5) Calculate ρ for all samples i and δ i After the value, ρ i As the abscissa, δ iAs the vertical axis, establish a decision diagram and select ρ i and δ i The larger points are taken as density peaks, i.e., cluster centers, or through γ i Select the density peak; γ i The definition of γ is i =ρ i ·δ i ;
[0044] (6) Considering the samples as particles, all samples in the data set have attraction. The shared neighbor similarity between samples is introduced into the sample attraction calculation to obtain the sample attraction matrix;
[0045] (7) Find the core sample with the largest attraction to the assigned sample in the attraction matrix and assign it to the cluster where the assigned sample is located;
[0046] (8) When the attraction between all allocated samples and unallocated samples reaches zero, go to step (9); otherwise, go to step (7) to find the sample with the largest attraction again and continue the allocation;
[0047] (9) The remaining samples are allocated using the allocation strategy of the DPC algorithm;
[0048] (10) The final clustering results are output as follows:
[0049]
[0050] According to the reduced dimension data in step 2 above, the K-means algorithm, DPC algorithm and DPC-SNA algorithm are used again for clustering, and the Davies-Bouldin Index (DBI) values of the three algorithms are compared. DBI is an internal evaluation index of clustering algorithm performance, which can be used to evaluate clustering results without prior categories. DBI uses the degree of clustering within the cluster and the degree of dispersion between clusters as evaluation criteria. The smaller the value, the better the clustering performance of the algorithm.
[0051] The final clustering results of the three clustering algorithms are as follows
[0052] Table 1. DBI values of three clustering algorithms
[0053]
[0054] Table 1 shows the DBI values of the optimal clustering results of the K-means algorithm, the DPC algorithm and the DPC-SNA algorithm in the reduced dimension load data. The "parameter" column in Table 1 gives the parameter values when the optimal clustering results are obtained. The "parameter" of the K-means algorithm refers to the number of clusters, indicating that its DBI is optimal when 10 clusters are clustered; the "parameter" of the DPC algorithm refers to the value of the cutoff distance, and when the cutoff distance is 4.4, a good DBI is obtained; the "parameter" of the DPC-SNA algorithm is the number of neighbors, and when the number of neighbors is 18, the DBI value is optimal. It can be seen from Table 1 that the DPC-SNA algorithm proposed in the present invention has a clustering accuracy that is 49.59% higher than that of the K-means algorithm and 39.41% higher than that of the DPC algorithm, that is, the DPC-SNA algorithm has a better clustering effect.
[0055] Step 4: The DPC-SNA algorithm obtains the optimal DBI value and divides the 364 electricity users into five categories. The number and proportion of samples in each category are shown in Table 2.
[0056] Table 2. Sample distribution of DPC-SNA algorithm clustering results. As can be seen from Table 2, the DPC-SNA algorithm clustering results belong to the five types of A, B, C, D, and E.
[0057]
[0058] The number of cluster samples are 205, 39, 8, 79 and 33, accounting for 56.32%, 10.71%, 2.20%, 21.70% and 9.07% of the total samples respectively.
[0059] Business analysis of various types of typical users
[0060] The power load curve of various types of typical users in the region in July 2020 is shown in Figure (2). As can be seen from the figure, there are 5 types of users in the region, and the power consumption characteristics of different users are quite different.
[0061] in, Figures 2 to 6 They correspond to the clustering result label types A to E in the above label 2 respectively.
[0062] Will Figure 2 Type A is defined as a production user facing the evening peak. The electricity load of this type of user begins to increase in the evening, with the peak time period from 19:00 to 22:00, and the peak electricity consumption reaches 20:00. The representative industries of Type A are the catering industry and urban residents' daily electricity consumption, and high-power appliances such as induction cookers and air conditioners are their main sources of electricity consumption.
[0063] Figure 3Type B is defined as a full-day production user. This type of user is in high-load production all day, with a long peak in electricity consumption, and only takes a short break at the turn of night and day. Representative industries of Type B are hospitals and Internet access-related services, whose large equipment needs to operate continuously without interruption.
[0064] Figure 4 Type C is defined as a multi-peak production user. This type of user has multiple peak electricity consumption throughout the day, which is common in public services and management organizations, and its electricity demand varies greatly in different time periods.
[0065] Figure 5 Type D is defined as a daytime production user. The production activities of this type of user are mainly concentrated in the daytime, and the peak electricity consumption is concentrated between 10 am and 4 pm. The iconic industries of Type D are agricultural, forestry, animal husbandry and fishery product wholesale and food and beverage wholesale, and their storage and transportation equipment are the main sources of electricity consumption.
[0066] Figure 6 Type E is defined as night production users. The electricity load of this type of user is lower during the day, but much higher at night. The representative industry of type E is the chemical manufacturing industry. There are a large number of high-energy-consuming electrical equipment in the chemical manufacturing process, so this industry chooses to produce at night when the electricity price is lower.
[0067] Table 3 shows typical users of five types of electricity load in a certain area of Jiangxi Province in July 2020. Figure 2 From Table 2 and Table 3, we can find that among all users in the region, the number of late peak production users is the highest, exceeding the sum of the other four types. In addition to urban residents' electricity consumption and catering industry, public lighting and household appliances and electronic product retail also reach peaks in the evening. The late peak production users in the region are in the peak season, and their daily load curve peaks are concentrated between 18:00 and 22:00. The smart grid should appropriately increase the evening peak power distribution share according to the distribution area of late peak production users to meet the large electricity demand of this type of users.
[0068] Table 3. Typical users of five types of electricity load
[0069]
[0070] The proportion of daytime production users is second only to evening peak production users. This type includes product wholesale, water conservancy management and small manufacturing industries, accounting for more than one-fifth of the total, and the peak electricity consumption is mainly at noon. Smart grids can increase the share of noon distribution to ensure that daytime production users in the region can produce normally.
[0071] The multi-peak production type accounts for the lowest proportion. The public service industry is greatly affected by the flow of people and has greater uncertainty, resulting in its peak power consumption being distributed in multiple time periods. This type of user is in the off-season, and the smart grid can appropriately reduce its power distribution share throughout the day.
[0072] The proportion of all-day production users and night production users is relatively close. The former mainly includes users in continuously operating industries such as hospitals and the Internet, while the latter includes high-energy-consuming users at night such as municipal engineering and chemical plants. All-day production users must have a stable power supply, so the power grid needs to increase the maintenance and inspection of power supply facilities in the areas where this type of users are located to ensure uninterrupted and continuous power supply. However, night production users are limited by factors such as time and energy consumption, and tend to produce during residents' non-working hours. The power grid can consider the peak power consumption and provide lower peak-valley electricity prices for this type of users, which not only reduces the user's electricity cost, but also reduces the peak power consumption pressure of the power grid.
[0073] In view of the complex characteristics of high latitude, noise and multiple redundancy of power load data, the present invention uses the principal component analysis method to screen out the main features of power load data and reduce the dimension, and then uses the density peak clustering algorithm based on shared nearest neighbors and attraction to complete the cluster analysis of the reduced-dimensional data. The DPC-SNA algorithm first constructs a weighted shared nearest neighbor to calculate the similarity of samples, thereby distinguishing the contribution of local samples and global samples to local density; secondly, it integrates the idea of universal gravitation and redefines a sample attraction. Samples are allocated to clusters based on the attraction matrix, making the allocation of samples from different clusters more accurate. The experimental results of power load data show that the algorithm of the present invention can distinguish the power consumption behavior characteristics of different users and give the load peak time period of the corresponding type of users, verifying the effectiveness of the algorithm of the present invention.
[0074] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for analyzing user electricity consumption behavior based on density peak clustering based on shared neighbors and attraction, Its characteristic is that the steps as follows: Step 1: Preprocess the user's electricity load data, interpolate missing data, and eliminate invalid data; Step 2: Use PCA technology to reduce the dimension of load data, calculate the characteristic matrix, and extract its principal components; Step 3: Using the reduced-dimensional data as input, clustering is performed using the local density and attraction allocation strategy of the shared nearest neighbors of the DPC-SNA algorithm; Step 4: Analyze the clustering results, reconstruct the user's power load curve, and analyze the user's power consumption behavior; The process of the DPC-SNA algorithm in step 3 is as follows: (1) Input the reduced-dimensional dataset data and the number of sample neighbors K; (2) Normalize the data; (3) Calculate the Euclidean distance d between samples ij ; (4) By sharing the local density of the nearest neighbors, the sample X i The shared neighbor similarity S(i,j) is accumulated to obtain the sample X i The local density ρ i value, according to the local density ρ i , take the local density greater than sample i i And the distance to its nearest point is taken as sample X i The relative distance δ i ; After arranging all samples in descending order of density, the relative distance of the sample with the highest density is set to the maximum value, that is, the δ i Value; i The calculation formula is Where S(i,j) is the sample X i The shared neighbor similarity of , N is the number of samples; (5) Calculate ρ for all samples i and δ i After the value, ρ i As the abscissa, δ i As the vertical axis, establish a decision diagram and select ρ i and δ i The larger points are taken as density peaks, i.e., cluster centers, or through γ i Select the density peak; (6) Considering the samples as particles, all samples in the data set have attraction. The shared neighbor similarity between samples is introduced into the sample attraction calculation to obtain the sample attraction matrix; (7) Find the core sample with the largest attraction to the assigned sample in the attraction matrix and assign it to the cluster where the assigned sample is located; (8) When the attraction between all allocated samples and unallocated samples reaches zero, go to step (9); otherwise, go to step (7) to find the sample with the largest attraction again and continue the allocation; (9) The remaining samples are allocated using the allocation strategy of the DPC algorithm; (10) Output the final clustering results.
2. According to claim 1, a method for analyzing user electricity consumption behavior based on density peak clustering of shared neighbors and attraction, Its characteristics are: The calculation method of shared neighbor similarity S(i,j) is as follows: the K nearest samples of sample i form a set KNN(i), and the K nearest samples of sample j form a set KNN(j). The intersection of KNN(i) and KNN(j) is the shared neighbor SNN(i,j) of sample i and sample j. Then, according to the distribution characteristics of the K nearest neighbor set KNN(i) of sample i and the distribution characteristics of the K nearest neighbor set KNN(j) of sample j, the shared neighbor SNN(i,j) of sample i and sample j is weighted to obtain the shared neighbor similarity S(i,j) of sample i and sample j.
3. According to claim 2, a method for analyzing user electricity consumption behavior based on density peak clustering based on shared neighbors and attraction, Its characteristics are: The calculation formula of shared neighbor SNN(i, j) is SNN(i, j) = KNN(i) ∩ KNN(j); the calculation formula of shared neighbor similarity S(i, j) is In the formula Characterizes the membership of sample i’s K nearest neighbor samples to sample j, The membership of K nearest neighbor samples of sample j to sample i is characterized, and the sum of the two memberships is used as the weight to weight the shared neighbor SNN (i, j) to obtain the shared neighbor similarity of the two samples.
4. According to claim 1, a method for analyzing user electricity consumption behavior based on density peak clustering of shared neighbors and attraction, Its characteristics are: In step 4, the user electricity consumption behavior analysis is classified according to the daily electricity consumption time nodes and the peak and off-peak seasons, and the power distribution quota is recommended according to the peak value of the electricity load curve of different types of users.
5. According to claim 1, a method for analyzing user electricity consumption behavior based on density peak clustering of shared neighbors and attraction, Its characteristics are: In step 1, the missing data are interpolated using the mean interpolation method, that is, the mean of the data at the three previous and next time points is used for interpolation; The invalid data refers to the data of users who do not use electricity.
6. The method for analyzing user electricity consumption behavior based on density peak clustering based on shared neighbors and attraction according to claim 1, Its characteristics are: γ i The definition of γ is as follows i =ρ i ·δ i shown.
