A method and device for distributed energy storage aggregation control
By combining the SA-Kmeans algorithm with simulated annealing and the Kmeans algorithm, and introducing an equalization evaluation function of adjustment factors, the initial cluster centers and number of distributed energy storage modules are optimized, solving the problem of poor controllability of distributed energy storage modules in power system regulation and achieving more efficient aggregation control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-07
- Publication Date
- 2026-04-07
AI Technical Summary
Distributed energy storage modules suffer from poor controllability and scattered layout in power system regulation. Traditional Kmeans algorithm requires the initial cluster centers and number to be determined in advance, which limits the application effect.
The SA-Kmeans algorithm is combined with the simulated annealing algorithm and the Kmeans algorithm. By introducing a balanced evaluation function with an adjustment factor, and combining intra-class distance and inter-class distance, the search space for K value is reduced using the early stopping method and the elbow method, thereby optimizing the initial cluster centers and number.
It effectively solves the problem of uncertainty in the initial cluster centers and number, improves the accuracy of the clustering model and the efficiency of aggregation control, and enhances the regulation capability of distributed energy storage systems.
Smart Images

Figure CN115758193B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of energy storage control, and particularly relates to a distributed energy storage aggregation control method and device. BACKGROUND
[0002] At present, with the continuous consumption of traditional fossil energy, traditional energy cannot meet the development of global economy. In order to solve the above-mentioned problems, new energy technology is developed. The emergence of new energy technology can solve the energy problem, but most of these new energies are limited by the natural environment. The supply-demand matching ability of power generation side and power consumption side is not as good as that of traditional fossil energy, which will cause the phenomenon of abandoned wind and light, and also will bring certain harm to the regulation and control of the power system. In order to alleviate this situation, the most useful method is to install a distributed energy storage module.
[0003] A control system and method for a clean heating system are disclosed in CN111750420B. The system includes a controller, an illuminometer for collecting outdoor illumination, a first temperature measuring instrument for collecting outdoor air temperature, a second temperature measuring instrument for collecting indoor air temperature, a third temperature measuring instrument for collecting the outlet heating circulating water temperature of the heat storage water tank, and a fourth temperature measuring instrument for collecting the inlet heating circulating water temperature of the indoor room. The method includes a heating cycle control step S1, which includes data collection S101, heat demand calculation S102, operation time calculation S103, and start-stop control S104. Through the controller, illuminometer, and first to fourth temperature measuring instruments, the clean heating system has high working efficiency.
[0004] A control system based on clean energy heating is disclosed in CN111750421B. The system includes a solar collector, a heat collection water tank, a biomass furnace, an indoor radiator, a first pump and a second pump. The solar collector, heat collection water tank and first pump are connected in series and form a first loop. The heat collection water tank, second pump, biomass furnace and indoor radiator are connected in series and form a second loop. Through the solar collector, heat collection water tank, biomass furnace, indoor radiator, first pump and second pump, the energy heating efficiency is high.
[0005] Based on the above two patent documents and the existing technical solutions, the inventors have learned that:
[0006] The distributed energy storage module has poor controllability and scattered layout, and it is difficult to be directly regulated and managed by the power system.
[0007] In the aggregation control of energy storage nodes based on the energy storage system architecture, the traditional K-means algorithm has two major shortcomings: 1) The K-means algorithm is limited by the need to determine the initial cluster centers in advance; 2) The K-means algorithm is also limited by the need to determine the number of initial cluster centers in advance.
[0008] Existing technical issues and considerations:
[0009] How to solve the technical problem of determining the initial cluster centers and their number in distributed energy storage aggregation control. Summary of the Invention
[0010] The technical problem to be solved by the present invention is to provide a method and apparatus for distributed energy storage aggregation control, and to solve the technical problem of determining the initial cluster centers and their number in distributed energy storage aggregation control.
[0011] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a method for distributed energy storage aggregation control includes the steps of aggregation control, obtaining energy storage nodes (DESNC), and obtaining the upper limit K of cluster groups. up The value of the cluster group K ranges from 1 to the upper limit of the cluster group K. up The values were used to calculate the cluster centers and the corresponding intra-cluster distances L. intra Inter-class distance L inter An adjustment factor α is obtained based on the value of the adjustment factor under each cluster group, where α∈[0,1]. This factor is substituted into the equalization evaluation function. When the equalization evaluation function has a minimum value, the optimal cluster group is obtained. The optimal cluster group is used as the initial number of cluster centers, and the corresponding cluster centers of the optimal cluster group are used as the initial cluster centers. These are then input into the aggregation control algorithm to implement aggregation control.
[0012] A further technical solution is as follows:
[0013]
[0014] Equation (12) is the equilibrium evaluation function with adjustment factors, which is calculated by J for each K value. k-best J k-best The minimum value of K corresponds to the optimal K value, where α is the adjustment factor. α∈[0,1],C i It is the i-th cluster, x ij It belongs to C i The cluster of samples, n j c is the number of samples in the cluster. i_best It is C i Cluster center are different cluster centers under different K values; j is the j-th group under the same K value.
[0015] Further technical solutions are as follows: the SA-Kmeans algorithm is an algorithm obtained by organically combining a simulated annealing algorithm SA and a Kmeans algorithm.
[0016] Further technical solutions are as follows: the in-class distance is combined with the inter-class distance, the adjustment factor is introduced into the evaluation function of equalization, the early stopping method is combined with the elbow method, and a method of reducing the size of the K value search space is obtained to obtain an optimal clustering group.
[0017] Further technical solutions are as follows: the best initial clustering center is obtained by using the simulated annealing algorithm SA.
[0018] Further technical solutions are as follows: each energy storage node DESNC includes data of a state of charge SOC and power.
[0019] A device for distributed energy storage aggregation control includes an aggregation control module, which is used to obtain energy storage nodes DESNC, obtain an upper limit K of a clustering group up , calculate clustering centers and corresponding in-class distances L up and inter-class distances L intra based on values of the clustering group from 1 to the upper limit K inter of the clustering group, obtain an adjustment factor a based on a value of each clustering group, a belongs to [0, 1], and input the adjustment factor a into an equalization evaluation function, so as to obtain an optimal clustering group when the equalization evaluation function has a minimum value, use the optimal clustering group as the number of initial clustering centers, use corresponding clustering centers of the optimal clustering group as the initial clustering centers, and input the initial clustering centers into an aggregation control algorithm to implement aggregation control.
[0020] Further technical solutions are as follows: in the aggregation control module,
[0021]
[0022] Formula (12) is an equalization evaluation function with an adjustment factor, the minimum value of J k-best of each K value is obtained by calculation, the K value corresponding to the minimum value of J k-best is an optimal K value, a is an adjustment factor, a belongs to [0, 1], C i is the i th cluster, x ij is a sample belonging to the C i cluster, n j is the number of samples of the cluster, c i_best is a clustering center of the C i cluster, is different clustering center under the K value; j is the j th group under the same K value.
[0023] A distributed energy storage aggregation control device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the corresponding steps described above.
[0024] A distributed energy storage aggregation control device includes a computer-readable storage medium storing a computer program that, when executed by a processor, performs the aforementioned corresponding steps.
[0025] The beneficial effects of adopting the above technical solution are as follows:
[0026] First, a method for distributed energy storage aggregation control includes the following steps: obtaining the energy storage node DESNC and obtaining the upper limit K of the clustering groups. up The value of the cluster group K ranges from 1 to the upper limit of the cluster group K. up The values were used to calculate the cluster centers and the corresponding intra-cluster distances L. intra Inter-class distance L inter An adjustment factor α, ∈ [0, 1], is obtained based on the adjustment factor value under each cluster group. This factor is substituted into the equalization evaluation function. When the equalization evaluation function has a minimum value, the optimal cluster group is obtained. The optimal cluster group is used as the initial number of cluster centers, and the corresponding cluster centers of the optimal cluster group are used as the initial cluster centers. These are then input into the aggregation control algorithm to achieve aggregation control. This technical solution obtains the initial cluster centers and their number in distributed energy storage aggregation control when the equalization evaluation function has a minimum value.
[0027] Second, a distributed energy storage aggregation control device includes an aggregation control module for obtaining the energy storage node DESNC and obtaining the upper limit K of the clustering groups. up The value of the cluster group K ranges from 1 to the upper limit of the cluster group K. up The values were used to calculate the cluster centers and the corresponding intra-cluster distances L. intra Inter-class distance L inter An adjustment factor α, ∈ [0, 1], is obtained based on the adjustment factor value under each cluster group. This factor is substituted into the equalization evaluation function. When the equalization evaluation function has a minimum value, the optimal cluster group is obtained. The optimal cluster group is used as the initial number of cluster centers, and the corresponding cluster centers of the optimal cluster group are used as the initial cluster centers. These are then input into the aggregation control algorithm to achieve aggregation control. This technical solution obtains the initial cluster centers and their number in distributed energy storage aggregation control when the equalization evaluation function has a minimum value.
[0028] See the detailed implementation section for further description. Attached Figure Description
[0029] Figure 1 This is a topology diagram of an energy storage system architecture;
[0030] Figure 2 is a graph of the change in SSE values;
[0031] Figure 3 is a graph of the change in SSE values two;
[0032] Figure 4 is a flow chart of the SA-Kmeans algorithm of the present application;
[0033] Figure 5 is a graph of the function of the present application with the adjustment factor equalization function with the change in value K;
[0034] Figure 6 is a scatter plot of the SOC and power clustering of the present application;
[0035] Figure 7 is a graph of the SOC equalization control of the present application. DETAILED DESCRIPTION
[0036] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. The following description of at least one exemplary embodiment is actually only illustrative, but not as any limitation on the present application and its application or use. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative efforts, fall within the scope of protection of the present application.
[0037] In the following description, many specific details are set forth in order to provide a thorough understanding of the present application. However, the present application can be practiced without the specific details that are set forth in the following description, in other manners different from those described herein, and it can be apparent to those skilled in the art that the present application is not limited to the specific embodiments disclosed herein and can be practiced with or without the same in other ways. Therefore, the present application is not limited to the specific embodiments disclosed below.
[0038] Embodiment 1:
[0039] As shown in Figure 4 , the present application discloses a distributed energy storage aggregation control method comprising the following steps:
[0040] obtaining energy storage nodes DESNC, each energy storage node DESNC comprising data of state of charge SOC and power.
[0041] obtaining a cluster group upper limit K up value, the cluster group K from 1 to the cluster group upper limit K up value, the cluster group K from 1 to the cluster group upper limit K intra value, the cluster group K from 1 to the cluster group upper limit K inter, a regulation factor alpha is obtained based on the value of the regulation factor under each cluster group, alpha belongs to [0, 1], the regulation factor alpha is substituted into the equalization evaluation function formula (12), when the equalization evaluation function has a minimum value, the optimal cluster group is obtained, the optimal cluster group is taken as the number of initial cluster centers, the cluster center corresponding to the optimal cluster group is taken as the initial cluster center, and the aggregation control algorithm is input to realize aggregation control.
[0042]
[0043] Formula (12) is an equalization evaluation function with a regulation factor, the minimum value of J k-best , J k-best corresponding to K is the optimal K value, alpha is a regulation factor, alpha belongs to [0, 1], C i is the i-th cluster, x ij is a sample belonging to the C i cluster, n j is the sample number of the cluster, c i_best is the cluster center of the C i cluster, is different cluster center under K, and j is the j-th group under the same K.
[0044] The SA-Kmeans algorithm is an algorithm obtained by organically combining a simulated annealing algorithm SA and a Kmeans algorithm, combines the intra-class distance with the inter-class distance, introduces a regulation factor into an equalization evaluation function, combines the early stopping method with the elbow method, obtains a method for reducing the K value search space size, and is used to obtain an optimal cluster group; and the best initial cluster center is obtained through the simulated annealing algorithm SA.
[0045] Wherein, the aggregation control algorithm itself is prior art and will not be repeated here.
[0046] Embodiment 2:
[0047] The application discloses a kind of distributed energy storage aggregation control devices, including aggregation control module, for program module.
[0048] Aggregation control module is used to obtain energy storage node DESNC, obtain cluster group upper limit K up Value, cluster group K is from 1 to cluster group upper limit K up Value respectively calculated to obtain cluster center and corresponding intra-class distance L intra And inter-class distance L inter, based on the value of the adjustment factor under each cluster group, an adjustment factor alpha is obtained, alpha belongs to [0, 1], and the adjustment factor is substituted into the equalization evaluation function; when the equalization evaluation function has a minimum value, the optimal cluster group is obtained; the optimal cluster group is used as the number of initial cluster centers; the cluster center corresponding to the optimal cluster group is used as the initial cluster center; and the aggregation control algorithm is input to realize aggregation control.
[0049]
[0050] Formula (12) is an equalization evaluation function with an adjustment factor, and the minimum value of J k-best , J k-best corresponding to the optimal K value is obtained by calculating the minimum value of J k-best of each K value, and alpha is an adjustment factor, alpha belongs to [0, 1], C i is the i-th cluster, x ij is a sample belonging to the C i cluster, n j is the number of samples of the cluster, c i_best is the cluster center of the C i cluster, is different cluster center under K value; j is the j-th group under the same K value.
[0051] Embodiment 3:
[0052] The application discloses a distributed energy storage aggregation control device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of embodiment 1 when executing the computer program.
[0053] Embodiment 4:
[0054] The application discloses a computer readable storage medium, which stores a computer program, and the computer program implements the steps in embodiment 1 when executed by a processor.
[0055] Research and development ideas:
[0056] As Figure 1 shown, to solve the above problems, the application takes the energy storage system architecture of a wide-area range energy storage cloud controller (ESCC) and a distributed energy storage node controller (DESNC) as the background, and performs aggregation control on the energy storage node controller (DESNC) in the figure based on a Kmeans algorithm (K-means clustering algorithm).
[0057] Kmeans algorithm belongs to the classical algorithm based on partition algorithm, the algorithm structure is simple and easy to realize, is widely used in various fields. However, the Kmeans algorithm determines the initial clustering center and the number of initial clustering center in advance, which limits the practical application effect of Kmeans algorithm.
[0058] The technical problems to be solved are:
[0059] The energy storage node aggregation control based on energy storage system architecture solves the two shortcomings of traditional Kmeans algorithm in this application, 1) Kmeans algorithm is limited to the need to determine the initial clustering center in advance; 2) Kmeans algorithm is also limited to the need to determine the number of initial clustering center in advance.
[0060] The purpose of the application is:
[0061] The energy storage node aggregation control method based on SA-Kmeans algorithm is provided, wherein the main technology is to provide a SA-Kmeans algorithm to solve the problem of initial clustering center and a balanced evaluation function with adjustment factor to solve the problem of the number of clustering centers. The main goal of the application is to improve the accuracy of the clustering model applied to the classification of energy storage nodes, thereby solving the problems of uncertainty of initial clustering center and uncertainty of the number of initial clustering centers of the existing Kmeans algorithm.
[0062] Technical contribution:
[0063] The invention point of the application corresponds to step one, step two and step three of the following implementation steps. The application organically combines the SA algorithm (simulated annealing algorithm) and the Kmeans algorithm, proposes a SA-Kmeans algorithm, finds the best initial clustering center through the strong global optimization ability of the SA algorithm, and improves the clustering effect. The application combines the intra-class distance and the inter-class distance, introduces a balanced evaluation function, proposes a balanced evaluation function with adjustment factor, combines the early stopping method and the elbow method, and proposes a method of reducing the size of K value search space. Finally, the proposed method realizes an energy storage node aggregation control method based on SA-Kmeans algorithm.
[0064] Step one of the method of the application:
[0065] The SA-Kmeans algorithm step flow is:
[0066] Input: SOC and power data of n energy storage nodes (DESNC), and clustering group number K.
[0067] Output: K clustering groups
[0068] 1) Set up the cooling schedule (control temperature T0, Markov chain length L i , temperature decay factor α), determine the number of participating clustering energy storage nodes (DESNC) n and the number of clustering groups K, set the objective function as y = f(x), randomly select a clustering center solution x 00 in the feasible solution space, and calculate the objective function value f(x 00 ) at this time.
[0069]
[0070] In formula (1), is the shortest distance from each energy storage node (DESNC) to the different clustering centers under its current group, x i is the sample SOC data, x j is the sample power data, x 0~ column is the SOC data, and x ~0 column is the power data.
[0071] 2) For the temperature T at this time is equal to the next value T i in the cooling table (T = T0 for the first iteration).
[0072] T i = T0 × α k (2)
[0073] In formula (2), k is the number of iterations of the temperature in simulated annealing.
[0074] 3) Randomly generate a new solution x near the current solution x Calculate the objective function value f(x ) of the solution (f(x ) for the first iteration).
[0075]
[0076] In formula (3), is the new solution, T i is the temperature, m ij is a set of random numbers of K columns and 2 rows randomly generated, where m ij obeys N(0, 1).
[0077] 4) Determine whether to accept the new solution.
[0078] 4.1) If f(x ), accept the new solution x
[0079] 4.2) If f(x ), calculate f(x ) and calculate Then a random number r is generated randomly in the interval [0, 1] and if r < p, the new solution is accepted
[0080] 5) At temperature T i , repeat 3) and 4) for L i times.
[0081] 6) Determine whether the stopping criterion is met, i.e. temperature T i is less than a set threshold, if yes, output K best cluster centers, otherwise go back to step 3) and continue iteration.
[0082]
[0083] In formula (4), x is a current solution close to the best cluster center, T i is temperature, m ij is a set of random numbers of K columns and 2 rows generated randomly, where m ij obeys N(0, 1), c i_best is the best cluster center, c i_best_x is the horizontal coordinate of the best cluster center, c i_best_y is the vertical coordinate of the best cluster center, is an arbitrary cluster center in the SA algorithm.
[0084] 7) Starting from the first DESNC, calculate the distance from the DESNC to the K cluster centers, and classify the DESNC into the group closest to the cluster center, until the classification of n DESNCs is completed.
[0085]
[0086] In formula (5), d(x ij , c i_best ) represents the distance from any sample in the cluster to the cluster center c i_best , C i is the i-th cluster, x ij is a sample belonging to the cluster C i , n j is the number of samples in the cluster, and c i_best is the cluster center of the cluster C i .
[0087] 8) Calculate the sum of the data of the DESNCs in each group and find its average, and replace the cluster center in 7) with a new cluster center, which is shown in formula (6).
[0088]
[0089] In equation (6), It is the average of the horizontal and vertical coordinates of all samples within the cluster.
[0090] 9) Repeat steps 7) to 8) until the convergence condition is met, that is, the change in the position of the cluster center is less than the preset value in the two runs.
[0091] 10) Output K cluster groups and K cluster centers.
[0092]
[0093] In equation (7), C i It is the i-th cluster, and any two clusters C i With C i+1 The energy storage node samples are different, and the sum of the number of energy storage nodes in all clusters is equal to n. The K cluster centers are the cluster centers of the most recent iteration.
[0094] Step two of the method of the present invention:
[0095] In theory, the value of K should be selected from 1 to n. However, the K value selected according to the traditional elbow method often appears in the initial stage. As the K value increases, the sum of squared errors decreases slowly. At this time, the K value is much larger than the optimal K value. Once the K value exceeds the optimal value, further calculation will only increase the computation time in vain. Therefore, it is necessary to narrow the search range of K value.
[0096] Therefore, regarding the selection of K value, this invention proposes an equalization evaluation function with adjustment factors.
[0097] The evaluation function of the equilibrium focuses on the following two aspects:
[0098] 1. Each cluster should be compact, and the greater the similarity within a cluster, the more compact the cluster.
[0099] 2. At the same time, the distance between each cluster should be as far as possible, and the smaller the similarity between clusters, the farther the distance between clusters.
[0100] Intra-class distance is defined as the distance from each sample in a class (cluster) to its cluster center.
[0101]
[0102] In equation (8), L intra It is the intra-class distance, C i It is the i-th cluster, x ij It belongs to C i The samples of the cluster, n j c is the number of samples in the cluster. i_best It is C iCluster center of cluster, x i~ Column is SOC data, x ~j Column is power data.
[0103] The definition of inter-class distance is the distance between the cluster centers of different classes (clusters).
[0104]
[0105] In formula (9), L inter is the inter-class distance, is the different cluster center under K value.
[0106] The intra-class distance is the compactness of each cluster under clustering, and the inter-class distance is the distance between different clusters, and the overall quality of clustering is defined as the combination of intra-class distance and inter-class distance, and the balanced evaluation function is also proposed according to this concept.
[0107] The balanced evaluation function is defined as the square root of the sum of squares of intra-class distance and inter-class distance:
[0108]
[0109] In formula (10), L intra is the intra-class distance, L inter is the inter-class distance.
[0110] When the balanced evaluation function is used, the imbalance between intra-class and inter-class can be effectively balanced, and when the balanced function reaches the minimum, it is the optimal clustering number, that is, the optimal K value.
[0111] K = min (J k ) (11)
[0112] In formula (11), K is the optimal K value calculated by the balanced evaluation function.
[0113] But the traditional balanced evaluation function has a defect: with the increase of sample space, the intra-class distance becomes larger and larger, and the inter-class distance is almost unchanged. The K value under this condition is usually not the optimal K value. In order to overcome this phenomenon, the present application proposes a balanced evaluation function with adjustment factor α, and its expression is as follows:
[0114]
[0115] Formula (12) is a balanced evaluation function with adjustment factor, by calculating J k-best under different K values, the minimum value of J k-best corresponding to K value is the optimal K value, and α is the adjustment factor, α ∈ [0, 1], C i is the i-th cluster, xij is the sample belonging to the C i cluster, n j is the sample number of the C i_best cluster, c i is the cluster center of the C up cluster. is the different cluster center under the K value; j is the jth group under the same K value.
[0116] At the same time, combined with the early stop method and the elbow method, a method of reducing the size of the K value search space is proposed. If the difference of the SSE corresponding to the K value is less than the set threshold θ for two consecutive times, then the size of the K value is set as the upper limit of the K value search range, and the lower limit is still 1. up
[0117]
[0118] In formula (13), SSE is the sum of squares of errors, C i is the ith cluster, x ij is the sample belonging to the C i cluster, n j is the sample number of the C i cluster, c i_best is the cluster center of the C i cluster.
[0119]
[0120] In formula (14), SSE i and SSE i+1 are the sum of squares of errors represented by different cluster groups, K up is the upper limit of the K search range.
[0121] Step three of the method of the application:
[0122] The flow based on the SA-Kmeans algorithm and the equalization evaluation function algorithm with an adjustment factor is:
[0123] Input: data of n energy storage nodes (DESNC)
[0124] Output: optimal K value
[0125] 1) Call the SA-Kmeans algorithm in step one of the application, and use formula (13) and formula (14) to calculate the K up value.
[0126] 2) The K value enters the loop from 1 to K up
[0127] 2.1) Call the SA-Kmeans algorithm in step one of the application, and determine i initial cluster centers.
[0128] 2.2) Calculate the intra-class distance L intra and inter-class distance L inter value using formula (8) and formula (9) respectively.
[0129] 2.3) Keep on executing 2.1 and 2.2 until the loop is completed.
[0130] 3) Calculate the value of adjustment factor a under different K value, and determine the value of a.
[0131] 4) Obtain the optimal K value using formula (12), and end the algorithm.
[0132] The inventive concept of the present application:
[0133] When the user uses the Kmeans algorithm, the initial clustering center needs to be set by the user, however, the user does not know the initial clustering center in advance, and then a random setting method is taken, but since the Kmeans objective function is not convex, many local minimum values can be contained, so in the process of solving the objective function, it is easy to fall into local minimum and local maximum, and the effect of clustering is not very ideal.
[0134] Therefore, the selection of the initial clustering center is particularly important, in order to solve the problem of initializing the clustering center, the present application adopts the simulated annealing algorithm (SA) to solve this problem.
[0135] The advantage of SA is that the global optimization ability is strong, and the problem of easily falling into local minimum in Kmeans clustering can be well compensated. Furthermore, the present application proposes a new SA-Kmeans hybrid algorithm to optimize the Kmeans algorithm.
[0136] Another problem of the Kmeans algorithm is the selection of K value, in order to solve this problem, scholars have proposed many methods, and the widely used method is the elbow method. However, the optimal K value in the result graph of the elbow method is not obvious, and the elbow method only considers the intra-class distance.
[0137] According to the shortcomings of the elbow method, the present application adopts a balanced evaluation function to calculate the optimal K value, but the balanced evaluation function has a defect, that is, with the increase of the sample space, the intra-class distance is getting larger and larger, while the inter-class distance is almost unchanged, so the obtained K value is often not the optimal K value.
[0138] In order to overcome this phenomenon, the present application proposes a balanced evaluation function with an adjustment factor. At the same time, the idea of early stopping is introduced, the early stopping and the elbow method are combined, and a method for reducing the size of the K value search space is proposed.
[0139] Technical scheme description:
[0140] In view of the two defects of the Kmeans algorithm, 1) the Kmeans algorithm is limited to the need to determine the initial clustering center in advance; 2) the Kmeans algorithm is also limited to the need to determine the number of initial clustering centers in advance. The present application proposes a SA-Kmeans algorithm based on the initial clustering center problem and an equalization evaluation function with an adjustment factor to solve the problem of the number of clustering centers. The main goal is to improve the accuracy of the clustering model and apply it to the classification of energy storage nodes, thereby solving the problems of the uncertainty of the initial clustering center and the uncertainty of the number of clustering centers of the existing Kmeans algorithm.
[0141] When using the Kmeans algorithm, the user needs to set the initial clustering center himself. When the user does not know the initial clustering center, a random setting method is adopted. However, since the Kmeans objective function is not convex, it may contain many local minima, so it is easy to fall into local minimum and local maximum in the process of solving the objective function. Therefore, the selection of the initial clustering center is particularly important. In order to solve the problem of the initial clustering center, the present application uses the simulated annealing algorithm (SA) to solve this problem.
[0142] The advantage of SA is that it has strong global optimization ability and can well make up for the problem of falling into local minimum in Kmeans clustering. However, the disadvantage is that the search speed is slow. In practical application, the parameters of the SA algorithm need to be adjusted by experience method, so as to accelerate the convergence speed of the algorithm and improve the global optimization ability of the algorithm. If these parameters are not correctly adjusted, the search of SA will become very slow.
[0143] Another problem of the Kmeans algorithm is the selection of K value. Many scholars have proposed many methods to solve this problem. The widely used method is the elbow method, and the objective function of the elbow method is SSE, i.e. error sum of squares.
[0144]
[0145] In formula (13), SSE is the error sum of squares, C i is the i-th cluster, x ij is the sample belonging to C i cluster, n j is the sample number of C i cluster, c i_best is the clustering center of C i cluster.
[0146] The core idea of the elbow method is that as the K value increases, the sample division becomes more fine, and the aggregation degree of each cluster increases, so the error sum of squares gradually decreases.
[0147] When K is less than the real cluster number, the increase of K will improve the aggregation degree of each cluster, and the decline of SSE is larger. When K reaches the real cluster number, the aggregation degree will decrease, and the decline of SSE will slow down, and then it will tend to be flat with the continuous increase of K.
[0148] Because the graph of SSE and K is an elbow shape, this method is called elbow method, and the elbow corresponds to the real cluster number of data.
[0149] However, this method has limitations and is not suitable for all cases. In some special cases, the elbow is not obvious.
[0150] As shown in Figure 2 , the optimal K value is 2. Figure 2
[0151] As shown in Figure 3 , but Figure 3 the optimal K value cannot be read, and the selection of K value will be misjudged, so the real K value cannot be obtained, and the elbow method only considers the intra-class distance and does not consider the inter-class distance.
[0152] Based on the above ideas, a SA-Kmeans algorithm is proposed to solve the problem of initial cluster center. The operation idea of this hybrid algorithm is to use SA algorithm to find the best cluster center in the initial stage of the hybrid algorithm, and when the temperature T i satisfies the stopping criterion, output the K best cluster centers, and then switch to Kmeans algorithm to complete the clustering grouping. When the change of cluster center satisfies the convergence condition, output the K cluster groups and the best cluster center, and exit the SA-Kmeans algorithm.
[0153] As shown in Figure 4 , it is the flow chart of SA-Kmeans algorithm.
[0154] In view of the shortcomings of elbow method, a balanced evaluation function with adjustment factor is proposed to solve the problem of the number of cluster centers.
[0155]
[0156] Equation (12) is a balanced evaluation function with adjustment factor. By calculating J k-best under different K values, the minimum value of J k-best corresponds to the optimal K value, and α is the adjustment factor, α∈[0,1],C i is the i-th cluster, x ij is the sample belonging to C i cluster, and nj is the sample number of the cluster, c i_best is C i is the cluster center of the cluster, is the different cluster center under the K value; j is the jth group under the same K value.
[0157] In order to reduce the operation amount, the early stopping method and the elbow method are combined, and a method for reducing the size of the K value search space is proposed.
[0158]
[0159] In formula (13), SSE is the sum of squares of errors, C i is the ith cluster, x ij is the sample belonging to C i is the sample belonging to C j is the sample number of the cluster, c i is the sample number of the cluster, c i_best is the cluster center of the cluster. i is the cluster center of the cluster.
[0160]
[0161] In formula (14), SSE i and SSE i+1 are the sum of squares of errors represented by different cluster groups, K up is the upper limit of the K search range.
[0162] The advantages of the present application are that the present application improves the existing Kmeans algorithm from two shortcomings, and is successfully applied to the classification of the energy storage cloud platform energy storage node (DESNC).
[0163] 1、The present application combines the SA algorithm and the Kmeans algorithm organically, proposes a SA-Kmeans algorithm, finds the best initial cluster center through the strong global optimization ability of the SA algorithm, and thus improves the clustering effect.
[0164] 2、The present application combines the intra-class distance and the inter-class distance, introduces an equalization evaluation function, proposes an equalization evaluation function with an adjustment factor, combines the early stopping method and the elbow method, and proposes a method for reducing the size of the K value search space.
[0165] 3、The two improved algorithms of the present application are not only suitable for the classification of the energy storage node, but also can be expanded to other fields.
[0166] In order to make the purpose, technical scheme and advantages of the present application more clear and obvious, the following will be further described in detail in combination with the drawings and the present application.
[0167] As Figure 1As shown, the experimental platform used in this invention and the clustering object implemented by this invention are the energy storage nodes (DESNC) in the figure.
[0168] The upper-layer energy storage cloud control layer mainly receives dispatch information, electricity price and other information from third parties, and participates in the aggregation control of the SOC and power of the lower-layer energy storage nodes (DESNC) to achieve unified regulation and control over a wide area.
[0169] The middle layer of energy storage node control is responsible for receiving scheduling information from the energy storage cloud and sending instructions to the distributed energy storage module in real time. Based on the data (SOC and power) uploaded by the distributed energy storage module (DESM), it calculates the real-time SOC and power of the energy storage node (DESNC). The SOC and power data of the energy storage node are simultaneously involved in the aggregation control of the energy storage cloud. In this invention, a total of 100 energy storage nodes participate in the aggregation control.
[0170] The underlying distributed energy storage module control layer is mainly composed of distributed energy storage modules (DESM). Every 15 minutes, it uploads its own data (SOC and power) to its corresponding energy storage node (DESNC) and applies it to peak shaving and valley filling of the power grid.
[0171] like Figures 5 to 7 As shown, a method for clustered control of energy storage nodes based on the SA-Kmeans algorithm is implemented, including the following steps:
[0172] A. Determining the optimal cluster size K for energy storage nodes
[0173] Using the SA-Kmeans algorithm and the equalization evaluation function algorithm with adjustment factor from step three of the technical solution, with a dataset of 100 data points containing SOC and power storage nodes (DESNC), the optimal K value is found to be 4.
[0174] like Figure 5 As shown, for easier observation, a graph of the balanced evaluation function with adjustment factors is plotted. The intra-class distance is a graph processed by the adjustment factors, and the optimal K value is 4.
[0175] B. Based on the optimal number of clusters K obtained in Part A, cluster the energy storage nodes participating in the aggregation control.
[0176] Using the SA-Kmeans algorithm in step one of the technical solution, the input is a dataset of 100 data points containing SOCs and power storage nodes (DESNCs) and the optimal number of clusters is 4. Running the algorithm will yield 4 cluster groups and 4 cluster centers for each group.
[0177] like Figure 6As shown, in order to facilitate observation, an effect picture after clustering is drawn, the horizontal axis is the state of charge SOC, and the vertical axis is power.
[0178] C.Evaluation of A and B parts
[0179] After the above clustering is completed, it is important to adopt reasonable evaluation indexes to evaluate the good or bad of the obtained clustering model. The evaluation of the good or bad of the clustering model is divided into internal evaluation indexes and external evaluation indexes. However, the external evaluation indexes can be used only when the clustering result is known, and there is certain limitation, therefore, the internal evaluation indexes are adopted for evaluation in the application.
[0180] The internal evaluation index adopted in the application is a contour coefficient, and the formula is as follows
[0181]
[0182] In formula (15), a(i) represents the average distance of the sample to other samples in the cluster, and b(i) represents the average distance of the sample to samples in other clusters.
[0183] The contour coefficient S(i) is valued in [-1, 1]. If the contour coefficient is negative, it indicates that the distance in the cluster is greater than the distance between clusters, and the clustering result is very poor. At the same time, the closer the contour coefficient is to 1, the smaller the distance in the cluster is, and the better the clustering result is.
[0184] The total contour coefficient SC is
[0185]
[0186] In formula (16), SC is the total contour coefficient, and n is the number of energy storage nodes.
[0187] After calculation, the total contour coefficient is 0.5571, and from the total contour coefficient, the overall average level has exceeded 0.5, and the improved algorithm has strong practicability.
[0188] D.In a day as a cycle, the energy storage cloud platform in the cloud is used to cluster the energy storage nodes by using the SA-Kmeans algorithm, and the charging and discharging of the distributed energy storage module is verified.
[0189] From the perspective of protecting the service life of the distributed energy storage module (DESM), the method for regulating and controlling the distributed energy storage module (DESM) adopted in the application is in the form of one charging and two discharging in a day.
[0190] The form of one charging and two discharging in a day is that in a day as a cycle, the energy storage cloud end issues a charging instruction to the energy storage node from 0 to 6, issues a discharging instruction to the energy storage node from 10 to 12, and issues a discharging instruction to the energy storage node from 18 to 22.
[0191] At 0-6, the SOC and power of the energy storage node (DESNC) are continuously clustered by using the SA-Kmeans algorithm in a small cycle of 15 minutes, and the power required to be consumed by the power grid is issued to each energy storage node (DESNC) in proportion to the capacity of the energy storage node (DESNC) according to the dispatching plan of the power grid for this day. The energy storage node (DESNC) performs SOC balancing control according to the SOC and power of all distributed energy storage modules (DESM) of the node, and the power distribution relationship of the SOC and the power is:
[0192]
[0193] In formula (17), P i * is the power dispatching information issued by the energy storage cloud to each energy storage node (DESNC i ), is the power reference of DESM ij , K scc_ij is the middle layer control coefficient of DESM ij .
[0194] The SOC balancing control is adopted to prevent the overcharging / overdischarging of the distributed energy storage module (DESM) caused by the unbalanced SOC control, thereby damaging the service life of the distributed energy storage module (DESM).
[0195] In the charging state, in order to ensure that the output power of the distributed energy storage module (DESM) does not exceed the allowable value in the SOC balancing process, an SOC balancing control strategy based on the rated charging power and the average SOC is adopted. In the charging state, the middle layer control coefficient K scc_ij is:
[0196]
[0197] In formula (18), P rateij_ch is the rated charging power of the distributed energy storage module DESM ij , SOC ij is the state of charge of the distributed energy storage module DESM ij , and m is the total number of energy storage modules (DESM ij ) under the current energy storage node (DESNC i ).
[0198] At 10-12 and 18-22, the SOC and power of the energy storage node (DESNC iThe SOC and power of the energy storage nodes are continuously clustered using the SA-Kmeans algorithm. Based on the grid's dispatch plan, the power required for peak shaving at that moment is then distributed by the energy storage cloud to each energy storage node (DESNC) in proportion to their capacity. i )above.
[0199] In the discharge state, each distributed energy storage module (DESM) ij The corresponding middle layer coefficient has changed, and the middle layer coefficient at this time is as follows:
[0200]
[0201] In equation (19), P rateij_dis For DESM ij Rated discharge power, SOC ij For DESM ij The state of charge. m is the total number of energy storage modules at the current node.
[0202] like Figure 6 As shown, the 100 energy storage nodes are clustered into four groups: ① low SOC, low power; ② low SOC, high power; ③ high SOC, low power; and ④ high SOC, high power. During charging, the principle of charging less at high SOC and more at low SOC is followed, so the group order is ①→②→③→④. During discharging, the principle of discharging more at high SOC and less at low SOC is followed, so the group order is ④→③→②→①. This approach maximizes the utilization of the distributed energy storage modules (DESMs), allowing for flexible adaptation to various grid conditions and extending the DESM's lifespan.
[0203] For ease of observation, we will now use a single energy storage node (DESNC) as an example. i The two distributed energy storage modules (DESM) below ij Verification was conducted using two distributed energy storage modules (DESM). ij The parameters of P are as follows: ratei1_ch =P ratei2_ch =2kW, P ratei1_dis =P ratei2_dis =2kW, with charging power set to positive and discharging power set to negative. Two distributed energy storage modules (DESM) ij The system receives charging instructions during the off-peak electricity hours of 0-6, discharge instructions during the first peak electricity hours of 10-12, and discharge instructions during the second peak electricity hours of 18-22.
[0204] like Figure 7As shown, the horizontal axis is time, the left vertical axis is power, and the right vertical axis is state of charge SOC; in the three time periods, two distributed energy storage modules (DESM i ) under the energy storage node (DESNC ij ) can flexibly adjust the charging power and discharging power according to the SOC of the modules, and will not exceed the rated power of the modules.
[0205] After the application runs for a period of time, the on-site technical personnel feedbacks the advantages of:
[0206] The present application improves two points of the existing Kmeans algorithm, and successfully applies it to the aggregation control of the energy storage node (DESNC) of the energy storage cloud platform.
[0207] 1) The present application combines the SA algorithm and the Kmeans algorithm organically, proposes an SA-Kmeans algorithm, finds the best initial clustering center through the strong global optimization ability of the SA algorithm, and improves the clustering effect.
[0208] 2) The present application combines the intra-class distance and the inter-class distance, introduces an equalization evaluation function, proposes an equalization evaluation function with an adjustment factor, combines the early stopping method and the elbow method, and proposes a method for reducing the size of the K value search space.
[0209] 3) The two improved algorithms of the present application are not only suitable for the classification of the energy storage node, but also can be expanded to other fields.
Claims
1. A method for distributed energy storage aggregation control, characterized in that: This includes steps such as aggregation control, obtaining the energy storage node DESNC, and obtaining the upper limit K of the cluster groups. up The value of the cluster group K ranges from 1 to the upper limit of the cluster group K. up The values were used to calculate the cluster centers and the corresponding intra-cluster distances L. intra Inter-class distance L inter An adjustment factor α is obtained based on the value of the adjustment factor under each cluster group, where α∈[0,1]. This factor is substituted into the equalization evaluation function. When the equalization evaluation function has a minimum value, the optimal cluster group is obtained. The optimal cluster group is used as the number of initial cluster centers, and the corresponding cluster centers of the optimal cluster group are used as the initial cluster centers. The aggregation control algorithm is then input to implement aggregation control. Equation (12) is the equilibrium evaluation function with adjustment factors, which is calculated by J for each K value. k-best J k-best The minimum value of K corresponds to the optimal K value, where α is the adjustment factor. α∈[0,1],C i It is the i-th cluster, x ij It belongs to C i The samples of the cluster, n j c is the number of samples in the cluster. i_best It is C i Cluster center These are the different cluster centers under different K values; j represents the j-th group under the same K value; The SA-Kmeans algorithm is an algorithm obtained by organically combining the simulated annealing algorithm (SA) and the Kmeans algorithm. It combines intra-class distance and inter-class distance, introduces the adjustment factor into the balanced evaluation function, and combines the early stopping method and the elbow method to obtain a method that reduces the search space of the K value, which is used to obtain the optimal cluster group. The best initial cluster center is obtained through the simulated annealing algorithm (SA). The SA-Kmeans algorithm includes the following steps: 1) Initialize the cooling schedule, which includes the control temperature T0 and the Markov chain length L. i Given the temperature decay factor α, determine the number of energy storage nodes n and the number of clusters K participating in the clustering. Let the objective function be y = f(x), and randomly select a cluster center solution x from the feasible solution space. 00 And calculate the objective function value f(x) at this time. 00 ); In equation (1), It is the shortest distance from the data represented by each energy storage node to the different cluster centers under its current group, x i This is sample SOC data, x j These are sample power data, x 0~ The column is SOC data, x ~0 The column contains power data; 2) The temperature T at this point is equal to the next value T in the cooling table. i In the first iteration, T = T0; T i =T0×α k (2) In equation (2), k is the number of temperature iterations in the simulated annealing process; 3) In the current solution A new solution is randomly generated in the vicinity of [the solution]. Calculate the objective function value of the solution During the first iteration In equation (3), This is a new interpretation, T i It is temperature, m ij It is a set of randomly generated K columns and 2 rows of random numbers, where m ij It follows the N(0,1) rule. 4) Determine whether to accept the new solution; 4.1) If Then accept the new solution. 4.2) If Then calculate And calculate Then, a random number r is randomly generated that follows a uniform distribution on the interval [0,1]. If r < p, then the new solution is accepted. 5) At temperature T i Next, repeat steps 3) and 4). i Second-rate; 6) Determine if the stopping criterion is met, i.e., temperature T. i If the value is less than the set threshold, output the K best cluster centers; otherwise, return to step 3) to continue iterating. 7) Starting from the first energy storage node, calculate the distance from the energy storage node to the K cluster centers, and assign the energy storage node to the group to which the nearest cluster center belongs, until the classification of n energy storage nodes is completed; 8) Calculate the sum of data for each group of energy storage nodes and take its average. Set the average as the new cluster center. 9) Repeat steps 7) to 8) until the convergence condition is met, that is, the change in the position of the cluster center is less than the preset value between the two runs; 10) Output K cluster groups and K cluster centers; In equation (7), C i It is the i-th cluster, and any two clusters C i With C i+1 The energy storage node samples are different, and the sum of the number of energy storage nodes in all clusters is equal to n. The K cluster centers are the cluster centers of the most recent iteration in step 8).
2. The method for distributed energy storage aggregation control according to claim 1, characterized in that: Each energy storage node (DESNC) includes data on its state of charge (SOC) and power.
3. A device for distributed energy storage aggregation control, used in the distributed energy storage aggregation control method of claim 1, characterized in that: Includes an aggregation control module for obtaining the DESNC of energy storage nodes and the upper limit K of cluster groups. up The value of the cluster group K ranges from 1 to the upper limit of the cluster group K. up The values were used to calculate the cluster centers and the corresponding intra-cluster distances L. intra Inter-class distance L inter An adjustment factor α is obtained based on the value of the adjustment factor under each cluster group, where α∈[0,1]. This factor is substituted into the equalization evaluation function. When the equalization evaluation function has a minimum value, the optimal cluster group is obtained. The optimal cluster group is used as the initial number of cluster centers, and the corresponding cluster centers of the optimal cluster group are used as the initial cluster centers. These are then input into the aggregation control algorithm to implement aggregation control.
4. The distributed energy storage aggregation control device according to claim 3, characterized in that: In the aggregation control module, Equation (12) is the equilibrium evaluation function with adjustment factors, which is calculated by J for each K value. k-best J k-best The minimum value of K corresponds to the optimal K value, where α is the adjustment factor. α∈[0,1],C i It is the i-th cluster, x ij It belongs to C i The samples of the cluster, n j c is the number of samples in the cluster. i_best It is C i Cluster center are different cluster centers under different K values; j is the j-th group under the same K value.
5. A device for distributed energy storage aggregation control, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the corresponding steps in the distributed energy storage aggregation control method described in claim 1 or 2.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, it implements the corresponding steps in the method for distributed energy storage aggregation control as described in claim 1 or 2.
Citation Information
Patent Citations
A control system and method for a clean heating system
CN111750420B
A control system based on clean energy heating
CN111750421B