Power consumption behavior analysis and demand side management method, system and device based on centroid optimization clustering and medium

By introducing the grasshopper algorithm to optimize the initial centroid and combining it with the silhouette coefficient and Davis-Boulting index evaluation, the instability problem of the K-means algorithm in the selection of the initial centroid is solved, and the accuracy and stability of the electricity consumption behavior analysis are achieved, which is suitable for demand-side management in the field of power dispatching.

CN120687856APending Publication Date: 2025-09-23YUNNAN POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510846767.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

The random selection of initial centroids in the traditional K-means algorithm leads to unstable and inaccurate clustering results. The existing technology lacks systematic evaluation and is difficult to meet the real-time and accuracy requirements of large-scale load data.

Method used

The grasshopper algorithm is introduced to optimize the initial centroid selection, and the silhouette coefficient and Davis-Boulting index are combined to evaluate the clustering results, optimize the clustering effect, and improve stability and accuracy.

Benefits of technology

It significantly improves the accuracy and stability of clustering results, can efficiently process large-scale load data, meet real-time requirements, and is suitable for electricity consumption behavior analysis of various user types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120687856A_ABST
    Figure CN120687856A_ABST
Patent Text Reader

Abstract

The invention discloses a power consumption behavior analysis and demand side management method, system and device based on centroid optimization clustering and a medium, and relates to the field of power dispatching, and the method comprises the steps: collecting the power consumption data of each user, carrying out the normalization processing of the power consumption data of each user, and obtaining a typical daily load curve of each user; clustering the daily load curve data set by adopting a K-means algorithm, and establishing labels for the data; when the step of selecting the initial center of mass is carried out, a grasshopper algorithm GOA is introduced to participate in selection of the initial center of mass; when the number of iterations reaches the maximum number of iterations, outputting a clustering result, and introducing a contour coefficient and a Devens-Boolean index to evaluate the clustering result; if the evaluation result meets the requirement, outputting a final clustering result; and demand response scheduling is carried out based on the final clustering result. The grasshopper algorithm GOA is introduced to optimize the selection of the initial centroid, instability caused by random initialization is avoided, and the accuracy and stability of a clustering result are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electric power dispatching, and in particular to a method, system, device and medium for analyzing electric power consumption behavior and managing demand side based on centroid optimization clustering. Background Art

[0002] In demand-side management research, existing technologies mainly focus on the classification and analysis of user electricity consumption behavior, especially on distinguishing the electricity consumption patterns of three typical user types: residential users, commercial users, and industrial users. These technologies are usually based on traditional clustering methods (such as K-means algorithm) to classify user load curves to identify the electricity consumption behavior characteristics of different users. However, existing clustering methods usually use random initialization in the selection of initial centroids, which may cause the algorithm to be sensitive to the initial value, thereby affecting the stability and accuracy of the clustering results. In addition, when processing large-scale load data, existing technologies often lack objective evaluation of clustering effects, which may lead to deviations in clustering results in practical applications.

[0003] The initial centroids of the K-means algorithm are typically randomly selected. This randomness can make the algorithm sensitive to initial values, affecting the stability and accuracy of the clustering results. Due to the random selection of initial centroids, the K-means algorithm may converge to a local optimum, resulting in suboptimal clustering results. Furthermore, existing technologies often lack systematic evaluation of clustering results, making it difficult to ensure their accuracy and practicality. When faced with massive amounts of data, existing technologies suffer from low computational efficiency and struggle to meet real-time requirements.

[0004] In view of the shortcomings of the above-mentioned prior art, the present invention proposes a clustering method based on centroid optimization, which aims to solve the following technical problems. By introducing the Grasshopper Algorithm (GOA) to optimize the selection of the initial centroid, the instability caused by random initialization is avoided, and the accuracy and stability of the clustering results are improved. Secondly, by optimizing the initial centroid, the possibility of the algorithm falling into the local optimal solution is reduced, and the clustering effect is improved. Validity indicators such as the Silhouette Coefficient (SC) and the Davis-Boulding Index (DBI) are introduced to systematically evaluate the clustering results to ensure the accuracy and practicality of the clustering results. Summary of the Invention

[0005] In view of the above-mentioned problems, the present invention is proposed.

[0006] Therefore, the problem to be solved by the present invention is that the initial centroid of the traditional K-means algorithm is usually randomly selected and may converge to a local optimal solution, resulting in unsatisfactory clustering effect; in addition, the existing technology often lacks a systematic evaluation of the clustering results, making it difficult to ensure the accuracy and practicality of the clustering results.

[0007] To solve the above technical problems, the present invention provides the following technical solutions: a method for electricity consumption behavior analysis and demand-side management based on centroid optimization clustering, which includes collecting monthly electricity consumption data of each user, normalizing the electricity consumption data of each user, and obtaining a monthly average load curve as the user's typical daily load curve; clustering the daily load curve data set using the K-means algorithm, establishing labels for the data, and obtaining a training data set; when the K-means algorithm performs the initial centroid selection step, the grasshopper algorithm GOA is introduced to participate in the selection of the initial centroid; when the number of iterations reaches the maximum number of iterations, the clustering result is output, and the silhouette coefficient and Davis-Boulting index are introduced to evaluate the clustering result; if the evaluation result does not meet the requirements, the centroid selection and iteration are performed again, and if the evaluation result meets the requirements, the final clustering result is output; and demand response scheduling is performed based on the final clustering result.

[0008] As an optimal solution of the electricity consumption behavior analysis and demand-side management method based on centroid optimization clustering described in the present invention, the method includes: before clustering, the input data is the time series data and related statistical characteristics of the daily load curve; the related statistical characteristics include peak load, valley load, average load and load fluctuation rate; after clustering, the output data is a labeled data set, and the label is a mark that can reflect the user's electricity consumption pattern.

[0009] As a preferred solution of the power consumption behavior analysis and demand side management method based on centroid optimization clustering described in the present invention, wherein: the introduction of the grasshopper algorithm GOA to participate in the selection of the initial centroid includes using GOA to initialize the cluster center V0 = (v 10 ,…,v C0 ), and determine the number of clusters C, GOA individual coding and objective function are expressed as,

[0010] X=(C,v1,…,v C )

[0011]

[0012] Among them, X represents the individual code of the algorithm, f(X) represents the objective function, C represents the total number of clusters, and v C Represents the cluster center of the cth cluster, u kc Represented as data point x k The membership degree of cluster c, k represents the total number of data points.

[0013] As a preferred solution of the power consumption behavior analysis and demand-side management method based on centroid optimization clustering described in the present invention, when the number of iterations reaches the maximum number of iterations, the output clustering result includes: GOA optimizes the objective function by simulating the behavior of grasshopper groups, and the position update formula of each individual is expressed as:

[0014]

[0015]

[0016] s(r)=e -r / l -e -r

[0017] in, It is represented as the position of the d-th individual in the t+1 iteration, t is the t-th iteration, ρ is the decreasing coefficient, which controls the balance between exploration and development, and ρ max Expressed as the maximum value of the decreasing coefficient, ρ min Expressed as the minimum value of the decreasing coefficient, T max It is expressed as the maximum number of iterations, and Denotes the upper and lower bounds of the search space, s(.) denotes the social force function, It is represented as the social interaction force between grasshoppers, l is the perception range adjustment factor, which controls the distance of the perception range, and T d Expressed as the influence of the target position; GOA optimizes the objective function f(X) by iteratively updating the individual position until the maximum number of iterations is reached, specifically including updating the cluster center v according to the position update formula c And the membership matrix u kc , check whether the maximum number of iterations has been reached, if not, continue to iterate, if the maximum number of iterations has been reached, output the clustering results, specifically including the output of the number of clusters C and the cluster center V = (v1,…,v C ), output membership matrix U, which represents the membership of each data point to each cluster.

[0018] As a preferred solution of the power consumption behavior analysis and demand side management method based on centroid optimization clustering described in the present invention, wherein: the introduction of the silhouette coefficient and Davis-Boulting index to evaluate the clustering results includes introducing the silhouette coefficient SC to evaluate the clustering results, and the formula is expressed as follows:

[0019]

[0020] Where SC(i) is the silhouette coefficient of the i-th sample, a(i) is the average distance between the i-th sample and all samples in the cluster, b(i) is the average distance between the i-th sample and all other samples outside the cluster, and max{a(i),b(i)} is the maximum value of a(i) and b(i). SC(i) evaluates the clustering effect by comparing the average distance of elements in the same cluster with the average distance of elements in other clusters. The difference between the value of SC(i) and the boundary value is inversely proportional to the clustering effect.

[0021] As a preferred solution of the power consumption behavior analysis and demand side management method based on centroid optimization clustering described in the present invention, wherein: the introduction of the silhouette coefficient and Davis-Bourdin index to evaluate the clustering results also includes introducing the Davis-Bourdin index DBI to evaluate the clustering results, the formula is expressed as follows:

[0022]

[0023] Where K represents the number of clusters; c i is represented as the center of the i-th cluster; σ i Represented as all elements in cluster i to cluster center c i The average distance of d(c i ,c j ) is represented as the cluster center c i and c j DBI evaluates the clustering effect by measuring the intra-cluster distance and inter-cluster distance. The DBI value is inversely proportional to the clustering effect.

[0024] As a preferred solution of the electricity consumption behavior analysis and demand-side management method based on centroid optimization clustering described in the present invention, the demand response scheduling based on the final clustering result includes: when either the value of SC(i) or the DBI value meets the preset requirements, the current clustering result is output as the final clustering result; when demand response scheduling is performed, scheduling is performed based on the data under the demand corresponding label in the final clustering result, as well as constraints; the constraints include power constraints and revenue constraints.

[0025] Another object of the present invention is to provide an electricity consumption behavior analysis and demand-side management system based on centroid optimization clustering, which can schedule electricity demand based on the clustering results of historical data.

[0026] To solve the above technical problems, the present invention provides the following technical solutions: an electricity consumption behavior analysis and demand-side management system based on centroid optimization clustering, comprising: a data acquisition and processing module, a clustering module and a scheduling module; the data acquisition and processing module is used to collect the monthly electricity consumption data of each user, normalize the electricity consumption data of each user, and obtain a monthly average load curve as the user's typical daily load curve; the clustering module uses the K-means algorithm to cluster the daily load curve data set, establish labels for the data, and obtain a training data set; when the K-means algorithm performs the initial centroid selection step, the grasshopper algorithm GOA is introduced to participate in the selection of the initial centroid; when the number of iterations reaches the maximum number of iterations, the clustering result is output, and the silhouette coefficient and Davis-Boulting index are introduced to evaluate the clustering result; if the evaluation result does not meet the requirements, the centroid selection and iteration are performed again, and if the evaluation result meets the requirements, the final clustering result is output; the scheduling module performs demand response scheduling based on the final clustering result.

[0027] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the steps of the above-mentioned method for analyzing electricity consumption behavior and managing demand side based on centroid optimization clustering.

[0028] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned method for analyzing electricity consumption behavior and managing demand side based on centroid optimization clustering.

[0029] The beneficial effects of the present invention are as follows: compared with the prior art, the present invention not only focuses on the accuracy of user electricity consumption behavior classification, but also significantly improves the clustering effect and practicality by optimizing the initial centroid selection and systematically evaluating the clustering results. By introducing the grasshopper algorithm (GOA) to optimize the selection of the initial centroid, the instability caused by random initialization is avoided, and the accuracy and stability of the clustering results are improved. The present invention comprehensively considers the electricity consumption behavior characteristics of various user types such as residential users, commercial users and industrial users, and the proposed optimization method can efficiently coordinate the electricity demand of various types of users. At the same time, the scheme fully considers various practical constraints such as power constraints and revenue constraints, making it closer to the actual application scenarios of demand-side management. On the basis of cluster analysis, comprehensive consideration of factors such as user consumption psychology, satisfaction and carbon emissions has achieved more comprehensive demand-side management, taking into account the stability and sustainable development of the electricity market. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0031] Figure 1 This is a flow chart of a method for electricity consumption behavior analysis and demand-side management based on centroid optimization clustering in Example 1.

[0032] Figure 2 This is a residential electricity load diagram of an electricity consumption behavior analysis and demand-side management method based on centroid optimization clustering in Example 3.

[0033] Figure 3 This is a commercial electricity load diagram of an electricity consumption behavior analysis and demand-side management method based on centroid optimization clustering in Example 3.

[0034] Figure 4 This is an industrial electricity load diagram of an electricity consumption behavior analysis and demand-side management method based on centroid optimization clustering in Example 3.

[0035] Figure 5 This is an iterative optimization diagram of an electricity consumption behavior analysis and demand-side management method based on centroid optimization clustering in Example 3.

[0036] Figure 6 This is a GOA clustering result diagram of a power consumption behavior analysis and demand-side management method based on centroid optimization clustering in Example 3.

[0037] Figure 7 This is a GA clustering result diagram of a power consumption behavior analysis and demand-side management method based on centroid optimization clustering in Example 3.

[0038] Figure 8 This is a diagram of the common K-means clustering results of a method for electricity consumption behavior analysis and demand-side management based on centroid optimization clustering in Example 3. DETAILED DESCRIPTION

[0039] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0040] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0041] Example 1, with reference to Figure 1 , which is the first embodiment of the present invention, provides a method for analyzing electricity consumption behavior and managing demand side based on centroid optimization clustering, such as Figure 1 Shown include:

[0042] Step 1: Collect the monthly electricity consumption data of each user, normalize the electricity consumption data of each user, and obtain the monthly average load curve as the typical daily load curve of the user.

[0043] In order to more effectively collect data from various types of power users, it is necessary to implement clustering operations based on their characteristics. Therefore, it is necessary to first take the average monthly data of each user as the typical daily load curve, and each load curve is represented by x i ={x i,j ,j=1,2,...,n}, since each load sample has different maximum and minimum loads, in order to facilitate subsequent analysis, the following method is used to normalize the data, and the formula is expressed as,

[0044]

[0045] Among them, x i,max It is expressed as the maximum load in sample i; x i,min It is expressed as the minimum load value in sample i; x i ',j represents the normalized value of the data at the jth moment in sample i.

[0046] The monthly average load curve after normalizing the electricity consumption data of each user is used as the typical daily load curve of the user.

[0047] Step 2: Use the K-means algorithm to cluster the daily load curve dataset and create labels for the data to obtain a training dataset.

[0048] Actual massive load data often do not have category labels. Therefore, when classifying user daily load curves, the K-means algorithm is used to cluster the load curve dataset and establish labels for the data to obtain a training dataset.

[0049] Before clustering, the input data are the time series data of the daily load curve and related statistical characteristics, which include peak load, valley load, average load and load fluctuation rate.

[0050] After clustering, the output data is a labeled data set. The labels are markers that can reflect the user's electricity consumption patterns. For example, in current demand-side management research, user types can generally be divided into residential users, commercial users, and industrial users. The three types of users represent the three typical patterns of electricity consumption in my country, so different data can be labeled with corresponding user types.

[0051] In another optional embodiment, labels can also be affixed according to different electricity consumption. For example, different users have different electricity consumption in different time periods. The labels can be designed as industrial users (continuous load), commercial users (daytime peak), household users (morning and evening peak), etc.

[0052] Step 21: When the K-means algorithm performs the initial centroid selection step, the Grasshopper Algorithm (GOA) is introduced to participate in the selection of the initial centroid.

[0053] Generally speaking, the initial centroids for K-means clustering are typically randomly selected. This randomness can make the algorithm very sensitive to the initial values, thus affecting the final clustering effect and computational efficiency. Randomly selecting initial centroids can slow the algorithm's convergence and even lead to local optima, thus affecting clustering quality. To address this issue, this embodiment optimizes the selection of initial centroids using the random seeding method of the Grasshopper algorithm.

[0054] This method can effectively disperse the distribution of the initial centroids, preventing them from being too concentrated, thereby improving the stability of the algorithm and the clustering effect. In this way, the distance between the initial centroids is maximized, reducing the possibility of the algorithm falling into a local optimum and accelerating the convergence speed. Specifically,

[0055] Use GOA to initialize the cluster center V0 = (v 10 ,…,v C0 ), and determine the number of clusters C, GOA individual coding and objective function are expressed as,

[0056] X=(C,v1,…,v C )

[0057]

[0058] Among them, X represents the individual code of the algorithm, f(X) represents the objective function, C represents the total number of clusters, and v C Represents the cluster center of the cth cluster, u kc Represented as data point x k The membership degree of cluster c, k represents the total number of data points.

[0059] Step 22: When the number of iterations reaches the maximum number of iterations, the clustering result is output.

[0060] GOA optimizes the objective function by simulating the behavior of grasshopper groups. The position update formula of each individual is expressed as:

[0061]

[0062] s(r)=e -r / l -e -r

[0063] in, It is represented as the position of the d-th individual in the t+1 iteration, t is the t-th iteration, ρ is the decreasing coefficient, which controls the balance between exploration and development, and ρ max Expressed as the maximum value of the decreasing coefficient, ρ min Expressed as the minimum value of the decreasing coefficient, T max It is expressed as the maximum number of iterations, and Denotes the upper and lower bounds of the search space, s(.) denotes the social force function, It is represented as the social interaction force between grasshoppers, l is the perception range adjustment factor, which controls the distance of the perception range, and T d Expressed as the influence of the target position.

[0064] GOA optimizes the objective function f(X) by iteratively updating individual positions until the maximum number of iterations is reached, specifically including updating the cluster center v according to the position update formula c And the membership matrix u kc , check whether the maximum number of iterations is reached. If not, continue to iterate. If the maximum number of iterations is reached, output the clustering results.

[0065] The output clustering results specifically include: the number of clusters C and the cluster center V = (v1,…,v C ), output membership matrix U, which represents the membership of each data point to each cluster.

[0066] Step 23: Introduce the silhouette coefficient and Davis-Boulting index to evaluate the clustering results. If the evaluation results do not meet the requirements, reselect the centroid and iterate. If the evaluation results meet the requirements, output the final clustering results.

[0067] Common evaluation methods for clustering results include internal evaluation, external evaluation, and human evaluation. Internal evaluation evaluates clustering results by summarizing them into a single quality score, while external evaluation compares clustering results against existing benchmarks. Furthermore, human evaluation relies on expert judgment, while indirect evaluation analyzes the actual effectiveness of clustering in specific applications.

[0068] A major problem with internal evaluation methods is that their evaluation criteria themselves can be considered a clustering objective, which can lead to biased evaluation results. To reduce the impact of subjective manual evaluation on clustering quality, some effectiveness indicators can be selected for evaluation based on actual conditions. This embodiment uses two effectiveness indicators: the Silhouette coefficient (SC) and the Davies-Bouldin index (DBI), calculated as shown in the following formula.

[0069] The silhouette coefficient SC is introduced to evaluate the clustering results. The formula is expressed as follows:

[0070]

[0071] Where SC(i) is the silhouette coefficient of the i-th sample, a(i) is the average distance between the i-th sample and all samples in the cluster, b(i) is the average distance between the i-th sample and all other samples outside the cluster, and max{a(i),b(i)} is the maximum value of a(i) and b(i).

[0072] SC(i) evaluates the clustering effect by comparing the average distance of elements in the same cluster with the average distance of elements in other clusters. The difference between the value of SC(i) and the boundary value is inversely proportional to the clustering effect. The closer the SC(i) value is to its boundary value, the more ideal the clustering effect is.

[0073] The Davis-Boulting index DBI is introduced to evaluate the clustering results. The formula is expressed as follows:

[0074]

[0075] Where K represents the number of clusters; c i is represented as the center of the i-th cluster; σ i Represented as all elements in cluster i to cluster center c i The average distance of d(c i ,c j ) is represented as the cluster center c i and c j distance.

[0076] The DBI evaluates clustering effectiveness by measuring both intra-cluster distance and inter-cluster distance. The DBI value is inversely proportional to clustering effectiveness; lower DBI values ​​indicate higher intra-cluster similarity and lower inter-cluster similarity. Therefore, smaller DBI values ​​indicate better clustering effectiveness. Based on the SC and DBI, the evaluation is performed. If the evaluation results meet the requirements, the final clustering results are output.

[0077] Step 3: Perform demand response scheduling based on the final clustering results.

[0078] Example 2 is the second embodiment of the present invention, which differs from the first embodiment in that: a method for analyzing electricity consumption behavior and demand-side management based on centroid optimization clustering also includes that demand response can effectively balance the electricity market, adjust load distribution, optimize resource allocation and improve the utilization efficiency of electricity resources. With the introduction of these management methods, traditional electricity trading rules will be reshaped to form a more flexible and efficient new trading mechanism. The rapid development of smart grids enables various user groups and load types to jointly participate in electricity demand response, thereby promoting dynamic interaction on the demand side of the electricity market.

[0079] Different types of loads require specific analysis based on their characteristics. During electricity trading, the interests of both supply and demand must be balanced to ensure a stable and sustainable electricity market. This research also requires comprehensive consideration of factors such as user psychology, satisfaction, and carbon emissions to achieve more comprehensive demand-side management. Demand response scheduling is based on the data under the corresponding demand labels in the final clustering results, as well as constraints; these constraints include power constraints and revenue constraints.

[0080] Assuming that the total electricity consumption of users does not change during the study period, the power constraint in this embodiment can be an electricity consumption constraint. After the implementation of the time-of-use electricity price policy, the electricity consumption of the three types of users meets the following conditions:

[0081] Q 1,0 +Q 2,0 +Q 3,0 =Q 1,t +Q 2,t +Q 3,t

[0082] Among them, Q 1,0 , Q 2,0 , Q 3,0 It represents the electricity consumption before time-of-use electricity price for residential, commercial and industrial users, Q 1,t , Q 2,t , Q 3,t Indicates the electricity consumption after time-of-use electricity prices for residential, commercial and industrial users.

[0083] In another optional embodiment, during the power trading process, frequent and flexible scheduling of power is required. After the implementation of the time-of-use electricity price policy, the power flow of each node in the power system changes. In order for the power system to meet the new power distribution requirements, it is necessary to maintain the power flow balance of the transmission line. Therefore, the power constraint can also be a power system power flow constraint, which is expressed as follows:

[0084] P n,t +P G,t -Q t +f t+P dis -P cha =0

[0085] Among them, P n,t Expressed as renewable energy power generation power, P G,t Expressed as the power generation power of the thermal power generator set, Q t Expressed as load power, P dis Expressed as energy storage charging power, P cha Expressed as the discharge power of energy storage, f t Expressed as the power flow value of the line.

[0086] Under the constraints of market rules, electricity price adjustments must be carried out within a reasonable range. The upper and lower limits of time-of-use electricity prices must be constrained and electricity prices must be controlled to ensure the interests of all parties in the electricity market. In this embodiment, the profit constraint can be an electricity price constraint, and the constraint range is expressed as:

[0087] P n.1.min ≤P n.1 ≤P n.1.max

[0088] P n.2.min ≤P n.2 ≤P n.2.max

[0089] P n.3.min ≤P n.3 ≤P n.3.max

[0090] Among them, n=1, 2, and 3 represent the three types of users: industrial users, commercial users, and residential users, respectively. n.1 , P n.2 , P n.3 They represent the electricity prices of users during peak, flat and valley periods respectively, P n.1.max , P n.1.min , P n.2.max , P n.2.min , P n.3.max , P n.3.min They represent the upper and lower limits of electricity price fluctuations during the user's peak, flat and valley periods respectively.

[0091] In another optional embodiment, when the power supply company's profit is the core, the time-of-use electricity price policy cannot undermine the market mechanism. If the interests of the power sales side are not protected, users may over-respond, resulting in losses on the power sales side. In serious cases, the load curve peaks and valleys will be reversed, causing an impact on the power system and having a huge impact on its stability and security. While ensuring that the interests of users are not harmed, the interests of the power supply company are also not harmed. The profit constraint can also be the power supply company's profit constraint, which is expressed as follows:

[0092] Q after-(1-δ)Q before ≥0

[0093] Among them, δ represents the profit-sharing coefficient, Q before , Q after They represent the profits of the power supply company before and after time-of-use electricity prices.

[0094] In another optional embodiment, when user benefits are the core, it is necessary to clearly ensure that user interests are not harmed, that is, the electricity charges paid by users after the implementation of time-of-use electricity prices are not higher than the electricity charges paid before the time-of-use electricity prices. Therefore, the benefit constraint can also be a user interest constraint, which is expressed as follows:

[0095] Q before,y -Q after,y ≥0

[0096]

[0097] Among them, Q before,y , Q after,y They represent the electricity charges paid by users before and after the time-of-use electricity price, p represents the flat price period, f represents the peak period, g represents the valley period, z represents any time period among p, f, and g, E z It is expressed as the electricity demand in the first z period of the time-of-use electricity price, E' z It is expressed as the electricity demand in the zth period after the time-of-use electricity price, p0 is the initial electricity price before the time-of-use electricity price, and p z Expressed as the corresponding electricity price in the zth period.

[0098] It is further explained that all the above constraints can appear in multiple forms at the same time during scheduling. Not every scheduling can have only one type of constraint. For example, the revenue constraint can be a combination of the power company's revenue constraint and the user's interest constraint. These two constraints together become the limiting conditions during scheduling.

[0099] Example 3, reference Figure 2-Figure 8 , which is the third embodiment of the present invention, is different from the previous two embodiments in that: in order to verify and illustrate the technical effects achieved in this method, this embodiment adopts a traditional technical solution and the method of the present invention for comparative testing, and compares the test results by means of scientific demonstration to verify the real effect of this method.

[0100] The calculation includes three typical types of electricity loads, namely industrial load, commercial load and household load. The standardized loads are clustered, such as Figure 2-4 shown.

[0101] Taking the DBI value as the target, GA-Kmeans (a K-means clustering algorithm combined with the genetic algorithm GA), GOA-Kmeans (a K-means clustering algorithm combined with the grasshopper algorithm GOA) and the ordinary K-means clustering algorithm were used for experiments, and the iterative optimization was performed as follows: Figure 5 As shown in the figure, it can be seen that the clustering performance is effectively improved after using GOA optimization.

[0102] The specific clustering results are as follows Figure 6-8 As shown in the figure, we can see that the clustering optimized by GOA is more concentrated and the DBI value is also the lowest, which shows that the GOA algorithm has excellent effect on K-means optimization in the field of power dispatching.

[0103] Example 4 is the fourth example of the present invention, which is different from the previous three examples in that: an electricity consumption behavior analysis and demand-side management system based on centroid optimization clustering, including a data acquisition and processing module, a clustering module and a scheduling module; the data acquisition and processing module is used to collect the monthly electricity consumption data of each user, normalize the electricity consumption data of each user, and obtain a monthly average load curve as the user's typical daily load curve; the clustering module uses the K-means algorithm to cluster the daily load curve data set, establish labels for the data, and obtain a training data set; when the K-means algorithm performs the initial centroid selection step, the grasshopper algorithm GOA is introduced to participate in the selection of the initial centroid; when the number of iterations reaches the maximum number of iterations, the clustering result is output, and the silhouette coefficient and Davis-Boulting index are introduced to evaluate the clustering result; if the evaluation result does not meet the requirements, the centroid selection and iteration are performed again, and if the evaluation result meets the requirements, the final clustering result is output; the scheduling module performs demand response scheduling based on the final clustering result.

[0104] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0105] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0106] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.

[0107] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0108] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for analyzing electricity consumption behavior and managing demand side based on centroid optimization clustering, characterized by: include, Collect the monthly electricity consumption data of each user, normalize the electricity consumption data of each user, and obtain the monthly average load curve as the typical daily load curve of the user; The K-means algorithm is used to cluster the daily load curve dataset and label the data to obtain a training dataset. When the K-means algorithm performs the initial centroid selection step, the Grasshopper Algorithm (GOA) is introduced to participate in the selection of the initial centroid; When the number of iterations reaches the maximum number of iterations, the clustering results are output, and the silhouette coefficient and Davis-Boulting index are introduced to evaluate the clustering results; If the evaluation result does not meet the requirements, the centroid selection and iteration are performed again. If the evaluation result meets the requirements, the final clustering result is output; Demand response scheduling is performed based on the final clustering results.

2. The method for analyzing electricity consumption behavior and managing demand side based on centroid optimization clustering according to claim 1, characterized in that: The clustering of the daily load curve data set using the K-means algorithm includes: before clustering, the input data is the time series data and related statistical features of the daily load curve; The relevant statistical characteristics include peak load, valley load, average load and load fluctuation rate; After clustering, the output data is a data set with labels, where the labels are marks that can reflect the user's electricity usage patterns.

3. The method for analyzing electricity consumption behavior and managing demand side based on centroid optimization clustering according to claim 2, characterized in that: The introduction of the Grasshopper Algorithm (GOA) to participate in the selection of the initial centroid includes using GOA to initialize the cluster center V0 = (v 10 ,…,v C0 ), and determine the number of clusters C, GOA individual coding and objective function are expressed as, X=(C,v1,…,v C ) Among them, X represents the individual code of the algorithm, f(X) represents the objective function, C represents the total number of clusters, and v C Represents the cluster center of the cth cluster, u kc Represented as data point x k The membership degree of cluster c, k represents the total number of data points.

4. The power consumption behavior analysis and demand side management based on centroid optimization clustering according to claim 3 The treatment method is characterized by: When the number of iterations reaches the maximum number of iterations, the output clustering results include: GOA optimizes the objective function by simulating the behavior of the grasshopper group, and the position update formula of each individual is expressed as: s(r)=e -r / l -e -r in, It is represented as the position of the d-th individual in the t+1 iteration, t is the t-th iteration, ρ is the decreasing coefficient, which controls the balance between exploration and development, and ρ max Expressed as the maximum value of the decreasing coefficient, ρ min Expressed as the minimum value of the decreasing coefficient, T max It is expressed as the maximum number of iterations, and Denotes the upper and lower bounds of the search space, s(.) denotes the social force function, It is represented as the social interaction force between grasshoppers, l is the perception range adjustment factor, which controls the distance of the perception range, and T d expressed as the effect of target location; GOA optimizes the objective function f(X) by iteratively updating individual positions until the maximum number of iterations is reached, specifically including updating the cluster center v according to the position update formula c And the membership matrix u kc , check whether the maximum number of iterations has been reached, if not, continue iterating, if the maximum number of iterations has been reached, output the clustering results, including, Output the number of clusters C and cluster centers V = (v1,…,v C ), output membership matrix U, which represents the membership of each data point to each cluster.

5. The method for analyzing electricity consumption behavior and managing demand side based on centroid optimization clustering according to claim 4, characterized in that: The introduction of the silhouette coefficient and the Davis-Boulting index to evaluate the clustering results includes introducing the silhouette coefficient SC to evaluate the clustering results, which is expressed as follows: Among them, SC(i) represents the silhouette coefficient of the i-th sample, a(i) represents the average distance between the i-th sample and all samples in the cluster; b(i) represents the average distance between the i-th sample and all other samples outside the cluster. max{a(i),b(i)} represents the maximum value of a(i) and b(i); SC(i) evaluates the clustering effect by comparing the average distance of elements in the same cluster with the average distance of elements in other clusters. The difference between the value of SC(i) and the boundary value is inversely proportional to the clustering effect.

6. The method for analyzing electricity consumption behavior and managing demand side based on centroid optimization clustering according to claim 5, characterized in that: The introduction of the silhouette coefficient and the Davis-Bourdin index to evaluate the clustering results also includes introducing the Davis-Bourdin index DBI to evaluate the clustering results, which is expressed as follows: Among them, K represents the number of clusters; c i is represented as the center of the i-th cluster; σ i Represented as all elements in cluster i to cluster center c i The average distance of d(c i ,c j ) is represented as the cluster center c i and c j distance; DBI evaluates the clustering effect by measuring the intra-cluster distance and inter-cluster distance. The size of the DBI value is inversely proportional to the clustering effect.

7. The method for analyzing electricity consumption behavior and managing demand side based on centroid optimization clustering according to claim 6, characterized in that: The demand response scheduling based on the final clustering result includes outputting the current clustering result as the final clustering result when either the value of SC(i) or the DBI value meets a preset requirement; When performing demand response scheduling, scheduling is performed based on the data under the demand corresponding label described in the final clustering result and the constraints; The constraints include power constraints and revenue constraints.

8. A power consumption behavior analysis and demand side management system based on centroid optimization clustering, applying the power consumption behavior analysis and demand side management method based on centroid optimization clustering according to any one of claims 1 to 7, characterized in that: It includes data acquisition and processing module, clustering module and scheduling module; The data collection and processing module is used to collect the monthly electricity consumption data of each user, normalize the electricity consumption data of each user, and obtain a monthly average load curve as the typical daily load curve of the user; The clustering module uses the K-means algorithm to cluster the daily load curve data set, establishes labels for the data, and obtains a training data set; when the K-means algorithm performs the initial centroid selection step, the Grasshopper Algorithm (GOA) is introduced to participate in the selection of the initial centroid; when the number of iterations reaches the maximum number of iterations, the clustering result is output, and the silhouette coefficient and Davis-Boulting index are introduced to evaluate the clustering result; if the evaluation result does not meet the requirements, the centroid selection and iteration are repeated, and if the evaluation result meets the requirements, the final clustering result is output; The scheduling module performs demand response scheduling based on the final clustering result.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the processor implements the steps of a method for electricity consumption behavior analysis and demand-side management based on centroid optimization clustering according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a method for electricity consumption behavior analysis and demand-side management based on centroid optimization clustering according to any one of claims 1 to 7 are implemented.