A clustering method of power load curves based on load variation characteristics
Through the distance algorithm and cluster threshold setting based on load change characteristics, the optimal cluster number and center point are automatically determined, which solves the problem of difficult to determine the optimal cluster number in the existing power load curve clustering algorithm, and realizes high-precision power load curve classification.
Patent Information
- Application Number
- CN202210952027.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-09
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2042-08-09
AI Technical Summary
The existing power load curve clustering algorithm is difficult to automatically determine the optimal cluster number K and the optimal center point, resulting in poor clustering results. In traditional methods, there are problems such as 'dimensionality disaster' and rough clustering results in high-dimensional data.
The distance algorithm based on load change characteristics is adopted, combined with the cluster size threshold t and the cluster distance threshold d, and through data preprocessing and clustering rules, the optimal number of clusters is automatically determined and the optimal center point is obtained, and the load mean, standard deviation and backshen angle are used to reflect the load change trend, achieving accurate power load curve classification.
Automatically determine the optimal cluster number and center point, improve the accuracy and rationality of the clustering results, avoid the influence of outliers, and ensure the accuracy and rationality of the clustering process.
Smart Images

Figure CN115718877B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data technology, and in particular to a method for clustering power load curves based on load variation characteristics. Background Art
[0002] In the era of big data, clustering historical power load data to understand user electricity usage patterns and characteristics is a key component of power system economic dispatch and demand-side management. Traditional clustering algorithms are ineffective at clustering power load curves, requiring the specification of the number of clusters and initial cluster centers. Some neural network clustering algorithms, while not requiring a specific number of clusters, suffer from the drawback of uncertain convergence. Currently, the main clustering method for user load data is the Kmeans algorithm, which calculates the distance displacement of cluster centers. This algorithm is simple and easy to use, iteratively calculating cluster centers until the centers no longer shift. However, this algorithm has the following problems when clustering user load data: 1) The number of clusters, K, must be determined in advance, making it difficult for researchers to determine the optimal value of K; 2) The initial cluster centers require a specific initial point, which is often randomly generated, resulting in significant deviations in the clustering results. There's also the Canpoy clustering algorithm, which uses fast approximation based on a distance threshold. This algorithm's advantage lies in its rapid clustering speed, requiring only a single pass through the data. However, in practice, it suffers from the following problems: 1) This algorithm can produce data that belong to different classes, resulting in a relatively rough clustering result. 2) The number of clusters is large, meaning there are many categories, some with more samples than others. This can lead to a large number of small categories, resulting in poor clustering results. Furthermore, most current clustering algorithms use Euclidean distance for clustering, which reflects the numerical differences between points and cannot reflect the changes in the load curve points along the time axis.
[0003] For example, Chinese patent authorization announcement number: CN109272058A discloses an integrated power load curve clustering method. This method first uses a SOM neural network to perform coarse clustering on the original power load data to obtain cluster centers. The DBSCAN algorithm is then used to cluster the cluster centers after coarse clustering, merging clusters corresponding to similar cluster centers. Finally, the deviating elements in the cluster are removed and placed in the most similar cluster to obtain the final clustering result. This scheme first uses a SOM neural network to perform coarse clustering on the original power load data. Although the number of clusters does not need to be specified, it has the defect of not necessarily converging. The DBSCAN algorithm is then used to cluster the cluster centers after coarse clustering. When the amount of data increases, it requires a large amount of memory support and I / O consumption. When the density of spatial clusters is uneven and the cluster spacing varies greatly, the clustering quality is poor. At the same time, the algorithm clustering effect depends on the choice of distance formula. In practical applications, Euclidean distance is often used, which suffers from the "curse of dimensionality" for high-dimensional data.
[0004] Therefore, it is necessary to find a clustering algorithm based on automatically determining the optimal number of clusters K and the optimal center point, so that the number of clusters, category size, and category center point are optimized. Summary of the Invention
[0005] In response to the above-mentioned shortcomings, the present invention provides a power load curve clustering method based on load change characteristics. By setting the parameters of cluster size threshold t, cluster distance threshold d and certain clustering rules, it can automatically determine the number of clusters and obtain the clustering of the optimal center point; a distance algorithm based on load change characteristics is used to improve the classification effect of the load curve to meet the load change trend, which is suitable for clustering analysis of user power loads.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] A method for clustering power load curves based on load variation characteristics comprises the following steps:
[0008] Step S1: data preprocessing and threshold determination;
[0009] Step S2: data clustering;
[0010] Step S3: outlier classification;
[0011] Step S4: reporting the results;
[0012] The present invention rationally classifies the load data based on its own characteristics. The number of clusters, k, is automatically determined during the clustering process; the cluster centers are also obtained during the clustering process, and the number of clusters, K, is controlled within a reasonable range based on certain conditions. The clustering method used in the present invention can automatically obtain the optimal number of clusters, K, and the optimal center points, resulting in a more rational and optimized clustering result.
[0013] Preferably, the specific process of data preprocessing in step S1 is: obtaining a complete data set through a data completion tool and normalizing it, and using a sliding window technology to process the entire data into individual sample units to form a two-dimensional sample array W (n*m) to be clustered.
[0014] Preferably, the thresholds include a cluster distance threshold d and a cluster size threshold t. By setting the cluster distance threshold, the obtained clusters are non-intersecting, making the clustering process more accurate; by setting the cluster size threshold, the influence of outliers on the number of clusters is avoided, thus avoiding the generation of too many clusters.
[0015] Preferably, the specific process of step S2 includes the following steps:
[0016] Step S21: Calculate the distance from each point i to other points in the data to be clustered W, and obtain a two-dimensional distance array D(n*n). Each column D i Represents a cluster of distances from one point to other points;
[0017] Step S22: traverse each distance cluster D in D i , get a distance cluster D with the largest number of distances less than the cluster distance threshold d max ;
[0018] Step S23: cluster the distance D max Data with a distance less than the cluster distance threshold d form a cluster C i , get cluster center C Ci ; Step S24: Delete the cluster C obtained in step S23 from the data W to be clustered i , forming new data W to be clustered;
[0019] Step S25: Repeat steps S21 to S24 until the number of data in W or C i The number of data in is less than the cluster size threshold t; Step S26: Obtain n clusters C through the above process n and its cluster center C Cn .
[0020] As a preferred embodiment, the specific process of step S3 is: calculating the remaining outlier data to be clustered W i To each cluster center CCn distance, and W i Belong to the cluster with the smallest distance, and finally get the cluster C with outlier data added n , recalculate and update the cluster center C Cn .
[0021] Preferably, in step S2, a distance algorithm based on load variation characteristics is used, wherein the distance algorithm integrates the load mean, standard deviation, and tangent angle. The present invention provides a distance algorithm based on load variation characteristics to improve the classification effect of the load curve. The distance algorithm integrates the load mean, standard deviation, and tangent angle (forward differential inclination) to meet the load variation trend.
[0022] Preferably, in step S2, the distance is distance similarity. According to the similarity calculation formula, the smaller the sample similarity index d is, the higher the sample similarity is, and it is considered that the distance between the two samples is closer.
[0023] Therefore, the advantages of the present invention are:
[0024] (1) A distance algorithm that reflects the load change trend by integrating the load mean, standard deviation, and tangent angle is provided;
[0025] (2) The clustering algorithm can automatically determine the optimal number of clusters and obtain the optimal center point;
[0026] (3) By setting the cluster distance threshold, the obtained clusters are free of intersection, making the clustering process more accurate;
[0027] (4) By setting the cluster size threshold, the influence of outliers on the number of clusters can be avoided, and the generation of too many clusters can be avoided. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 This is a flow chart of a method for clustering power load curves based on load variation characteristics in Example 1 of the present invention.
[0029] Figure 2 This is a graph of electricity load data for a user of a specialized transformer in one month in Example 3 of the present invention.
[0030] Figure 3 This is a load curve diagram with higher electricity consumption in the third embodiment of the present invention.
[0031] Figure 4 This is a load curve diagram with lower power consumption in the third embodiment of the present invention.
[0032] Figure 5 This is a load curve diagram of the middle power consumption in the third embodiment of the present invention.
[0033] Figure 6This is a load curve diagram of electricity consumption in the third embodiment of the present invention.
[0034] Figure 7 This is a load curve diagram of power consumption in the third embodiment of the present invention. DETAILED DESCRIPTION
[0035] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0036] Example 1:
[0037] This embodiment automatically determines the number of clusters and obtains the cluster with the optimal center point by setting the cluster size threshold t and cluster distance threshold d parameters and certain clustering rules, such as Figure 1 As shown, the specific process includes the following steps.
[0038] S1: Data preprocessing and threshold determination
[0039] The main task is to complete the data, normalize it, and process the one-dimensional array into a two-dimensional array. Then, the cluster size threshold t and cluster distance threshold d are determined. Specifically, the following steps are performed:
[0040] S11: Data Preprocessing
[0041] The complete data set is obtained through the data completion tool and normalized. The entire data is processed into sample units using the sliding window technology to form a two-dimensional sample array W (n*m) to be clustered.
[0042] S12: Calculation of threshold
[0043] In this embodiment, the cluster size threshold t is 5% of the number of samples, and the cluster distance threshold d is 50% of the average distance between samples.
[0044] S2: Data Clustering
[0045] It mainly clusters normal sample data according to certain clustering rules to obtain different clusters C n and cluster center C Cn , specifically including:
[0046] S21: Calculate distance similarity and find distance cluster D max
[0047] The two-dimensional array W(n*m) calculates the distance similarity with itself to obtain the two-dimensional array D(n*n), and traverses each distance cluster D in D i , get a distance cluster D with the largest number of distances less than the cluster distance threshold d max ;
[0048] S22: Get new clusters and calculate cluster centers
[0049] Cluster D at this distance max Data with a distance less than the cluster distance threshold d form a cluster C i , get cluster center C Ci ;
[0050] S23: Remove clustered samples from the sample set to obtain new samples to be clustered
[0051] Eliminate the cluster C obtained in step S22 from the data to be clustered W i , forming new data W to be clustered;
[0052] S24: Threshold determination
[0053] Determine the number of samples in the new data to be clustered W formed in step S23 or the number of clusters C obtained in step S22 i The number of samples, if the number of samples in the new data set W or the number of clusters C i If the number of samples is less than the cluster size threshold t, then step S25 is executed to perform the next calculation; otherwise, step S21 is executed to obtain a new cluster;
[0054] S25: Get different clusters and cluster centers
[0055] After processing of steps S21-S24, different clusters C are obtained. n and cluster heart C Cn .
[0056] S3: Outlier Classification
[0057] For the unclassified sample set to be clustered, calculate its distance to each cluster center C Cn distance and assigns it to the cluster with the smallest distance.
[0058] S4: Results reporting
[0059] After the above processing, the entire sample W to be clustered has been divided into clusters, and a new cluster C is obtained. n and cluster heart C Cn and report the results.
[0060] In S21, the specific process of calculating distance similarity is as follows:
[0061] There are many statistical characteristic indicators of the grid load change trend. This embodiment selects three of them: mean, standard deviation and forward differential inclination;
[0062] 1) Mean: reflects the central tendency of the data, such as the load level of a user in one hour:
[0063]
[0064] Among them, x1,x2,x3,…,x n are all real numbers;
[0065] 2) Standard deviation: reflects the degree of dispersion of data, such as the load distribution of a user in one hour;
[0066]
[0067] 3) Forward differential inclination: The inverse tangent of the difference between the first and last data is used to determine the inclination. The inverse tangent function has upper and lower bounds and is monotonic, which can reflect the trend of the data. Positive values indicate an increase, and negative values indicate a decrease, such as whether the load data of a user in recent hours has increased or decreased.
[0068]
[0069] Among them, λ and η are two real numbers, and λ and η have the following assignment rules:
[0070] When the number of data sets n is an even number,
[0071]
[0072] When the number of data sets n is an odd number,
[0073]
[0074] This embodiment uses the methods of calculating statistical indicators in Python's numpy library: numpy.mean(), numpy.std(), numpy.arctan() to calculate the statistical indicators of each sample unit;
[0075] Assume that the sample unit to be filled has three statistical indicators: μ0, σ0, Three statistical indicators of other sample units: μ i , σ i , Then the similarity
[0076]
[0077] According to the similarity calculation formula, the smaller the sample similarity index d is, the higher the sample similarity is, and it is considered that the distance between the two samples is closer.
[0078] Example 2:
[0079] This patent is implemented in Python language with the help of pandas, numpy, and scipy libraries in Python;
[0080] 1) Data preprocessing object class
[0081] This module mainly performs data completion, normalization, and processing of one-dimensional arrays into two-dimensional arrays, and then determines the cluster size threshold t and cluster distance threshold d. This module uses pandas and numpy to implement data completion and normalization.
[0082] 2) Distance calculation object class
[0083] This module uses the scipy distance algorithm library to calculate different distances, and supports Euclidean distance, cosine distance and patented distance;
[0084] 3) Data clustering object class
[0085] This module mainly clusters normal sample data according to certain clustering rules to obtain different clusters C n and cluster center C Cn . Through different methods, the functions of optimal center point selection, cluster generation, outlier classification and cluster data acquisition are realized.
[0086] Example 3:
[0087] This patent can be used for cluster analysis of user power load to achieve the optimal center point selection and cluster number selection. Select a dedicated transformer user's power load data for one month, such as Figure 2 As shown in the figure, 96 load data points are divided into 744 cluster data points according to the 1-hour time window. The clustering algorithm is used to classify them. The cluster size threshold t is set to 5% of the number of data points, and the cluster distance threshold d is set to 50% of the average distance between each point. The results are automatically divided into 5 categories, as shown in the figure. Figure 3-7 As shown, it includes a load curve with higher electricity consumption, a load curve with lower electricity consumption, a load curve with medium electricity consumption, a load curve with increasing electricity consumption, and a load curve with decreasing electricity consumption.
[0088] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A power load curve clustering method based on load change characteristics, characterized in that: The following steps are involved: Step S1: data preprocessing and threshold determination; Step S2: Data clustering; Calculate the distance from each point i to other points in the data to be clustered W, and obtain a two-dimensional array D(n*n) of distances. Each column D i Represents the distance cluster from one point to other points; traverse the distance cluster D in D i , get a distance cluster D with the largest number of distances less than the cluster distance threshold d max ; D max Data with a distance less than the threshold d form a cluster C i , get cluster center C Ci ; Delete cluster C from W i , update W; repeat until W or C i The number of data in is less than the cluster size threshold t; obtain n clusters C n and cluster center C Cn ; The distance similarity is calculated using a distance algorithm based on load variation characteristics. The distance algorithm integrates the load mean, standard deviation, and forward differential inclination. Step S3: outlier classification; Step S4: Report the results.
2. The method for clustering power load curves based on load variation characteristics according to claim 1, characterized in that: The specific process of data preprocessing in step S1 is: obtain a complete data set through a data completion tool and normalize it, and use the sliding window technology to process the entire data into sample units to form a two-dimensional sample array W (n*m) to be clustered.
3. The method for clustering power load curves based on load variation characteristics according to claim 2, characterized in that: The thresholds include a cluster distance threshold d and a cluster size threshold t.
4. The method for clustering power load curves based on load variation characteristics according to claim 1, characterized in that: The specific process of step S3 is: calculate the remaining outlier data to be clustered W i To each cluster center C Cn distance, and W i Belong to the cluster with the smallest distance, and finally get the cluster C with outlier data added n , recalculate and update the cluster center C Cn .
5. The method for clustering power load curves based on load variation characteristics according to claim 1, characterized in that: In step S2, the distance is distance similarity.
6. The method for clustering power load curves based on load variation characteristics according to claim 1, characterized in that: The mean reflects the central trend of the data, that is, the load level of a user in one hour.
7. The method for clustering power load curves based on load variation characteristics according to claim 1, characterized in that: The forward differential inclination is determined by the arctangent of the difference between the first and last data. The arctangent function has upper and lower bounds and monotonicity, and can reflect the trend of the data. A positive value indicates an increase, and a negative value indicates a decrease, that is, whether the load data of a user in the past few hours has increased or decreased.
Citation Information
Patent Citations
An integrated power load curve clustering method
CN109272058A