Industrial and commercial user electricity consumption behavior portrait analysis method based on data mining

Through the principal component analysis method and the improved K-means++ algorithm combined with the Elkan triangle theorem, the problem of slow clustering speed of massive users is solved, the rapid classification and portrait analysis of the electricity consumption behavior of industrial and commercial users is realized, and the clustering speed and accuracy are improved. .

CN118535937APending Publication Date: 2024-08-23STATE GRID ZHEJIANG TONGXIANG ELECTRIC POWER SUPPLY CO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410614365.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2024-08-23

Smart Images

  • Figure CN118535937A
    Figure CN118535937A
Patent Text Reader

Abstract

The invention discloses an industrial and commercial user electricity consumption behavior portrait analysis method based on data mining, and the method carries out the analysis and dimension reduction of the electricity consumption behavior characteristics of a large number of users through a data mining related algorithm, such as a principal component analysis method, and reduces the number of characteristics while maintaining the original characteristic information of the power users to the greatest extent. And meanwhile, the clustering speed of the industrial and commercial users is improved by improving the K-means + + algorithm, and the power consumption behavior portrait analysis of the industrial and commercial users is completed, so that the classification and the power consumption behavior portrait description of massive industrial and commercial users can be effectively completed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to fire fighting equipment, and in particular to a method for analyzing the electricity consumption behavior of industrial and commercial users based on data mining. Background Art

[0002] As the informatization process of my country's power industry continues to accelerate, the user data stored by power grid companies is increasing, the analysis cycle is gradually lengthening, and the processing difficulty is becoming higher and higher. With the help of user portrait analysis, we can gain in-depth insights into users' needs, habits and behavior patterns, and reveal the differences and characteristics between users in electricity consumption. This paper proposes a method for constructing the characteristics of industrial and commercial user electricity consumption behavior based on data mining technology. By using the principal component analysis method, the data scale of the user electricity consumption behavior feature set is reduced while retaining the main characteristics of the user's electricity consumption behavior. It is proposed to improve the K-means++ algorithm based on the Elkan triangle theorem and complete the clustering of industrial and commercial users. This algorithm can solve the problem of the difficulty in determining the initial cluster center and reduce the workload of clustering operations. Finally, based on the obtained classification results, the electricity consumption behavior of various types of industrial and commercial users is analyzed.

[0003] Data show that with the continuous growth of electricity demand, the importance of analyzing and processing electricity consumption data has become increasingly prominent in the power system. Although many scholars have conducted research on the extraction of electricity consumption behavior features and portrait analysis of power users, the research objects are relatively vague, and there is no focus on distinguishing between industrial and commercial users and residential users. On the other hand, the traditional K-means algorithm often takes a long time to directly apply to the clustering of massive residential loads.

[0004] Chinese patent document CN115168437A discloses a "method and system for realizing electricity user portrait based on data analysis". It includes: Step 1: Collect the user's historical electricity consumption data, and pre-classify the historical electricity consumption data to obtain several categories of electricity consumption data; Step 2: Construct the initial electricity consumption behavior for each category of electricity consumption data, and set an electricity consumption label for each initial electricity consumption behavior; Step 3: Based on the label setting result, extract representative electricity consumption behaviors from all initial electricity consumption behaviors; Step 4: Construct the user's electricity consumption portrait based on the representative electricity consumption behavior. The above technical solution has a slow clustering speed when facing massive users. Summary of the invention

[0005] The present invention mainly solves the technical problem of slow clustering speed of massive users faced by the original technical solution, and provides a method for analyzing electricity consumption behavior portraits of industrial and commercial users based on data mining. Through relevant algorithms of data mining such as principal component analysis, the electricity consumption behavior characteristics of massive users are analyzed and reduced in dimension, while the original characteristic information of power users is retained to the greatest extent and the number of features is reduced. At the same time, the clustering speed of industrial and commercial users is improved by improving the K-means++ algorithm, and the electricity consumption behavior portrait analysis of industrial and commercial users is completed, which can effectively complete the classification of massive industrial and commercial users and the description of electricity consumption behavior portraits.

[0006] The above technical problem of the present invention is mainly solved by the following technical solution: The present invention comprises the following steps: S1 performs characteristic representation of attributes of electricity consumption behavior of commercial users; S2 constructs power customer feature engineering based on principal component analysis; S3 optimizes the clustering distance calculation of the K-means++ algorithm; S4 improves the K-means++ algorithm based on Elkan's triangle theorem; S5 classifies industrial and commercial users and describes their electricity usage behavior.

[0007] Preferably, the step S1 is to understand the electricity consumption behavior characteristics of the target user group through electricity consumption behavior characteristic indicators, including electricity consumption E, maximum load L max and minimum load L min .

[0008] (1) Electricity consumption E: Electricity consumption on a typical load day, in kilowatt-hours (kWh).

[0009] (2) Maximum load L max : The maximum power value on a typical load day, in kilowatts (kW).

[0010] (3) Minimum load L min : The minimum load on a typical load day, in kilowatts (kW).

[0011] (4) Average load L avg : The unit is kilowatt (kW).

[0012] (5) Peak-to-valley difference L pk :L pk =L max -L min , in kilowatts (kW). The peak-to-valley difference is the difference between the maximum load and the minimum load, indicating the degree of fluctuation in the user's power consumption in different time periods. A larger peak-to-valley difference indicates that the user's load fluctuates greatly and has a greater potential for load adjustment.

[0013] (6) Load factor L ratio : The load rate is the ratio of the user's actual load to the maximum load, indicating the proportion of the user's current load to the maximum load.

[0014] (7) Peak-to-valley difference rate L pk_ratio : The peak-to-valley difference ratio refers to the ratio of the peak-to-valley difference to the maximum load, reflecting the relative degree of user load fluctuation. Users with a higher peak-to-valley difference ratio have greater load fluctuations and greater load adjustment potential.

[0015] As a preference, the electricity consumption behavior characteristic index also includes the peak power consumption rate E pk_ratio , off-peak power consumption rate E valley_ratio And peak power consumption rate E sharp_ratio , the peak power consumption rate, valley power consumption rate and peak power consumption rate indicators indicate the proportion of power consumption of users in different time periods. The peak power consumption rate, valley power consumption rate and peak power consumption rate indicate the proportion of power consumption of users in different time periods. For demand response, users with higher peak power consumption rate and peak power consumption rate can reduce power consumption during peak periods and save power resources.

[0016] Preferably, the step S2 specifically includes: S2.1 calculate the covariance matrix C; S2.2 calculate the eigenvalues ​​and eigenvectors of the covariance matrix; S2.3 select the first k eigenvectors; S2.4 constructs the projection matrix P; S2.5 maps the data into a low-dimensional space.

[0017] Principal component analysis (PCA) is a commonly used dimensionality reduction technique. Its principle is to calculate the eigenvalues ​​and eigenvectors of the covariance matrix of the data, select the first k eigenvectors as the projection matrix, and map the original data points to the low-dimensional space formed by these eigenvectors.

[0018] The analysis process of PCA can be expressed as follows: Assume that there are n sample data points, each of which contains a d-dimensional feature vector, forming an n×d data matrix X, where X ij Represents the j-th dimension eigenvalue of the i-th sample data point.

[0019] Calculate the covariance matrix C: In the formula, X i represents the i-th sample data point, Represents the mean of all sample data points.

[0020] Compute the eigenvalues ​​and eigenvectors of the covariance matrix: C·v=λ·v Where v represents the eigenvector and λ represents the eigenvalue.

[0021] Select the first k eigenvectors: Select the first k eigenvectors v1,v2,…,v of the covariance matrix k , the corresponding eigenvalues ​​are λ1,λ2,…,λ k .

[0022] Construct the projection matrix P: P=[v1 v2 … v k ] Where v1, v2, …, v k Respectively represent the selected 1st to kth feature vectors.

[0023] Map the data into a lower dimensional space: Multiply the original data matrix X by the projection matrix P to get the reduced-dimensional data matrix Y: Y=X·P In this way, the data matrix Y obtained is the low-dimensional data obtained after reducing the dimension of the original data. ij Represents the projection value of the i-th sample data point on the j-th principal component direction.

[0024] The principal component analysis method is used to reduce the dimensionality of massive user feature data, reducing the pressure on big data computing power while ensuring the integrity of feature engineering descriptions.

[0025] Preferably, the step S3 specifically includes: setting x i ∈X is the i-th sample data point, x i The class center of the current cluster is c∈C, the position of c in the previous iteration is c′, the distance between any two samples is d(,), s is the distance from c to its nearest class center, u i For x i to c j The upper limit of the distance, l ij For x i to c j The distance lower limit is . The main disadvantages of the traditional K-means algorithm are twofold: first, it is difficult to determine the initial cluster center; second, the time required for calculation increases greatly when faced with massive data. Therefore, the K-means++ algorithm is used to replace the K-means algorithm to solve the problem of the difficulty in determining the initial cluster center; at the same time, the Elkan triangle theorem is used to simplify the distance calculation and shorten the calculation time of the overall algorithm.

[0026] Preferably, the optimization specifically includes reducing the distance calculation of users who will not obviously change the cluster center, that is, ui When the value of is less than half of s, the i-th sample data point does not need to change its cluster center; reduce the distance calculation of users who obviously do not belong to a certain category, that is, when l ij Greater than u i When d(x i ,c) and d(x i ,c j ).

[0027] Preferably, the step S4 specifically includes: S4.1 randomly determine the initial cluster center C1; S4.2 calculates the distance between each sample and the current cluster center; S4.3 Solve for sample x i The probability values ​​of being selected as the next cluster center are as follows, which means that the farther away from each cluster center, the more likely it is to become the new cluster center; According to the probability result, the sample point with the largest probability is taken as the next cluster center; S4.4 repeats S4.2 and S4.3 until k cluster centers are selected; S4.5 introduces Eklan's triangle theorem to shorten the calculation time.

[0028] In the K-means algorithm, the quality of clustering results is closely related to the overall running time and the selection of the initial cluster center. Completely random selection of the initial centroid may lead to a slow convergence of the algorithm. In order to solve this problem, the K-means++ algorithm has been improved, focusing on optimizing the initial centroid selection process of the K-means algorithm. The Eklan triangle theorem is introduced into the K-means++ algorithm to avoid distance calculations for the two situations of clearly belonging to a certain class and clearly not belonging to a certain class, thereby shortening the overall operation time.

[0029] Preferably, the step S4.2 calculates the distance between each sample and the current cluster center as follows: D(x (i) )=min(dist(x (i) ,C1),dist(x (i) ,C2),…,dist(x (i) ,C n )).

[0030] As a preference, the peak power consumption rate E pk_ratio : E pk The typical load daily peak power Where P(t) is the load value at time t, t1 and t2 are the start and end times of the peak period; Off-peak power consumption rate E valley_ratio E valley The typical load daily valley power Where P(t) is the load value at time t, and t3 and t4 are the start and end times of the valley period.

[0031] As a preference, the peak power consumption rate E sharp_ratio E sharp The peak power of typical load Where P(t) is the load value at time t, and t5 and t6 are the start and end times of the peak period.

[0032] The beneficial effects of the present invention are as follows: through data mining related algorithms such as principal component analysis, the electricity consumption behavior characteristics of a large number of users are analyzed and reduced in dimension, the number of features is reduced while retaining the original characteristic information of the power users to the greatest extent, and at the same time, the clustering speed of industrial and commercial users is improved by improving the K-means++ algorithm, and the electricity consumption behavior portrait analysis of industrial and commercial users is completed, which can effectively complete the classification of a large number of industrial and commercial users and the description of their electricity consumption behavior portraits. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 This is a complete calculation flow chart of an improved K-means++ algorithm of the present invention.

[0034] Figure 2 It is a schematic diagram of Elkan triangle determination principle of the present invention.

[0035] Figure 3 This is an example diagram of the K-mens++ algorithm of the present invention.

[0036] Figure 4 It is a variable correlation heat map of the present invention.

[0037] Figure 5 It is a cumulative explained variance rate graph of the present invention.

[0038] Figure 6 It is an elbow curve diagram of the present invention.

[0039] Figure 7This is a K-means clustering scatter plot when K=6 according to the present invention.

[0040] Figure 8 It is a cluster scatter plot obtained by an improved K-means++ algorithm of the present invention.

[0041] Fig. 9 This is a K-means algorithm running time comparison chart of the present invention. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the technical solution of the present invention is further described in detail below through embodiments and in combination with the accompanying drawings. It should be understood that the specific implementation method described here is only an optimal embodiment of the present invention, which is only used to explain the present invention and does not limit the scope of protection of the present invention. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0043] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the operations (or steps) as sequential processes, many of the operations (or steps) therein can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the drawings; the process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0044] The technical solution of the present invention is further specifically described below through embodiments and in conjunction with the accompanying drawings.

[0045] Embodiment: This embodiment is a method for analyzing the electricity consumption behavior of industrial and commercial users based on data mining, such as Figure 1 Shown, including The following steps are involved: S1 characterizes the electricity consumption behavior attributes of commercial users. The electricity consumption behavior characteristics of the target user group are understood through electricity consumption behavior characteristic indicators, including electricity consumption E, maximum load L max and minimum load L min .

[0046] (1) Electricity consumption E: Electricity consumption on a typical load day, in kilowatt-hours (kWh).

[0047] (2) Maximum load L max : The maximum power value on a typical load day, in kilowatts (kW).

[0048] (3) Minimum load Lmin : The minimum load on a typical load day, in kilowatts (kW).

[0049] (4) Average load L avg : The unit is kilowatt (kW).

[0050] (5) Peak-to-valley difference L pk :L pk =L max -L min , in kilowatts (kW). The peak-to-valley difference is the difference between the maximum load and the minimum load, indicating the degree of fluctuation in the user's power consumption in different time periods. A larger peak-to-valley difference indicates that the user's load fluctuates greatly and has a greater potential for load adjustment.

[0051] (6) Load factor L ratio : The load rate is the ratio of the user's actual load to the maximum load, indicating the proportion of the user's current load to the maximum load.

[0052] (7) Peak-to-valley difference rate L pk_ratio : The peak-to-valley difference ratio refers to the ratio of the peak-to-valley difference to the maximum load, reflecting the relative degree of user load fluctuation. Users with a higher peak-to-valley difference ratio have greater load fluctuations and greater load adjustment potential.

[0053] (8) Peak power consumption rate E pk_ratio : E pk It is the peak power of typical load day. Where P(t) is the load value at time t, and t1 and t2 are the start and end times of the peak period.

[0054] (9) Off-peak power consumption rate E valley_ratio : E valley It is the daily valley power of typical load. Where P(t) is the load value at time t, and t3 and t4 are the start and end times of the valley period.

[0055] (10) Peak power consumption rate E sharp_ratio : E sharp It is the peak power of typical load day. Where P(t) is the load value at time t, and t5 and t6 are the start and end times of the peak period.

[0056] Peak power consumption rate, off-peak power consumption rate, and peak power consumption rate indicate the proportion of power consumption of users in different time periods. For demand response, users with higher peak power consumption rates and peak power consumption rates can reduce power consumption during peak periods to save power resources.

[0057] S2 constructs the power customer feature engineering based on principal component analysis, including: S2.1 calculate the covariance matrix C; S2.2 calculate the eigenvalues ​​and eigenvectors of the covariance matrix; S2.3 select the first k eigenvectors; S2.4 constructs the projection matrix P; S2.5 maps the data into a low-dimensional space.

[0058] Principal component analysis (PCA) is a commonly used dimensionality reduction technique. Its principle is to calculate the eigenvalues ​​and eigenvectors of the covariance matrix of the data, select the first k eigenvectors as the projection matrix, and map the original data points to the low-dimensional space formed by these eigenvectors.

[0059] The analysis process of PCA can be expressed as follows: Assume that there are n sample data points, each of which contains a d-dimensional feature vector, forming an n×d data matrix X, where X ij Represents the j-th dimension eigenvalue of the i-th sample data point.

[0060] Calculate the covariance matrix C: In the formula, X i represents the i-th sample data point, Represents the mean of all sample data points.

[0061] Compute the eigenvalues ​​and eigenvectors of the covariance matrix: C·v=λ·v Where v represents the eigenvector and λ represents the eigenvalue.

[0062] Select the first k eigenvectors: Select the first k eigenvectors v1,v2,…,v of the covariance matrix k , the corresponding eigenvalues ​​are λ1,λ2,…,λ k .

[0063] Construct the projection matrix P: P=[v1 v2 … v k ] Where v1, v2, …, v k Respectively represent the selected 1st to kth feature vectors.

[0064] Map the data into a lower dimensional space: Multiply the original data matrix X by the projection matrix P to get the reduced-dimensional data matrix Y: Y=X·P In this way, the data matrix Y obtained is the low-dimensional data obtained after reducing the dimension of the original data. ij Represents the projection value of the i-th sample data point on the j-th principal component direction.

[0065] The principal component analysis method is used to reduce the dimensionality of massive user feature data, reducing the pressure on big data computing power while ensuring the integrity of feature engineering descriptions.

[0066] S3 performs clustering distance calculation optimization of the K-means++ algorithm. Specifically, let x i ∈X is the i-th sample data point, x i The class center of the current cluster is c∈C, the position of c in the previous iteration is c′, the distance between any two samples is d(,), s is the distance from c to its nearest class center, u i For x i to c j The upper limit of the distance, l ij For x i to c j The distance lower limit is . The main disadvantages of the traditional K-means algorithm are twofold: first, it is difficult to determine the initial cluster center; second, the time required for calculation increases greatly when faced with massive data. Therefore, the K-means++ algorithm is used to replace the K-means algorithm to solve the problem of the difficulty in determining the initial cluster center; at the same time, the Elkan triangle theorem is used to simplify the distance calculation and shorten the calculation time of the overall algorithm.

[0067] The optimization specifically includes reducing the distance calculation for users who will obviously not change the cluster center, i.e. u i When the value of is less than half of s, the i-th sample data point does not need to change its cluster center; reduce the distance calculation of users who obviously do not belong to a certain category, that is, when l ij Greater than u i When d(x i ,c) and d(x i ,c j ).

[0068] S4 improves the K-means++ algorithm based on Elkan's triangle theorem; S4.1 randomly determine the initial cluster center C1; S4.2 calculates the distance between each sample and the current cluster center as follows: D(x (i) )=min(dist(x (i) ,C1),dist(x (i) ,C2),…,dist(x (i) ,C n )).

[0069] S4.3 Solve for sample x i The probability values ​​of being selected as the next cluster center are as follows, which means that the farther away from each cluster center, the more likely it is to become the new cluster center; According to the probability result, the sample point with the largest probability is taken as the next cluster center; S4.4 repeats S4.2 and S4.3 until k cluster centers are selected; S4.5 introduces Eklan's triangle theorem to shorten the calculation time.

[0070] In the K-means algorithm, the quality of clustering results is closely related to the overall running time and the selection of the initial cluster center. Completely random selection of the initial centroid may lead to a slow convergence of the algorithm. In order to solve this problem, the K-means++ algorithm has been improved, focusing on optimizing the initial centroid selection process of the K-means algorithm. The Eklan triangle theorem is introduced into the K-means++ algorithm to avoid distance calculations for the two situations of clearly belonging to a certain class and clearly not belonging to a certain class, thereby shortening the overall operation time.

[0071] S5 classifies industrial and commercial users and describes their electricity usage behavior.

[0072] The examples are as follows: 1 Construction of the electricity consumption behavior feature set of industrial and commercial users based on principal component analysis 1.1 Characteristic representation of commercial users’ electricity consumption behavior attributes By extracting the electricity consumption behavior characteristics, we can obtain a more comprehensive user electricity consumption behavior characteristic portrait and fully understand the electricity consumption behavior characteristics of the target user group from all aspects. The following briefly introduces the definition and mathematical representation of electricity consumption behavior characteristic indicators: (1) Electricity consumption E: Electricity consumption on a typical load day, in kilowatt-hours (kWh).

[0073] (2) Maximum load L max : The maximum power value on a typical load day, in kilowatts (kW).

[0074] (3) Minimum load L min : The minimum load on a typical load day, in kilowatts (kW).

[0075] (4) Average load L avg : The unit is kilowatt (kW).

[0076] (5) Peak-to-valley difference L pk :L pk =Lmax -L min , in kilowatts (kW). The peak-to-valley difference is the difference between the maximum load and the minimum load, indicating the degree of fluctuation in the user's power consumption in different time periods. A larger peak-to-valley difference indicates that the user's load fluctuates greatly and has a greater potential for load adjustment.

[0077] (6) Load factor L ratio : The load rate is the ratio of the user's actual load to the maximum load, indicating the proportion of the user's current load to the maximum load.

[0078] (7) Peak-to-valley difference rate L pk_ratio : The peak-to-valley difference ratio refers to the ratio of the peak-to-valley difference to the maximum load, reflecting the relative degree of user load fluctuation. Users with a higher peak-to-valley difference ratio have greater load fluctuations and greater load adjustment potential.

[0079] (8) Peak power consumption rate E pk_ratio : E pk It is the peak power of typical load day. Where P(t) is the load value at time t, and t1 and t2 are the start and end times of the peak period.

[0080] (9) Off-peak power consumption rate E valley_ratio : E valley It is the daily valley power of typical load. Where P(t) is the load value at time t, and t3 and t4 are the start and end times of the valley period.

[0081] (10) Peak power consumption rate E sharp_ratio : E sharp It is the peak power of typical load day. Where P(t) is the load value at time t, and t5 and t6 are the start and end times of the peak period.

[0082] Peak power consumption rate, off-peak power consumption rate, and peak power consumption rate indicate the proportion of power consumption of users in different time periods. For demand response, users with higher peak power consumption rates and peak power consumption rates can reduce power consumption during peak periods to save power resources.

[0083] 2.2 Construction of power customer feature engineering based on principal component analysis Principal component analysis (PCA) is a commonly used dimensionality reduction technique. Its principle is to calculate the eigenvalues ​​and eigenvectors of the covariance matrix of the data, select the first k eigenvectors as the projection matrix, and map the original data points to the low-dimensional space formed by these eigenvectors.

[0084] The analysis process of PCA can be expressed as follows: Assume that there are n sample data points, each of which contains a d-dimensional feature vector, forming an n×d data matrix X, where X ij Represents the j-th dimension eigenvalue of the i-th sample data point.

[0085] 1. Calculate the covariance matrix C: In the formula, X i represents the i-th sample data point, Represents the mean of all sample data points.

[0086] 2. Calculate the eigenvalues ​​and eigenvectors of the covariance matrix: C·v=λ·v (2) Where v represents the eigenvector and λ represents the eigenvalue.

[0087] 3. Select the first k eigenvectors: Select the first k eigenvectors v1,v2,…,v of the covariance matrix k , the corresponding eigenvalues ​​are λ1,λ2,…,λ k .

[0088] 4. Construct the projection matrix P: P=[v1 v2 ... v k ] (3) Where v1, v2, …, v k Respectively represent the selected 1st to kth feature vectors.

[0089] 5. Map the data to a low-dimensional space: Multiply the original data matrix X by the projection matrix P to get the reduced-dimensional data matrix Y: Y=X·P (4) In this way, the data matrix Y obtained is the low-dimensional data obtained after reducing the dimension of the original data. ij Represents the projection value of the i-th sample data point on the j-th principal component direction.

[0090] This paper adopts principal component analysis to achieve dimensionality reduction of massive user feature data, reducing the pressure of big data computing power while ensuring the integrity of feature engineering description.

[0091] 2. Elkan Triangle Theorem Improves K-means++ Algorithm for Clustering Industrial and Commercial Users The main disadvantages of the traditional K-means algorithm are twofold: first, it is difficult to determine the initial cluster center; second, when faced with massive data, the time required for calculation increases significantly. Therefore, this paper uses the K-means++ algorithm to replace the K-means algorithm to solve the problem of the difficulty in determining the initial cluster center; at the same time, the Elkan triangle theorem is used to simplify the distance calculation and shorten the calculation time of the overall algorithm.

[0092] 2.1 Clustering distance calculation optimization based on Elkan triangle theorem The core principle of the Elkan algorithm is that the third side of a triangle is smaller than the sum of the two sides and larger than the difference between the two sides. Let x i ∈X is the i-th sample data point, x i The class center of the current cluster is c∈C, the position of c in the previous iteration is c′, the distance between any two samples is d(,), s is the distance from c to its nearest class center, u i For x i to c j The upper limit of the distance, l ij For x i to c j The lower limit of the distance. Then the application of the trigonometric theorem can be described as follows: Case 1: Reduce the distance calculation of users who will not obviously change the cluster center, that is, when u i When the value of is less than half of s, the cluster center of the i-th sample data point does not need to be changed, and the relevant distance calculation can be omitted; Case 2: Reduce the distance calculation of users who obviously do not belong to a certain category, that is, when l ij Greater than u i When d(x i ,c) and d(x i ,c j ).

[0093] like Figure 2 As shown, for the cluster center c j Its nearest cluster center is c i , sample x i The current category is cluster center c j , then the sample x i In the iteration process, if case 1 is satisfied, there is no need to change the cluster center; but for sample x k Although it does not satisfy the first case, due to l km ≥u k So it can never belong to cluster center c m , then there is no need to calculate d(x k ,c m ).

[0094] 2.2 K-means++ algorithm In the K-means algorithm, the quality of clustering results is closely related to the overall running time and the selection of the initial cluster center. Completely random selection of the initial centroid may lead to a slow convergence of the algorithm. In order to solve this problem, the K-means++ algorithm has been improved, focusing on optimizing the initial centroid selection process of the K-means algorithm. The calculation principle is as follows: (1) First, randomly determine the initial cluster center C1; (2) Calculate the distance from each sample to the current cluster center, as shown in formula (2-10): D(x (i) )=min(dist(x (i) ,C1),dist(x (i) ,C2),…,dist(x (i) ,C n )) (5) (3) Solve for sample x i The probability values ​​of being selected as the next cluster center are as follows, which means that the farther away from each cluster center, the more likely it is to become the new cluster center; According to the probability result, the sample point with the largest probability is taken as the next cluster center.

[0095] (4) Repeat steps 2 and 3 until k cluster centers are selected.

[0096] The K-mens++ algorithm can be Figure 3 shown.

[0097] There are 8 samples in the sample, and their spatial distribution and numbering are shown in the figure. Assuming that the number 6 is randomly selected as the first initial cluster center, the distance and probability value of each sample to the initial cluster center can be calculated according to step 2 as shown in the following table 2-1: Table 2-1 Distance and probability value of each sample to the initial cluster center By observing the calculation results, we can find that the probability value of sample No. 2 is the largest, so the next cluster center is No. 2, and the subsequent calculations can be carried out in this way.

[0098] 2.3 Improved K-means++ algorithm based on Elkan triangle theorem In the above calculation, the algorithm performs each distance calculation, which takes a lot of time. Therefore, this paper introduces the Eklan triangle theorem into the K-means++ algorithm to avoid the distance calculation of the two cases that obviously belong to a certain category and obviously do not belong to a certain category, thereby shortening the overall operation time. The complete calculation process of the K-means++ algorithm improved based on the Elkan triangle theorem is as follows Figure 1 3 Example Analysis 3.1 Construction of the electricity consumption behavior feature set of industrial and commercial users The example data comes from the actual measurement data of smart meters of industrial and commercial users in a prefecture-level city in Zhejiang Province. The electricity consumption data of 2041 industrial and commercial users in a prefecture-level city in Zhejiang Province in August 2022 were collected every 15 minutes, with 96 points per user per day. In order to facilitate big data processing and meet demand response scenarios, since August 13 is the day with the largest load in August, this paper selects August 13, 2022 as the typical load day in August, and clusters the load curve based on the characteristic values ​​of the typical load day.

[0099] According to the formula in Section 1.1, the 10 characteristic index values ​​of industrial and commercial users on December 13 are calculated. Figure 4 It can be clearly seen that the maximum load is strongly correlated with the average load, peak-to-valley difference, and power consumption, is well correlated with the load rate, valley power consumption rate, and peak power consumption rate, and is negatively correlated with the peak-to-valley difference rate and peak power consumption rate.

[0100] After the principal component analysis (PCA) dimensionality reduction process, this paper usually needs to calculate the cumulative explained difference rate, such as Figure 5 As shown in the figure, the higher the cumulative explained difference rate, the more information contained in the first few principal components, and the better the dimensionality reduction effect. It can be seen from the figure that when the number of features is 5, the cumulative explained difference rate reaches the threshold.

[0101] 3.2 Industrial and commercial user clustering and electricity consumption behavior profiling analysis The elbow method is a visualization method based on the relationship between the number of clusters and the sum squared distance (SSD) that can help determine the optimal number of clusters.

[0102] By elbow method Figure 6 After analysis and multiple adjustments and tests, the clustering results were finally selected into 6 categories. The scatter plot of the clustering results without the modification in this paper is as follows Figure 7 As shown, it can be seen that each category has good clustering, but some points in category 6 (in the black circle in the figure) are not classified accurately.

[0103] After clustering again using the improved K-means++ algorithm based on Elkan triangle theorem proposed in this paper, the results are as follows: Figure 8As shown, it can be seen that the clustering accuracy for the 6th category of users is greatly improved.

[0104] In order to verify the improvement of computing speed brought by reducing unnecessary distance calculations by using Elkan triangle theorem, this paper compares the time taken by K-means algorithm and K-means++ algorithm improved by introducing Elkan triangle theorem when clustering K values ​​are 3, 6 and 20 respectively. In the experiment, the initial cluster centers are all specified as sample points selected by K-means++ algorithm. The results are shown in the figure. Fig. 9 As shown, it can be seen that the introduction of the Elkan triangle can effectively shorten the clustering time, and the shortening effect is more obvious as the number of clustering categories increases.

[0105] After clustering using the improved K-means++ algorithm based on Elkan's triangle theorem proposed in this paper, the load curves and electricity consumption behavior portraits of various categories of industrial and commercial users are analyzed. The first category of users has an average load rate of 54%, an average peak-to-valley difference rate of 72%, an average peak-time power consumption rate of 22%, an average peak-time power consumption rate of 43%, and an average valley-time power consumption rate of 35%. They have two peak electricity consumption peaks, a large peak-to-valley difference, and a load characteristic that is relatively consistent with the entire network. They have the potential to participate in the corresponding demand. This category of users is mainly industrial users.

[0106] The second category of users has an average load rate of 68%, an average peak-to-valley difference rate of 56%, an average peak-time power consumption rate of 47%, an average peak-time power consumption rate of 8%, and an average valley-time power consumption rate of 45%. There is an obvious peak in electricity consumption in the morning, and there is also a peak in electricity consumption from 15:00 to 17:00 in the afternoon. The peak-to-valley difference is large and the load characteristics are relatively consistent with the whole network. They have the potential to participate in the corresponding demand and can be used as the main research object of user-side demand response. This type of users are mainly industrial users.

[0107] The average load rate of the third category of users is 45%, the average peak-to-valley difference rate is 7%, the average peak-time power consumption rate is 25%, the average peak-time power consumption rate is 25%, and the average valley-time power consumption rate is 40%. The load characteristic curve fluctuates greatly. In addition to the stable peak power consumption at night, 11:00-12:30 noon is also a peak power consumption period. This type of users are mainly non-industrial users and do not have the potential to participate in demand response.

[0108] The fourth category of users has an average load rate of 35%, an average peak-to-valley difference rate of 82%, an average peak-time power consumption rate of 54%, an average peak-time power consumption rate of 6%, and an average valley-time power consumption rate of 40%. The entire day is peak power consumption, with relatively concentrated power consumption, large power consumption, small fluctuations, large peak-to-valley difference, and load characteristics that are relatively consistent with the entire network. This category of users is mainly industrial users, and has the potential to participate in corresponding demand, and can be used as the main research object of user-side demand response.

[0109] The average load rate of the fifth category of users is 37%, the average peak-to-valley difference rate is 88%, the average peak-time power consumption rate is 27%, the average peak-time power consumption rate is 56%, and the average valley-time power consumption rate is 16%. They are similar to the first category of users, both of whom have two peak electricity consumption peaks, large peak-to-valley differences, and relatively consistent load characteristics with the entire network. They have the potential to participate in demand response and can be used as the main research object of user-side demand response. This type of users is mainly commercial users.

[0110] The average load rate of the sixth user category is 39%, the average peak-to-valley difference rate is 91%, the average peak-time power consumption rate is 1%, the average peak-time power consumption rate is 1%, and the average valley-time power consumption rate is 77%. This is a typical night production load, that is, except for the period of electricity consumption at night, the load at other times is basically zero, and the peak electricity consumption is between 17:00 in the evening and 6:00 in the morning. This type of user is mainly cement and building materials companies that produce at night and do not have the potential to participate in demand response.

[0111] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0112] The specific embodiments described herein are merely examples of the spirit of the present invention. The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that technicians in the technical field to which the present invention belongs can make various modifications or supplements to the described specific embodiments or replace them in a similar manner, but will not deviate from the spirit of the present invention or exceed the scope defined in the attached claims. For ordinary technicians in this field, multiple deformations and improvements can also be made without departing from the concept of the present invention. Therefore, the scope of protection of the patent of the present invention shall be based on the attached claims.

Claims

1. A method for analyzing the electricity consumption behavior of industrial and commercial users based on data mining. It is characterized in that The following steps are involved: S1 performs characteristic representation of commercial users’ electricity consumption behavior attributes; S2 constructs power customer feature engineering based on principal component analysis; S3 optimizes the clustering distance calculation of the K-means++ algorithm; S4 improves the K-means++ algorithm based on Elkan's triangle theorem; S5 classifies industrial and commercial users and describes their electricity usage behavior.

2. According to claim 1, a method for analyzing the electricity consumption behavior of industrial and commercial users based on data mining, It is characterized in that The step S1 is to understand the electricity consumption behavior characteristics of the target user group through the electricity consumption behavior characteristic indicators, including the electricity consumption E, the maximum load L max and minimum load L min .

3. According to claim 2, a method for analyzing the electricity consumption behavior of industrial and commercial users based on data mining, It is characterized in that The power consumption behavior characteristic index also includes the peak power consumption rate E pk_ratio , off-peak power consumption rate E valley_ratio And peak power consumption rate E sharp_ratio The peak power consumption rate, valley power consumption rate and peak power consumption rate indicators represent the power consumption ratio of users in different time periods.

4. According to claim 1, a method for analyzing the electricity consumption behavior of industrial and commercial users based on data mining, It is characterized in that The step S2 specifically includes: S2.1 calculate the covariance matrix C; S2.2 calculate the eigenvalues ​​and eigenvectors of the covariance matrix; S2.3 select the first k eigenvectors; S2.4 constructs a projection matrix P; S2.5 maps the data into a low-dimensional space.

5. According to claim 1, a method for analyzing the electricity consumption behavior of industrial and commercial users based on data mining, It is characterized in that The step S3 specifically includes: setting x i ∈X is the i-th sample data point, x i The class center of the current cluster is c∈C, the position of c in the previous iteration is c′, the distance between any two samples is d(,), s is the distance from c to its nearest class center, u i For x i to c j The upper limit of the distance, l ij For x i to c j The lower limit of the distance.

6. According to claim 5, a method for analyzing the electricity consumption behavior of industrial and commercial users based on data mining, It is characterized in that The optimization specifically includes reducing the distance calculation of users who will obviously not change the cluster center, i.e., u i When the value of is less than half of s, the i-th sample data point does not need to change its cluster center; reduce the distance calculation of users who obviously do not belong to a certain category, that is, when l ij Greater than u i When d(x i ,c) and d(x i ,c j ).

7. According to claim 6, a method for analyzing the electricity consumption behavior of industrial and commercial users based on data mining, It is characterized in that The step S4 specifically includes: S4.1 randomly determine the initial cluster center C1; S4.2 calculates the distance between each sample and the current cluster center; S4.3 Solve for sample x i The probability values ​​of being selected as the next cluster center are as follows, which means that the farther away from each cluster center, the more likely it is to become the new cluster center; According to the probability result, the sample point with the largest probability is taken as the next cluster center; S4.4 Repeat S4.2 and S4.3 until k cluster centers are selected; S4.5 introduces Eklan's triangle theorem to shorten the calculation time.

8. According to claim 7, a method for analyzing the electricity consumption behavior of industrial and commercial users based on data mining, It is characterized in that The step S4.2 calculates the distance between each sample and the current cluster center as follows: D(x (i) )=min(dist(x (i) ,C 1 ),dist(x (i) ,C 2 ),…,dist(x (i) ,C n ))。 9. According to claim 3, a method for analyzing the electricity consumption behavior of industrial and commercial users based on data mining, It is characterized in that The peak power consumption rate E pk_ratio : E pk The typical load daily peak power Where P(t) is the load value at time t, t1 and t2 are the start and end times of the peak period; Off-peak power consumption rate E valley_ratio E valley The typical load daily valley power Where P(t) is the load value at time t, and t3 and t4 are the start and end times of the valley period.

10. According to claim 3, a method for analyzing the electricity consumption behavior of industrial and commercial users based on data mining, It is characterized in that The peak power consumption rate E sharp_ratio E sharp The peak power of typical load Where P(t) is the load value at time t, and t5 and t6 are the start and end times of the peak period.